d3 将力导向树布局制作成圆形

d3 make a force-directed-tree layout into a circle shape

如何将力导向树布局变成圆形

D3.js Titles on Collapsible Force-Directed graph

而不是挂起?

http://bl.ocks.org/mbostock/1138500

在这里找到一个未回答的类似问题:D3.js how do I arrange nodes of a force layout to be on a circle

显然可以像第二个 link 中看到的那样完成。只是不知道如何。谢谢!

您可以使用charge()函数来指定每个节点之间的排斥程度。负数越多,它们越会相互排斥。例如,尝试 -250 或 -500。

增加电荷的一个副作用是初始布局更多"bouncy",因为节点相互施加更大的力。