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