Nodes intersect with each other in VirtualizeForceDirectedLayout


I’m testing VirtualizeForceDirectedLayout. The problem is, nodes are not positioned evenly, and some nodes intersect with each other. ForceDirectedLayout with same properties has no this problem.

I made a comparison.



What should i do to make virtualizeForceDirectedLayout look better?

Is that behavior reliably repeatable?

The VirtualizedForceDirectedLayout ought to be working just like the regular one, as long as the nodes are actually as big as they are assumed to be when the layout runs.

ForceDirectedLayout does not guarantee there are no node overlaps.

Yes, i tried agagin and they were still different.

ForceDirectedLayout comes from here: Force Directed Layout
With changes:
MinNodes: 80;
MaxNodes: 80;
MinChildren: 80;
MaxChildren: 80;

VirtualizedForceDirectedLayout comes from here:

With changes:

layout: $(VirtualizedForceDirectedLayout, { maxIterations: 100 })

generateNodes(myWholeModel, 80, 80);
generateLinks(myWholeModel, 80, 80);

I’ve copied the VirtualizedForceDirectedLayout sample and modified it as you did. After five tries, I have yet to see any instance in which any nodes are overlapping.

I’m wondering what else I can do to reproduce what you are experiencing.

OK. I think i find the reason.

It’s GoJS version problem. I was using v1.6 in my demo. When i changed it to v1.8, everything is fine now.

Sorry, my mistake!