UI

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

Support tickets by topic
Use left and right arrows to move through time, up and down to change layer.
Support tickets by topic
WeekBugsBillingOnboarding
Jun 1, 2026422412
Jun 8, 2026482215
Jun 15, 2026452719
Jun 22, 2026562517
Jun 29, 2026613114
Jul 6, 2026583618
Jul 13, 2026663323
Jul 20, 2026722927
Jul 27, 2026693425
Aug 3, 2026644121
Aug 10, 2026703826
Aug 17, 2026783531
Aug 24, 2026743929
Aug 31, 2026814424
Sep 7, 2026774828
Sep 14, 2026844233
Loading interactive preview…

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.

Support tickets by topic
Use left and right arrows to move through time, up and down to change layer.
Support tickets by topic
WeekBugsBillingOnboarding
Jun 1, 2026422412
Jun 8, 2026482215
Jun 15, 2026452719
Jun 22, 2026562517
Jun 29, 2026613114
Jul 6, 2026583618
Jul 13, 2026663323
Jul 20, 2026722927
Jul 27, 2026693425
Aug 3, 2026644121
Aug 10, 2026703826
Aug 17, 2026783531
Aug 24, 2026743929
Aug 31, 2026814424
Sep 7, 2026774828
Sep 14, 2026844233

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.

ArgumentType / defaultDescription
titlestringDefault: "Streamgraph"Figure title. It names the chart for assistive technology and captions the data table.
descriptionstring—One or two sentences on what the chart shows, below the title; omit it when the title says enough.
tableTogglebooleanDefault: falseShow a button that reveals the data table. The table is always available to assistive technology.
tableLabelstringDefault: "Data table"Name of the data table button.
pointLabelstringDefault: "{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.
noDataLabelstringDefault: "No data"Shown in the tooltip and announced for a missing value (null).
valueFormatNumberFormat—How values appear in the tooltip, table and axis: decimal, percent or currency, with fraction digits. Axis ticks are compacted (12.9K).
localestring—BCP 47 locale for numbers and dates. Omit it to inherit the application locale (en-US by default).
seriesChartSeries[]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.
xLabelstringDefault: "Date"Header of the x column in the data table.
totalLabelstringDefault: "{x}. {count} layers, {total} in total"Announced when keyboard focus reads the whole stack, with no layer chosen: "{x}. {count} layers, {total} in total".
keysLabelstringDefault: "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.
roleLabelstringDefault: "stream graph"How assistive technology names the plot ("stream graph").
curvelinear | monotoneDefault: "monotone"linear joins points with straight segments; monotone draws a smooth curve that never overshoots the data.
offsetwiggle | 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).
directLabelsbooleanDefault: trueName each layer inside its thickest stretch when it is at least 19px thick; the spot holds until another stretch is clearly thicker.
emptyLabelstringDefault: "No data for this range"Shown over the plot when there are no points.
hiddenLabelstringDefault: "Choose a layer to show"Shown over the plot when every layer is hidden (through the controlled hiddenSeries prop).
legendTogglebooleanDefault: trueWith two or more series, legend entries hide and show their series.
legendLabelstringDefault: "{title} layers"Accessible name of the legend; {title} is the chart title (Arc: "Support tickets by topic layers").
heightintegerDefault: 260Plot height in pixels (120–640), as in Arc; the 26px time axis sits below it.
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeStreamgraphTheme—Color mode, accent, and tokens, including the chart palette (series1–series8). See Theming.
motionnone | subtle | expressiveDefault: "subtle"Draw-in and data change animation preset. System reduced-motion preferences take precedence.
motionOptionsChartMotionOptions—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.
dirltr | rtl—Reading direction of the text. The x axis always runs left to right. Omit it to inherit the page direction.

React integration

PropPurpose
hiddenSeriesControlled list of hidden series IDs
defaultHiddenSeriesInitial hidden series IDs when uncontrolled
onHiddenSeriesChangeFires with the updated hidden series IDs when the legend toggles, in both modes
onActiveChangeFires with (index, seriesId) as exploration moves, or (null, null) when it leaves
presetApplication defaults, overridden by explicit instance props
tokensCSS variables applied after the typed theme
refRef forwarded to the root <figure>
className, styleApplied to the root <figure>
Native attributesid, data-*, and remaining <figure> attributes forwarded to the root

Keyboard & accessibility

KeyInteraction
TabFocus the plot, then legend layer buttons
ArrowLeft, RightMove backward or forward along x
ArrowUp, ArrowDownSelect the next or previous layer in the stack
PageUp, PageDownJump one sixth of the x positions
Home, EndJump to the first or last x position
EscapeClear 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": []
}

On this page