UI

Brush chart

A line chart showing a movable window into a long series paired with a full-history overview strip.

import { BrushChart } from '@uthereal/ui/brush-chart'

Brush chart playground

Daily active users
Daily active users
DateActive users
Jan 1, 20262,400
Jan 2, 20262,760
Jan 3, 20262,865
Jan 4, 20262,656
Jan 5, 20262,315
Jan 6, 20262,128
Jan 7, 20262,260
Jan 8, 20262,630
Jan 9, 20262,973
Jan 10, 20263,045
Jan 11, 20262,808
Jan 12, 20262,465
Jan 13, 20262,297
Jan 14, 20262,450
Jan 15, 20262,822
Jan 16, 20263,141
Jan 17, 20263,175
Jan 18, 20262,909
Jan 19, 20262,561
Jan 20, 20262,409
Jan 21, 20262,580
Jan 22, 20262,949
Jan 23, 20263,240
Jan 24, 20263,233
Jan 25, 20262,938
Jan 26, 20262,587
Jan 27, 20262,452
Jan 28, 20262,638
Jan 29, 20263,002
Jan 30, 20263,262
Jan 31, 20263,216
Feb 1, 20262,896
Feb 2, 20262,545
Feb 3, 20262,430
Feb 4, 20262,633
Feb 5, 20262,992
Feb 6, 20263,225
Feb 7, 20263,143
Feb 8, 20262,803
Feb 9, 20262,459
Feb 10, 20262,368
Feb 11, 20262,592
Feb 12, 20262,950
Feb 13, 20263,157
Feb 14, 20263,046
Feb 15, 20262,695
Feb 16, 20262,365
Feb 17, 20262,305
Feb 18, 20262,554
Feb 19, 20262,913
Feb 20, 20263,100
Feb 21, 20262,965
Feb 22, 20262,609
Feb 23, 20262,302
Feb 24, 20262,278
Feb 25, 20262,554
Feb 26, 20262,917
Feb 27, 20263,087
Feb 28, 20262,934
Mar 1, 20262,579
Mar 2, 20262,300
Mar 3, 20262,316
Mar 4, 20262,621
Mar 5, 20262,988
Mar 6, 20263,141
Mar 7, 20262,973
Mar 8, 20262,623
Mar 9, 20262,374
Mar 10, 20262,430
Mar 11, 20262,762
Mar 12, 20263,129
Mar 13, 20263,264
Mar 14, 20263,080
Mar 15, 20262,736
Mar 16, 20262,517
Mar 17, 20262,610
Mar 18, 20262,964
Mar 19, 20263,326
Mar 20, 20263,439
Mar 21, 20263,236
Mar 22, 20262,896
Mar 23, 20262,703
Mar 24, 20262,828
Mar 25, 20263,197
Mar 26, 20263,547
Mar 27, 20263,631
Mar 28, 20263,406
Mar 29, 20263,067
Mar 30, 20262,896
Mar 31, 20263,047
Apr 1, 20263,423
Apr 2, 20263,753
Apr 3, 20263,803
Apr 4, 20263,551
Apr 5, 20263,209
Apr 6, 20263,057
Apr 7, 20263,228
Apr 8, 20263,604
Apr 9, 20263,908
Apr 10, 20263,919
Apr 11, 20263,639
Apr 12, 20263,294
Apr 13, 20263,159
Apr 14, 20263,345
Apr 15, 20263,716
Apr 16, 20263,991
Apr 17, 20263,962
Apr 18, 20263,654
Apr 19, 20263,307
Apr 20, 20263,189
Apr 21, 20263,391
Apr 22, 20263,755
Apr 23, 20263,999
Apr 24, 20263,931
Apr 25, 20263,600
Apr 26, 20263,255
Apr 27, 20263,158
Apr 28, 20263,377
Apr 29, 20263,737
Apr 30, 20263,952
May 1, 20263,850
May 2, 20263,501
May 3, 20263,166
May 4, 20263,095
May 5, 20263,335
May 6, 20263,691
May 7, 20263,882
May 8, 20263,752
May 9, 20263,393
May 10, 20263,076
May 11, 20263,037
May 12, 20263,301
May 13, 20263,659
May 14, 20263,829
May 15, 20263,677
May 16, 20263,316
May 17, 20263,023
May 18, 20263,022
May 19, 20263,313
May 20, 20263,673
May 21, 20263,826
May 22, 20263,657
May 23, 20263,300
May 24, 20263,036
May 25, 20263,075
May 26, 20263,394
May 27, 20263,757
May 28, 20263,893
May 29, 20263,708
May 30, 20263,358
May 31, 20263,126
Jun 1, 20263,204
Jun 2, 20263,548
Jun 3, 20263,910
Jun 4, 20264,026
Jun 5, 20263,826
Jun 6, 20263,483
Jun 7, 20263,280
Jun 8, 20263,395
Jun 9, 20263,759
Jun 10, 20264,113
Jun 11, 20264,206
Jun 12, 20263,987
Jun 13, 20263,649
Jun 14, 20263,473
Jun 15, 20263,617
Jun 16, 20263,994
Jun 17, 20264,333
Jun 18, 20264,396
Jun 19, 20264,155
Jun 20, 20263,817
Jun 21, 20263,664
Jun 22, 20263,833
Jun 23, 20264,213
Jun 24, 20264,531
Jun 25, 20264,558
Jun 26, 20264,291
Jun 27, 20263,952
Jun 28, 20263,817
Jun 29, 20264,004
Loading interactive preview…

