force-graph
force-graph copied to clipboard
on Nodedrag other nodes are moving away.
While dragging the node the other nodes that are not related are moving away from each other.
Is it possible to prevent nodes from moving away while dragging nodes?
Yes, you can set fixed coordinates to the nodes. You can see this example. It shows how to set fixed coordinates to the nodes.
https://github.com/vasturiano/force-graph/blob/master/example/fix-dragged-nodes/index.html
it will only set the fixed node on dragend . i want to prevent other nodes from keep moving.
You can get the nodes with the graphData([data]) function, iterate through all the nodes and set fixed positions as shown in the example. After you have set the coordinates, you can use the same function to load the new data.