Hello dear community - I’m having trouble focusing a node within the InitialLayoutCompleted event with
diagram.centerRect(node.actualBounds)
diagram.select(node)
The diagram always moves to top left.If I search for the node I’m trying to focus I can see, that it is actually focused. I want to note that I’m changing the model data (links and nodes).
myDiagram.model.startTransaction("adding nodes");
myDiagram.model.addNodeDataCollection(nodesToAdd);
myDiagram.model.commitTransaction("adding nodes");
When I remove the model-changes, the focus works perfectly.
I’m assuming, that when changing the model’s data a different event gets fired and the overview gets updated and thus scrolling to the default position.
Is there a way to intercept this kind of behaviour? Or is it possible to make sure, that the specific node I want to focus gets focused after all initial data changes occured?
Thanks in advance. I’m happy to give more details if needed.