Overview

A brush chart pairs a detail line chart with an overview strip of the complete series below it. Readers resize the active window by dragging either edge grip, pan by dragging the window body, draw a new window across the strip, tap to recenter, or double-click to reset to the full history. The detail plot rescales its axes to the visible window and supports crosshair exploration, tooltips, legend toggles, and keyboard navigation.

Use a brush chart when readers need both full-history context and close inspection of shorter intervals. For short series that fit cleanly in one view, use a line chart.

Usage

import { BrushChart } from '@uthereal/ui/brush-chart'

export function ActiveUsers({ days }: { days: { x: string; y: number }[] }) {
  return (
    <BrushChart
      title="Daily active users"
      series={[{ id: 'dau', label: 'Active users', points: days }]}
      onRangeChange={(range) => console.log(range)}
    />
  )
}

The active window is a zero-based [first, last] tuple indexing distinct x positions across all series. Omitting defaultRange opens on the entire series, and minWindow (default 7) sets the minimum number of points allowed in the window. Pass range and onRangeChange to control the window externally.

Examples

Event annotations

Pass annotations to mark events on both the main plot and the overview strip. Each annotation draws a vertical rule and marker dot with a collision-avoiding label. Hovering a marker displays its description, and tooltips and keyboard announcements include any event at the active point.

Daily active users
Daily active users
DateActive users
Jan 1, 20262,400
Jan 2, 20262,760
Jan 3, 20262,865
Jan 4, 20262,656
Jan 5, 20262,315
Jan 6, 20262,128
Jan 7, 20262,260
Jan 8, 20262,630
Jan 9, 20262,973
Jan 10, 20263,045
Jan 11, 20262,808
Jan 12, 20262,465
Jan 13, 20262,297
Jan 14, 20262,450
Jan 15, 20262,822
Jan 16, 20263,141
Jan 17, 20263,175
Jan 18, 20262,909
Jan 19, 20262,561
Jan 20, 20262,409
Jan 21, 20262,580
Jan 22, 20262,949
Jan 23, 20263,240
Jan 24, 20263,233
Jan 25, 20262,938
Jan 26, 20262,587
Jan 27, 20262,452
Jan 28, 20262,638
Jan 29, 20263,002
Jan 30, 20263,262
Jan 31, 20263,216
Feb 1, 20262,896
Feb 2, 20262,545
Feb 3, 20262,430
Feb 4, 20262,633
Feb 5, 20262,992
Feb 6, 20263,225
Feb 7, 20263,143
Feb 8, 20262,803
Feb 9, 20262,459
Feb 10, 20262,368
Feb 11, 20262,592
Feb 12, 20262,950
Feb 13, 20263,157
Feb 14, 20263,046
Feb 15, 20262,695
Feb 16, 20262,365
Feb 17, 20262,305
Feb 18, 20262,554
Feb 19, 20262,913
Feb 20, 20263,100
Feb 21, 20262,965
Feb 22, 20262,609
Feb 23, 20262,302
Feb 24, 20262,278
Feb 25, 20262,554
Feb 26, 20262,917
Feb 27, 20263,087
Feb 28, 20262,934
Mar 1, 20262,579
Mar 2, 20262,300
Mar 3, 20262,316
Mar 4, 20262,621
Mar 5, 20262,988
Mar 6, 20263,141
Mar 7, 20262,973
Mar 8, 20262,623
Mar 9, 20262,374
Mar 10, 20262,430
Mar 11, 20262,762
Mar 12, 20263,129
Mar 13, 20263,264
Mar 14, 20263,080
Mar 15, 20262,736
Mar 16, 20262,517
Mar 17, 20262,610
Mar 18, 20262,964
Mar 19, 20263,326
Mar 20, 20263,439
Mar 21, 20263,236
Mar 22, 20262,896
Mar 23, 20262,703
Mar 24, 20262,828
Mar 25, 20263,197
Mar 26, 20263,547
Mar 27, 20263,631
Mar 28, 20263,406
Mar 29, 20263,067
Mar 30, 20262,896
Mar 31, 20263,047
Apr 1, 20263,423
Apr 2, 20263,753
Apr 3, 20263,803
Apr 4, 20263,551
Apr 5, 20263,209
Apr 6, 20263,057
Apr 7, 20263,228
Apr 8, 20263,604
Apr 9, 20263,908
Apr 10, 20263,919
Apr 11, 20263,639
Apr 12, 20263,294
Apr 13, 20263,159
Apr 14, 20263,345
Apr 15, 20263,716
Apr 16, 20263,991
Apr 17, 20263,962
Apr 18, 20263,654
Apr 19, 20263,307
Apr 20, 20263,189
Apr 21, 20263,391
Apr 22, 20263,755
Apr 23, 20263,999
Apr 24, 20263,931
Apr 25, 20263,600
Apr 26, 20263,255
Apr 27, 20263,158
Apr 28, 20263,377
Apr 29, 20263,737
Apr 30, 20263,952
May 1, 20263,850
May 2, 20263,501
May 3, 20263,166
May 4, 20263,095
May 5, 20263,335
May 6, 20263,691
May 7, 20263,882
May 8, 20263,752
May 9, 20263,393
May 10, 20263,076
May 11, 20263,037
May 12, 20263,301
May 13, 20263,659
May 14, 20263,829
May 15, 20263,677
May 16, 20263,316
May 17, 20263,023
May 18, 20263,022
May 19, 20263,313
May 20, 20263,673
May 21, 20263,826
May 22, 20263,657
May 23, 20263,300
May 24, 20263,036
May 25, 20263,075
May 26, 20263,394
May 27, 20263,757
May 28, 20263,893
May 29, 20263,708
May 30, 20263,358
May 31, 20263,126
Jun 1, 20263,204
Jun 2, 20263,548
Jun 3, 20263,910
Jun 4, 20264,026
Jun 5, 20263,826
Jun 6, 20263,483
Jun 7, 20263,280
Jun 8, 20263,395
Jun 9, 20263,759
Jun 10, 20264,113
Jun 11, 20264,206
Jun 12, 20263,987
Jun 13, 20263,649
Jun 14, 20263,473
Jun 15, 20263,617
Jun 16, 20263,994
Jun 17, 20264,333
Jun 18, 20264,396
Jun 19, 20264,155
Jun 20, 20263,817
Jun 21, 20263,664
Jun 22, 20263,833
Jun 23, 20264,213
Jun 24, 20264,531
Jun 25, 20264,558
Jun 26, 20264,291
Jun 27, 20263,952
Jun 28, 20263,817
Jun 29, 20264,004

