| | |
| | | svgRenderer |
| | | }, |
| | | props: { |
| | | startX: Number, |
| | | netNodes: { |
| | | type: Array |
| | | }, |
| | |
| | | canvas: false, |
| | | nodes: [], |
| | | links: [], |
| | | nodeX: [], |
| | | nodeY: [], |
| | | minWidth:0, |
| | | minHeight:0, |
| | | size: { |
| | | w: 500, |
| | | h: 420 |
| | |
| | | vm.$set(node, "_opacity", node._size / 30); |
| | | vm.$set(node, "opacity", node._opacity); |
| | | } |
| | | |
| | | // this.nodeX.push(node.x); |
| | | // this.nodeY.push(node.y); |
| | | // this.minWidth = Math.max(...this.nodeX) - Math.min(...this.nodeX); |
| | | // this.minHeight = Math.max(...this.nodeY) - Math.min(...this.nodeY); |
| | | // console.log(this.nodeX,this.nodeY,this.minWidth,this.minHeight); |
| | | return node; |
| | | }); |
| | | }, |
| | |
| | | if (forces.Center !== false) |
| | | sim.force("center", d3.forceCenter(this.center.x, this.center.y)); |
| | | if (forces.X !== false) { |
| | | sim.force("X", d3.forceX(this.center.x).strength(forces.X)); |
| | | //sim.force("X", d3.forceX(this.center.x).strength(forces.X)); |
| | | sim.force("X", d3.forceX(this.startX||160).strength(forces.X)); |
| | | } |
| | | if (forces.Y !== false) { |
| | | sim.force("Y", d3.forceY(this.center.y).strength(forces.Y)); |