Hi,
There is a critical bug:
Let’s assume that the user changed the positions of some nodes (by dragging them) - any click on any node - redrawing the graph and resetting all of his work!! (of course that the bug also causes the process of changing the position to get disturbed because suddenly the graph can reset, etc).
I investigated it deeply, and the decisive conclusion was the code of changing the stroke width is causing all of this mess.
Why? Is there a way to change the stroke width other than simply:
Construct a Node template so that your selectionChanged is not really modifying the size, but merely
appearing that it is.
If you don’t want to re-layout at all, the first one is the easiest. If you do want to re-layout on similar conditions, then you should do #3. You can do this by having two shapes that overlap, with different strokeWidth, and instead toggle their shape.opacity between 1 and 0. This ensures that no Shape (and therefore Node) remeasuring ever takes place on such changes. This is what the flowchart sample does for Link shapes, on hover.
Something else must be happening. What is your Diagram.layout? What happens if you also set Layout.isInitial to false? Do you have a TwoWay Binding on the Node.location property?
Here’s a simple example demonstrating a layout that uses inOngoing: false to prevent relayouts. It’s not clear what else might be preventing your layout from functioning the same.