Search code examples
javascriptsvggraphd3.jscollision-detection

D3 nodes overlapping


I'm using a modified version of the following example and everything works great so far.

What I am trying to do is to make the nodes bounce from each others and not overlap because I can't see the text and icons of a node if there is another on top of it. Is there a way to make this happen without modifying too much of code that works already? Maybe add something like enabling collision for the nodes?


Solution

  • ok i its seems that setting the charge to .charge(-300), sets the nodes apart by pushing them away from each others.