d3/d3-force

Is there a way to avoid superposition of edges & nodes ?

redouane59 opened this issue · 2 comments

Hi,

In this example, we could think that there is a link between these two nodes :
image
but in reality they are not connected, the edge is just passing through this node to go to another one.
image

Is there a way to avoid this behavior please ?

There’s nothing built-in to prevent this, but possibly you could write a custom force that tries to avoid edges passing through unrelated nodes.

Hi @mbostock , do you have an idea to disable the fact that the edges / the nodes tend to be always aligned with other elements on the same line when moving them which provokes this behavior ?
see : https://twitter-social-graph.firebaseapp.com/index.html
Maybe the forceCollide method is guilty ?
https://github.com/redouane59/social-media-raiser/blob/master/social-graph/public/index.html