I can’t seem to duplicate this in a simple fiddle yet, so I hope it’s mostly my misunderstanding of the framework.
In my real app, I want to listen to the diagram’s LayoutCompleted event so I can take a thumbnail image and store it away. In general, this event seems to fire when I expect, such as when I add a new node to the diagram with myDiagram.model.addNodeData(mynode). But in my app, the LayoutCompleted event fires only when there’s a link added and not simply when I add a node on its own. I want to catch an event like this whenever a node is added, regardless of its links. If I do something silly like add a bogus empty link with “myDiagram.model.addLinkData({})” at the same time I add the node, this does seem to elicit the LayoutCompleted, which is nice, though it also leaves this empty link in my linkDataArray which is not nice.
I created this fiddle (Edit fiddle - JSFiddle - Code Playground) with the goal of trying to replicate this effect, but here the event fires every time, regardless of whether there’s also a link added. So, I’m not sure how to handle this.
Is there an obvious reason why adding nodes with no links would not cause a layout followed by a LayoutComplete event?
thanks!