2017-06-05 70 views
0
任何財產這樣

佈局:如何使gojs鏈接不採取最短路徑塊之間的goJS

diagrams.toolManager.linkingTool.temporaryLink.routing = go.Link.Orthogonal; 
diagrams.toolManager.relinkingTool.temporaryLink.routing = go.Link.Orthogonal; 

鏈接代碼:

this.go.Link, // the whole link panel 
      { 
       routing: this.go.Link.AvoidsNodes, 
       curve: this.go.Link.JumpOver, 
       corner: 5, toShortLength: 4, 
       relinkableFrom: true, 
       relinkableTo: true, 
       reshapable: true, 
       resegmentable: true, 
       toPortChanged: (a, b, c) =>{ console.log(a,"test");}, 
       mouseEnter: (e, link) => { link.findObject("HIGHLIGHT").stroke = "rgba(30,144,255,0.2)"; }, 
       mouseLeave: (e, link) => { link.findObject("HIGHLIGHT").stroke = "transparent"; } 
      }, 

連接線總是塊之間重新連接到最短路徑(從塊左側到塊右側)

回答

0

我想你的節點充當端口。如果您希望能夠連接到節點的不同側,您將需要定義多個端口。

Intro to Ports

或者,也許你想設置fromSpot和toSpots。

Intro to Connection Points