Drop a node on to a node

We want Drop a node on to a node nodes should not be overlapped.
How to achieve this?

I am using

layout: $(ParallelLayout, { nodeSpacing: 3, isOngoing: false, angle: 0,nodeSpacing: 10, layerSpacing: 30, setsPortSpot :false, setsChildPortSpot : false }),

Is there a reason that you have disabled an automatic relayout by setting Layout.isOngoing to false? Performing a layout after each adding of a node would ensure that no nodes would overlap.

I don’t want automatic relayout initially.
We need this when drop a element onto a element.
That’s why I use Layout.isOngoing to false.

We are building a water flow layout.
So I also need to know which layout will be better for this.

Well, in your “ExternalObjectsDropped” DiagramEvent listener you can see if the dropped node(s) overlap any existing nodes and, if needed, you can move each such node so that it no longer overlaps any nodes. However the GoJS library has no idea of what your requirements are regarding where to move dropped nodes – you’ll need to decide that for your app, because you are explicitly telling the Diagram.layout not to do it.

You might be interested in the isUnoccupied function defined in the Drag Unoccupied sample, Drag Unoccupied.