【问题标题】:How to make GoJS link not to take shortest path between blocks如何使 GoJS 链接不采用块之间的最短路径
【发布时间】:2017-06-05 09:23:31
【问题描述】:

布局:

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

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

【问题讨论】:

    标签: gojs


    【解决方案1】:

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

    Intro to Ports

    或者您可能想设置 fromSpot 和 toSpots。

    Intro to Connection Points

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-17
      • 2021-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多