Node = draggable point mass Edge = Hooke's-law spring
click empty space: add node · drag: move node · right-click: delete

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

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.