Vega-Lite Stream Graph
A streamgraph — a stacked area chart where the baseline is centred rather than zero, so the chart looks like a flowing river. Vega-Lite produces this with one tiny tweak to a stacked area: `stack: 'center'` on the y-encoding (instead of the default `'zero'`). The resulting visual
Template details
- chart
- streamgraph
- area
- composition
- vega
- vega-lite
When to use this template
A streamgraph excels at illustrating how the proportional contribution of various categories within a total evolves over time. It makes shifts in relative dominance and the ebb and flow of individual components visually apparent, allowing analysts to quickly grasp trends in composition without being distracted by absolute magnitudes or the cumulative sum. It's ideal when the story lies in the changing mix rather than the raw values.
- Time-series data with a continuous temporal axis.
- Multiple categorical series, each contributing to a total.
- Positive numerical values representing parts of a whole.
- Data where the relative proportion of categories matters most.
- Datasets with a moderate number of distinct categories (e.g., 5-15).
- Regularly sampled data points across the time dimension.