Skip to content

Size and lazy loading ​

You ship what you draw. nervure has no dependency, and each chart is a module of its own.

In the bundleMinifiedGzippedBrotliTime to bundle
One chart: gauge31.3 kB13.2 kB12.1 kB5 ms
One chart: pie35.4 kB14.9 kB13.6 kB4 ms
Lines and bars57.5 kB23.5 kB21.3 kB10 ms
Candlestick36.3 kB15.2 kB13.8 kB5 ms
Map40.6 kB16.8 kB15.3 kB4 ms
Every chart481.3 kB172.9 kB144.7 kB26 ms
Live data only2.3 kB1.1 kB1 kB2 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 ​

ts
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 ​

ts
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 time

Vite, 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.

tsx
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.