React API (@unifin/chart-react)
Generated reference of 75 public symbols of @unifin/chart-react plus 15 symbols of its subpaths, grouped by kind and ordered as in the sources.
Generated from the package entry packages/chart-react/src/index.ts. Names are reachable through
@unifin/chart-react; use your editor for full signatures - this page carries the map.
Functions (20)
| Symbol | What it does |
|---|---|
resolveThemeByName | Palette by public name (`` §1). The lookup is case-insensitive and an unknown or missing name falls back to the dark base, so a foreign attribute or property value can never reach the renderer unchecked (AUD-010). The caller owns the host preference: prefersLight resolves the system alias only. |
activeBindings | Number of bindings created and not yet disposed (leak-test witness). |
createChartBinding | - |
resolveBrowserTheme | Reads the --ud-* tokens of the shell and builds a theme. Values are read from the document root, so a theme change requires no chart recreation: the host only re-renders and calls this resolver again ( §1, ). |
prefersReducedMotion | Reads prefers-reduced-motion from the host window, defaulting to false. |
UnifinChart | React entry point. Client-side only: creation happens in an effect, so the component is safe to import in a server component or Next.js app ( §3). |
ChartGrid | Dashboard grid 2x2 (FR-SDK-11, §4): four charts on one board with a shared viewport group. The group itself is framework-free (createSyncGroup); the grid registers a panel adapter per chart and renders the boards. |
createChart | - |
attachChartInput | Binds the DOM events of target to the controller and returns the detach function. Idempotent per call: attach once, detach once - a host that remounts attaches a fresh set over the same target without duplicates. |
MiniChart | Dashboard mini panel (FR-RENDER-06, §4): price scale and time labels stay, the toolbar and the grid go away. |
quoteSpread | Spread of a two-sided quote; a crossed or incomplete book yields nulls. |
quoteTone | Direction of the change; an unknown or flat change stays neutral. |
quoteChangePercent | Change against the previous close in percent; null without a valid base. |
QuoteHeader | - |
captureChartPng | Repaints the binding and returns a PNG data URL of the canvas, or null when the canvas cannot export (no context, no toDataURL, disposed binding). |
copyChartPngToClipboard | Copies the repainted canvas to the clipboard as image/png. Returns false when the environment has no clipboard API or the host denies the write. |
shareChartPng | Shares the repainted canvas as a PNG file through the Web Share API (CHT-16-08). Returns unsupported when the platform or the host declines the payload, failed when the share sheet errors; the caller can fall back to copyChartPngToClipboard or a download. |
Sparkline | Dashboard sparkline (FR-RENDER-06, §4): no axes, no grid, no labels - the minimal trend line for tables and KPI tiles. |
createSyncGroup | - |
useChart | Wires a canvas element to the core pipeline through the framework-free binding ( §3). The effect creates exactly one binding; its cleanup disposes it - React 18 StrictMode double-invocation therefore keeps a single active binding and never leaks. The core owns the state; React only publishes props and asks for a repaint. |
Types (50)
| Symbol | What it does |
|---|---|
Bar | Core market data model: bars, ticks, instruments and timeframes. No DOM and no framework dependencies here. |
Tick | - |
Instrument | - |
Timeframe | 22 timeframes from a second to a month ( §2). |
SeriesRenderType | Series render types. The first wave ( §5): candles, outlineCandles, bars, line, area, histogram, step, baseline. adds the PRO pair: the footprint cluster grid and the four non-standard looks (renko, kagi, pointAndFigure, lineBreak) fed by the data/non-standard builders. adds the analytic four: volumeCandles, lineWithMarkers, hlcArea, highLow. |
LineOverlay | Host-provided line overlays (PRO wave): indicator curves (moving averages, VWAP, Bollinger bands) and level lines painted by the series layer over the price pane. Values are aligned to bars by index: null breaks the polyline, a gap is never bridged. The core paints, the host computes - the same contract as every other layer. |
ReadoutModel | Readout model: the bar under the cursor becomes one value row the shells read instead of assembling themselves. Pure data: no DOM, no canvas. The controller caches the model per bar object, so a repeated hover over the same bar returns the same instance without allocations. |
ReadoutBuildOptions | - |
CrosshairMoveEvent | - |
CrosshairLeaveEvent | The pointer left the plot area; the crosshair is hidden. |
CrosshairPinEvent | - |
BarClickEvent | - |
InteractionEventName | - |
InteractionEvent | - |
ChartTheme | Chart theme. Colors are never hardcoded in layers: they come from the shell tokens (--ud-*) of the Desktop Kit or from the built-in defaults below ( §1). |
ThemeName | Names of the selectable palettes plus the system alias. |
BuiltInThemeName | Names of the six palettes the library ships, in menu order. |
AttributionInput | Corner mark of the chart: where it points and what it says. |
CrosshairMode | Crosshair behaviour of the binding: hidden, free or magnet to the close. |
ChartBindingOptions | - |
ChartBinding | - |
ThemeHostElement | Narrow view of the host element: only what is needed to read shell tokens. Keeps the binding testable in Node without a real DOM. |
UnifinChartProps | - |
ChartGridPanel | - |
ChartGridProps | - |
ChartContainerLike | - |
CreateChartOptions | - |
ChartHandle | - |
InputEventLike | - |
InputTargetLike | - |
AttachInputOptions | - |
MiniChartProps | - |
QuoteSpread | - |
QuoteTone | - |
QuoteHeaderProps | - |
PngCanvasLike | - |
ClipboardEnv | - |
ShareEnv | Environment of the Web Share API, injected for tests and SSR safety. |
ShareResult | Outcome of shareChartPng: nothing is thrown at the host. |
ShareChartOptions | - |
SparklineProps | - |
SyncRange | - |
SyncPanel | - |
SyncGroupOptions | - |
SyncDrawingOp | - |
SyncSelectionHandler | - |
SyncDrawingHandler | - |
SyncGroup | - |
UseChartOptions | - |
UseChartResult | - |
Constants (5)
| Symbol | What it does |
|---|---|
CHART_THEMES | Named registry of the six shipped palettes (`` attribute accepts, so the menu order, the attribute values and the registry cannot drift apart. |
BUILT_IN_THEMES | The six palettes shipped by the library, in menu order. |
THEME_NAMES | Selectable palette names, system included, in menu order (ThemeName). |
ATTRIBUTION_HREF | Site of the library, opened by the mark. |
ATTRIBUTION_LABEL | Label of the mark. |
Subpath @unifin/chart-react/workspace (15)
Imported as @unifin/chart-react/workspace; the subpaths of this table are self-contained:
a host that does not need them does not pay for them.
Functions (15)
| Symbol | What it does |
|---|---|
useDrawingLayers | Effective state of the drawings after the layer rules. |
useLayerGroups | Drawing layers with their members, ready for a tree view. |
useHeaderValues | Values of the configured header fields. |
useAlignInstrumentLayers | Series of several instruments on one time axis. |
usePaneLayout | Pane actions that return the next layout; the host keeps the state. |
useAlertFeed | Alert feed with grouping and the badges of the panes. |
useExportLegend | Legend rows of an export, with the hidden series last. |
useAuditRows | Rows of the audit overlay. |
useFrameNarration | Narration sentence of the current frame. |
useFrameBudget | Rows of the frame budget panel and the worker decision behind them. |
useWorkerDecision | Decision whether the calculation leaves the frame. |
useAssistantDraft | Draft of the assistant: calls of the catalogue plus the words it did not know. |
useTimeNotes | Notes pinned to their bars. |
useReplayScenario | Scenario of a replay: ordered steps a host shows, exports or turns into a test. |
useTimeSlider | Position of the time slider: the bar index of a share, snapped to a session edge. |
Indicators API (@unifin/chart-indicators)
Generated reference of 194 public symbols of @unifin/chart-indicators, grouped by kind and ordered as in the sources.
Element API (@unifin/chart-element)
Generated reference of 18 public symbols of @unifin/chart-element, grouped by kind and ordered as in the sources.
