Redraw links when node placed on canvas

We have a project where nodes are being dragged from a palette onto a canvas. What we want to happen is if the block is dropped over any links for them to reroute around the block. However, this isn’t happening. We can trigger this by even the slightest movement of the block once it is on the canvas. Also I notice our desired behaviour is in the Flowchart sample, but I’m struggling to find what the pertinent difference between it and our project is.

So I’m wondering, what might have been enabled in the sample to do this, or what might we have inadvertently overridden/set in our project to stop this happening?

First, do your Links have Link.routing set to go.Link.AvoidsNodes? I assume yes, since you say it works once the user after the drop moves the node slightly.

Second, the drag-and-drop is coming from a GoJS Palette or other Diagram? This is also required for it to do what you want. If this is not the case, but the user is dragging from some other HTML element, then you will need to invalidate the routes of the links that intersect with the area where the new node was dropped.

Hmmm, after some more thought, I can’t think of any other reason why it wouldn’t work.

Are you using the go-debug.js library, and are you checking for any warnings or errors in the console output?

Thanks. We’re not using a GoJS palette, so I’m invalidating the routes of all the links that intersect with the node, which works as we want.

As you surmised we did have Link.routing set to go.Link.AvoidsNodes.