I used a simplified version of your link template but was unable to reproduce any problem. Here’s the complete code:
<!DOCTYPE html>
<html>
<head>
<title>Minimal AvoidsLinksRouter test</title>
<!-- Copyright 1998-2022 by Northwoods Software Corporation. -->
</head>
<body>
<div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:400px"></div>
<p>
Draw a new link from the bottom of Beta to the bottom of Delta.
The router doesn't modify the (only) link's route.
</p>
<p>
OR, first draw a new link from the bottom of Alpha to the top of Gamma, and then
draw a new link from the bottom of Beta to the bottom of Delta.
Both links will be shifted by the router.
</p>
<script src="go.js"></script>
<script src="AvoidsLinksRouter.js"></script>
<script id="code">
const $ = go.GraphObject.make;
const myDiagram =
$(go.Diagram, "myDiagramDiv",
{
"LayoutCompleted": e => myRouter.avoidOrthogonalOverlaps(e.diagram.links),
"SelectionMoved": e => myRouter.avoidOrthogonalOverlaps(e.diagram.links),
"LinkDrawn": e => myRouter.avoidOrthogonalOverlaps(e.diagram.links),
"undoManager.isEnabled": true
});
const myRouter = new AvoidsLinksRouter();
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{ width: 100, height: 50 },
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Shape,
{ fill: "white" },
new go.Binding("fill", "color")),
$(go.TextBlock,
new go.Binding("text")),
$(go.Shape,
{
width: 8, height: 8, fill: "white",
alignment: go.Spot.Top,
portId: "T", fromSpot: go.Spot.Top, toSpot: go.Spot.Top,
fromLinkable: true, toLinkable: true, cursor: "pointer"
}),
$(go.Shape,
{
width: 8, height: 8, fill: "white",
alignment: go.Spot.Bottom,
portId: "B", fromSpot: go.Spot.Bottom, toSpot: go.Spot.Bottom,
fromLinkable: true, toLinkable: true, cursor: "pointer"
})
);
myDiagram.linkTemplate =
$(go.Link,
{
routing: go.Link.Orthogonal,
corner: 5,
curve: go.Link.JumpOver,
relinkableFrom: true, relinkableTo: true,
reshapable: true,
resegmentable: true,
//mouseEnter: function(e, link) { link.path.strokeWidth=14},
//mouseLeave: function(e, link) { link.path.strokeWidth=4}
},
new go.Binding("routing", "routing"),
new go.Binding("points").makeTwoWay(),
$(go.Shape,
//{ isPanelMain: true, stroke: "transparent" },
//new go.Binding("pathPattern", "patt", convertPathPatternToShape),
new go.Binding("stroke", "color"),
new go.Binding("strokeWidth", "thick"),
new go.Binding("fill", "fill"),
new go.Binding("isPanelMain", "isPanelMain")
),
$(go.Shape,
{ toArrow: "" }, //{ isPanelMain: true },
new go.Binding("toArrow", "toArrow"),
new go.Binding("angle", "angle"),
new go.Binding("strokeWidth", "thick"),
new go.Binding("fill", "fill"),
new go.Binding("stroke", "color"),
//new go.Binding("isPanelMain", "isPanelMain")
)
);
myDiagram.model = new go.GraphLinksModel(
{
linkFromPortIdProperty: "fpid",
linkToPortIdProperty: "tpid",
nodeDataArray: [
{ key: 1, text: "Alpha", color: "lightblue", loc: "0 0" },
{ key: 2, text: "Beta", color: "orange", loc: "120 0" },
{ key: 3, text: "Gamma", color: "lightgreen", loc: "200 210" },
{ key: 4, text: "Delta", color: "pink", loc: "180 70" }
],
linkDataArray: [
//{ from: 1, fpid: "B", to: 3, tpid: "T" }
]
});
</script>
</body>
</html>
Note that I don’t understand the complexity of your link template, which is part of the reason that I simplified it.