block by bjtucker 1288c91d1a0e9c9928f7

Multi-Foci Force Layout with columns

Full Screen

Click to perturb or drag the nodes!

This example demonstrates the flexibility of D3’s force layout. By using position Verlet integration, it is easy to add custom forces to a layout. In this example, the nodes are clustered around four foci using additional forces: the odd nodes are pushed down, the even nodes are pushed up, and a similar bisecting force is applied laterally. These custom forces are based purely on the index of the node, but they could just as easily be derived from properties of data!

forked from mbostock‘s block: Multi-Foci Force Layout

index.html