Skip to content

Framework bindings

Lumen Charts keeps framework adapters intentionally thin: each adapter creates the chart on mount, forwards option changes to applyOptions, and calls destroy() on unmount.

Data always goes through the ChartApi, never through reactive framework props. Passing millions of bars through component props would force unnecessary diffing and allocations on every tick.

Terminal window
pnpm add lumen-charts
import { createChart } from 'lumen-charts';
const chart = createChart(document.getElementById('chart')!, { theme: 'dark' });
const candles = chart.addSeries('candlestick', { id: 'BTCUSD' });
candles.setData(bars);
chart.timeScale().fitContent();
// Clean up when leaving the page or view:
chart.destroy();
Package Export Lifecycle
lumen-charts createChart Manual destroy()
@lumen-charts/core createChart Manual destroy()
@lumen-charts/react LumenChart Mount/unmount via useEffect, exposes ChartApi on ref
@lumen-charts/vue LumenChart onMounted / onBeforeUnmount, exposes { chart }
@lumen-charts/svelte lumenChart Svelte action update / destroy, callback onReady(chart)
@lumen-charts/solid LumenChart onMount / onCleanup, callback onReady(chart)