Skip to main content
100%

fractal tree d3

✓ Published0🌍 Public
NNeeraj Kumar
Last edited Jan 10, 2024
Created on Jan 10, 2024

This example shows a procedurally generated fractal tree built from branching line segments, rendered as an animated SVG with a color gradient from black to purple based on depth. The code uses a recursive `branch()` function with randomness in angle and length to create organic variation, then draws each branch as a `<line>` element via D3’s data join. Hovering highlights parent branches in green, and the tree regenerates on click. It uses D3 v3 (via an external script) and D3 v7 (from `index.js`) for selection, transitions, and color scaling.

AI-generated description

My fisrt viz with javascript

MIT Licensed

Similar vizzes