Links overlap when moving target on top of source


If you create two nodes and create two links between them, each link with an opposite from / to key, then if you move one of the nodes on top of the other one a few times one of the two links will suddenly move on top of the other link and won’t separate from it again. You’ll basically have two links on top of each other so that it looks like there’s only one between the two nodes.

Anything I might be doing wrong?


I just tried it at State Chart and was unable to reproduce the problem.

What Link and Node properties have you set?

EDIT: I was able to reproduce it in that sample. There must be some situation where both links naturally get the same route, and once they do, because Link.adjusting is not None, they keep the same route. But it is easy for the user to spread them apart again.

I see what you mean. The problem is that in our case the user does not and can not interact with the links, so there’s no way for them to “fix” it without a page refresh. I guess there’s no solution for this then?

But the user can move nodes around, yes?

I don’t understand yet exactly how this can happen, so I don’t know if it’s easy to avoid. But I know that you can easily avoid it by changing the link template(s) so that they do not set Link.adjusting. However I don’t know if setting Link.adjusting to non-None value is OK for your app. But I would guess that if users cannot reshape the links, there’s little need for you to set Link.adjusting.

Yes, the user can move nodes. Users cannot shape the links, but might eventually be allowed to change the source / target node by dragging the end or beginning of the link. They just can’t change the link itself, it’s a straight line from point A to B. So long as changing the source or target works, if Link.adjusting fixes the problem that works for me. Do I just do the following?

Link.adjusting = null

Just don’t set adjusting in your Link template(s).

Once again, saved the day. Thanks Walter!