Overlapping issue of nodes in force directed layout In network diagram

Hello Everyone,

I am facing an issue related to node overlapping.
I have created a network diagram with lots of data.So maximum nodes are overlapping to each other.

I have used DemoForceDirectedLayout custom function defined in diagram as

" layout: new DemoForceDirectedLayout() "

/* define a custom ForceDirectedLayout for this sample /
function DemoForceDirectedLayout() {
go.Diagram.inherit(DemoForceDirectedLayout, go.ForceDirectedLayout);
Override the makeNetwork method to also initialize /
ForceDirectedVertex.isFixed from the corresponding Node.isSelected. /
@override /
DemoForceDirectedLayout.prototype.makeNetwork = function (coll) {
call base method for standard behavior /
var net = go.ForceDirectedLayout.prototype.makeNetwork.call(this, coll);
net.vertexes.each(function (vertex) {
var node = vertex.node;
if (node !== null)
vertex.isFixed = node.isSelected;
return net;
end DemoForceDirectedLayout class */

But its not working for me.
I want in diagram, All nodes should not to overlap to each other.

So please let me know how to resolve this issue.

Shivma Varshney

It would be more efficient for both you and for us if you chose one medium for communicating with us, rather than sending us the same question via both email and this forum. Here is our answer to your email:

That is a different requirement than what you first asked about.

Actually it is only ForceDirectedLayout that does not normally position nodes so that they do not overlap each other. In this case you might want to change the parameters of your ForceDirectedLayout to reduce the likelihood of node overlaps. You could try increasing the defaultElectricalCharge and decreasing the defaultSpringStiffness.