Skip to main content
100%

Force-Directed Lattice

✓ Published0🌍 Public
Mmbostock
Last edited Jul 4, 2016
Created on Apr 27, 2016

A 20-by-20 grid of nodes forms a force-directed lattice, with links connecting adjacent rows and columns. The simulation uses `d3.forceSimulation` with a `d3.forceManyBody` charge and `d3.forceLink` at high iteration counts to keep the structure rigid. Nodes and edges are drawn to a Canvas 2D context each tick, and users can drag nodes to interactively distort the lattice, with the simulation responding via `d3.drag` and pinned positions.

AI-generated description

This demonstrates forceLink.iterations, which strengthens d3-force’s link constraint by applying the constraint multiple times per simulation step.

gpl-3.0 Licensed

Similar vizzes