After updating and adding data to the model, when executing obj.diagram.layoutDiagram(true) to reflect the new changes in the diagram, I am encountering an over stack issue.
How can I handle the over stack issue while ensuring that the updated changes are reflected in the diagram and overlapping is avoided?
Can you describe what these methods are editing and what calls this code? If a node is changing side, or a node or link is getting added, its possible that yet another layout is getting triggered.
In the mentioned methods, I simply perform operations such as: model.addNodeData(newNode); model.addLinkDataCollection(_APIJsonData.linkdata); model.removeLinkData(link); model.setDataProperty(link, "to", newNode.key);
2.Yes, it is a TreeLayout, and it might be a deep tree. To handle deep tree structures, I have divided the data into dummy groups, as I have previously encountered issues with deeply nested trees.
It’s hard to guess from this alone what’s causing an infinite loop. Can you make a small reproducible case of this? Or if you inspect the stack, is there something obvious that’s repeating (like an addNodeData) that is unexpected?
While executing layoutDiagram, I observed that after pausing script execution, the loop inside go-debug.mjs continues running for a long time, after which a “Maximum call stack size exceeded” exception is thrown.
It’s possible that there is an infinite loop possible within AvoidsNodes that we’ll have to investigate. Anything you can give us (such as your diagram model data at the time and templates) that may be helpful for reproducing this would be helpful. You can always email gojs @nwoods.comnwoods.com for privacy.