block by rpgove 2c523eb97f594de8ae0d04e305495c72

Composing multiple forces and constraints with Random Vertex Sampling

Full Screen

This example shows how to compose d3.forceManyBodySampled() with other forces and position constraints using the Les Miserables character interaction graph. Vertices repel each other using the Random Vertex Sampling algorithm; edges attract vertices, but the force is stronger for vertices within the same group; constraints confine vertices to rectangular regions based on the book volume that introduced each character; and each rectangular region has a gravitational force that draws the vertices of that region toward its center.

index.html

d3-force-sampled.js