| 
														
															@@ -1,5 +1,8 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 <template> 
														 | 
														
														 | 
														
															 <template> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  <svg width="100%" height="100%" ref="svg"> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  <svg 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    width="100%" height="100%" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    ref="svg" :id="id" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  > 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     <path 
														 | 
														
														 | 
														
															     <path 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       v-for="(item, index) in links" 
														 | 
														
														 | 
														
															       v-for="(item, index) in links" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       :key="`link_${index}`" 
														 | 
														
														 | 
														
															       :key="`link_${index}`" 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -7,21 +10,22 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       stroke="black" 
														 | 
														
														 | 
														
															       stroke="black" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /> 
														 | 
														
														 | 
														
															     /> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    <circle 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      v-for="(node, index) in nodes" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      :key="index" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      :cx="node.x" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      :cy="node.y" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      :class="node.data.class" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      :r="node.children ? 7 : 5" 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    > 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      <title>{{ node.data.name }}</title> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    </circle> 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    <template v-for="(node, index) in nodes"> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      <circle 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        :key="'circle' + index" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        :cx="node.x" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        :cy="node.y" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        :class="node.data.class + (node.data.first ? ' first' : '')" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        :r="node.children ? 7 : 5" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      > 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        <title>{{ node.data.title }}</title> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      </circle> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      <text :key="'text' + index" :x="node.x + 7" :y="node.y-7">{{ node.data.id }}</text> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    </template> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   </svg> 
														 | 
														
														 | 
														
															   </svg> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 </template> 
														 | 
														
														 | 
														
															 </template> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 <script> 
														 | 
														
														 | 
														
															 <script> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import { hierarchy } from 'd3-hierarchy' 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { line } from 'd3-shape' 
														 | 
														
														 | 
														
															 import { line } from 'd3-shape' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { selectAll } from 'd3-selection' 
														 | 
														
														 | 
														
															 import { selectAll } from 'd3-selection' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { drag } from 'd3-drag' 
														 | 
														
														 | 
														
															 import { drag } from 'd3-drag' 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -39,29 +43,20 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   name: 'NodeMap', 
														 | 
														
														 | 
														
															   name: 'NodeMap', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   props: { 
														 | 
														
														 | 
														
															   props: { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    data: { type: Object, required: true } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    nodes: { type: Array, required: true }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    links: { type: Array, required: true }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    id: { type: String, default: 'map' } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   }, 
														 | 
														
														 | 
														
															   }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															   data () { 
														 | 
														
														 | 
														
															   data () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     return { 
														 | 
														
														 | 
														
															     return { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       width: 100, 
														 | 
														
														 | 
														
															       width: 100, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       height: 100, 
														 | 
														
														 | 
														
															       height: 100, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      h: hierarchy({}), 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       simulation: forceSimulation(), 
														 | 
														
														 | 
														
															       simulation: forceSimulation(), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       lineGenerator: line().x(node => node.x).y(node => node.y) 
														 | 
														
														 | 
														
															       lineGenerator: line().x(node => node.x).y(node => node.y) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   }, 
														 | 
														
														 | 
														
															   }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  computed: { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    nodes () { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      return this.h.descendants() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    }, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    links () { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      return this.h.links() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  }, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   methods: { 
														 | 
														
														 | 
														
															   methods: { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     updateSize () { 
														 | 
														
														 | 
														
															     updateSize () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const { width, height } = this.$el.getBoundingClientRect() 
														 | 
														
														 | 
														
															       const { width, height } = this.$el.getBoundingClientRect() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -71,16 +66,11 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     init () { 
														 | 
														
														 | 
														
															     init () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.updateSize() 
														 | 
														
														 | 
														
															       this.updateSize() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      const h = hierarchy(this.data) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      this.nodes.forEach(node => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.$set(node, 'x', this.width * 0.5) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.$set(node, 'y', this.height * 0.5) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      }) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      h.descendants().forEach(node => 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        Object.assign(node, { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-          x: this.width * 0.5, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-          y: this.height * 0.5 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        }) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      ) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      this.h = h 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.setupForces() 
														 | 
														
														 | 
														
															       this.setupForces() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       // Wait for DOM update so d3 can select 
														 | 
														
														 | 
														
															       // Wait for DOM update so d3 can select 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.$nextTick(this.initListeners) 
														 | 
														
														 | 
														
															       this.$nextTick(this.initListeners) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -88,7 +78,8 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     initListeners () { 
														 | 
														
														 | 
														
															     initListeners () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       // TODO replace with vue events ? 
														 | 
														
														 | 
														
															       // TODO replace with vue events ? 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      selectAll('circle') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      selectAll(`#${this.id} circle`) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .data(this.nodes) 
														 | 
														
														 | 
														
															         .data(this.nodes) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .call(drag() 
														 | 
														
														 | 
														
															         .call(drag() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           .on('start', this.onNodeDragStart) 
														 | 
														
														 | 
														
															           .on('start', this.onNodeDragStart) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -100,8 +91,8 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     setupForces () { 
														 | 
														
														 | 
														
															     setupForces () { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.simulation 
														 | 
														
														 | 
														
															       this.simulation 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .nodes(this.nodes) 
														 | 
														
														 | 
														
															         .nodes(this.nodes) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        .force('link', forceLink(this.links).distance(100)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        .force('charge', forceManyBody().strength(-350)) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        .force('link', forceLink(this.links).id(d => d.id).distance(50)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        .force('charge', forceManyBody().strength(-150)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .force('x', forceX()) 
														 | 
														
														 | 
														
															         .force('x', forceX()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .force('y', forceY()) 
														 | 
														
														 | 
														
															         .force('y', forceY()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         .force('center', forceCenter(this.width * 0.5, this.height * 0.5)) 
														 | 
														
														 | 
														
															         .force('center', forceCenter(this.width * 0.5, this.height * 0.5)) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -142,6 +133,11 @@ path { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   stroke: grey; 
														 | 
														
														 | 
														
															   stroke: grey; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+text { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  font-size: 0.7rem; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  user-select: none; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @each $id in map-keys($families){ 
														 | 
														
														 | 
														
															 @each $id in map-keys($families){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   .family-#{$id} { 
														 | 
														
														 | 
														
															   .family-#{$id} { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     fill: setColorFromId($id); 
														 | 
														
														 | 
														
															     fill: setColorFromId($id); 
														 |