| | |
| | | true, |
| | | ) |
| | | |
| | | this.graph.on('node:moved', ({ e, x, y, node, view }) => { |
| | | this.graph.on('node:moving', ({ e, x, y, node, view }) => { |
| | | this.$emit('getPoint',x,this.smallWidth) |
| | | }) |
| | | }, |
| | |
| | | this.smallWidth = this.graph.getContentBBox().width |
| | | const nodes = this.graph.getNodes() |
| | | for (const otherNode of nodes) { |
| | | if (otherNode.parent){ |
| | | if (otherNode.hasParent()){ |
| | | this.targetNode = otherNode |
| | | console.log(this.targetNode,'targetNode') |
| | | } |
| | | } |
| | | // console.log(this.graph.getContentBBox().width,'DiagramJson11') |
| | |
| | | }, |
| | | getNodePointX(x,bigWidth){ |
| | | let pointX = Number((x / ( bigWidth /this.smallWidth)).toFixed(0)) |
| | | if(this.targetNode){ |
| | | this.targetNode.position(pointX, this.targetNode.position().y) |
| | | return false |
| | | } |
| | | |
| | | }, |
| | | // setScroll(top){ |
| | | // this.graph.setScrollbarPosition(null, top) |