Skip to main content
100%

Tree Fractal

✓ Published12🌍 Public
CCurran Kelleher
Last edited Oct 9, 2025
Created on Jun 24, 2019
Forked from Moon Calendar 2024

An interactive tree fractal drawn on a Canvas element responds to mouse movement, which controls branch length ratio and angle difference. The rendering uses raw Canvas API calls like `beginPath`, `lineTo`, and `stroke` to recursively draw branching lines to a depth of 11. High-resolution displays are supported via `window.devicePixelRatio` scaling. The example is based on HTML5 Examples and adapts its rendering for high pixel density screens.

AI-generated description

Interactive tree fractal with Canvas.

Move the mouse to change the branching!

Draws from HTML5 Examples.

Extended to use high resolution Canvas for high pixel density displays.

MIT Licensed

Similar vizzes