Size and lazy loading
You ship what you draw. nervure has no dependency, and each chart is a module of its own.
| In the bundle | Minified | Gzipped | Brotli | Time to bundle |
|---|---|---|---|---|
| One chart: gauge | 31.3 kB | 13.2 kB | 12.1 kB | 5 ms |
| One chart: pie | 35.4 kB | 14.9 kB | 13.6 kB | 4 ms |
| Lines and bars | 57.5 kB | 23.5 kB | 21.3 kB | 10 ms |
| Candlestick | 36.3 kB | 15.2 kB | 13.8 kB | 5 ms |
| Map | 40.6 kB | 16.8 kB | 15.3 kB | 4 ms |
| Every chart | 481.3 kB | 172.9 kB | 144.7 kB | 26 ms |
| Live data only | 2.3 kB | 1.1 kB | 1 kB | 2 ms |
With nervure/lazy, 15.5 kB load at the start, and each chart type is a file of its own. Building the SVG of a chart takes 0.6 ms in the middle of the 216 samples and 9.4 ms for the slowest, in jsdom. Measured on 2026-12-02 with esbuild, Apple M4 Pro, Node v24.22.2. Run it yourself: npm run bench.
Pick your charts
import { createChart, registerChart } from 'nervure/core';
import { pie } from 'nervure/charts/basic/pie';
import { xy } from 'nervure/charts/basic/xy/index';
registerChart('pie', pie);
registerChart('xy', xy);The rest never enters your bundle. The source folder lists the paths.
Load when drawn
import { createChart, load } from 'nervure/lazy';
const chart = await createChart(host, spec); // fetches the code of its type, once
await load('sankey', 'map'); // ahead of timeVite, webpack, Rollup, esbuild and Parcel make a small file of each type. Before you give another type to chart.update, call load for it.
In a framework
nervure/react, nervure/vue and nervure/svelte hold every chart. nervure/react/core, nervure/vue/core and nervure/svelte/core hold none: register those you draw.
import { registerChart } from 'nervure/core';
import { gauge } from 'nervure/charts/basic/gauge';
import { Chart } from 'nervure/react/core';
registerChart('gauge', gauge);Many points
A scatter plot paints more than 3000 points on one canvas; axes, legend and labels stay SVG, and the tooltip finds the nearest point. Draw 100 000 points here, with a canvas and with SVG:
While it runs
A chart that is drawn does nothing: no loop, no timer. Live charts stop in hidden tabs, and draw at most ten times a second.