it works fine.
the problem I have is the I can see a message in the console. Change not within a transaction: !d position: Link#129412(flow_0_4) old: Point(638.3500000000017,-332.5) new: Point(638.3500000000017,-340)
I have noticed that if I remove link.curve = go.Link.JumpOver then the problem goes away.
by looking at the stack trace I can see that gojs start a timer to change the points and this is why (I guess) I get this message.
Since it says “Change not within a transaction”, did you try changing the implementation of the alignLeft function to execute within a transaction. Whenever you make changes, particularly to a model, you should perform a transaction.
It’s common to call Diagram.commit or Model.commit.
Yes I did look at the code, it runs in a transaction.
alignLeft calls iterateAndCommitOverAllSelectedNodes , and pass a lamda function to a function that commits.
It’s hard to know what’s doing this. We are expecting that requestAnimationFrame will not fire in the middle of synchronous code, and in my simplistic example it seems to work as I’d expect.
What is zone.js? It’s not clear to me what’s actually calling the task.
Broadly: In GoJS, if properties are modified, after a short while we update the Diagram. Properties are typically modified within a transaction, and the update at the end of a transaction removes the need for the timed update. But that is not happening here.