RFC 0061 — Zoom: a window on a long series
Status: implemented (2026-11-27) · Target: 0.61.0 · builds on RFC 0058, RFC 0059 and RFC 0060 · see Decisions
Summary
A year of daily sales is 365 points. Drawn whole, it's a smudge; the
question is usually about one month. WireCharts' LineTimeChart,
SplineTimeChart and LineBoostChart take zoom and get ECharts' slider
and wheel zoom; the six charts of 0.58 have nothing, and nothing in
@elyra/charts lets the app know or set what's shown, or reach it from the
keyboard.
This RFC gives every chart with a category or time axis a zoom the user drives with the pointer or the keys, and the app reads and sets:
<LineChart {series} categories={days} zoom bind:range />
<p>Showing {range[0]} – {range[1]}</p>
<Button onclick={() => (range = ["2026-03-01", "2026-03-31"])}>March</Button>
<Button onclick={() => (range = null)}>All</Button>
zoomturns it on forLineChart,AreaChart,ColumnChart,BarChartandScatterChart(and stays WireCharts'zoomon the three that have it): the wheel and a pinch zoom, a drag pans, and a slider under the chart shows where the window is.bind:rangeis the window as the axis's own values (["2026-03-01", "2026-03-31"], or["Q2", "Q3"]), ornullfor all of it: read it to filter a table beside the chart, set it to jump.- The keyboard: with the chart focused,
+and-zoom about the focused category, ←/→ pan when zoomed (they still walk the categories, and the window follows),0shows all. The slider's handles are focusable, with their values as names. - What it says follows the window: the summary is of what's shown ("Revenue in March: from 120 to 260…"), and the hidden table keeps every row, marking the shown ones, so the assistant can answer about any month.
- Live data keeps the window: new points don't reset it; a window at the end of the axis follows the end ("the last 30 days").
- Export takes what's shown (RFC 0060): the image is the window; the CSV, the whole series.
Motivation
- Long series are the desktop's. An app over a database draws years of rows; the web's dashboards page them, a desktop chart should zoom.
- The window is state. "Show March" from a button, the table beside
the chart filtered to the same dates, the window kept as the user left
it (
persist, asTable's widths are): all need the app to have it. - A slider isn't enough for the keyboard. ECharts' handles aren't in the tab order; a chart that zooms only by the pointer isn't one a keyboard user can read a month of.
Current state (0.60)
- WireCharts'
lineTime,splineTimeandlineBoostbuilders adddataZoom: [{ type: "inside" }, { type: "slider" }]whenzoomis true: the pointer only; the app doesn't learn the window. - The six of 0.58 (
internal/options.js) have nodataZoom; ←/→ walk the categories with the tooltip (RFC 0058). - ECharts reports the window on
datazoom(as percents or values) and takes it fromdispatchAction({ type: "dataZoom", startValue, endValue }).
Design
The props
| Prop | ||
|---|---|---|
zoom |
false |
The wheel, a pinch, a drag and the slider. |
range (bindable) |
null |
The window, as [from, to] in the axis's values, or null for all. |
persist |
— | A key: the window is kept in the app's settings store and comes back. |
On the six, zoom adds ECharts' inside and slider data zooms on the
category axis (the value axis, for ScatterChart's x), styled from the
tokens: the slider's track --elyra-inset, its window --elyra-accent-soft,
its handles --elyra-accent, its labels --elyra-muted. On a WireCharts
chart with zoom, the same styling and the same range.
The window, both ways
ChartBase listens to datazoom and sets range to the axis's values at the
window's ends (ECharts gives percents for the slider and values for the
wheel; both are turned into values). Setting range dispatches dataZoom
with startValue/endValue. null is 0–100 percent. A window that
reached the axis's end follows it when live data adds points.
The keyboard
On the chart's focus (one tab stop, as now):
+/=and-zoom in and out by half, about the focused category (or the window's middle);- ←/→ walk the categories as now; past the window's edge, the window pans to keep the focused one in it;
0shows all;- Shift+←/→ pan the window by a tenth.
The slider's handles get role="slider", aria-valuetext (the end's value,
in the locale), and ←/→ of their own, through an overlay ChartBase draws
over ECharts' slider, so a screen reader and the keyboard reach them.
What it says
The summary is computed from the points in the window, prefixed by it
(elyra.charts.window: "Revenue, 1 March – 31 March: from 120 to 260…").
The table keeps all rows; the shown ones are marked
(aria-current="true" on their row header), and its caption says the
window. Export (RFC 0060): the image is what's drawn; the CSV, every row.
Testing
- The option:
dataZoomwith the tokens' colours whenzoom; none without. rangein: thedataZoomaction with values;null: all.rangeout: from adatazoomevent with percents and with values.- Live: a window at the end follows the end; one in the middle stays.
- The keys:
+/-/0, ←/→ past the edge, Shift+←/→. - The summary of the window; the table marking it;
persist. - A browser check: wheel and slider in the gallery, the window in the summary.
Implementation plan
zoom,rangeand the styling in ChartBase and the six; WireCharts' three through the same.- The keys and the slider overlay.
- The summary, the table's marks,
persist; export. - The gallery's time charts zoomable; docs, CHANGELOG.
Open questions
- Off by default? Recommendation: yes. A chart of twelve months doesn't need it, and a wheel over a dashboard should scroll the page, not zoom a chart.
- The slider always, or only the wheel and the keys?
Recommendation: the slider with
zoom: it's where the window is seen, and what a pointer user without a wheel drags. rangein the axis's values, or as percents? Recommendation: values. "March" is what an app means; percents change meaning when live data adds a day.- The table: all rows, or only the window's? Recommendation: all rows, the window marked. The assistant answering "and April?" shouldn't depend on where the user left the slider.
- Zoom on the value axis too (a y zoom)? Recommendation: not in this RFC; the category or time axis is where the length is.
As built
- One place:
internal/zoom.jsturns the window between the axis's values and ECharts' percents, moves it for the keys, cuts the data to it for the summary, and styles the slider. ChartBase finds the axis in the option it draws (a category axis's categories, a time axis's first series' dates, a scatter's x), so the five of 0.58 and WireCharts' three share it; a chart zooms when its option has a data zoom. - The window is set in the option on every drawing (
start,end), so new data keeps it without a second action; the app'srangeis dispatched as percents, and ECharts'datazoom(percents from the slider and the wheel, values from an action) comes back as values. - The handles' overlay sits where the slider is drawn (the slider's
place is fixed for it: 48 px in, 8 px up, 22 px high; on the right,
standing, for
BarChart), and lets the pointer through. A browser check put both ends on ECharts' own handles. - Words:
elyra.charts.window,shownCaption,windowStartandwindowEnd, in English and Norwegian. - Found on the way: a chart that had data from the start dropped the first new value of its live query. The update after the first drawing was skipped by a flag, and the first drawing can come after that update has already run (the canvas is bound later); it now compares what it last drew from.
Decisions
- Off by default;
zoomturns it on. - The slider always with
zoom, beside the wheel, a pinch, a drag and the keys. rangein the axis's values,nullfor all.- The table keeps every row, the window's marked.
- No zoom on the value axis in this RFC.
Not in this RFC
- Brushing (selecting points with a rectangle), and linked charts
(one chart's window driving another's) beyond
bind:range. - Zoom on the y axis, on pies, gauges, trees and the like.
Alternatives considered
- Only WireCharts'
zoomon more charts: the pointer gets it; the app and the keyboard don't. - Paging the data instead (
Paginationunder a chart): a month at a time loses the year's shape, which is why one zooms.