Time-series charts that stay fast at 10 million points.
Observability charts for Native Shell: a TSX TimeSeriesChart with an
opt-in Rust backend, and logs, trace waterfalls, flame graphs and latency heatmaps beside it. Live metrics, zoom,
synced panels, thresholds and deploy markers, drawn on NSH's native
canvas on iOS, Android, desktop and the web.
Built for dashboards that never stop
A frame costs what the plot's width does, not what the data does. Everything else an O11y panel needs comes with it.
Level of detail, exactly
Each series keeps a min/max pyramid. A frame takes the first, min, max and last of each pixel column (M4), so a spike one sample wide in ten million is still drawn.
Opt-in Rust backend
Register it and samples live in Rust: they cross once, when appended, and each frame one SVG path per series comes back. Past NSH's 256 MB JS heap, to hundreds of millions of samples.
Live data
append one sample or a batch. maxPoints keeps a window by shifting the pyramid, not rebuilding it; window shows the last N minutes and follows.
Made for O11y
Units (reqps, ms, bytes, percent…), calendar-aware time axes, SLO thresholds, deploy and incident annotations, gaps, steps and fills.
Synced panels
createChartSync() shares the crosshair and the zoom across every chart on the page. Two canvases per chart: moving the pointer never redraws the data.
Accessible, headless, exportable
Keyboard navigation, a screen-reader label with every value at the cursor, PNG export. The store, engine and renderer are plain TypeScript you can run without the view.
Logs, traces and profiles, too
The other signals on the same canvases and the same theme, linked to each other: a log line opens its trace, a heatmap cell opens a request in it. The demo's tabs show each one.
LogView
Level toggles with counts, search, a stacked volume histogram to drag a time range on, and a virtualized list. Live frames don't rescan: 13 ms at 50,000 lines in NSH's interpreter.
TraceWaterfall
Spans as a tree of bars by service, errors outlined, the critical path underlined, span events marked. An overview to brush a range on; only the rows in view are drawn, at any trace size.
FlameGraph
Zoom to a frame, search, walk it from the keyboard. Pass a baseline for a diff (red grew, blue shrank), or open a function in a SandwichView, between its callers and callees.
Heatmap
A latency distribution over time with percentile lines: a slow minority shows as its own band where p99 just rises. Exemplars link cells to traces; hours of data sum into columns that fit the screen.
A few lines of TSX
Make a store, append to it, hand it to the chart.
- Any data source. A store from
createTimeSeries, or plain arrays:{ x, ys }.NaNis a gap. - Reactive controller.
range(),following()andcursor()are signals;setRange,zoom,back,toImage. - Rust when you need it. One call to
setNativeBackend; every store after it lives in Rust, and apps without Rust keep working. - Follows your theme. Colors come from NSH theme tokens, light and dark, or override any of them.
- Draws the same everywhere. Rust and TypeScript trace identical paths; the tests check it.
import { mount } from "nsh";
import { TimeSeriesChart, createChartSync,
createTimeSeries } from "nsh-o11y";
const latency = createTimeSeries({ series: 3, maxPoints: 100_000 });
setInterval(() =>
latency.append(Date.now(), [p50(), p95(), p99()]), 1000);
function App() {
const sync = createChartSync();
return (
<TimeSeriesChart
title="Latency"
data={latency}
series={[{ label: "p50" }, { label: "p95" }, { label: "p99" }]}
unit="ms"
window={15 * 60_000} // the last 15 min, live
thresholds={[{ value: 250, label: "SLO" }]}
annotations={[{ time: deployedAt, label: "deploy v2.14" }]}
sync={sync}
style={{ flex: 1 }}
/>
);
}
mount(App);
Faster than the charts you know
The same data, the same 1000 × 300 plot, each library set up as its docs recommend for big series, each in a fresh headless Edge. nsh-o11y runs its own TypeScript engine on the same page, so the comparison is like for like. JavaScript time per frame; lower is better.
Full-view frame
The whole series on screen, recomputed, as a pan, a resize or new data needs.
Plotly (scattergl) draws on the GPU, which isn't in JavaScript time: once its upload is done (14 s at 10M), a frame mostly moves a camera: 18.7, 18 and 14.5 ms.
Live and dashboards
Live: 1M samples kept, 3000 in view, one appended per frame. Dashboard: 24 panels × 3 series × 20k, all redrawn.
| Library | Live | Dashboard |
|---|---|---|
| nsh-o11y | 0.41 ms | 31 ms |
| uPlot | 0.43 ms | 75 ms |
| Dygraphs | 46 ms | 531 ms |
| Chart.js | 124 ms | 176 ms |
| ECharts | 1073 ms | 152 ms |
| Plotly | 1785 ms | n/a¹ |
ECharts, Chart.js and Plotly re-ingest the whole dataset on each update. ¹ Browsers keep about 16 WebGL contexts.
Zooming in
A wheel zoom, 1.25× a frame, toward the middle.
| Library | 1M | 10M |
|---|---|---|
| nsh-o11y | 2.1 ms | 2.4 ms |
| uPlot | 6.1 ms | 28.5 ms |
| ECharts | 24 ms | 143 ms |
| Chart.js | 57 ms | 27 ms |
| Plotly | 35 ms | 55 ms |
| Dygraphs | 81 ms | 2862 ms |
Creating the chart with its first draw, 10M samples: nsh-o11y 246 ms, uPlot 268, Chart.js 335, ECharts 628.
Inside NSH: TypeScript or Rust
NSH runs TSX on QuickJS, an interpreter, everywhere but the web. The Rust store does the per-sample work natively and brings an NSH app to browser speed or better. Measured with nsh test perf.
| Samples | TypeScript, full view | Rust, full view | Rust, zooming | Rust, load |
|---|---|---|---|---|
| 100,000 | 14.2 ms | 1.8 ms | 0.84 ms | 6.6 ms |
| 1,000,000 | 20.2 ms | 2.6 ms | 1.0 ms | 79 ms |
| 10,000,000 | out of memory² | 4.4 ms | 3.2 ms | 1277 ms |
² NSH caps the JS heap at 256 MB, so the TypeScript store holds about 2 million samples. Live (1M kept): 2.1 ms TypeScript, 0.94 ms Rust. 24-panel dashboard: 491 ms TypeScript, 46 ms Rust. Method and every figure: bench/README.md.
How it compares
Browser chart libraries need a DOM, so none of them run inside an NSH app off the web. nsh-o11y is built for it, and holds its own in the browser too.
| nsh-o11y | uPlot | ECharts | Chart.js | Plotly | |
|---|---|---|---|---|---|
| Runs inside NSH | ✓ iOS · Android · desktop · web | ✕ DOM | ✕ DOM | ✕ DOM | ✕ DOM, WebGL |
| Big series | min/max pyramid + M4: cost follows the width | draws every point in view | LTTB sampling over the points in view | min-max decimation over the points in view | WebGL |
| Spikes one sample wide | ✓ always drawn | ✓ drawn | can be sampled away | ✓ kept | ✓ drawn |
| Live, 1M kept | 0.41 ms a frame | 0.43 ms | 1073 ms | 124 ms | 1785 ms |
| O11y built in | units, thresholds, annotations, synced panels, follow window | sync; the rest by plugins | markLine / markArea, connect | by plugins | shapes, annotations |
| Accessibility | keyboard, screen-reader label, values at the cursor | none built in | aria description | none built in | none built in |
| Chart types | time series, latency heatmap, log volume, trace waterfall, flame graph (diff, sandwich) | time series, bars | dozens | many | dozens |
Honest gaps: no bars or stacked areas yet, and with only a few thousand points on screen uPlot ties it. See the roadmap.
Put a dashboard in your NSH app
Requires NSH 0.7 or later. nsh add nsh-o11y installs it from crates.io: the TSX charts and their Rust backend; without Rust it runs on TypeScript alone.