@abdullahjaswal/tickyr-charts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +14 -0
- package/README.md +225 -0
- package/dist/accessibility-B-2UbONR.js +14598 -0
- package/dist/chunk-BmowowmI.js +16 -0
- package/dist/index.d.ts +1725 -0
- package/dist/index.js +50 -0
- package/dist/react-COTigUl0.js +4561 -0
- package/dist/react.d.ts +3741 -0
- package/dist/react.js +118 -0
- package/dist/solid.d.ts +2971 -0
- package/dist/solid.js +2571 -0
- package/dist/tickyr_charts_wasm-SyLrOzol.js +818 -0
- package/package.json +128 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1725 @@
|
|
|
1
|
+
import * as React_2 from 'react';
|
|
2
|
+
|
|
3
|
+
export declare interface Anchor {
|
|
4
|
+
/** Time in ms since the epoch. */
|
|
5
|
+
t: number;
|
|
6
|
+
/** Price (in the chart's price scale). */
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Anchor count required for each drawing type. The chart's drawing
|
|
11
|
+
* pipeline asserts that `drawing.anchors.length >= ANCHOR_COUNTS[type]`. */
|
|
12
|
+
export declare const ANCHOR_COUNTS: Record<DrawingType, number>;
|
|
13
|
+
|
|
14
|
+
export declare const ANIMATION_DEFAULTS: AnimationAxes;
|
|
15
|
+
|
|
16
|
+
declare interface AnimationAxes {
|
|
17
|
+
barEntryAnimation: BarEntryAnimation;
|
|
18
|
+
barUpdateAnimation: BarUpdateAnimation;
|
|
19
|
+
/** ms ≥ 0; clamps to 0 under reduced-motion. */
|
|
20
|
+
crosshairFadeDuration: number;
|
|
21
|
+
/** ms ≥ 0; clamps to 0 under reduced-motion. */
|
|
22
|
+
tooltipFadeDuration: number;
|
|
23
|
+
panZoomSmoothing: boolean;
|
|
24
|
+
themeSwitchTransition: ThemeSwitchTransition;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare interface AnimationInputs {
|
|
28
|
+
barEntryAnimation?: BarEntryAnimation;
|
|
29
|
+
barUpdateAnimation?: BarUpdateAnimation;
|
|
30
|
+
crosshairFadeDuration?: number;
|
|
31
|
+
tooltipFadeDuration?: number;
|
|
32
|
+
panZoomSmoothing?: boolean;
|
|
33
|
+
themeSwitchTransition?: ThemeSwitchTransition;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare type AreaBaseline = "zero" | "first-value" | "last-value" | "min" | "max" | "mean" | "average" | "median" | number | ((window: Float64Array) => number);
|
|
37
|
+
|
|
38
|
+
export declare function AreaChart(props: AreaChartProps): React_2.ReactElement;
|
|
39
|
+
|
|
40
|
+
export declare interface AreaChartProps extends Omit<LineChartProps, "areaFill"> {
|
|
41
|
+
/** Where the bottom of the fill anchors. Default `'min'` (visible window's
|
|
42
|
+
* lowest value). See `AreaBaseline` for all 9 modes. */
|
|
43
|
+
baseline?: AreaBaseline;
|
|
44
|
+
/** Solid alpha fill (`'flat'`) or vertical gradient that fades to 0 at the
|
|
45
|
+
* baseline (`'gradient'`). Default `'flat'` (clean read, low-tier-friendly). */
|
|
46
|
+
fillType?: AreaFillType;
|
|
47
|
+
/** 0–1. Alpha for `'flat'`; top-stop alpha for `'gradient'`. Default 0.6. */
|
|
48
|
+
fillOpacity?: number;
|
|
49
|
+
/** Optional color split at a y-value. **`false`** (default) = single-color
|
|
50
|
+
* fill. **`true`** = split at the resolved baseline (or 0 when baseline
|
|
51
|
+
* is non-numeric), `aboveColor=palette.up`, `belowColor=palette.down`.
|
|
52
|
+
* **Config** = explicit value and/or custom above/below colors. The line
|
|
53
|
+
* stroke is also color-split for a consistent above/below read. */
|
|
54
|
+
thresholdFill?: ThresholdFill;
|
|
55
|
+
/** Multi-series stacking mode (requires the `series` prop with 2+
|
|
56
|
+
* entries; ignored otherwise).
|
|
57
|
+
* - `false` (default): each series renders an overlapping independent
|
|
58
|
+
* fill from the resolved baseline.
|
|
59
|
+
* - `true`: additive stacking - each band stacks on the previous; the
|
|
60
|
+
* sum at each x is visualized.
|
|
61
|
+
* - `'normalized'`: 100%-stacked - every column normalizes to 1 so the
|
|
62
|
+
* chart shows percentage breakdown. The y-axis becomes [0, 1].
|
|
63
|
+
* Stacked modes require all series to share the same `times` view; the
|
|
64
|
+
* lib validates this once at the public API boundary and throws a
|
|
65
|
+
* descriptive error otherwise. */
|
|
66
|
+
stacked?: StackingMode;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Area-fill configuration. AreaChart sets this; LineChart renders it as a
|
|
70
|
+
* polygon between the line and a horizontal `baseline` y-value. Internal -
|
|
71
|
+
* LineChart's public surface intentionally has no area fill (that's
|
|
72
|
+
* <AreaChart>'s defining feature). Reused via `<AreaChart>` which forwards this transparently. */
|
|
73
|
+
declare interface AreaFillConfig {
|
|
74
|
+
baseline: AreaBaseline;
|
|
75
|
+
fillType: "flat" | "gradient";
|
|
76
|
+
fillOpacity: number;
|
|
77
|
+
/** Optional threshold split. When set, the area fill renders as two
|
|
78
|
+
* polygons (above + below threshold) and the line stroke is split too.
|
|
79
|
+
* Mutually exclusive with `stacked`; when
|
|
80
|
+
* both are set, `stacked` wins (threshold becomes a no-op). */
|
|
81
|
+
threshold?: AreaFillThreshold;
|
|
82
|
+
/** Multi-series stacking mode. Resolved form (AreaChart maps user-facing
|
|
83
|
+
* `false | true | 'normalized'` to `false | 'additive' | 'normalized'`).
|
|
84
|
+
* - `false` (default): non-stacked. With 2+ series, each band fills
|
|
85
|
+
* independently from the resolved baseline (overlapping fills).
|
|
86
|
+
* - `'additive'`: bands stack, total = sum at each x.
|
|
87
|
+
* - `'normalized'`: bands stack, total = 1 (100%) at each x. */
|
|
88
|
+
stacked?: false | "additive" | "normalized";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare interface AreaFillThreshold {
|
|
92
|
+
/** Domain-space y to split at. `undefined` → use the resolved baseline. */
|
|
93
|
+
readonly value: number | undefined;
|
|
94
|
+
/** Pre-resolved CSS rgba string for above-threshold runs. */
|
|
95
|
+
readonly aboveColor: string;
|
|
96
|
+
/** Pre-resolved CSS rgba string for below-threshold runs. */
|
|
97
|
+
readonly belowColor: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare type AreaFillType = "flat" | "gradient";
|
|
101
|
+
|
|
102
|
+
declare interface AtrSpecInput extends IndicatorPaneCommon {
|
|
103
|
+
type: "atr";
|
|
104
|
+
period?: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare function BarChart(props: BarChartProps): React_2.ReactElement;
|
|
108
|
+
|
|
109
|
+
/** Framework-agnostic BarChart prop shape. Excludes the `tooltip` render-
|
|
110
|
+
* prop field that each framework adapter retypes against its native JSX
|
|
111
|
+
* element type. The controller's `BarChartControllerProps` extends this
|
|
112
|
+
* with an `unknown`-returning tooltip so both adapters' shapes are
|
|
113
|
+
* structurally assignable via covariance. */
|
|
114
|
+
declare interface BarChartBaseProps {
|
|
115
|
+
/** Bar data - single series (categories + values). Mutually
|
|
116
|
+
* exclusive with `series` for multi-series. */
|
|
117
|
+
data?: BarChartSeriesInput;
|
|
118
|
+
/** Multi-series mode: multiple parallel series. Layout follows
|
|
119
|
+
* `grouping` (grouped / stacked / normalized). */
|
|
120
|
+
series?: readonly BarSeriesConfig[];
|
|
121
|
+
/** Multi-series layout: `"grouped"` (side-by-side bars per
|
|
122
|
+
* category), `"stacked"` (vertically stacked), `"normalized"`
|
|
123
|
+
* (stacked to 100%). */
|
|
124
|
+
grouping?: BarGrouping;
|
|
125
|
+
/** Padding between bar groups (0–1 fraction of slot width). */
|
|
126
|
+
groupPadding?: number;
|
|
127
|
+
/** Chart orientation: `"vertical"` (default, value on y) or
|
|
128
|
+
* `"horizontal"` (value on x). */
|
|
129
|
+
orientation?: Orientation;
|
|
130
|
+
/** Render the bar value as a text label on/near the bar. */
|
|
131
|
+
valueLabels?: ValueLabels;
|
|
132
|
+
/** Legend visibility. */
|
|
133
|
+
legend?: LegendVisibility;
|
|
134
|
+
/** Legend anchor corner. */
|
|
135
|
+
legendPosition?: LegendPosition;
|
|
136
|
+
/** Toggle crosshair on hover. */
|
|
137
|
+
crosshairVisible?: boolean;
|
|
138
|
+
/** Crosshair line style. */
|
|
139
|
+
crosshairLineStyle?: GridStyle;
|
|
140
|
+
/** Snap-marker shape. */
|
|
141
|
+
crosshairMarker?: CrosshairMarker;
|
|
142
|
+
/** Chart width in CSS px. Default 800. */
|
|
143
|
+
width?: number;
|
|
144
|
+
/** Chart height in CSS px. Default 300. */
|
|
145
|
+
height?: number;
|
|
146
|
+
/** Color theme. */
|
|
147
|
+
theme?: ThemeInput;
|
|
148
|
+
/** Palette name. */
|
|
149
|
+
palette?: string;
|
|
150
|
+
/** `"Fill"` (default) or `"Outline"`. */
|
|
151
|
+
visualStyle?: "Fill" | "Outline";
|
|
152
|
+
/** Outline-mode fill color. */
|
|
153
|
+
outlineFillColor?: "auto" | string;
|
|
154
|
+
/** Outline-mode fill opacity (0–100). */
|
|
155
|
+
outlineFillOpacity?: number;
|
|
156
|
+
/** Cap the DPR. */
|
|
157
|
+
pixelDensityCap?: number;
|
|
158
|
+
/** Skip cosmetic features for low-end devices. */
|
|
159
|
+
fastMode?: boolean;
|
|
160
|
+
/** Direction-colored aura behind marks. */
|
|
161
|
+
glow?: GlowInput;
|
|
162
|
+
/** Glow color rule. `"auto"` = direction-derived. */
|
|
163
|
+
glowColor?: GlowColorInput;
|
|
164
|
+
/** Pattern fills (hatch, dots, etc.). */
|
|
165
|
+
pattern?: PatternInput;
|
|
166
|
+
/** Pattern scale multiplier. */
|
|
167
|
+
patternScale?: number;
|
|
168
|
+
/** Pattern color rule. `"auto"` = derived from bar color. */
|
|
169
|
+
patternColor?: PatternColorInput;
|
|
170
|
+
/** Force sparkline mode. */
|
|
171
|
+
sparkline?: boolean;
|
|
172
|
+
/** Override the auto-generated `aria-label`. */
|
|
173
|
+
ariaLabel?: string;
|
|
174
|
+
/** Toggle axis labels + spine. */
|
|
175
|
+
axisVisible?: boolean;
|
|
176
|
+
/** Value-axis position (depends on `orientation`). */
|
|
177
|
+
yAxisPosition?: YAxisPosition;
|
|
178
|
+
/** Category-axis position. */
|
|
179
|
+
xAxisPosition?: XAxisPosition;
|
|
180
|
+
/** Padding above/below the value-axis data range (fraction). */
|
|
181
|
+
yAxisPadding?: number;
|
|
182
|
+
/** Toggle gridlines. */
|
|
183
|
+
gridVisible?: boolean;
|
|
184
|
+
/** Gridline style. */
|
|
185
|
+
gridStyle?: GridStyle;
|
|
186
|
+
/** Gridline density. */
|
|
187
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
188
|
+
/** Use accent tint for axis + grid. */
|
|
189
|
+
accents?: boolean;
|
|
190
|
+
/** Locale code. */
|
|
191
|
+
locale?: string;
|
|
192
|
+
/** IANA time zone. */
|
|
193
|
+
timeZone?: string;
|
|
194
|
+
/** Fraction of slot width consumed by the bar body (0–1).
|
|
195
|
+
* Default 0.7. */
|
|
196
|
+
barWidthRatio?: number;
|
|
197
|
+
/** Bar corner radius in CSS px. Default 3. */
|
|
198
|
+
cornerRadius?: number;
|
|
199
|
+
/** Bar border width in CSS px. */
|
|
200
|
+
borderWidth?: number;
|
|
201
|
+
/** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
|
|
202
|
+
digitGrouping?: DigitGrouping;
|
|
203
|
+
/** Compact number abbreviation rule. */
|
|
204
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
205
|
+
/** Decimal-place rule for value labels. */
|
|
206
|
+
decimalPlaces?: DecimalPlaces;
|
|
207
|
+
/** ISO currency code. */
|
|
208
|
+
currency?: string;
|
|
209
|
+
/** Currency display style. */
|
|
210
|
+
currencyDisplay?: CurrencyDisplay;
|
|
211
|
+
/** Percentage precision. */
|
|
212
|
+
percentPrecision?: PercentPrecision;
|
|
213
|
+
/** Date format rule for time-axis category labels. */
|
|
214
|
+
dateFormat?: DateFormat;
|
|
215
|
+
/** Time format rule. */
|
|
216
|
+
timeFormat?: TimeFormat;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** React BarChart prop shape. Extends the framework-agnostic
|
|
220
|
+
* `BarChartBaseProps` (in `charts/bar-chart-helpers.ts`) with the React-
|
|
221
|
+
* specific `tooltip` field whose return type is `React.ReactNode`. */
|
|
222
|
+
export declare interface BarChartProps extends BarChartBaseProps {
|
|
223
|
+
tooltip?: BarChartTooltipProp;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** Public input shape - same SoA + AoS pair as LineChart so hosts can
|
|
227
|
+
* share data pipelines between line / area / bar without re-shaping. */
|
|
228
|
+
export declare type BarChartSeriesInput = LineSeriesInput;
|
|
229
|
+
|
|
230
|
+
/** Polymorphic tooltip prop. `undefined` (default) → built-in tooltip;
|
|
231
|
+
* `false` → suppress; function → custom render. */
|
|
232
|
+
export declare type BarChartTooltipProp = undefined | false | ((props: BarChartTooltipProps) => React_2.ReactNode);
|
|
233
|
+
|
|
234
|
+
/** Props passed to a custom tooltip render function. Mirrors
|
|
235
|
+
* `LineChartTooltipProps` but tailored to bar geometry (no
|
|
236
|
+
* threshold-fill semantics; bar-snap uses the slot index). */
|
|
237
|
+
export declare interface BarChartTooltipProps {
|
|
238
|
+
/** Time at the hovered bar (unix-ms). */
|
|
239
|
+
readonly t: number;
|
|
240
|
+
/** Bar index (0-based). */
|
|
241
|
+
readonly idx: number;
|
|
242
|
+
/** Per-series values at this x. */
|
|
243
|
+
readonly seriesValues: readonly BarTooltipSeriesValue[];
|
|
244
|
+
readonly pointerX: number;
|
|
245
|
+
readonly pointerY: number;
|
|
246
|
+
readonly containerWidth: number;
|
|
247
|
+
readonly containerHeight: number;
|
|
248
|
+
readonly theme: Theme;
|
|
249
|
+
readonly palette: Palette;
|
|
250
|
+
readonly locale: string;
|
|
251
|
+
readonly timeZone: string | undefined;
|
|
252
|
+
readonly formatter: ChartFormatter;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export declare type BarEntryAnimation = "none" | "spring" | "fade" | "fade-stagger-left" | "fade-stagger-right" | "grow-from-baseline" | "rise-from-low" | "slide-from-right" | "slide-from-top" | "scale" | "expand-x" | "wave" | "wipe" | "random-fade";
|
|
256
|
+
|
|
257
|
+
/** Multi-series rendering mode. */
|
|
258
|
+
export declare type BarGrouping = "clustered" | "stacked" | "normalized" | "overlapping";
|
|
259
|
+
|
|
260
|
+
/** Multi-series config - one entry per side-by-side bar at each x-slot.
|
|
261
|
+
* Without per-series `color`, the lib auto-
|
|
262
|
+
* cycles `palette.categorical[i]`. All series MUST share the same `times`
|
|
263
|
+
* view (validated at the public API boundary). */
|
|
264
|
+
export declare interface BarSeriesConfig {
|
|
265
|
+
readonly id: string;
|
|
266
|
+
readonly data: BarChartSeriesInput;
|
|
267
|
+
readonly label?: string;
|
|
268
|
+
readonly color?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Per-series value at the hover slot - every visible series at that x. */
|
|
272
|
+
export declare interface BarTooltipSeriesValue {
|
|
273
|
+
readonly id: string;
|
|
274
|
+
readonly label: string;
|
|
275
|
+
readonly color: string;
|
|
276
|
+
readonly value: number;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export declare type BarUpdateAnimation = "none" | "morph + flash-direction" | "morph" | "flash-neutral" | "flash-direction" | "pulse" | "glow" | "tick-line" | "flicker" | "rise";
|
|
280
|
+
|
|
281
|
+
export declare interface BinaryCandleSeriesInput {
|
|
282
|
+
times: Float64Array;
|
|
283
|
+
opens: Float64Array;
|
|
284
|
+
highs: Float64Array;
|
|
285
|
+
lows: Float64Array;
|
|
286
|
+
closes: Float64Array;
|
|
287
|
+
volumes?: Float64Array;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export declare const BUILT_IN_PALETTES: {
|
|
291
|
+
readonly Monochrome: Palette;
|
|
292
|
+
readonly Classic: Palette;
|
|
293
|
+
readonly Accessible: Palette;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export declare type BuiltInPaletteName = keyof typeof BUILT_IN_PALETTES;
|
|
297
|
+
|
|
298
|
+
export declare interface Candle {
|
|
299
|
+
t: number;
|
|
300
|
+
o: number;
|
|
301
|
+
h: number;
|
|
302
|
+
l: number;
|
|
303
|
+
c: number;
|
|
304
|
+
v?: number;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export declare const CandleChart: React_2.ForwardRefExoticComponent<CandleChartProps & React_2.RefAttributes<CandleChartHandle>>;
|
|
308
|
+
|
|
309
|
+
/** Framework-agnostic CandleChart prop shape. Excludes the eight render-
|
|
310
|
+
* prop fields (`tooltip`, `extremeTooltip`, `volumeBarTooltip`,
|
|
311
|
+
* `staleBanner`, `signalTooltip`, `orderTooltip`, `positionTooltip`,
|
|
312
|
+
* `eventTooltip`) that each framework adapter retypes against its
|
|
313
|
+
* native JSX element type. The controller's `CandleChartControllerProps`
|
|
314
|
+
* extends this with `unknown`-returning render props so both adapters'
|
|
315
|
+
* shapes are structurally assignable via covariance. */
|
|
316
|
+
declare interface CandleChartBaseProps {
|
|
317
|
+
/** Required. OHLC(V) bars - either structured (`{ candles: Array<{t,o,h,l,c,v?}> }`)
|
|
318
|
+
* or binary (per-field `Float64Array`). The binary path is zero-copy. */
|
|
319
|
+
data: CandleSeriesInput;
|
|
320
|
+
/** Older bars prepended to `data` for indicator warm-up. Same shape
|
|
321
|
+
* as `data`. Lets RSI/MACD/etc. have priors so the visible window
|
|
322
|
+
* starts post-warmup with non-NaN values. */
|
|
323
|
+
historyData?: CandleSeriesInput;
|
|
324
|
+
/** When `true` (default) and the dynamic
|
|
325
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
326
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
327
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
328
|
+
partialRepaints?: boolean;
|
|
329
|
+
/** VWAP price-overlay computed by the engine. When set,
|
|
330
|
+
* the engine's `vwap(highs, lows, closes, volumes, sessionStarts)`
|
|
331
|
+
* is computed once per data update and rendered as a line on the
|
|
332
|
+
* price pane. Requires `data.volumes` - silently skipped when
|
|
333
|
+
* volumes are absent. */
|
|
334
|
+
vwap?: {
|
|
335
|
+
/** Defaults to `true` when the `vwap` prop is present. */
|
|
336
|
+
visible?: boolean;
|
|
337
|
+
/** `"auto"` pulls from `palette[theme].indicators.vwap`. */
|
|
338
|
+
color?: "auto" | string;
|
|
339
|
+
/** Defaults to `indicatorLineWidth` from personalization. */
|
|
340
|
+
lineWidth?: number;
|
|
341
|
+
/** Session breakpoints - strictly-increasing indices into the
|
|
342
|
+
* times array. Defaults to `[0]` (whole series is one session). */
|
|
343
|
+
sessionStarts?: Uint32Array;
|
|
344
|
+
};
|
|
345
|
+
/** Engine-backed streaming mode. When
|
|
346
|
+
* set, `chart.onTick(t, p, s)` routes through the engine's
|
|
347
|
+
* `Engine.pushTick` for validate-then-aggregate semantics:
|
|
348
|
+
*
|
|
349
|
+
* - **Validation** - rejects non-positive prices, out-of-range
|
|
350
|
+
* price/volume, backward timestamps (per the anomaly policy).
|
|
351
|
+
* - **Bucket transitions** - engine returns `MutateLast` (extend
|
|
352
|
+
* current bar) or `AppendNew` (current bar closed; new one opens)
|
|
353
|
+
* so the controller correctly extends the series past the live bar.
|
|
354
|
+
* - **Anomaly + audit + telemetry** - pass-through to the engine's
|
|
355
|
+
* `setAnomalyPolicy` / `setAuditCallback` / `setTelemetryCallback`.
|
|
356
|
+
*
|
|
357
|
+
* When omitted, `onTick` falls back to JS-side last-bar-only
|
|
358
|
+
* mutation (suitable for hosts that own bar progression and just
|
|
359
|
+
* want intra-bar high/low/close updates). */
|
|
360
|
+
streaming?: {
|
|
361
|
+
/** Timeframe in minutes. Must match the data's bar spacing. */
|
|
362
|
+
timeframeMinutes: number;
|
|
363
|
+
/** Market spec - controls session-aware bucketing. */
|
|
364
|
+
market: "equity" | "dst-equity" | "crypto-24-7";
|
|
365
|
+
/** Completed-candle ring capacity. */
|
|
366
|
+
capacity?: number;
|
|
367
|
+
/** Validator bounds (scaled-integer per `Market::price_scale.decimals`). */
|
|
368
|
+
minPriceRaw?: number;
|
|
369
|
+
maxPriceRaw?: number;
|
|
370
|
+
maxVolumeRaw?: number;
|
|
371
|
+
/** Optional anomaly policy. Each field accepts a negative value to
|
|
372
|
+
* disable that specific check. */
|
|
373
|
+
anomaly?: {
|
|
374
|
+
maxRelativePriceJump?: number;
|
|
375
|
+
rejectZeroVolumeTrade?: boolean;
|
|
376
|
+
clockSkewToleranceMs?: number;
|
|
377
|
+
maxGapMs?: number;
|
|
378
|
+
};
|
|
379
|
+
/** Observability callbacks - wired into the engine's audit /
|
|
380
|
+
* telemetry surfaces. */
|
|
381
|
+
onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
|
|
382
|
+
onTelemetry?: (name: string) => void;
|
|
383
|
+
};
|
|
384
|
+
/** Candle visual: `"solid"` (default, filled bodies), `"hollow"`
|
|
385
|
+
* (down bodies hollow), `"ohlc-bars"` (open/close ticks), or
|
|
386
|
+
* `"heikin-ashi"` (smoothed Heikin-Ashi transform). */
|
|
387
|
+
candleType?: CandleType;
|
|
388
|
+
/** Fraction of the slot width consumed by the body (0–1). Default
|
|
389
|
+
* 0.7 - bars touch but don't overlap. */
|
|
390
|
+
bodyWidthRatio?: number;
|
|
391
|
+
/** Wick stroke width in CSS px. Default 1.4. */
|
|
392
|
+
wickWidth?: number;
|
|
393
|
+
/** Wick color rule: `"body"` (matches body color, default),
|
|
394
|
+
* `"neutral"`, `"up"`, `"down"`. */
|
|
395
|
+
wickColor?: WickColor;
|
|
396
|
+
/** Minimum body height in CSS px so true-doji bars stay visible.
|
|
397
|
+
* Default 1. */
|
|
398
|
+
dojiMinBodyHeight?: number;
|
|
399
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
400
|
+
crosshairVisible?: boolean;
|
|
401
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
402
|
+
crosshairLineStyle?: GridStyle;
|
|
403
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"` /
|
|
404
|
+
* `"none"`. CandleChart defaults to `"none"`. */
|
|
405
|
+
crosshairMarker?: CrosshairMarker;
|
|
406
|
+
/** Last-price horizontal reference line style. Default `"solid"`. */
|
|
407
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
408
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
409
|
+
lastPriceLabel?: boolean;
|
|
410
|
+
/** Visible-range high/low marker mode: `"lines+labels"` (default),
|
|
411
|
+
* `"labels"`, `"off"`. */
|
|
412
|
+
highLowMarkers?: HighLowMarkers;
|
|
413
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
414
|
+
width?: number;
|
|
415
|
+
/** Chart height in CSS pixels. Default 400 (taller than LineChart
|
|
416
|
+
* to accommodate the volume sub-pane). */
|
|
417
|
+
height?: number;
|
|
418
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"`. */
|
|
419
|
+
theme?: ThemeInput;
|
|
420
|
+
/** Palette name (`"Monochrome"`, `"Classic"`, etc.). */
|
|
421
|
+
palette?: string;
|
|
422
|
+
/** `"Fill"` (default) = solid body fills; `"Outline"` = colored
|
|
423
|
+
* border + translucent body fill. */
|
|
424
|
+
visualStyle?: "Fill" | "Outline";
|
|
425
|
+
/** In Outline mode, the fill color inside the outlined body. */
|
|
426
|
+
outlineFillColor?: "auto" | string;
|
|
427
|
+
/** In Outline mode, alpha of the outline body fill (0–100). */
|
|
428
|
+
outlineFillOpacity?: number;
|
|
429
|
+
/** Body corner radius in CSS px. Default 3. */
|
|
430
|
+
cornerRadius?: number;
|
|
431
|
+
/** Body border width in CSS px. Default 1.4. */
|
|
432
|
+
borderWidth?: number;
|
|
433
|
+
/** Cap the DPR (1–2 typical). */
|
|
434
|
+
pixelDensityCap?: number;
|
|
435
|
+
/** Skip cosmetic features for low-end devices. */
|
|
436
|
+
fastMode?: boolean;
|
|
437
|
+
/** Force sparkline mode (minimal axis-less render). */
|
|
438
|
+
sparkline?: boolean;
|
|
439
|
+
/** Override the auto-generated `aria-label`. */
|
|
440
|
+
ariaLabel?: string;
|
|
441
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
442
|
+
axisVisible?: boolean;
|
|
443
|
+
/** `"left"` or `"right"`. Default `"right"` for candles. */
|
|
444
|
+
yAxisPosition?: YAxisPosition;
|
|
445
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
446
|
+
xAxisPosition?: XAxisPosition;
|
|
447
|
+
/** Fractional padding above/below the y-data range. Default 0.05. */
|
|
448
|
+
yAxisPadding?: number;
|
|
449
|
+
/** Toggle gridlines. */
|
|
450
|
+
gridVisible?: boolean;
|
|
451
|
+
/** Gridline style. */
|
|
452
|
+
gridStyle?: GridStyle;
|
|
453
|
+
/** Gridline density. */
|
|
454
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
455
|
+
/** Use accent tint for axis + grid colors. */
|
|
456
|
+
accents?: boolean;
|
|
457
|
+
/** Locale code (e.g. `"USA"`). */
|
|
458
|
+
locale?: string;
|
|
459
|
+
/** IANA time zone. */
|
|
460
|
+
timeZone?: string;
|
|
461
|
+
/** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
|
|
462
|
+
digitGrouping?: DigitGrouping;
|
|
463
|
+
/** Compact number abbreviation rule (e.g. `"short"` → `"1.2M"`). */
|
|
464
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
465
|
+
/** Decimal-place rule for price labels. */
|
|
466
|
+
decimalPlaces?: DecimalPlaces;
|
|
467
|
+
/** ISO currency code (e.g. `"USD"`). */
|
|
468
|
+
currency?: string;
|
|
469
|
+
/** Currency display style. */
|
|
470
|
+
currencyDisplay?: CurrencyDisplay;
|
|
471
|
+
/** Percentage precision. */
|
|
472
|
+
percentPrecision?: PercentPrecision;
|
|
473
|
+
/** Date format rule. */
|
|
474
|
+
dateFormat?: DateFormat;
|
|
475
|
+
/** Time format rule. */
|
|
476
|
+
timeFormat?: TimeFormat;
|
|
477
|
+
/** Show the volume sub-pane. Requires `data.volumes` to be present.
|
|
478
|
+
* Default `true` when volumes exist. */
|
|
479
|
+
volumeVisible?: boolean;
|
|
480
|
+
/** Volume placement: `"subpane"` (separate pane below price,
|
|
481
|
+
* default) or `"overlay"` (transparent bars on the price pane). */
|
|
482
|
+
volumePlacement?: VolumePlacement;
|
|
483
|
+
/** Fraction of inner height given to the volume pane (0–1).
|
|
484
|
+
* Default 0.25. */
|
|
485
|
+
volumeHeightRatio?: number;
|
|
486
|
+
/** Allow the user to drag the divider between price + volume panes. */
|
|
487
|
+
volumeResizable?: boolean;
|
|
488
|
+
/** Volume bar coloring: `"by-direction"` (matches candle direction,
|
|
489
|
+
* default), `"single-color"`. */
|
|
490
|
+
volumeColoring?: VolumeColoring;
|
|
491
|
+
/** When `volumeColoring === "single-color"`, the bar color. */
|
|
492
|
+
volumeSingleColor?: "auto" | string;
|
|
493
|
+
/** Volume y-axis scale: `"linear"` (default) or `"log"`. */
|
|
494
|
+
volumeScale?: VolumeScale;
|
|
495
|
+
/** Sync the crosshair vertical line across price + volume +
|
|
496
|
+
* indicator panes. Default `true`. */
|
|
497
|
+
crosshairPaneSync?: boolean;
|
|
498
|
+
/** Sub-pane indicators: RSI / MACD / Stochastic / ATR. Each becomes
|
|
499
|
+
* its own pane below volume. */
|
|
500
|
+
indicators?: readonly IndicatorPaneSpec[];
|
|
501
|
+
/** Default line width for indicator lines. */
|
|
502
|
+
indicatorLineWidth?: number;
|
|
503
|
+
/** Default line style for indicator lines. */
|
|
504
|
+
indicatorLineStyle?: IndicatorLineStyle;
|
|
505
|
+
/** Default opacity for indicator lines (0–1). */
|
|
506
|
+
indicatorOpacity?: number;
|
|
507
|
+
/** Live-bar animation. */
|
|
508
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
509
|
+
/** Connection-state badge: `"dot"` (default), `"pill"`, `"off"`.
|
|
510
|
+
* Renders as an HTML overlay above the chart's plot area. */
|
|
511
|
+
connectionIndicator?: ConnectionIndicator;
|
|
512
|
+
/** Visual treatment for stale state. */
|
|
513
|
+
staleVisualization?: StaleVisualization;
|
|
514
|
+
/** Auto-stale timeout in ms. Default 5000. */
|
|
515
|
+
staleThreshold?: number;
|
|
516
|
+
/** Unix-ms of the latest accepted tick. */
|
|
517
|
+
liveSince?: number;
|
|
518
|
+
/** Host-asserted connection state. */
|
|
519
|
+
connectionState?: LiveState;
|
|
520
|
+
/** Anchor corner for the badge + legend overlay. */
|
|
521
|
+
legendPosition?: LegendPosition;
|
|
522
|
+
/** Host-forced reduced-motion override. */
|
|
523
|
+
reducedMotion?: boolean;
|
|
524
|
+
/** Animation when new bars first appear. */
|
|
525
|
+
barEntryAnimation?: BarEntryAnimation;
|
|
526
|
+
/** Animation when the live bar updates. */
|
|
527
|
+
barUpdateAnimation?: BarUpdateAnimation;
|
|
528
|
+
/** Crosshair fade-in duration (ms) on hover-enter. */
|
|
529
|
+
crosshairFadeDuration?: number;
|
|
530
|
+
/** Tooltip fade-in duration (ms). */
|
|
531
|
+
tooltipFadeDuration?: number;
|
|
532
|
+
/** Smooth wheel-zoom interpolation. */
|
|
533
|
+
panZoomSmoothing?: boolean;
|
|
534
|
+
/** Cross-fade transition when the theme changes. */
|
|
535
|
+
themeSwitchTransition?: ThemeSwitchTransition;
|
|
536
|
+
/** Drawing tool annotations (trendlines, fib, horizontal lines, etc.).
|
|
537
|
+
* Host-controlled array - push new drawings via `onDrawingsChange`. */
|
|
538
|
+
drawings?: readonly Drawing[];
|
|
539
|
+
/** Default stroke color for new drawings. */
|
|
540
|
+
drawingDefaultColor?: "auto" | string;
|
|
541
|
+
/** Default stroke width for new drawings. */
|
|
542
|
+
drawingDefaultLineWidth?: number;
|
|
543
|
+
/** Default stroke style for new drawings. */
|
|
544
|
+
drawingDefaultLineStyle?: "solid" | "dashed" | "dotted";
|
|
545
|
+
/** Default fill opacity for filled drawings. */
|
|
546
|
+
drawingFillOpacity?: number;
|
|
547
|
+
/** When to show resize handles: `"always"`, `"on-select"` (default),
|
|
548
|
+
* `"on-hover"`. */
|
|
549
|
+
drawingHandlesMode?: "always" | "on-select" | "on-hover";
|
|
550
|
+
/** Controlled-mode: id of the currently selected drawing. */
|
|
551
|
+
selectedDrawingId?: string;
|
|
552
|
+
/** Whitelist of drawing tool types the user can create. */
|
|
553
|
+
enabledTools?: readonly DrawingType[];
|
|
554
|
+
/** Snap mode for drawing tool placement. */
|
|
555
|
+
drawingSnap?: "free" | "x-axis" | "data";
|
|
556
|
+
/** Delete the selected drawing when the user presses Esc. */
|
|
557
|
+
drawingDeleteOnEsc?: boolean;
|
|
558
|
+
/** Fires when the user adds, modifies, or removes a drawing. */
|
|
559
|
+
onDrawingsChange?: (next: readonly Drawing[]) => void;
|
|
560
|
+
/** Fires when the selected drawing changes. */
|
|
561
|
+
onDrawingSelected?: (id: string | undefined) => void;
|
|
562
|
+
/** Signal markers (buy/sell arrows + confidence). */
|
|
563
|
+
signals?: readonly SignalMarker[];
|
|
564
|
+
/** Signal marker visualization mode. */
|
|
565
|
+
signalMarkers?: SignalMarkerMode;
|
|
566
|
+
/** Order markers (open/active orders with entry/SL/TP). */
|
|
567
|
+
orders?: readonly OrderMarker[];
|
|
568
|
+
/** Order marker visualization mode. */
|
|
569
|
+
orderMarkers?: OrderMarkerMode;
|
|
570
|
+
/** Singleton position marker (current open position). */
|
|
571
|
+
position?: PositionMarker;
|
|
572
|
+
/** Position marker visualization mode. */
|
|
573
|
+
positionMarker?: PositionMarkerMode;
|
|
574
|
+
/** Event markers (earnings, dividends, splits, news). */
|
|
575
|
+
events?: readonly EventMarker[];
|
|
576
|
+
/** Event marker visualization mode. */
|
|
577
|
+
eventMarkers?: EventMarkerMode;
|
|
578
|
+
/** Comparison series rendered as a normalized line overlay on the
|
|
579
|
+
* price pane. */
|
|
580
|
+
compareData?: {
|
|
581
|
+
times: Float64Array;
|
|
582
|
+
closes: Float64Array;
|
|
583
|
+
};
|
|
584
|
+
/** Comparison rendering mode. */
|
|
585
|
+
symbolComparison?: "off" | "normalized-line";
|
|
586
|
+
/** Optional watermark - symbol text, symbol + exchange, or an image. */
|
|
587
|
+
watermark?: "off" | "symbol" | "symbol + exchange" | {
|
|
588
|
+
image: string;
|
|
589
|
+
};
|
|
590
|
+
/** Symbol ticker (e.g. `"AAPL"`) for watermark + tooltip header. */
|
|
591
|
+
symbol?: string;
|
|
592
|
+
/** Exchange code (e.g. `"NYSE"`) for watermark + tooltip header. */
|
|
593
|
+
exchange?: string;
|
|
594
|
+
/** Color-blind augmentation: `"arrows"` adds direction arrows to
|
|
595
|
+
* bar bodies for users who can't distinguish red/green. */
|
|
596
|
+
colorBlindIndicators?: "off" | "arrows";
|
|
597
|
+
/** Direction-colored aura on candle bodies. */
|
|
598
|
+
glow?: GlowInput;
|
|
599
|
+
/** Glow color. */
|
|
600
|
+
glowColor?: GlowColorInput;
|
|
601
|
+
/** Pattern fills. */
|
|
602
|
+
pattern?: PatternInput;
|
|
603
|
+
patternScale?: number;
|
|
604
|
+
patternColor?: PatternColorInput;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
declare interface CandleChartHandle {
|
|
608
|
+
/** Arm the next pointerdown to start drawing this `type`. */
|
|
609
|
+
startDrawing(type: DrawingType): void;
|
|
610
|
+
/** Abort the in-flight tool selection (no shape committed). */
|
|
611
|
+
cancelDrawing(): void;
|
|
612
|
+
/** Whether a drawing tool is currently armed. */
|
|
613
|
+
readonly isDrawing: boolean;
|
|
614
|
+
/** Push a live tick (primitive args).
|
|
615
|
+
* Updates the high/low/close of the most recent bar in-place.
|
|
616
|
+
* Multiple ticks per rAF coalesce into one static draw. */
|
|
617
|
+
onTick(time: number, price: number, size?: number): void;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/** React CandleChart prop shape. Extends the framework-agnostic
|
|
621
|
+
* `CandleChartBaseProps` (in `charts/candle-chart-helpers.ts`) with the
|
|
622
|
+
* eight render-prop fields whose return type is `React.ReactNode`. */
|
|
623
|
+
export declare interface CandleChartProps extends CandleChartBaseProps {
|
|
624
|
+
tooltip?: CandleChartTooltipProp;
|
|
625
|
+
extremeTooltip?: ExtremeTooltipProp;
|
|
626
|
+
volumeBarTooltip?: boolean | ((props: {
|
|
627
|
+
bar: {
|
|
628
|
+
t: number;
|
|
629
|
+
v: number;
|
|
630
|
+
idx: number;
|
|
631
|
+
};
|
|
632
|
+
avg20: number;
|
|
633
|
+
percentile: number;
|
|
634
|
+
}) => React_2.ReactNode);
|
|
635
|
+
staleBanner?: CandleStaleBannerProp;
|
|
636
|
+
signalTooltip?: false | ((p: SignalTooltipProps) => React_2.ReactNode);
|
|
637
|
+
orderTooltip?: false | ((p: OrderTooltipProps) => React_2.ReactNode);
|
|
638
|
+
positionTooltip?: false | ((p: PositionTooltipProps) => React_2.ReactNode);
|
|
639
|
+
eventTooltip?: false | ((p: EventTooltipProps) => React_2.ReactNode);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/** Polymorphic tooltip prop. `undefined` (default) → built-in OHLC
|
|
643
|
+
* tooltip; `false` → suppress; function → custom render. */
|
|
644
|
+
export declare type CandleChartTooltipProp = undefined | false | ((props: CandleChartTooltipProps) => React_2.ReactNode);
|
|
645
|
+
|
|
646
|
+
/** Props passed to a custom CandleChart OHLC tooltip render function (and
|
|
647
|
+
* to the built-in `DefaultCandleTooltip`). Framework-agnostic data shape. */
|
|
648
|
+
export declare interface CandleChartTooltipProps {
|
|
649
|
+
/** Time at the active hover position (unix-ms). */
|
|
650
|
+
t: number;
|
|
651
|
+
/** Bar index in the candle series (0-based). */
|
|
652
|
+
idx: number;
|
|
653
|
+
/** Open / High / Low / Close at the hover bar. For Heikin-Ashi mode
|
|
654
|
+
* these are the HA-transformed values (what the chart is actually
|
|
655
|
+
* rendering); the tooltip stays consistent with what's on screen. */
|
|
656
|
+
o: number;
|
|
657
|
+
h: number;
|
|
658
|
+
l: number;
|
|
659
|
+
c: number;
|
|
660
|
+
/** Direction at hover - `'up'` if `c >= o`, `'down'` if `c < o`,
|
|
661
|
+
* `'doji'` if the body collapsed below the floor and rendered with
|
|
662
|
+
* `palette.doji`. */
|
|
663
|
+
direction: CandleDirection;
|
|
664
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
665
|
+
pointerX: number;
|
|
666
|
+
pointerY: number;
|
|
667
|
+
/** Container dimensions for placement decisions. */
|
|
668
|
+
containerWidth: number;
|
|
669
|
+
containerHeight: number;
|
|
670
|
+
theme: Theme;
|
|
671
|
+
palette: Palette;
|
|
672
|
+
locale: string;
|
|
673
|
+
timeZone: string | undefined;
|
|
674
|
+
formatter: ChartFormatter;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** Direction signal for the OHLC bar at hover. `'doji'` when the
|
|
678
|
+
* source-data |O−C| would render below `dojiMinBodyHeight` and the chart
|
|
679
|
+
* is showing the doji floor in `palette.doji`. */
|
|
680
|
+
export declare type CandleDirection = "up" | "down" | "doji";
|
|
681
|
+
|
|
682
|
+
declare class CandleSeries {
|
|
683
|
+
#private;
|
|
684
|
+
readonly times: Float64Array;
|
|
685
|
+
readonly opens: Float64Array;
|
|
686
|
+
readonly highs: Float64Array;
|
|
687
|
+
readonly lows: Float64Array;
|
|
688
|
+
readonly closes: Float64Array;
|
|
689
|
+
readonly volumes: Float64Array | null;
|
|
690
|
+
readonly length: number;
|
|
691
|
+
constructor(times: Float64Array, opens: Float64Array, highs: Float64Array, lows: Float64Array, closes: Float64Array, volumes: Float64Array | null);
|
|
692
|
+
get revisionId(): number;
|
|
693
|
+
bumpRevision(): number;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export declare type CandleSeriesInput = {
|
|
697
|
+
candles: readonly Candle[];
|
|
698
|
+
} | BinaryCandleSeriesInput;
|
|
699
|
+
|
|
700
|
+
/** Polymorphic prop:
|
|
701
|
+
* `undefined | true` - built-in amber pill with pause icon
|
|
702
|
+
* `false` - no banner (overrides staleVisualization)
|
|
703
|
+
* function - custom HTML component (lib positions it top-center). */
|
|
704
|
+
declare type CandleStaleBannerProp = boolean | ((props: CandleStaleBannerRenderProps) => React_2.ReactNode);
|
|
705
|
+
|
|
706
|
+
declare interface CandleStaleBannerRenderProps {
|
|
707
|
+
state: LiveState;
|
|
708
|
+
liveSince: number | undefined;
|
|
709
|
+
theme: Theme;
|
|
710
|
+
palette: Palette;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** `solid` (Japanese candle), `heikin-ashi`
|
|
714
|
+
* (smoothed via per-bar transform), `ohlc-bars` (Western tick bar). */
|
|
715
|
+
export declare type CandleType = "solid" | "heikin-ashi" | "ohlc-bars";
|
|
716
|
+
|
|
717
|
+
declare class ChartFormatter {
|
|
718
|
+
private readonly opt;
|
|
719
|
+
private readonly resolvedAbbrev;
|
|
720
|
+
private readonly intlCache;
|
|
721
|
+
private readonly dateFmt;
|
|
722
|
+
private readonly timeFmt;
|
|
723
|
+
constructor(opt: ChartFormatterOptions);
|
|
724
|
+
private intlFor;
|
|
725
|
+
formatNumber(n: number, decimalsOverride?: number): string;
|
|
726
|
+
formatPrice(n: number, decimalsOverride?: number): string;
|
|
727
|
+
formatPercent(fraction: number, precisionOverride?: number): string;
|
|
728
|
+
formatDate(t: number): string;
|
|
729
|
+
formatTime(t: number): string;
|
|
730
|
+
private buildDateFmt;
|
|
731
|
+
private buildTimeFmt;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
declare interface ChartFormatterOptions {
|
|
735
|
+
readonly locale: ResolvedLocale;
|
|
736
|
+
readonly digitGrouping: DigitGrouping;
|
|
737
|
+
readonly numberAbbreviation: NumberAbbreviation;
|
|
738
|
+
readonly decimalPlaces: DecimalPlaces;
|
|
739
|
+
readonly currency: string;
|
|
740
|
+
readonly currencyDisplay: CurrencyDisplay;
|
|
741
|
+
readonly percentPrecision: PercentPrecision;
|
|
742
|
+
readonly dateFormat: DateFormat;
|
|
743
|
+
readonly timeFormat: TimeFormat;
|
|
744
|
+
readonly timeZone?: string | undefined;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export declare function ChartsProvider(props: ChartsProviderProps): React_2.ReactElement;
|
|
748
|
+
|
|
749
|
+
export declare interface ChartsProviderProps {
|
|
750
|
+
theme?: ThemeInput;
|
|
751
|
+
palette?: string;
|
|
752
|
+
locale?: string;
|
|
753
|
+
timeZone?: string;
|
|
754
|
+
visualStyle?: VisualStyle;
|
|
755
|
+
outlineFillColor?: "auto" | string;
|
|
756
|
+
outlineFillOpacity?: number;
|
|
757
|
+
cornerRadius?: number;
|
|
758
|
+
borderWidth?: number;
|
|
759
|
+
accents?: boolean;
|
|
760
|
+
osTheme?: Theme;
|
|
761
|
+
appTheme?: Theme;
|
|
762
|
+
/** Host-supplied custom palettes. Each gets
|
|
763
|
+
* registered into the global palette registry on mount; downstream
|
|
764
|
+
* charts can reference them by name via the `palette` prop. */
|
|
765
|
+
palettes?: readonly Palette[];
|
|
766
|
+
children?: React_2.ReactNode;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/** Concatenate two ingested `CandleSeries` (history first, visible
|
|
770
|
+
* second). Re-runs ingestion on the combined typed arrays so the
|
|
771
|
+
* result is validated as a single monotonic series (catches
|
|
772
|
+
* history that overlaps the visible window via duplicate / out-of-
|
|
773
|
+
* order timestamps).
|
|
774
|
+
*
|
|
775
|
+
* When the history series is empty, returns the visible unchanged
|
|
776
|
+
* (zero-allocation fast path). */
|
|
777
|
+
export declare function concatCandleSeries(history: CandleSeries, visible: CandleSeries): CandleSeries;
|
|
778
|
+
|
|
779
|
+
/** Concatenate two ingested `LineSeries`. Same contract as
|
|
780
|
+
* `concatCandleSeries`. */
|
|
781
|
+
export declare function concatLineSeries(history: LineSeries, visible: LineSeries): LineSeries;
|
|
782
|
+
|
|
783
|
+
/** Connection-indicator modes. */
|
|
784
|
+
export declare type ConnectionIndicator = "off" | "dot" | "pill";
|
|
785
|
+
|
|
786
|
+
/** Polymorphic prop:
|
|
787
|
+
* `'off' | 'dot' | 'pill'` - built-in canvas badge
|
|
788
|
+
* function - custom HTML component, lib positions it. */
|
|
789
|
+
declare type ConnectionIndicatorProp = ConnectionIndicator | ((props: ConnectionIndicatorRenderProps) => React_2.ReactNode);
|
|
790
|
+
|
|
791
|
+
/** Props passed to a custom connection-indicator render-prop. Framework-
|
|
792
|
+
* agnostic data shape - the React adapter renders this via a function
|
|
793
|
+
* returning `React.ReactNode`; the Solid adapter via `JSX.Element`; the
|
|
794
|
+
* controller widens to `unknown`. */
|
|
795
|
+
declare interface ConnectionIndicatorRenderProps {
|
|
796
|
+
state: LiveState;
|
|
797
|
+
liveSince: number | undefined;
|
|
798
|
+
position: LegendPosition;
|
|
799
|
+
theme: Theme;
|
|
800
|
+
palette: Palette;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
declare type CrosshairMarker = "none" | "circle" | "square";
|
|
804
|
+
|
|
805
|
+
export declare type CrosshairMode = "follow" | "sticky";
|
|
806
|
+
|
|
807
|
+
export declare type CrosshairSnap = "free" | "x-axis" | "data";
|
|
808
|
+
|
|
809
|
+
declare type CurrencyDisplay = "none" | "symbol" | "code";
|
|
810
|
+
|
|
811
|
+
declare type CurveType = CurveTypeName | CurveTypeConfig;
|
|
812
|
+
|
|
813
|
+
declare interface CurveTypeConfig {
|
|
814
|
+
readonly type: CurveTypeName;
|
|
815
|
+
/** 0–1 - only honored for `cardinal`. Default 0. Higher = looser curve. */
|
|
816
|
+
readonly tension?: number;
|
|
817
|
+
/** 0–1 - only honored for `catmull-rom`. Default 0.5 (centripetal). */
|
|
818
|
+
readonly alpha?: number;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
declare type CurveTypeName = "linear" | "monotone" | "monotone-x" | "monotone-y" | "step" | "step-before" | "step-after" | "bump" | "bump-x" | "bump-y" | "natural" | "basis" | "cardinal" | "catmull-rom";
|
|
822
|
+
|
|
823
|
+
export declare class DataValidationError extends Error {
|
|
824
|
+
readonly name = "DataValidationError";
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
declare type DateFormat = "auto" | "short" | "medium" | "iso";
|
|
828
|
+
|
|
829
|
+
declare type DecimalPlaces = "auto" | number;
|
|
830
|
+
|
|
831
|
+
export declare function DefaultCandleTooltip(props: CandleChartTooltipProps): React_2.ReactElement;
|
|
832
|
+
|
|
833
|
+
export declare function DefaultTooltip(props: LineChartTooltipProps): React_2.ReactElement;
|
|
834
|
+
|
|
835
|
+
export declare function DefaultVolumeBarTooltip(props: VolumeBarTooltipProps): React_2.ReactElement;
|
|
836
|
+
|
|
837
|
+
export declare function deriveLiveState(input: LiveStateInput): LiveState;
|
|
838
|
+
|
|
839
|
+
declare type DigitGrouping = "international" | "lakh-crore" | "none";
|
|
840
|
+
|
|
841
|
+
export declare interface Drawing {
|
|
842
|
+
readonly id: string;
|
|
843
|
+
readonly type: DrawingType;
|
|
844
|
+
/** Anchors in data coordinates. Cardinality varies by type:
|
|
845
|
+
* - 1: horizontal-line (y), vertical-line (t)
|
|
846
|
+
* - 2: trend-line, rectangle, ellipse, arrow, text (single anchor
|
|
847
|
+
* point + style.text), fib-retracement, fib-extension, brush
|
|
848
|
+
* - 3: pitchfork, channel
|
|
849
|
+
* Validation is host-side at construction; the chart trusts the
|
|
850
|
+
* cardinality for the type it sees. */
|
|
851
|
+
readonly anchors: readonly Anchor[];
|
|
852
|
+
readonly style: DrawingStyle;
|
|
853
|
+
/** Optional metadata for host bookkeeping; not used by the chart. */
|
|
854
|
+
readonly meta?: Record<string, unknown>;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export declare interface DrawingStyle {
|
|
858
|
+
/** Stroke / fill base color (resolved CSS string OR `'auto'` to use
|
|
859
|
+
* the active palette's `drawings.stroke` slot). */
|
|
860
|
+
color?: string | "auto";
|
|
861
|
+
lineWidth?: number;
|
|
862
|
+
lineStyle?: "solid" | "dashed" | "dotted";
|
|
863
|
+
fillOpacity?: number;
|
|
864
|
+
/** Trend-line + arrow only - bool toggles arrowhead at the second
|
|
865
|
+
* anchor. */
|
|
866
|
+
arrowhead?: boolean;
|
|
867
|
+
/** Text-drawing only. */
|
|
868
|
+
text?: string;
|
|
869
|
+
fontSize?: number;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export declare type DrawingType = "trend-line" | "horizontal-line" | "vertical-line" | "rectangle" | "ellipse" | "arrow" | "text" | "fib-retracement" | "fib-extension" | "pitchfork" | "channel" | "brush";
|
|
873
|
+
|
|
874
|
+
export declare type EventKind = "earnings" | "dividend" | "split" | "news";
|
|
875
|
+
|
|
876
|
+
export declare interface EventMarker {
|
|
877
|
+
t: number;
|
|
878
|
+
kind: EventKind;
|
|
879
|
+
/** Short label (1-2 chars) for the glyph mode. */
|
|
880
|
+
glyph?: string;
|
|
881
|
+
/** Full title for the banner mode. */
|
|
882
|
+
title?: string;
|
|
883
|
+
meta?: Record<string, unknown>;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
declare type EventMarkerMode = "off" | "glyph-axis" | "vertical-line" | "banner-strip";
|
|
887
|
+
|
|
888
|
+
declare interface EventTooltipProps {
|
|
889
|
+
marker: EventMarker;
|
|
890
|
+
pointerX: number;
|
|
891
|
+
pointerY: number;
|
|
892
|
+
formatter: ChartFormatter;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/** Polymorphic tooltip prop for visible-window high / low pill hover.
|
|
896
|
+
*
|
|
897
|
+
* - `true` (default) - built-in `<DefaultExtremeTooltip>`.
|
|
898
|
+
* - `false` - no tooltip on H/L pill hover.
|
|
899
|
+
* - function - render-prop receiving `ExtremeTooltipProps`. */
|
|
900
|
+
export declare type ExtremeTooltipProp = boolean | ((props: ExtremeTooltipProps) => React_2.ReactNode);
|
|
901
|
+
|
|
902
|
+
/** Props passed to a custom extreme-tooltip render function (H/L pill hover).
|
|
903
|
+
* Framework-agnostic data shape - same in both React and Solid. */
|
|
904
|
+
export declare interface ExtremeTooltipProps {
|
|
905
|
+
kind: "high" | "low";
|
|
906
|
+
/** Bar index in the source series. */
|
|
907
|
+
barIdx: number;
|
|
908
|
+
price: number;
|
|
909
|
+
/** Time at the extreme bar (unix-ms). */
|
|
910
|
+
t: number;
|
|
911
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
912
|
+
pointerX: number;
|
|
913
|
+
pointerY: number;
|
|
914
|
+
containerWidth: number;
|
|
915
|
+
containerHeight: number;
|
|
916
|
+
theme: Theme;
|
|
917
|
+
palette: Palette;
|
|
918
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
919
|
+
locale: string;
|
|
920
|
+
timeZone: string | undefined;
|
|
921
|
+
formatter: ChartFormatter;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/** Standard fib extension levels. */
|
|
925
|
+
export declare const FIB_EXTENSION_LEVELS: readonly [1, 1.272, 1.414, 1.618, 2, 2.618];
|
|
926
|
+
|
|
927
|
+
/** Standard fib retracement levels. */
|
|
928
|
+
export declare const FIB_RETRACEMENT_LEVELS: readonly [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1];
|
|
929
|
+
|
|
930
|
+
/** `'auto'` (default) = each mark glows in its own direction color
|
|
931
|
+
* (`up`/`down`/`doji` from the palette). A literal color (any CSS-color
|
|
932
|
+
* string, hex, or `oklch(...)`) overrides for uniform brand glow. */
|
|
933
|
+
declare type GlowColorInput = "auto" | string;
|
|
934
|
+
|
|
935
|
+
/** Host-supplied input. Named presets resolve to fixed strengths; numeric
|
|
936
|
+
* values clamp to `[0, 1]`. */
|
|
937
|
+
declare type GlowInput = GlowPreset | number;
|
|
938
|
+
|
|
939
|
+
declare type GlowPreset = "off" | "subtle" | "standard" | "intense";
|
|
940
|
+
|
|
941
|
+
declare type GridStyle = "solid" | "dashed" | "dotted";
|
|
942
|
+
|
|
943
|
+
/** Marker mode for the visible-window high / low. */
|
|
944
|
+
export declare type HighLowMarkers = "off" | "lines+labels" | "labels-only";
|
|
945
|
+
|
|
946
|
+
export declare type IndicatorLineStyle = "solid" | "dashed" | "dotted";
|
|
947
|
+
|
|
948
|
+
declare interface IndicatorPaneCommon {
|
|
949
|
+
/** `'auto'` resolves from `palette.indicators.<type>` at draw time. */
|
|
950
|
+
color?: "auto" | string;
|
|
951
|
+
/** Overrides global `indicatorLineWidth`. */
|
|
952
|
+
lineWidth?: number;
|
|
953
|
+
/** Overrides global `indicatorLineStyle`. */
|
|
954
|
+
lineStyle?: IndicatorLineStyle;
|
|
955
|
+
/** Overrides global `indicatorOpacity`. */
|
|
956
|
+
opacity?: number;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export declare type IndicatorPaneSpec = RsiSpecInput | MacdSpecInput | StochasticSpecInput | AtrSpecInput;
|
|
960
|
+
|
|
961
|
+
export declare function isValidDrawing(d: Drawing): boolean;
|
|
962
|
+
|
|
963
|
+
export declare interface LabelConfig {
|
|
964
|
+
position?: ValueLabelPosition;
|
|
965
|
+
format?: "auto" | ((value: number) => string);
|
|
966
|
+
/** `'auto'` picks high-contrast based on fill (white on Fill mode,
|
|
967
|
+
* theme primary text on Outline mode). Hex / rgba string overrides. */
|
|
968
|
+
color?: "auto" | string;
|
|
969
|
+
fontSize?: number;
|
|
970
|
+
fontWeight?: number | "normal" | "bold";
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
export declare type LastPriceLineStyle = "off" | "solid" | "dashed" | "dotted";
|
|
974
|
+
|
|
975
|
+
/** Corner anchor for the legend. */
|
|
976
|
+
export declare type LegendPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
977
|
+
|
|
978
|
+
/** Legend visibility. */
|
|
979
|
+
declare type LegendVisibility = "always" | "on-hover" | "off";
|
|
980
|
+
|
|
981
|
+
export declare const LineChart: React_2.ForwardRefExoticComponent<LineChartProps & React_2.RefAttributes<LineChartHandle>>;
|
|
982
|
+
|
|
983
|
+
/** Framework-agnostic LineChart prop shape. Excludes the four render-prop
|
|
984
|
+
* fields (`tooltip`, `extremeTooltip`, `connectionIndicator`, `staleBanner`)
|
|
985
|
+
* that each framework adapter retypes against its native JSX element type
|
|
986
|
+
* (`React.ReactNode` for React, `JSX.Element` for Solid). The controller's
|
|
987
|
+
* `LineChartControllerProps` extends this with `unknown`-returning render
|
|
988
|
+
* props so both adapters' shapes are structurally assignable via covariance. */
|
|
989
|
+
declare interface LineChartBaseProps {
|
|
990
|
+
/** Primary series data - either structured (`{ points: Array<{t, value}> }`)
|
|
991
|
+
* or binary (`{ times: Float64Array; values: Float64Array }`). The
|
|
992
|
+
* binary path is zero-copy. Mutually exclusive with `series` for
|
|
993
|
+
* multi-series charts. */
|
|
994
|
+
data?: LineSeriesInput;
|
|
995
|
+
/** Older data prepended to `data` for indicator warm-up. Lets indicators
|
|
996
|
+
* (SMA/EMA/etc.) have priors so the visible window starts post-warmup
|
|
997
|
+
* with non-NaN values. Same shape as `data`. */
|
|
998
|
+
historyData?: LineSeriesInput;
|
|
999
|
+
/** Multi-series mode - overrides `data`. Each entry has its own id,
|
|
1000
|
+
* label, color, and `LineSeriesInput`. The first entry is the primary
|
|
1001
|
+
* series; subsequent entries draw as secondary lines. */
|
|
1002
|
+
series?: readonly SeriesConfig[];
|
|
1003
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
1004
|
+
width?: number;
|
|
1005
|
+
/** Chart height in CSS pixels. Default 300. */
|
|
1006
|
+
height?: number;
|
|
1007
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"` (follows
|
|
1008
|
+
* parent provider). Default: inherits from `<ChartsProvider>`. */
|
|
1009
|
+
theme?: ThemeInput;
|
|
1010
|
+
/** Palette name registered in the provider (e.g. `"Monochrome"`,
|
|
1011
|
+
* `"Classic"`, `"Accessible"`). Default: inherits from provider. */
|
|
1012
|
+
palette?: string;
|
|
1013
|
+
/** `"Fill"` (default) = solid up/down body fills. `"Outline"` =
|
|
1014
|
+
* colored border + translucent body fill. */
|
|
1015
|
+
visualStyle?: "Fill" | "Outline";
|
|
1016
|
+
/** In Outline mode, the fill color inside the outlined body.
|
|
1017
|
+
* `"auto"` (default) uses chart background. */
|
|
1018
|
+
outlineFillColor?: "auto" | string;
|
|
1019
|
+
/** In Outline mode, alpha of the outline body fill (0–100). Default 15. */
|
|
1020
|
+
outlineFillOpacity?: number;
|
|
1021
|
+
/** Cap the DPR used for canvas backing-store sizing (1–2 typical).
|
|
1022
|
+
* Reduces memory on hi-DPR screens with marginal sharpness loss.
|
|
1023
|
+
* Default 2. */
|
|
1024
|
+
pixelDensityCap?: number;
|
|
1025
|
+
/** Skip cosmetic features (glow, animations, full DPR) for low-end
|
|
1026
|
+
* devices. Adaptive complexity auto-engages this when fps drops. */
|
|
1027
|
+
fastMode?: boolean;
|
|
1028
|
+
/** Force sparkline mode - minimal axis-less render. Auto-engaged
|
|
1029
|
+
* when `width < 150`. */
|
|
1030
|
+
sparkline?: boolean;
|
|
1031
|
+
/** Override the auto-generated `aria-label` attached to the chart
|
|
1032
|
+
* container. Default summarizes data length + type. */
|
|
1033
|
+
ariaLabel?: string;
|
|
1034
|
+
/** When `true` (default) and the dynamic
|
|
1035
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
1036
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
1037
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
1038
|
+
partialRepaints?: boolean;
|
|
1039
|
+
/** Time-axis mode per the engine boundary.
|
|
1040
|
+
* - `"wall-clock"` (default) - engine's `TimeAxis.wallClock`. Bars
|
|
1041
|
+
* are positioned at their actual unix-ms; off-hours / weekends
|
|
1042
|
+
* leave horizontal gaps.
|
|
1043
|
+
* - `"session-ordinal"` - engine's `TimeAxis.sessionOrdinal` for the
|
|
1044
|
+
* supplied market. Off-session time is collapsed; bars sit
|
|
1045
|
+
* continuously without overnight / weekend gaps. Required for
|
|
1046
|
+
* equity charts (regular session 9:30-16:00, weekdays only). */
|
|
1047
|
+
timeAxisMode?: "wall-clock" | "session-ordinal";
|
|
1048
|
+
/** Market spec for session-ordinal mode. Ignored when `timeAxisMode`
|
|
1049
|
+
* is `"wall-clock"` (the default). */
|
|
1050
|
+
market?: "equity" | "dst-equity" | "crypto-24-7";
|
|
1051
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
1052
|
+
axisVisible?: boolean;
|
|
1053
|
+
/** `"left"` (default) or `"right"`. */
|
|
1054
|
+
yAxisPosition?: YAxisPosition;
|
|
1055
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
1056
|
+
xAxisPosition?: XAxisPosition;
|
|
1057
|
+
/** Fractional padding above/below the y-data range so marks don't
|
|
1058
|
+
* touch the axis edges. Default 0.05 (5%). */
|
|
1059
|
+
yAxisPadding?: number;
|
|
1060
|
+
/** Toggle gridlines. Default `true`. */
|
|
1061
|
+
gridVisible?: boolean;
|
|
1062
|
+
/** Gridline style: `"solid"` / `"dashed"` / `"dotted"`. Default `"solid"`. */
|
|
1063
|
+
gridStyle?: GridStyle;
|
|
1064
|
+
/** Number of gridline ticks - `"sparse"` (~3) / `"normal"` (~5) /
|
|
1065
|
+
* `"dense"` (~8). Default `"normal"`. */
|
|
1066
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
1067
|
+
/** Use the palette's `accentTint` for axis + grid colors instead of
|
|
1068
|
+
* `neutral`. Default `false`. */
|
|
1069
|
+
accents?: boolean;
|
|
1070
|
+
/** Locale code for number/date formatting (e.g. `"USA"`, `"en-US"`).
|
|
1071
|
+
* Default: inherits from provider. */
|
|
1072
|
+
locale?: string;
|
|
1073
|
+
/** IANA time zone for date formatting (e.g. `"America/New_York"`).
|
|
1074
|
+
* Default: inherits from provider. */
|
|
1075
|
+
timeZone?: string;
|
|
1076
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
1077
|
+
crosshairVisible?: boolean;
|
|
1078
|
+
/** How the crosshair snaps to data: `"data"` snaps to nearest data
|
|
1079
|
+
* point, `"free"` follows pointer exactly. Default `"data"`. */
|
|
1080
|
+
crosshairSnap?: CrosshairSnap;
|
|
1081
|
+
/** Crosshair line span: `"horizontal"`, `"vertical"`, or `"both"`. */
|
|
1082
|
+
crosshairMode?: CrosshairMode;
|
|
1083
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
1084
|
+
crosshairLineStyle?: GridStyle;
|
|
1085
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"`
|
|
1086
|
+
* / `"none"`. */
|
|
1087
|
+
crosshairMarker?: CrosshairMarker;
|
|
1088
|
+
indicators?: readonly LineChartIndicatorSpec[];
|
|
1089
|
+
digitGrouping?: DigitGrouping;
|
|
1090
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1091
|
+
/** Decimal-place rule for price labels. Default 2. */
|
|
1092
|
+
decimalPlaces?: DecimalPlaces;
|
|
1093
|
+
/** ISO currency code (e.g. `"USD"`, `"EUR"`) for currency-formatted
|
|
1094
|
+
* labels. Default: inherit from provider locale. */
|
|
1095
|
+
currency?: string;
|
|
1096
|
+
/** `"symbol"` (default), `"code"`, or `"narrowSymbol"`. */
|
|
1097
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1098
|
+
/** Precision for percentage-style labels. */
|
|
1099
|
+
percentPrecision?: PercentPrecision;
|
|
1100
|
+
/** Date format rule for time-axis labels (`"short"`, `"medium"`,
|
|
1101
|
+
* `"long"`). */
|
|
1102
|
+
dateFormat?: DateFormat;
|
|
1103
|
+
/** Time format rule for intraday tick labels. */
|
|
1104
|
+
timeFormat?: TimeFormat;
|
|
1105
|
+
/** Style of the last-price horizontal reference line: `"solid"` /
|
|
1106
|
+
* `"dashed"` / `"dotted"` / `false` to hide. Default `"solid"`. */
|
|
1107
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
1108
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
1109
|
+
lastPriceLabel?: boolean;
|
|
1110
|
+
/** Override the chart background color (CSS). Default: theme-derived. */
|
|
1111
|
+
chartBgColor?: string;
|
|
1112
|
+
/** Show high + low markers on the visible data range:
|
|
1113
|
+
* `"lines+labels"` (default), `"labels"`, `"off"`. */
|
|
1114
|
+
highLowMarkers?: HighLowMarkers;
|
|
1115
|
+
/** Live-bar animation: `"glow"` / `"dot"` / `"pulse-bar"` / `"none"`. */
|
|
1116
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
1117
|
+
/** Anchor for the connection-indicator badge + legend overlay:
|
|
1118
|
+
* `"top-left"` (default), `"top-right"`, `"bottom-left"`,
|
|
1119
|
+
* `"bottom-right"`. */
|
|
1120
|
+
legendPosition?: LegendPosition;
|
|
1121
|
+
/** Legend visibility: `"on"` (default), `"off"`, `"on-hover"`. */
|
|
1122
|
+
legend?: LegendVisibility;
|
|
1123
|
+
/** Visual treatment for stale connection state: `"banner"`,
|
|
1124
|
+
* `"desaturate-pulse"`, `"desaturate-pulse + banner"`, `"off"`. */
|
|
1125
|
+
staleVisualization?: StaleVisualization;
|
|
1126
|
+
/** Unix-ms timestamp of the latest accepted tick. Used to drive
|
|
1127
|
+
* the live/stale state machine + auto-stale timeout. */
|
|
1128
|
+
liveSince?: number;
|
|
1129
|
+
/** Host-asserted connection state - overrides `liveSince`-derived
|
|
1130
|
+
* state when present. `"live"` / `"stale"` / `"disconnected"`. */
|
|
1131
|
+
connectionState?: LiveState;
|
|
1132
|
+
/** Milliseconds after the last `liveSince` tick before the chart
|
|
1133
|
+
* auto-transitions to `"stale"`. Default 5000. */
|
|
1134
|
+
staleThreshold?: number;
|
|
1135
|
+
/** Host-forced reduced-motion override. When unset the chart reads
|
|
1136
|
+
* the user's `prefers-reduced-motion` media query. */
|
|
1137
|
+
reducedMotion?: boolean;
|
|
1138
|
+
/** Curve interpolation between points: `"linear"`, `"monotone"`,
|
|
1139
|
+
* `"step"`, `"step-before"`, `"step-after"`, `"basis"`, `"natural"`,
|
|
1140
|
+
* `"bump"`, or a parameterized form. Default `"linear"`. */
|
|
1141
|
+
curveType?: CurveType;
|
|
1142
|
+
/** When `curveType` is a `"step-*"` variant, radius (CSS px) for
|
|
1143
|
+
* rounded step corners. `0` (default) = square. */
|
|
1144
|
+
stepEdgeRadius?: number;
|
|
1145
|
+
/** Series stroke width in CSS px. Default 2. */
|
|
1146
|
+
lineWidth?: number;
|
|
1147
|
+
/** Dash pattern: `"solid"`, `"dashed"`, `"dotted"`. */
|
|
1148
|
+
lineDash?: LineDash;
|
|
1149
|
+
/** Multiplier for the dash gap when `lineDash !== "solid"`. */
|
|
1150
|
+
lineDashSpacing?: number;
|
|
1151
|
+
/** Per-point markers along the line: `"circle"`, `"diamond"`,
|
|
1152
|
+
* `"square"`, `"off"`. */
|
|
1153
|
+
pointMarkers?: PointMarkers;
|
|
1154
|
+
/** Area-fill config - when set, renders a filled polygon between the
|
|
1155
|
+
* line and a horizontal baseline. Switches the chart to AreaChart
|
|
1156
|
+
* visuals. See `AreaFillConfig` for full options. */
|
|
1157
|
+
areaFill?: AreaFillConfig;
|
|
1158
|
+
/** Direction-colored aura behind marks. */
|
|
1159
|
+
glow?: GlowInput;
|
|
1160
|
+
/** `'auto'` = direction-colored from palette;
|
|
1161
|
+
* literal color = uniform glow regardless of direction. */
|
|
1162
|
+
glowColor?: GlowColorInput;
|
|
1163
|
+
/** Pattern fills. */
|
|
1164
|
+
pattern?: PatternInput;
|
|
1165
|
+
patternScale?: number;
|
|
1166
|
+
patternColor?: PatternColorInput;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/** Imperative handle exposed via `ref` on `<LineChart>`. Lets the host
|
|
1170
|
+
* push live-tick updates without re-rendering the React tree.
|
|
1171
|
+
* Binary Data Ingestion: primitive args. */
|
|
1172
|
+
declare interface LineChartHandle {
|
|
1173
|
+
/** Append a live tick (time ms, price). `size` is accepted for API
|
|
1174
|
+
* parity with CandleChart but is unused for line charts. */
|
|
1175
|
+
onTick(time: number, price: number, size?: number): void;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/** Indicator overlays that LineChart can render on the price pane. VWAP
|
|
1179
|
+
* needs OHLC + volume + session_starts and is only available on
|
|
1180
|
+
* CandleChart. */
|
|
1181
|
+
export declare type LineChartIndicatorSpec = {
|
|
1182
|
+
type: "sma";
|
|
1183
|
+
period: number;
|
|
1184
|
+
color?: string;
|
|
1185
|
+
} | {
|
|
1186
|
+
type: "ema";
|
|
1187
|
+
period: number;
|
|
1188
|
+
color?: string;
|
|
1189
|
+
} | {
|
|
1190
|
+
type: "wma";
|
|
1191
|
+
period: number;
|
|
1192
|
+
color?: string;
|
|
1193
|
+
} | {
|
|
1194
|
+
type: "bollinger";
|
|
1195
|
+
period: number;
|
|
1196
|
+
multiplier: number;
|
|
1197
|
+
color?: string;
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
/** React LineChart prop shape. Extends the framework-agnostic
|
|
1201
|
+
* `LineChartBaseProps` (in `charts/line-chart-helpers.ts`) with the four
|
|
1202
|
+
* React-specific render-prop fields whose return type is `React.ReactNode`.
|
|
1203
|
+
* See `LineChartControllerProps` for the controller's `unknown`-returning
|
|
1204
|
+
* variant of the same shape. */
|
|
1205
|
+
export declare interface LineChartProps extends LineChartBaseProps {
|
|
1206
|
+
tooltip?: LineChartTooltipProp;
|
|
1207
|
+
extremeTooltip?: ExtremeTooltipProp;
|
|
1208
|
+
connectionIndicator?: ConnectionIndicatorProp;
|
|
1209
|
+
staleBanner?: StaleBannerProp;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Polymorphic tooltip prop:
|
|
1214
|
+
* false - no tooltip
|
|
1215
|
+
* true / undefined - DefaultTooltip with theme-aware styling
|
|
1216
|
+
* function - custom render-prop, called with LineChartTooltipProps
|
|
1217
|
+
*/
|
|
1218
|
+
export declare type LineChartTooltipProp = boolean | ((props: LineChartTooltipProps) => React_2.ReactNode);
|
|
1219
|
+
|
|
1220
|
+
/** Props passed to a custom LineChart tooltip render function (and to the
|
|
1221
|
+
* built-in `DefaultTooltip` in both React and Solid). Framework-agnostic
|
|
1222
|
+
* data shape. */
|
|
1223
|
+
export declare interface LineChartTooltipProps {
|
|
1224
|
+
/** Time at the active hover position (unix-ms). */
|
|
1225
|
+
t: number;
|
|
1226
|
+
/** Value at the active hover position (primary series only). */
|
|
1227
|
+
value: number;
|
|
1228
|
+
/** Bar index in the source series; -1 when free-snap. */
|
|
1229
|
+
idx: number;
|
|
1230
|
+
/** Per-series values at hover.t - primary first, then secondaries. */
|
|
1231
|
+
seriesValues: readonly TooltipSeriesValue[];
|
|
1232
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
1233
|
+
pointerX: number;
|
|
1234
|
+
pointerY: number;
|
|
1235
|
+
/** Container dimensions for placement decisions. */
|
|
1236
|
+
containerWidth: number;
|
|
1237
|
+
containerHeight: number;
|
|
1238
|
+
/** Resolved theme + palette for color matching. */
|
|
1239
|
+
theme: Theme;
|
|
1240
|
+
palette: Palette;
|
|
1241
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
1242
|
+
locale: string;
|
|
1243
|
+
timeZone: string | undefined;
|
|
1244
|
+
/** Per-chart formatter - preferred over `locale` for new tooltip code. */
|
|
1245
|
+
formatter: ChartFormatter;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
declare type LineDash = "solid" | "dashed" | "dotted" | readonly number[];
|
|
1249
|
+
|
|
1250
|
+
export declare interface LinePoint {
|
|
1251
|
+
t: number;
|
|
1252
|
+
value: number;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
declare class LineSeries {
|
|
1256
|
+
#private;
|
|
1257
|
+
readonly times: Float64Array;
|
|
1258
|
+
readonly values: Float64Array;
|
|
1259
|
+
readonly length: number;
|
|
1260
|
+
constructor(times: Float64Array, values: Float64Array);
|
|
1261
|
+
get revisionId(): number;
|
|
1262
|
+
bumpRevision(): number;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
export declare type LineSeriesInput = {
|
|
1266
|
+
points: readonly LinePoint[];
|
|
1267
|
+
} | {
|
|
1268
|
+
times: Float64Array;
|
|
1269
|
+
values: Float64Array;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
declare type Listener = () => void;
|
|
1273
|
+
|
|
1274
|
+
export declare function listPalettes(): readonly string[];
|
|
1275
|
+
|
|
1276
|
+
/** Live-bar indicator modes. */
|
|
1277
|
+
export declare type LiveBarIndicator = "none" | "dot" | "badge" | "glow" | "outline" | "pulse-bar";
|
|
1278
|
+
|
|
1279
|
+
export declare type LiveState = "live" | "stale" | "disconnected";
|
|
1280
|
+
|
|
1281
|
+
declare interface LiveStateInput {
|
|
1282
|
+
/** Explicit override from host. When set, wins over auto-detection. */
|
|
1283
|
+
readonly connectionState?: LiveState | undefined;
|
|
1284
|
+
/** ms timestamp of the last successful tick. Undefined → no signal. */
|
|
1285
|
+
readonly liveSince?: number | undefined;
|
|
1286
|
+
/** ms; 0 disables auto-detection. */
|
|
1287
|
+
readonly staleThreshold: number;
|
|
1288
|
+
/** ms; clock used for the freshness comparison. Pure → injectable. */
|
|
1289
|
+
readonly now: number;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
declare interface MacdSpecInput extends IndicatorPaneCommon {
|
|
1293
|
+
type: "macd";
|
|
1294
|
+
fastPeriod?: number;
|
|
1295
|
+
slowPeriod?: number;
|
|
1296
|
+
signalPeriod?: number;
|
|
1297
|
+
histogramVisible?: boolean;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
declare interface MarkerConfig {
|
|
1301
|
+
style?: MarkerStyle;
|
|
1302
|
+
/** Diameter / longest side, in CSS px. Floored to `MIN_MARKER_SIZE` (1.5)
|
|
1303
|
+
* internally so markers don't disappear at extreme zoom-out. Default 5. */
|
|
1304
|
+
size?: number;
|
|
1305
|
+
/** Fill color. `'auto'` = the line's resolved color. `'none'` = no fill. */
|
|
1306
|
+
fill?: "auto" | "none" | string;
|
|
1307
|
+
/** Stroke color. `'auto'` matches `fill`. `'none'` = no stroke. */
|
|
1308
|
+
stroke?: "auto" | "none" | string;
|
|
1309
|
+
/** Stroke width in CSS px. `0` (default) = no border. */
|
|
1310
|
+
strokeWidth?: number;
|
|
1311
|
+
/** Up-arrow color when `style: 'direction'`. `'auto'` = `palette.up`. */
|
|
1312
|
+
upColor?: "auto" | string;
|
|
1313
|
+
/** Down-arrow color when `style: 'direction'`. `'auto'` = `palette.down`. */
|
|
1314
|
+
downColor?: "auto" | string;
|
|
1315
|
+
/** Custom up/down icons for `style: 'direction'`. Defaults to the built-in
|
|
1316
|
+
* chevron when `undefined`. */
|
|
1317
|
+
upIcon?: MarkerIcon;
|
|
1318
|
+
downIcon?: MarkerIcon;
|
|
1319
|
+
/** Required when `style: 'custom'`. Used for every data point. */
|
|
1320
|
+
icon?: MarkerIcon;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/** Custom-icon shapes accepted by `MarkerConfig.icon` / `upIcon` / `downIcon`.
|
|
1324
|
+
* Evaluated synchronously per draw - no async resolution, no React-component
|
|
1325
|
+
* offscreen rendering (that's a future sweep when we add
|
|
1326
|
+
* bitmap-cache infra). */
|
|
1327
|
+
declare type MarkerIcon =
|
|
1328
|
+
/** SVG path-data string (e.g. `"M-1,-1 L1,1 ..."`). Parsed to a cached
|
|
1329
|
+
* `Path2D` once per unique string at first use. */
|
|
1330
|
+
string
|
|
1331
|
+
/** Pre-built `Path2D` - used directly. */
|
|
1332
|
+
| Path2D
|
|
1333
|
+
/** Direct-draw function - called per point with translated origin.
|
|
1334
|
+
* Receives a context whose origin is at (x, y) and scaled to half-size,
|
|
1335
|
+
* so the function should draw the shape in [-1, 1] coordinates. */
|
|
1336
|
+
| ((ctx: CanvasRenderingContext2D) => void);
|
|
1337
|
+
|
|
1338
|
+
declare type MarkerStyle = "circle" | "square" | "diamond" | "triangle" | "triangle-down" | "cross" | "plus" | "star" | "direction" | "custom";
|
|
1339
|
+
|
|
1340
|
+
declare type MarketKind = "equity" | "dst-equity" | "crypto-24-7";
|
|
1341
|
+
|
|
1342
|
+
/** Fire all registered listeners. Hosts call this when the platform
|
|
1343
|
+
* signals memory pressure (e.g. iOS `didReceiveMemoryWarning` bridged
|
|
1344
|
+
* through to web, or a manual host-side throttle). The lib also calls
|
|
1345
|
+
* it internally from the visibility helper when a chart returns from
|
|
1346
|
+
* > 5 minutes of background time (TODO - wire from VisibilityGate). */
|
|
1347
|
+
export declare function notifyMemoryPressure(): void;
|
|
1348
|
+
|
|
1349
|
+
declare type NumberAbbreviation = "off" | "compact" | "lakh-crore" | "auto";
|
|
1350
|
+
|
|
1351
|
+
export declare interface Oklch {
|
|
1352
|
+
L: number;
|
|
1353
|
+
C: number;
|
|
1354
|
+
h: number;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
export declare function oklchToHex({ L, C, h }: Oklch, alpha?: number): string;
|
|
1358
|
+
|
|
1359
|
+
export declare function oklchToRgbF(o: Oklch): RgbF;
|
|
1360
|
+
|
|
1361
|
+
/** Register a callback that fires whenever `notifyMemoryPressure()` is
|
|
1362
|
+
* called. Returns an unsubscribe function. Caches register at module
|
|
1363
|
+
* load time. Order of dispatch is registration order. */
|
|
1364
|
+
export declare function onMemoryPressure(cb: Listener): () => void;
|
|
1365
|
+
|
|
1366
|
+
export declare interface OrderMarker {
|
|
1367
|
+
/** Bar t the order lives at (typically the most-recent bar). */
|
|
1368
|
+
t: number;
|
|
1369
|
+
side: OrderSide;
|
|
1370
|
+
entryPrice: number;
|
|
1371
|
+
stopLossPrice?: number;
|
|
1372
|
+
takeProfitPrice?: number;
|
|
1373
|
+
meta?: Record<string, unknown>;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
declare type OrderMarkerMode = "off" | "lines" | "arrows-only" | "lines + zone";
|
|
1377
|
+
|
|
1378
|
+
export declare type OrderSide = "buy" | "sell";
|
|
1379
|
+
|
|
1380
|
+
declare interface OrderTooltipProps {
|
|
1381
|
+
marker: OrderMarker;
|
|
1382
|
+
pointerX: number;
|
|
1383
|
+
pointerY: number;
|
|
1384
|
+
formatter: ChartFormatter;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
declare type Orientation = "vertical" | "horizontal";
|
|
1388
|
+
|
|
1389
|
+
export declare interface Palette {
|
|
1390
|
+
name: string;
|
|
1391
|
+
light: PaletteVariant;
|
|
1392
|
+
dark: PaletteVariant;
|
|
1393
|
+
tonalSymmetrySide: TonalSymmetrySide;
|
|
1394
|
+
tonalSymmetryFlipInDarkMode: boolean;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export declare class PaletteValidationError extends Error {
|
|
1398
|
+
readonly paletteName: string;
|
|
1399
|
+
readonly missingSlot: string;
|
|
1400
|
+
readonly name = "PaletteValidationError";
|
|
1401
|
+
constructor(paletteName: string, missingSlot: string);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
declare interface PaletteVariant {
|
|
1405
|
+
up: Oklch;
|
|
1406
|
+
down: Oklch;
|
|
1407
|
+
doji: Oklch;
|
|
1408
|
+
neutral: Oklch;
|
|
1409
|
+
/** Caution / amber - used for stale state (connection indicator + stale
|
|
1410
|
+
* banner). Must read as "warning" without competing with `up`/`down`. */
|
|
1411
|
+
warn: Oklch;
|
|
1412
|
+
accentTint: Oklch;
|
|
1413
|
+
categorical: readonly Oklch[];
|
|
1414
|
+
indicators: {
|
|
1415
|
+
sma: Oklch;
|
|
1416
|
+
ema: Oklch;
|
|
1417
|
+
wma: Oklch;
|
|
1418
|
+
bb: Oklch;
|
|
1419
|
+
fib: Oklch;
|
|
1420
|
+
rsi: Oklch;
|
|
1421
|
+
macd: Oklch;
|
|
1422
|
+
stochastic: Oklch;
|
|
1423
|
+
atr: Oklch;
|
|
1424
|
+
vwap: Oklch;
|
|
1425
|
+
};
|
|
1426
|
+
drawings: {
|
|
1427
|
+
stroke: Oklch;
|
|
1428
|
+
fill: Oklch;
|
|
1429
|
+
handle: Oklch;
|
|
1430
|
+
label: Oklch;
|
|
1431
|
+
};
|
|
1432
|
+
/** Optional event-kind colors. When absent,
|
|
1433
|
+
* the chart falls back to a built-in default for each kind. */
|
|
1434
|
+
events?: {
|
|
1435
|
+
earnings?: Oklch;
|
|
1436
|
+
dividend?: Oklch;
|
|
1437
|
+
split?: Oklch;
|
|
1438
|
+
news?: Oklch;
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
declare type PatternColorInput = "auto" | string;
|
|
1443
|
+
|
|
1444
|
+
/** Host-supplied input - string preset, config form, or a literal
|
|
1445
|
+
* `CanvasPattern` (full dev control). */
|
|
1446
|
+
declare type PatternInput = PatternPreset | {
|
|
1447
|
+
readonly type: PatternPreset;
|
|
1448
|
+
readonly scale?: number;
|
|
1449
|
+
readonly lineWidth?: number;
|
|
1450
|
+
readonly color?: string;
|
|
1451
|
+
} | CanvasPattern;
|
|
1452
|
+
|
|
1453
|
+
declare type PatternPreset = "solid" | "diagonal-lines" | "diagonal-lines-reverse" | "cross-hatch" | "dots" | "circles" | "grid" | "horizontal-lines" | "vertical-lines" | "plus" | "chevron" | "zigzag" | "waves" | "checkerboard" | "hexagons" | "bricks";
|
|
1454
|
+
|
|
1455
|
+
declare type PercentPrecision = "auto" | number;
|
|
1456
|
+
|
|
1457
|
+
declare type PointMarkers = boolean | MarkerConfig;
|
|
1458
|
+
|
|
1459
|
+
export declare interface PositionMarker {
|
|
1460
|
+
t: number;
|
|
1461
|
+
side: "long" | "short";
|
|
1462
|
+
entryPrice: number;
|
|
1463
|
+
/** Quantity in shares / lots - used by P&L pill calculations. */
|
|
1464
|
+
qty: number;
|
|
1465
|
+
meta?: Record<string, unknown>;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
declare type PositionMarkerMode = "off" | "line + pnl-pill" | "arrows-only";
|
|
1469
|
+
|
|
1470
|
+
declare interface PositionTooltipProps {
|
|
1471
|
+
marker: PositionMarker;
|
|
1472
|
+
/** Live last close - for P&L snapshot in the tooltip. */
|
|
1473
|
+
lastClose: number;
|
|
1474
|
+
pointerX: number;
|
|
1475
|
+
pointerY: number;
|
|
1476
|
+
formatter: ChartFormatter;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
export declare function registerPalette(palette: Palette): void;
|
|
1480
|
+
|
|
1481
|
+
export declare function resolveAnimation(input: AnimationInputs, reducedMotion: boolean): AnimationAxes;
|
|
1482
|
+
|
|
1483
|
+
declare interface ResolvedLocale {
|
|
1484
|
+
/** Uppercase ISO 3166-1 alpha-3 code. */
|
|
1485
|
+
readonly country: string;
|
|
1486
|
+
/** Platform-formatter locale for international grouping. */
|
|
1487
|
+
readonly baseLocale: string;
|
|
1488
|
+
/** Locale for lakh-crore (lakh/crore) grouping with Latin digits forced.
|
|
1489
|
+
* When undefined, the country has no native lakh-crore-grouping
|
|
1490
|
+
* locale; ChartFormatter falls back to its custom 5-line formatter
|
|
1491
|
+
* when the host opts into lakh-crore grouping. */
|
|
1492
|
+
readonly lakhCroreLocale: string | undefined;
|
|
1493
|
+
/** ISO 4217 currency code paired with this locale by default. */
|
|
1494
|
+
readonly defaultCurrency: string;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
declare interface RgbF {
|
|
1498
|
+
r: number;
|
|
1499
|
+
g: number;
|
|
1500
|
+
b: number;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
declare interface RsiSpecInput extends IndicatorPaneCommon {
|
|
1504
|
+
type: "rsi";
|
|
1505
|
+
period?: number;
|
|
1506
|
+
overbought?: number;
|
|
1507
|
+
oversold?: number;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/** Multi-series config - one entry per line on the chart.
|
|
1511
|
+
* Each entry can override the chart-level
|
|
1512
|
+
* curveType / lineWidth / lineDash / lineDashSpacing / pointMarkers for
|
|
1513
|
+
* this one series. Without a per-series `color`, lib auto-cycles
|
|
1514
|
+
* `palette.categorical[i]`. */
|
|
1515
|
+
declare interface SeriesConfig {
|
|
1516
|
+
readonly id: string;
|
|
1517
|
+
readonly data: LineSeriesInput;
|
|
1518
|
+
readonly label?: string;
|
|
1519
|
+
readonly color?: string;
|
|
1520
|
+
readonly curveType?: CurveType;
|
|
1521
|
+
readonly stepEdgeRadius?: number;
|
|
1522
|
+
readonly lineWidth?: number;
|
|
1523
|
+
readonly lineDash?: LineDash;
|
|
1524
|
+
readonly lineDashSpacing?: number;
|
|
1525
|
+
readonly pointMarkers?: PointMarkers;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
export declare interface SignalMarker {
|
|
1529
|
+
/** Time in ms (matches a candle's t). */
|
|
1530
|
+
t: number;
|
|
1531
|
+
side: SignalSide;
|
|
1532
|
+
/** [0, 1] confidence - drives the marker size scale. */
|
|
1533
|
+
confidence?: number;
|
|
1534
|
+
/** Optional override for the chart's `signalTooltip` data. */
|
|
1535
|
+
meta?: Record<string, unknown>;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
declare type SignalMarkerMode = "off" | "arrows + letter" | "arrows" | "flags" | "dots" | "arrows + label";
|
|
1539
|
+
|
|
1540
|
+
export declare type SignalSide = "buy" | "sell";
|
|
1541
|
+
|
|
1542
|
+
declare interface SignalTooltipProps {
|
|
1543
|
+
marker: SignalMarker;
|
|
1544
|
+
/** Bar's center x in CSS px (host can use for absolute positioning). */
|
|
1545
|
+
pointerX: number;
|
|
1546
|
+
pointerY: number;
|
|
1547
|
+
formatter: ChartFormatter;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
/** Slice the leading `n` values off a typed-array indicator output.
|
|
1551
|
+
* Zero-copy via `subarray()`. Used to drop the warmup-history
|
|
1552
|
+
* portion of an indicator result so the remainder aligns with the
|
|
1553
|
+
* visible data window. */
|
|
1554
|
+
export declare function sliceLeading(values: Float64Array, n: number): Float64Array;
|
|
1555
|
+
|
|
1556
|
+
export declare type StackingMode = false | true | "normalized";
|
|
1557
|
+
|
|
1558
|
+
/** Polymorphic prop:
|
|
1559
|
+
* `undefined | true` - built-in amber pill with pause icon
|
|
1560
|
+
* `false` - no banner (overrides staleVisualization)
|
|
1561
|
+
* function - custom HTML component (lib positions it top-center). */
|
|
1562
|
+
declare type StaleBannerProp = boolean | ((props: StaleBannerRenderProps) => React_2.ReactNode);
|
|
1563
|
+
|
|
1564
|
+
/** Props passed to a custom stale-banner render-prop. Framework-agnostic
|
|
1565
|
+
* data shape - same widening pattern as `ConnectionIndicatorRenderProps`. */
|
|
1566
|
+
declare interface StaleBannerRenderProps {
|
|
1567
|
+
state: LiveState;
|
|
1568
|
+
liveSince: number | undefined;
|
|
1569
|
+
theme: Theme;
|
|
1570
|
+
palette: Palette;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/** Chart-wide stale-state visual treatment. */
|
|
1574
|
+
export declare type StaleVisualization = "none" | "desaturate-pulse" | "banner" | "desaturate-pulse + banner";
|
|
1575
|
+
|
|
1576
|
+
declare interface StochasticSpecInput extends IndicatorPaneCommon {
|
|
1577
|
+
type: "stochastic";
|
|
1578
|
+
kPeriod?: number;
|
|
1579
|
+
dPeriod?: number;
|
|
1580
|
+
smoothing?: number;
|
|
1581
|
+
overbought?: number;
|
|
1582
|
+
oversold?: number;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
export declare type Theme = "light" | "dark";
|
|
1586
|
+
|
|
1587
|
+
export declare type ThemeInput = "inherit" | "light" | "dark" | "system";
|
|
1588
|
+
|
|
1589
|
+
export declare type ThemeSwitchTransition = "fade" | "none";
|
|
1590
|
+
|
|
1591
|
+
export declare type ThresholdFill = false | true | ThresholdFillConfig;
|
|
1592
|
+
|
|
1593
|
+
/** Optional config form of `thresholdFill`. */
|
|
1594
|
+
export declare interface ThresholdFillConfig {
|
|
1595
|
+
/** Domain-space y to split at. Defaults to the resolved baseline value
|
|
1596
|
+
* when the user passes `thresholdFill: true`. */
|
|
1597
|
+
value?: number;
|
|
1598
|
+
/** CSS color for above-threshold runs. Defaults to `palette.up`. */
|
|
1599
|
+
aboveColor?: string;
|
|
1600
|
+
/** CSS color for below-threshold runs. Defaults to `palette.down`. */
|
|
1601
|
+
belowColor?: string;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
declare type TimeFormat = "auto" | "24h" | "12h";
|
|
1605
|
+
|
|
1606
|
+
/** Per-palette declaration of the tonal-symmetry rule.
|
|
1607
|
+
* When `'positive'` or `'negative'`, the
|
|
1608
|
+
* chosen direction renders with the opposite-direction's color as
|
|
1609
|
+
* its stroke and a fully-transparent interior (regardless of
|
|
1610
|
+
* `visualStyle`). The non-chosen direction renders normally per
|
|
1611
|
+
* `visualStyle`. `'none'` disables the rule - both directions render
|
|
1612
|
+
* by their own palette color per `visualStyle`. */
|
|
1613
|
+
declare type TonalSymmetrySide = "positive" | "negative" | "none";
|
|
1614
|
+
|
|
1615
|
+
/** Per-series value at the hover-x. Every visible
|
|
1616
|
+
* series shows its value at the cursor in multi-series mode. */
|
|
1617
|
+
declare interface TooltipSeriesValue {
|
|
1618
|
+
readonly id: string;
|
|
1619
|
+
readonly label: string;
|
|
1620
|
+
readonly color: string;
|
|
1621
|
+
readonly value: number;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
export declare function useChartTheme(perChartTheme?: ThemeInput): Theme;
|
|
1625
|
+
|
|
1626
|
+
/** React hook: own a streaming Engine + an SoA mirror; expose
|
|
1627
|
+
* `pushTick` + a `BinaryCandleSeriesInput` snapshot. */
|
|
1628
|
+
export declare function useStreamingCandles(opts: UseStreamingCandlesOptions): UseStreamingCandlesResult;
|
|
1629
|
+
|
|
1630
|
+
export declare interface UseStreamingCandlesOptions {
|
|
1631
|
+
/** Bucket timeframe in minutes (e.g. `1` for 1-minute bars). */
|
|
1632
|
+
timeframeMinutes: number;
|
|
1633
|
+
/** Market kind - controls trading-hours / DST rules. */
|
|
1634
|
+
market: MarketKind;
|
|
1635
|
+
/** Capacity of the bar ring buffer. Once full, the oldest bar is
|
|
1636
|
+
* evicted on the next `AppendNew`. Default `5_000`. */
|
|
1637
|
+
capacity?: number;
|
|
1638
|
+
/** Validator bounds for the engine. */
|
|
1639
|
+
minPriceRaw: number;
|
|
1640
|
+
maxPriceRaw: number;
|
|
1641
|
+
maxVolumeRaw: number;
|
|
1642
|
+
/** Anomaly policy - values < 0 / NaN disable that specific check.
|
|
1643
|
+
* See engine `setAnomalyPolicy`. */
|
|
1644
|
+
anomalyPolicy?: {
|
|
1645
|
+
maxRelativePriceJump?: number;
|
|
1646
|
+
rejectZeroVolumeTrade?: boolean;
|
|
1647
|
+
clockSkewToleranceMs?: number;
|
|
1648
|
+
maxGapMs?: number;
|
|
1649
|
+
};
|
|
1650
|
+
/** Audit callback - fires per-tick `accept` / `reject`, plus
|
|
1651
|
+
* `candle-rolled` and policy-change events. Engine signature:
|
|
1652
|
+
* `(kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number)`. */
|
|
1653
|
+
onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
|
|
1654
|
+
/** Telemetry callback - fires per-tick a counter name string
|
|
1655
|
+
* (`'ticks_accepted'`, `'ticks_rejected_<reason>'`, `'candles_rolled'`). */
|
|
1656
|
+
onTelemetry?: (name: string) => void;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
export declare interface UseStreamingCandlesResult {
|
|
1660
|
+
/** Snapshot of the current bars in `BinaryCandleSeriesInput` form.
|
|
1661
|
+
* The wrapping object is fresh per tick (so React's referential
|
|
1662
|
+
* equality check sees the change), but the underlying typed-array
|
|
1663
|
+
* buffers are reused. Pass directly to `<CandleChart data={candles} />`. */
|
|
1664
|
+
candles: BinaryCandleSeriesInput;
|
|
1665
|
+
/** Number of bars currently in the ring (≤ `capacity`). */
|
|
1666
|
+
length: number;
|
|
1667
|
+
/** Push a tick to the engine. Throws if the engine rejected the
|
|
1668
|
+
* tick (out-of-bounds price/volume, strictly older timestamp). */
|
|
1669
|
+
pushTick: (tsMs: number, priceRaw: number, volumeRaw: number) => void;
|
|
1670
|
+
/** Reset the engine + clear the bar buffer. */
|
|
1671
|
+
reset: () => void;
|
|
1672
|
+
/** Whether the engine is ready (WASM loaded). Pre-init `pushTick`
|
|
1673
|
+
* calls are buffered and replayed once the engine is ready. */
|
|
1674
|
+
ready: boolean;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
export declare type ValueLabelPosition = "auto" | "inside" | "outside" | "top" | "bottom";
|
|
1678
|
+
|
|
1679
|
+
export declare type ValueLabels = false | true | LabelConfig;
|
|
1680
|
+
|
|
1681
|
+
export declare type VisualStyle = "Fill" | "Outline";
|
|
1682
|
+
|
|
1683
|
+
/** Volume-bar tooltip render-prop param shape - framework-agnostic.
|
|
1684
|
+
* Mirrors `VolumeBarTooltipProps` in both `react/tooltips/default-volume-
|
|
1685
|
+
* bar-tooltip` and `solid/tooltips/default-volume-bar-tooltip`. The
|
|
1686
|
+
* controller's `volumeBarTooltip` widens the return type to `unknown`
|
|
1687
|
+
* so both the React adapter (`React.ReactNode`) and the Solid adapter
|
|
1688
|
+
* (`JSX.Element`) pass type-check via covariance. */
|
|
1689
|
+
export declare interface VolumeBarTooltipProps {
|
|
1690
|
+
bar: {
|
|
1691
|
+
t: number;
|
|
1692
|
+
v: number;
|
|
1693
|
+
idx: number;
|
|
1694
|
+
};
|
|
1695
|
+
avg20: number;
|
|
1696
|
+
percentile: number;
|
|
1697
|
+
pointerX: number;
|
|
1698
|
+
pointerY: number;
|
|
1699
|
+
containerWidth: number;
|
|
1700
|
+
containerHeight: number;
|
|
1701
|
+
theme: Theme;
|
|
1702
|
+
palette: Palette;
|
|
1703
|
+
locale: string;
|
|
1704
|
+
timeZone: string | undefined;
|
|
1705
|
+
formatter: ChartFormatter;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/** Volume bar coloring mode. */
|
|
1709
|
+
export declare type VolumeColoring = "by-direction" | "single" | "by-magnitude";
|
|
1710
|
+
|
|
1711
|
+
export declare type VolumePlacement = "subpane" | "overlay";
|
|
1712
|
+
|
|
1713
|
+
/** Volume bar scale. */
|
|
1714
|
+
export declare type VolumeScale = "linear" | "log";
|
|
1715
|
+
|
|
1716
|
+
/** `'body'` = wick tracks the body's directional
|
|
1717
|
+
* color; `'neutral'` = wick uses `palette.neutral`; literal hex =
|
|
1718
|
+
* override. */
|
|
1719
|
+
export declare type WickColor = "body" | "neutral" | string;
|
|
1720
|
+
|
|
1721
|
+
declare type XAxisPosition = "top" | "bottom";
|
|
1722
|
+
|
|
1723
|
+
declare type YAxisPosition = "left" | "right";
|
|
1724
|
+
|
|
1725
|
+
export { }
|