Force-Directed Graph v1
✓ Published1🌍 Public
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 descriptionMIT Licensed