When collapsing/expanding a group that contains nodes connected by multiple links, a link with adjusting: End does not get its computePoints() called correctly if there are sibling
links (with adjusting: None) between the same nodes. The link with adjusting: End ends up with incorrect/stale point coordinates.
Key observations:
• If the link with adjusting: End is the only link between the nodes, collapse/expand works correctly
• The bug only occurs when there are multiple links and at least one has adjusting: End while another has adjusting: None
• On collapse, computePoints() is called for the adjusting: None link but appears to be skipped or called at the wrong time for the adjusting: End link
• The adjusting: End link retains its old absolute point coordinates instead of properly adjusting to the new node positions
Minimal reproduction:
html
<!DOCTYPE html>
<html>
<head>
<title>Link Adjusting Bug - Group Collapse</title>
<script src="https://unpkg.com/[email protected]/release/go.js"></script>
</head>
<body>
<div id="myDiagramDiv" style="width:800px;height:400px;border:1px solid #ccc"></div>
<button onclick="addLink()">Add Link</button>
<script>
const $ = go.GraphObject.make;
class DebugLink extends go.Link {
computePoints() {
console.log(`computePoints on "${this.data?.key}" (adjusting=${this.adjusting === go.LinkAdjusting.End ? 'End' : 'None'})`);
return super.computePoints();
}
}
const diagram = $(go.Diagram, 'myDiagramDiv', {
'undoManager.isEnabled': true,
'animationManager.isEnabled': false,
'LinkReshaped': e => e.subject.adjusting = go.LinkAdjusting.End
});
diagram.nodeTemplate = $(go.Node, 'Auto',
{ locationSpot: go.Spot.Center },
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Shape, 'Rectangle', {
fill: 'lightblue', width: 80, height: 40,
portId: '', fromSpot: go.Spot.AllSides, toSpot: go.Spot.AllSides
}),
$(go.TextBlock, { margin: 8 }, new go.Binding('text', 'key'))
);
diagram.groupTemplate = $(go.Group, 'Vertical',
{ layout: $(go.GridLayout, { wrappingColumn: 1 }) },
new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding('isSubGraphExpanded').makeTwoWay(),
$(go.Panel, 'Horizontal', { background: 'lightgray' },
$('SubGraphExpanderButton'),
$(go.TextBlock, { margin: 5, font: 'bold 12px sans-serif' }, new go.Binding('text', 'key'))
),
$(go.Placeholder, { padding: 10, background: 'whitesmoke' })
);
diagram.linkTemplate = $(DebugLink,
{ reshapable: true, resegmentable: true, routing: go.Routing.Orthogonal },
new go.Binding('adjusting').makeTwoWay(),
new go.Binding('points').makeTwoWay(),
$(go.Shape, { strokeWidth: 2 }),
$(go.Shape, { toArrow: 'Standard' })
);
diagram.model = new go.GraphLinksModel([
{ key: 'Group A', isGroup: true, loc: '0 0', isSubGraphExpanded: true },
{ key: 'Group B', isGroup: true, loc: '300 0', isSubGraphExpanded: true },
{ key: 'Node A', group: 'Group A', loc: '50 50' },
{ key: 'Node B', group: 'Group B', loc: '350 50' }
], []);
let linkCount = 0;
function addLink() {
diagram.model.commit(m => {
m.addLinkData({ key: 'Link ' + (++linkCount), from: 'Node A', to: 'Node B' });
});
}
</script>
</body>
</html>
Steps to reproduce:
- Click “Add Link” to create Link 1 (adjusting=None)
- Click “Add Link” to create Link 2 (adjusting=None)
- Reshape Link 2 by dragging its handles (this sets adjusting=End)
- Collapse Group B using the expander button
- Observe: Link 2 (adjusting=End) has incorrect route, Link 1 (adjusting=None) is correct
Expected: Both links should correctly adjust their routes when group collapses.
Actual: The link with adjusting: End maintains stale/incorrect point coordinates.


