简体   繁体   English

D3节点重叠

[英]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? 也许添加诸如为节点启用碰撞之类的东西?

好的,我似乎将charge设置为.charge(-300),通过将节点彼此推开来将节点分开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM