Hi folks,
I’ve built a diagram where some nodes are linked together and nested within groups. I’m running into an unexpected result with my diagram layout when I hide nodes/groups. My diagram starts off like this:
and when I hide the nodes and group on the right side by setting their visible
flag to false
, it looks like this:
Notice how the node in the bottom right is oddly far away from the rest of the diagram. That’s what I’m struggling to understand. If I render the diagram from scratch, this isn’t a problem.
Possibly relevant: the code that updates the diagram:
function updateDiagram(nodes, links) {
diagram.model.commit((m) => {
m.mergeNodeDataArray(nodes);
if (m instanceof go.GraphLinksModel) {
m.mergeLinkDataArray(links);
}
});
}
The nodes are hidden using the binding below:
function visibleBinding () {
return new go.Binding("visible", "hidden", (hidden) => !hidden);
}
Code sample here - use the buttons in the bottom left to reproduce the issue
GoJS version: 2.1
Thank you!