🌍 Public
Viewing a saved revision (read-only)
1b97590229f54ba0bc5a69c0e614a499
D3 Forces
This example demonstrates a basic force-directed graph layout with three labeled nodes and two connecting links. Using the D3.js library version 7.8.0, it applies `d3.forceSimulation` with `forceManyBody`, `forceLink`, and `forceCenter` forces to position nodes. The visualization renders as SVG circles, text labels, and lines, updating their positions on each simulation tick based on computed node coordinates. The code imports methods like `select`, `forceSimulation`, and `forceCenter` directly from D3, with data defined as simple JavaScript objects containing node IDs and link indices.
AI-generated descriptionD3 Forces.