如何让gojs链接不要在goJS之间的任何属性之间采取最短路径

时间:2017-06-05 09:23:31

标签: 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"; }
            },

链接总是重新连接到块之间的最短路径(从块左侧到块右侧)

1 个答案:

答案 0 :(得分:1)

我想你的节点充当了端口。如果您希望能够连接到节点的不同侧面,则需要定义多个端口。

Intro to Ports

或许你想设置fromSpot和toSpots。

Intro to Connection Points