This clustered force layout is implemented using two custom forces. The first, cluster
, pushes nodes towards the largest node of the same color. A second collide
force prevents circles from overlapping by detecting collisions.
This example uses custom gravity applied only to the largest node of each color; compare to standard gravity.
forked from mbostock's block: Clustered Force Layout II
https://d3js.org/d3.v3.min.js