Home▸Networks & Graph Theory▸2D Force-Directed Graph — Live Spring Physics & Editable Network

2D Force-Directed Graph — Live Spring Physics & Editable Network

Build and edit a network live on a flat 2D canvas driven by real force physics: Coulomb-like node repulsion, Hooke's-law spring edges, and a centering pull, integrated frame by frame with velocity damping until the layout settles. Drag nodes, add and remove nodes and edges, and tune every force constant.

Networks & Graph Theory2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-force-directed-graph ↗ Open standalone

This simulator runs a genuine force-directed graph layout on a flat 2D canvas: every pair of nodes repels along an inverse-square Coulomb-like force, every edge acts as a Hooke's-law spring pulling or pushing its endpoints toward a rest length, and a weak centering force keeps the whole graph on screen. Each frame integrates velocity and position with damping, so a freshly built or edited graph visibly relaxes from a random tangle into a stable, readable layout. Unlike a static diagram, the graph here is fully editable live: click empty canvas to add a node, drag any node to perturb the layout and watch the rest of the graph react in real time, use Link Mode to wire up new edges between existing nodes, and right-click to delete a node or an edge. Tune the repulsion strength, spring stiffness, rest length, centering pull and damping to see how each force constant reshapes the equilibrium the system settles into.

⚙ Under the hood

A genuine 2D force-directed graph layout: Coulomb-like node repulsion, Hooke's-law spring edges and a centering pull integrated frame by frame with velocity damping until the network settles. Drag nodes, add and remove nodes and edges live, and tune every force constant.

force-directed graphspring layoutgraph theorynetwork visualizationcoulomb repulsionhooke's law2dinteractive

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)