Streamgraph
Stacked streams around a flowing baseline showing how the mix of a total shifts over time.
import { Streamgraph } from '@uthereal/ui/streamgraph'Streamgraph playground
| Week | Bugs | Billing | Onboarding |
|---|---|---|---|
| Jun 1, 2026 | 42 | 24 | 12 |
| Jun 8, 2026 | 48 | 22 | 15 |
| Jun 15, 2026 | 45 | 27 | 19 |
| Jun 22, 2026 | 56 | 25 | 17 |
| Jun 29, 2026 | 61 | 31 | 14 |
| Jul 6, 2026 | 58 | 36 | 18 |
| Jul 13, 2026 | 66 | 33 | 23 |
| Jul 20, 2026 | 72 | 29 | 27 |
| Jul 27, 2026 | 69 | 34 | 25 |
| Aug 3, 2026 | 64 | 41 | 21 |
| Aug 10, 2026 | 70 | 38 | 26 |
| Aug 17, 2026 | 78 | 35 | 31 |
| Aug 24, 2026 | 74 | 39 | 29 |
| Aug 31, 2026 | 81 | 44 | 24 |
| Sep 7, 2026 | 77 | 48 | 28 |
| Sep 14, 2026 | 84 | 42 | 33 |
Overview
A streamgraph stacks one to eight series over dates or numeric scales around a flowing baseline so shifts in composition stand out at a glance. Streams render at 82% fill with a 2 px surface gap between layers and inline labels inside stretches at least 19 px thick (directLabels). Exploring the plot snaps a crosshair to the nearest x value, highlights the hovered layer at full color while dimming other layers, and lists every layer in stack order inside a floating tooltip. A legend toggles layers and a data table exposes every value.
Use a streamgraph to show how parts of a total wax and wane over time. Use offset: 'zero' to stack from a flat baseline. To compare individual series magnitudes directly, use a line chart.
Usage
import { Streamgraph } from '@uthereal/ui/streamgraph'
export function TicketsByTopic() {
return (
<Streamgraph
title="Support tickets by topic"
xLabel="Week"
series={[
{
id: 'bugs',
label: 'Bugs',
points: [
{ x: '2026-06-01', y: 42 },
{ x: '2026-06-08', y: 48 },
],
},
]}
/>
)
}All y values must be zero or more. Missing points or null count as zero in the stack and display as "No data" in the tooltip and data table.
Examples
Flat stacked area
wiggle (default, shown in the playground above) minimizes vertical wobble around a centered baseline, while silhouette centers the stack around zero. Set offset: 'zero' and curve: 'linear' for a traditional stacked area chart from a flat baseline.
| Week | Bugs | Billing | Onboarding |
|---|---|---|---|
| Jun 1, 2026 | 42 | 24 | 12 |
| Jun 8, 2026 | 48 | 22 | 15 |
| Jun 15, 2026 | 45 | 27 | 19 |
| Jun 22, 2026 | 56 | 25 | 17 |
| Jun 29, 2026 | 61 | 31 | 14 |
| Jul 6, 2026 | 58 | 36 | 18 |
| Jul 13, 2026 | 66 | 33 | 23 |
| Jul 20, 2026 | 72 | 29 | 27 |
| Jul 27, 2026 | 69 | 34 | 25 |
| Aug 3, 2026 | 64 | 41 | 21 |
| Aug 10, 2026 | 70 | 38 | 26 |
| Aug 17, 2026 | 78 | 35 | 31 |
| Aug 24, 2026 | 74 | 39 | 29 |
| Aug 31, 2026 | 81 | 44 | 24 |
| Sep 7, 2026 | 77 | 48 | 28 |
| Sep 14, 2026 | 84 | 42 | 33 |
Behavior
Under wiggle and silhouette, the first series runs through the center and subsequent series alternate above and below it; zero stacks series in configured order. Colors always follow configured series order, so toggling layers never repaints remaining streams. Series beyond the fourth use alternating neutral steps unless given an explicit color.
Hovering or focusing a legend button previews its layer at full color and dims all other layers. Every layer can be hidden, including the last one. The plot renders emptyLabel when there are no points and hiddenLabel ("Choose a layer to show") when all layers are hidden. The time axis sits 26 px below the height plot with at most one label per 72 px counted backward from the latest point. Touch drags scrub the plot while vertical swipes scroll the page.
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
title | stringDefault: "Streamgraph" | Figure title. It names the chart for assistive technology and captions the data table. |
description | string— | One or two sentences on what the chart shows, below the title; omit it when the title says enough. |
tableToggle | booleanDefault: false | Show a button that reveals the data table. The table is always available to assistive technology. |
tableLabel | stringDefault: "Data table" | Name of the data table button. |
pointLabel | stringDefault: "{x}. {series} {value}, {count} layers, {total} in total" | Announced when keyboard focus reads a layer (Arc): "{x}. {series} {value}, {count} layers, {total} in total"; {count} is the number of shown layers and {total} their sum at that point. |
noDataLabel | stringDefault: "No data" | Shown in the tooltip and announced for a missing value (null). |
valueFormat | NumberFormat— | How values appear in the tooltip, table and axis: decimal, percent or currency, with fraction digits. Axis ticks are compacted (12.9K). |
locale | string— | BCP 47 locale for numbers and dates. Omit it to inherit the application locale (en-US by default). |
series | ChartSeries[]Default: [{"id":"bugs","label":"Bugs","points":[{"x":"2026-06-01","y":42},{"x":"2026-06-08","y":48},{"x":"2026-06-15","y":45},{"x":"2026-06-22","y":56},{"x":"2026-06-29","y":61},{"x":"2026-07-06","y":58},{"x":"2026-07-13","y":66},{"x":"2026-07-20","y":72},{"x":"2026-07-27","y":69},{"x":"2026-08-03","y":64},{"x":"2026-08-10","y":70},{"x":"2026-08-17","y":78},{"x":"2026-08-24","y":74},{"x":"2026-08-31","y":81},{"x":"2026-09-07","y":77},{"x":"2026-09-14","y":84}]},{"id":"billing","label":"Billing","points":[{"x":"2026-06-01","y":24},{"x":"2026-06-08","y":22},{"x":"2026-06-15","y":27},{"x":"2026-06-22","y":25},{"x":"2026-06-29","y":31},{"x":"2026-07-06","y":36},{"x":"2026-07-13","y":33},{"x":"2026-07-20","y":29},{"x":"2026-07-27","y":34},{"x":"2026-08-03","y":41},{"x":"2026-08-10","y":38},{"x":"2026-08-17","y":35},{"x":"2026-08-24","y":39},{"x":"2026-08-31","y":44},{"x":"2026-09-07","y":48},{"x":"2026-09-14","y":42}]},{"id":"onboarding","label":"Onboarding","points":[{"x":"2026-06-01","y":12},{"x":"2026-06-08","y":15},{"x":"2026-06-15","y":19},{"x":"2026-06-22","y":17},{"x":"2026-06-29","y":14},{"x":"2026-07-06","y":18},{"x":"2026-07-13","y":23},{"x":"2026-07-20","y":27},{"x":"2026-07-27","y":25},{"x":"2026-08-03","y":21},{"x":"2026-08-10","y":26},{"x":"2026-08-17","y":31},{"x":"2026-08-24","y":29},{"x":"2026-08-31","y":24},{"x":"2026-09-07","y":28},{"x":"2026-09-14","y":33}]}] | One to eight series, each with an id, a label and { x, y } points. x is a number or an ISO date (the same kind in every series, not repeated within one); y is zero or more; null counts as zero. Colors follow the series order and never move when a series is hidden; a series may set its own color and a dashed stroke. |
xLabel | stringDefault: "Date" | Header of the x column in the data table. |
totalLabel | stringDefault: "{x}. {count} layers, {total} in total" | Announced when keyboard focus reads the whole stack, with no layer chosen: "{x}. {count} layers, {total} in total". |
keysLabel | stringDefault: "Use left and right arrows to move through time, up and down to change layer." | Keyboard hint that describes the plot (Arc): Left and Right move through time, Up and Down change the layer. |
roleLabel | stringDefault: "stream graph" | How assistive technology names the plot ("stream graph"). |
curve | linear | monotoneDefault: "monotone" | linear joins points with straight segments; monotone draws a smooth curve that never overshoots the data. |
offset | wiggle | silhouette | zeroDefault: "wiggle" | wiggle centers the streams on a level baseline that minimizes their movement; silhouette centers them on zero; zero stacks them from a flat baseline. The first series runs through the middle and the rest alternate above and below it (with zero, they stack in order). |
directLabels | booleanDefault: true | Name each layer inside its thickest stretch when it is at least 19px thick; the spot holds until another stretch is clearly thicker. |
emptyLabel | stringDefault: "No data for this range" | Shown over the plot when there are no points. |
hiddenLabel | stringDefault: "Choose a layer to show" | Shown over the plot when every layer is hidden (through the controlled hiddenSeries prop). |
legendToggle | booleanDefault: true | With two or more series, legend entries hide and show their series. |
legendLabel | stringDefault: "{title} layers" | Accessible name of the legend; {title} is the chart title (Arc: "Support tickets by topic layers"). |
height | integerDefault: 260 | Plot height in pixels (120–640), as in Arc; the 26px time axis sits below it. |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes use the same interaction behavior. |
theme | StreamgraphTheme— | Color mode, accent, and tokens, including the chart palette (series1–series8). See Theming. |
motion | none | subtle | expressiveDefault: "subtle" | Draw-in and data change animation preset. System reduced-motion preferences take precedence. |
motionOptions | ChartMotionOptions— | draw (the stream swelling from its center when it scrolls into view; Arc's .9s spring unless set) and morph (streams moving to new data, hidden layers thinning out): a tween with a duration (ms) or a spring. |
dir | ltr | rtl— | Reading direction of the text. The x axis always runs left to right. Omit it to inherit the page direction. |
React integration
| Prop | Purpose |
|---|---|
hiddenSeries | Controlled list of hidden series IDs |
defaultHiddenSeries | Initial hidden series IDs when uncontrolled |
onHiddenSeriesChange | Fires with the updated hidden series IDs when the legend toggles, in both modes |
onActiveChange | Fires with (index, seriesId) as exploration moves, or (null, null) when it leaves |
preset | Application defaults, overridden by explicit instance props |
tokens | CSS variables applied after the typed theme |
ref | Ref forwarded to the root <figure> |
className, style | Applied to the root <figure> |
| Native attributes | id, data-*, and remaining <figure> attributes forwarded to the root |
Keyboard & accessibility
| Key | Interaction |
|---|---|
Tab | Focus the plot, then legend layer buttons |
ArrowLeft, Right | Move backward or forward along x |
ArrowUp, ArrowDown | Select the next or previous layer in the stack |
PageUp, PageDown | Jump one sixth of the x positions |
Home, End | Jump to the first or last x position |
Escape | Clear the active reading and tooltip |
The chart renders a <figure> named by title and described by description. aria-details links to a native data table with one row per x value and one column per series. The SVG drawing is hidden from assistive technology.
The plot forms a single tab stop with role description roleLabel ("stream graph") and hint keysLabel. Focus starts at the latest x position with no layer selected. Each move updates the crosshair and tooltip and announces politely using pointLabel (with a layer selected) or totalLabel (whole stack). In RTL, text follows the reading direction while x runs left to right.
Motion and theming
When 30% of the chart enters the viewport, streams swell from a center hairline on a 900 ms spring; server-rendered markup is final. Data updates resample every layer onto a shared 161-point grid and morph on a smooth spring, with hidden layers thinning to zero in place. The crosshair glides between points, the tooltip tracks on a snappy spring, and layer highlight fills transition over 240 ms. motionOptions.draw and motionOptions.morph accept a tween with duration (ms) or a spring. motion="none" and prefers-reduced-motion: reduce disable morphs and glides so updates apply immediately.
theme accepts a mode, an accent, and semantic tokens including the chart palette. An application-wide UtherealProvider supplies defaults.
Composition
In an agent composition, Streamgraph is a leaf with no actions. The host updates series through composition updates. See Building with agents.
{
"type": "Streamgraph",
"props": {
"title": "Tickets by channel",
"series": [
{
"id": "email",
"label": "Email",
"points": [
{ "x": "2026-01-01", "y": 120 },
{ "x": "2026-02-01", "y": 140 }
]
}
]
},
"children": []
}