March 25, 2018, 11:29am
I used ForceDirectedLayout to get the results:
There are two nodes that are far away because there is no link connection.
Q1:I want these two nodes to be closer to the other nodes.Could you give me some advice?
Q2:Computations stop when no vertex moves more than epsilonDistance or when maxIterations have happened.Can I let the computations never stop?
March 25, 2018, 1:39pm
[EDIT: ArrangingForceDirectedLayout has been subsumed by the
ArrangingLayout extension in v2.1.23.]
I suggest that you use the
It is demonstrated at: Arranging Layout of the Class Hierarchy
It is defined at: https://gojs.net/latest/extensions/ArrangingLayout.js
It is documented at: ArrangingLayout | GoJS API
In your case you’ll want to set
ArrangingLayout.primaryLayout to be your ForceDirectedLayout. Disconnected nodes it will automatically arrange along the bottom of the document by a GridLayout.
March 27, 2018, 3:47pm
The ArrangingForceDirectedLayout is what most people want.
But an alternative design is to customize the ForceDirectedLayout so that there are pretend links/edges between the single (disconnected) nodes/vertexes and other already-connected nodes/vertexes.
I notice now that I didn’t answer your second question. There are a number of possibliities. Perhaps you would be interested in
Interactive Force Directed Layout ?