Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

fractal tree d3

Public visualization

fractal tree d3

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed