0
votes

How do you make a force-directed-tree layout into a circle shape

D3.js Titles on Collapsible Force-Directed graph

instead of hanging?

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

Found an unanswered similar question here: D3.js how do I arrange nodes of a force layout to be on a circle

Apparently it can be done as seen in the second link. Just no idea how. Thanks!

1
Thanks will try that. - user4534236

1 Answers

0
votes

You can use the charge() function to specify how repellant each node is each other. The more negative the number, the more they will repel each other. For example, try -250 or -500.

One side-effect of increasing the charge is the initial layout is more "bouncy" since the nodes are applying more force on each other.