All examples By author By category About

mbostock

Clustered Force Layout II

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.