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.