🌍 Public
Viewing a saved revision (read-only)
fca40a25077944d4a7fa6dab493002c8
Force-Directed Graph v1
This example demonstrates a minimal force-directed graph with three nodes and two links. It shows the basic mechanics of a force simulation, where node positions update iteratively as the layout reaches equilibrium. The implementation uses D3 v6’s `forceSimulation` with `forceManyBody` for repulsion, `forceLink` for link constraints, and `forceCenter` to anchor the graph. Circles and lines are rendered as SVG elements, with their coordinates updated on each simulation tick.
AI-generated description