Fork of Force Directed Graph Starter
✓ Published0🌍 Public
This example shows a minimal force-directed graph with three nodes and two links arranged dynamically. It renders circles for nodes and lines for edges in an SVG container, using a simulation that applies charge, link, and centering forces to position the elements. The code implements this with D3 v6 functions including `forceSimulation`, `forceManyBody`, `forceLink`, and `forceCenter`. Node and link positions update on each simulation tick by setting SVG attributes directly. The data is hardcoded as three named nodes and two connections.
AI-generated descriptionMIT Licensed