Branched Random Walk
✓ Published0🌍 Public
Mmbostock
Last edited Nov 15, 2016
Created on Oct 17, 2016
This example visualizes a branching random walk on a canvas. A single black main walk of 1,000 steps runs horizontally, and from every other point along it, multiple short colored branch walks emerge, each with fading opacity. Clicking the canvas regenerates the entire composition. The code uses d3.randomNormal to generate step offsets, d3.scaleSequential with d3.interpolateRainbow for branch colors, and the Canvas 2D API with globalCompositeOperation set to "multiply" to blend overlapping strokes.
AI-generated descriptiongpl-3.0 Licensed