Behavior

The detail plot rescales its value axis to the active window (starting at zero unless zero: false), draws 1.75 px lines with an area wash under the first series, and clips continuations at the window edges. With fewer than two points, the plot renders emptyLabel ("No data yet") and hides the overview strip.

When zoomed out so points sit closer than roughly 4 px apart, a centered seven-point moving average and its low-to-high band crossfade over the raw series so short-term noise reads as texture. The tooltip then includes averageLabel and changeLabel comparing seven points earlier. Legend toggles, loading state, and the full-series data table match Line chart.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
titlestringDefault: "Brush chart"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: "{series}, {x}: {value}"Announced when keyboard focus moves to a point. {series}, {x} and {value} are filled in.
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":"visits","label":"Visits","points":[{"x":"2026-01-01","y":3200},{"x":"2026-02-01","y":3500},{"x":"2026-03-01","y":3350},{"x":"2026-04-01","y":4100},{"x":"2026-05-01","y":4300},{"x":"2026-06-01","y":4720}]}]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); a null y leaves a gap. Colors follow the series order and never move when a series is hidden; a series may set its own color and a dashed stroke. A series may set its own color (hex, rgb, hsl, oklch or var(--token)) over its slot and dashed: true for a dashed stroke (Arc: 4 5 at 1.75px), e.g. a previous period or a target.
xLabelstringDefault: "Date"Header of the x column in the data table.
curvelinear | monotoneDefault: "monotone"linear joins points with straight segments; monotone draws a smooth curve that never overshoots the data.
areabooleanDefault: trueA 10% wash under the first shown series.
zerobooleanDefault: trueStart the value axis at zero (unless the data dips below it); off fits the axis to the data.
directLabelsbooleanDefault: falseUnused by the brush chart (Arc draws no line-end labels); kept for the shared line fields.
emptyLabelstringDefault: "No data yet"Shown over the plot when the series have fewer than two points (the overview is hidden then).
loadingbooleanDefault: falseKeep the current lines on screen, dimmed and breathing, while the host loads the next data; the plot is marked busy.
loadingLabelstringDefault: "Loading"Announced politely while loading.
legendTogglebooleanDefault: trueWith two or more series, legend entries hide and show their series.
legendLabelstringDefault: "Legend"Accessible name of the legend list.
annotationsBrushAnnotation[]Default: []Events marked on both charts, at most 50, each with an id, an x (the same kind as the series x), a short label and an optional description. The main chart draws a rule and a dot with its label where it fits (labels that would collide are skipped); hovering the dot shows the description; the tooltip and the announcement name an event at the point read. The overview marks each event with a small dot.
averageLabelstringDefault: "{value} seven day average"Tooltip note while points are crowded and the seven point moving average with its band replaces the raw line (Arc). {value} is filled in.
changeLabelstringDefault: "{change} vs a week earlier"Tooltip note comparing the point read with seven points earlier, e.g. "+4.1% vs a week earlier". {change} is filled in.
defaultRange[number, number]—Initial window as [first, last] point positions, counted from 0 across every distinct x. Omit it to show the whole series. Later argument edits do not reset an existing instance.
minWindowintegerDefault: 7Fewest points the window may show (default 7); the handles, zoom keys and drawn windows stop there.
overviewLabelstringDefault: "Overview"Accessible name of the overview strip.
windowLabelstringDefault: "Window"Accessible name of the window slider, which pans with the arrow keys, zooms with + and −, and resets with Escape or 0.
plotLabelstringDefault: "{title}, {window}. Use left and right arrows to read values."Accessible name of the main plot, as Arc names it: {title} and {window} (windowValueLabel) are filled in, with a hint about the arrow keys.
windowValueLabelstringDefault: "{start} to {end}"Announced value of the window slider. {start} and {end} are filled with the first and last x shown.
windowStartLabelstringDefault: "Window start"Accessible name of the start handle.
windowEndLabelstringDefault: "Window end"Accessible name of the end handle.
heightintegerDefault: 268Main chart height in pixels, axes included (120–640). The default 268 is Arc’s 240px plot plus its 28px date axis.
overviewHeightintegerDefault: 52Overview strip height in pixels (32–120; Arc: 52).
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeBrushChartTheme—Color mode, accent, and tokens, including the chart palette (series1–series8). See Theming.
motionnone | subtle | expressiveDefault: "subtle"Draw-in and window change animation preset. System reduced-motion preferences take precedence.
motionOptionsChartMotionOptions—draw (lines wiping in once the chart scrolls into view) and morph (lines and the window gliding when the window is set from outside, stepped or reset): a tween with a duration (ms) or a spring.
dirltr | rtl—Reading direction of the text. The chart, the overview and the handles always run left to right. Omit it to inherit the page direction.

