Installation
Install
Section titled “Install”The core has no runtime dependencies.
npm i @lightfin/corepnpm add @lightfin/corebun add @lightfin/coreUsing React? Add the bindings — @lightfin/core and react are peer
dependencies:
npm i @lightfin/reactpnpm add @lightfin/reactbun add @lightfin/reactRender a chart
Section titled “Render a chart”import { createChart } from '@lightfin/core'
const chart = createChart(document.querySelector('#chart')!, { volumeVisible: true,})
chart.addCandlestickSeries().setData(bars)The container should have a size — the chart fills it and watches for resizes.
Subpath exports
Section titled “Subpath exports”Pay only for what you import. The extras live behind their own entry points so they tree-shake out when unused:
| Import | What it adds |
|---|---|
@lightfin/core | Chart engine, series, axes, crosshair |
@lightfin/core/indicators/* | One indicator each, loaded on demand |
@lightfin/core/annotations | The 21 drawing tools |
@lightfin/core/annotations/schema | JSON Schema to let an AI draw |
@lightfin/core/chrome | HUD, legend, toolbars, clock |
@lightfin/core/price-lines | Order and position price lines |
@lightfin/core/event-tags | Earnings / dividend tags |
Indicators are imported one subpath at a time (usually via a dynamic import(),
so only the ones you use ship) — see the Indicators reference.
Next: your first chart.