Build Your Own Graph!
Clicking anywhere on the SVG canvas adds a node at that position and automatically links it to any existing nodes within 30 pixels, using `d3.layout.force` for simulated physics. A brown cursor circle tracks the mouse as a visual guide. The force layout applies charge (-60) and link distance (30) constraints, with a virtual spring anchoring nodes to the chart’s center to prevent drift. Rendered as SVG circles and lines, the graph updates on each tick, and nodes are draggable via `force.drag`.
AI-generated descriptionClick to add nodes! Nodes near the cursor will be linked to the new node.
D3's force layout uses the Barnes–Hut approximation to compute repulsive charge forces between all nodes efficiently. Links are implemented as geometric constraints on top of position Verlet integration, offering greater stability. A virtual spring between each node and the center of the chart prevents nodes from drifting into space.