BloxwapChart SDK
API reference

Package exports

Import the chart core or the specific integration layer you need.

The package ships ESM and TypeScript declarations. There is no CommonJS export. It declares no runtime dependencies. React is an optional peer dependency, needed only for @bloxwap/chart/react.

Import pathMain exports
@bloxwap/chartcreateChart, Chart, config helpers, scales, data types, built-in registries, themes and presets, events, snapshots, canvas abstractions
@bloxwap/chart/configdefineConfig, resolveConfig, DEFAULT_CONFIG, config types
@bloxwap/chart/colorColor parsing, serialization, alpha and contrast helpers
@bloxwap/chart/domCanvas/document interfaces and recording mocks
@bloxwap/chart/indicatorsIndicator registry, built-ins, and calculation helpers
@bloxwap/chart/drawingsDrawing registry, catalog, built-ins, and geometry types
@bloxwap/chart/wasmWASM initialization and kernel interface
@bloxwap/chart/uiDrawing toolbar, settings, header, control rail, scale buttons, indicator dialog, context menu, touch gestures, countdown ticker, controller, history, UI primitives, and frame scheduler
@bloxwap/chart/iconsICONS and icon(name, size?)
@bloxwap/chart/react<Chart> React component ('use client'), ChartProps, ChartInstance
@bloxwap/chart/datafeedcreateDatafeedChart, attachDatafeed, loadHistory, createLiveBarFolder, paging and bucket helpers

Main entry additions

Beyond createChart, the root entry exports:

AreaExports
Presets and themesCHART_THEMES, CHART_PRESETS, bloxwapDark, withPreset, presetChartTheme, scaleFont, scaleFontSize
EventsEmitter; types VisibleRangeChangeEvent, CrosshairMoveEvent, DataLoadEvent, DataLoadReason, LayoutChangeEvent, ConfigChangeEvent
Price lines and markersDEFAULT_PRICE_LINE_COLOR, MARKER_MIN_SIZE, MARKER_MAX_SIZE; types SeriesApi, PriceLine, PriceLineOptions, PriceLineStyle, SeriesMarker, SeriesMarkerPosition, SeriesMarkerShape
SnapshotsrenderSnapshot, createSnapshotCanvas, canvasToBlob, canvasToDataURL, snapshotToBlob, snapshotToDataURL; types SnapshotOptions, SnapshotImageOptions, SnapshotBlob
CountdownformatCountdown, barIntervalMs, barCloseMs, barCountdownMs, countdownText
Time scalecomputeTimeSlots, inferIntervalMs; types TimeScaleConfig, SlotRange
SeriesheikinAshi, heikinAshiBar, updateHeikinAshi
IndicatorsAll 20 built-in definitions (smaIndicator … psarIndicator), calculation helpers such as smaValues, atrValues, and ichimokuValues, the vwapMeta, adxMeta, cciMeta, mfiMeta, obvMeta, and maRibbonMeta display metadata, indicatorLineKeys, indicatorStyleColors, indicatorLineLabels, indicatorStyleLabel, applyIndicatorPatch; types IndicatorFill, IndicatorLevel, IndicatorInputDef, IndicatorStyleDef, IndicatorPatch, ResolvedIndicatorConfig
DataDataStore, Candle, IndicatorHit

UI entry additions

AreaExports
HeadercreateChartHeader, DEFAULT_TIMEFRAMES, DEFAULT_HEADER_INTERVAL_MS, DEFAULT_CHART_TYPES, CHART_TYPE_LABELS, HEADER_CSS, HEADER_STYLE_MARKER, injectHeaderStyles, BLOXWAP_HEADER_TOKENS, BLOXWAP_HEADER_THEME; types HeaderTokens, ThemedHeaderTokens
Control railcreateControlRail; types ControlRail, ControlRailOptions
Scale buttonscreateScaleButtons, toggleScale, scaleToggleState, syncScaleToggles, SCALE_TOGGLES
Indicator dialogcreateIndicatorsDialog, indicatorInputs, indicatorStyleGroups, INDICATORS_DIALOG_CSS, INDICATORS_DIALOG_STYLE_MARKER
Context menucreateChartContextMenu; types ChartContextMenuHooks, ContextMenuTarget, ContextMenuAction, ContextMenuEntry
TouchattachTouchGestures, GestureRecognizer, LONG_PRESS_MS, TAP_SLOP_PX, TOUCH_HIT_PX, TOUCH_HANDLE_HIT_PX, DOUBLE_TAP_MS, FLING_MIN_VELOCITY, FLING_DURATION_MS, TOUCH_POINTER_TYPES
CountdownstartCountdownTicker

Datafeed entry

@bloxwap/chart/datafeed exports createDatafeedChart, attachDatafeed, loadHistory, pageWindow, barsInWindow, mergeCandles, normalizeCandles, createLiveBarFolder, bucketStartMs, candleTimeMs, applyTick, hasMissedBucket, seedBarFromTick, and the constants DEFAULT_PAGE_SIZE, DEFAULT_MAX_EMPTY_PAGES, DEFAULT_INITIAL_BARS, DEFAULT_PAGE_BARS, MIN_LAZY_LOAD_THRESHOLD, RETRY_BACKOFF_MS, MAX_RETRY_BACKOFF_MS, MAX_GAP_BARS, GAP_SILENCE_MS, ROLL_SILENCE_MS, and MAX_PENDING_TICKS. See paging datafeed.

Icons

import { icon } from '@bloxwap/chart/icons';

const button = document.createElement('button');
button.innerHTML = icon('chart-candlestick', 20);
button.setAttribute('aria-label', 'Candlestick chart');

Library icons use currentColor to inherit their host's color. Provide accessible labels when an icon is the only button content.

Configuration helpers

import { defineConfig, resolveConfig } from '@bloxwap/chart/config';

const partial = defineConfig({ series: { type: 'area' } });
const complete = resolveConfig(partial);

Use exported types rather than duplicating the schema. The declarations in each published build follow the implementation in this repository.

Edit on GitHub

On this page