Skip to main content
100%

Force-Directed Tree

✓ Published0🌍 Public
SSputniza
Last edited Aug 5, 2016
Created on Aug 5, 2016

A randomly generated tree of 1,000 nodes is laid out using D3’s `d3.forceSimulation` with charge, link, and centering forces, and rendered on a Canvas 2D context. The links connect each node to its parent based on a square-root index mapping. The code includes drag interaction via `d3.drag`, allowing users to pin and move nodes. The visualization updates on each simulation tick, redrawing nodes as small circles and links as gray lines on a 960×960 canvas.

AI-generated description

This randomly-generated tree is positioned using a force simulation.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/95aa92e2f4e8345aaa55a4a94d41ce37'>Force-Directed Tree</a>

gpl-3.0 Licensed

Similar vizzes