Skip to main content
100%

Labeled Streamgraph

✓ Published1🌍 Public
CCurran Kelleher
Last edited Mar 1, 2024
Created on Mar 1, 2024
Forked from HTML Starter

A streamgraph displays four time series—Leonardo, Donatello, Raphael, and Michelangelo—as smoothly curved stacked areas. The code uses D3 v4 with the `d3-area-label` plugin to automatically place white labels inside each layer. Random walk data updates every two seconds, triggering animated transitions that recompute the stacked layout via `d3.stack().offset(d3.stackOffsetWiggle)` and redraw the areas with `d3.area` and `d3.curveBasis`. The `d3.areaLabel(area)` helper positions each label along the final shape.

AI-generated description
MIT Licensed

Similar vizzes