Is there a way to make nodes spawn initially without links overlapping? #554
-
Hello, We are using react force graph to display hundreds of nodes and wanted them to spawn in so they are separated out nicely with no links overlapping. One way I have noticed to achieve this is to let them naturally spawn in and then hold and wiggle the root node a little and eventually all the nodes will place themselves correctly. I have provided screenshots of the initial load and what we want it to look like on initial load (after wiggling the root node until all are placed nicely). As you can see, in the initial load links cross over each other and it makes the graph hard to trace whereas the screenshot of what we want it to look like all the nodes are nicely spaced out and it is easy to follow the links from the root to children with minimal overlap. Is there a way to achieve this? I have tried playing with various settings but nothing seems to get it quite right. We are fine if it takes a few seconds to get to the final state but having it spawn initially like that would be great! Thanks in advance and wonderful project! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@liamlows thanks for reaching out. You can try decreasing the |
Beta Was this translation helpful? Give feedback.
-
one more thing @vasturiano, we have a onclick handler for the nodes to display information about them. When we click on the node, it causes the graph to re-engage in the force effect. is there a way to prevent this and keep it static?
|
Beta Was this translation helpful? Give feedback.
@liamlows thanks for reaching out.
You can try decreasing the
d3AlphaDecay
to say0.005
in order to keep the engine running at high intensity for longer.