React integration

PropPurpose
rangeControlled window as [first, last] distinct x positions
onRangeChangeFires with the updated [first, last] window while it moves, in both modes
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

Focus targetKeyInteraction
Detail plotArrowLeft, ArrowRightStep backward or forward along x inside the window
Detail plotArrowUp, ArrowDownSwitch active series
Detail plotHome, End, EscapeJump to window ends, or clear the active reading
Overview windowArrowLeft, ArrowRightPan the window by one tenth of its width
Overview windowShift+Arrow, PageUp/DownPan the window by half its width
Overview window+, -Zoom in or out (down to minWindow points)
Overview windowHome, End, 0, EscapeJump to series ends, or reset to the full series
Edge gripsArrowLeft, ArrowRightMove the grip by one point (Shift or PageUp/Down: 10)
Edge gripsHome, End, 0, EscapeMove grip to series end, or reset to the full series

The chart renders a <figure> named by title, described by description, and linked via aria-details to a full-series data table. The overview strip is a group named by overviewLabel containing a slider for the window (windowLabel, value text windowValueLabel) and two range-slider edge grips (windowStartLabel, windowEndLabel) with 28 × 44 px hit targets. Plot, overview, and grips always run left to right in both LTR and RTL layouts.

Motion and theming

Lines wipe in once when the chart scrolls into view; server-rendered markup is final. Programmatic window changes, keyboard steps, zoom, and resets animate on the shared chart morph transition while the main lines, moving average, and band resample across the plot. Pointer drags track directly without lag, and edge grips scale slightly on hover and press. motionOptions.draw and motionOptions.morph accept a tween with duration (ms) or a spring. motion="none" and prefers-reduced-motion: reduce make updates immediate.

theme accepts a mode, an accent, and semantic tokens including the chart palette (used for series lines and the window ring) and shadowResting for the grips. An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, BrushChart is a leaf with no actions. Its active window is host state stored at /components/instance-<id>/range, initialized from defaultRange or the full series. See Building with agents.

{
  "type": "BrushChart",
  "props": {
    "title": "Daily active users",
    "series": [
      {
        "id": "dau",
        "label": "Active users",
        "points": [
          { "x": "2026-01-01", "y": 2400 },
          { "x": "2026-01-02", "y": 2510 },
          { "x": "2026-01-03", "y": 2460 }
        ]
      }
    ]
  },
  "children": []
}

On this page