🌍 Public
Viewing a saved revision (read-only)
11052cb33d3d4d2c8c45e5c4d8a54511
Force Directed Graph Starter
This example shows a minimal force-directed graph with three nodes (Alice, Bob, Carol) and two links, rendered as circles and lines in an SVG canvas. The layout is computed using d3.forceSimulation with forces from forceManyBody, forceLink, and forceCenter to position the nodes. The simulation’s tick event updates the circle and line attributes to reflect the current positions. The code uses d3.select to target the SVG container and d3 data binding to append elements from the nodes and links arrays.
AI-generated description