Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Force Directed Graph Starter

Public visualization

Viewing a saved revision (read-only)

f8e7dbcfb8d04fba91691d92971f62db

Force Directed Graph Starter

0 stars1🌍 Public
KKai Stewart
Last edited Jan 25, 2022
Created on Jan 25, 2022
Forked from HTML Starter

A force-directed graph starter example renders three nodes and two links as SVG circles and lines. The simulation uses `d3.forceSimulation` with `forceManyBody` for repulsion, `forceLink` for connections, and `forceCenter` to keep the layout centered. On each tick, node and link positions update directly via the `simulation.on('tick')` handler, assigning `cx`, `cy`, and line endpoints from the simulation's coordinates. The data is hardcoded as three objects and two link pairs in D3 v7.

AI-generated description