@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/react.d.ts
ADDED
|
@@ -0,0 +1,3741 @@
|
|
|
1
|
+
import * as React_2 from 'react';
|
|
2
|
+
|
|
3
|
+
/** Allocate a Float64-backed buffer using `SharedArrayBuffer` when
|
|
4
|
+
* available, falling back to a regular `Float64Array`. The returned
|
|
5
|
+
* array's `.buffer` is `SharedArrayBuffer` in the fast path; callers
|
|
6
|
+
* that want to be sure should check `.buffer instanceof SharedArrayBuffer`. */
|
|
7
|
+
export declare function allocSharedFloat64(length: number): Float64Array;
|
|
8
|
+
|
|
9
|
+
/** Allocate a Uint32-backed buffer using `SharedArrayBuffer` when
|
|
10
|
+
* available, falling back to a regular `Uint32Array`. */
|
|
11
|
+
export declare function allocSharedUint32(length: number): Uint32Array;
|
|
12
|
+
|
|
13
|
+
declare interface Anchor {
|
|
14
|
+
/** Time in ms since the epoch. */
|
|
15
|
+
t: number;
|
|
16
|
+
/** Price (in the chart's price scale). */
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Apply ARIA attributes to a canvas host element. Idempotent - safe to
|
|
21
|
+
* call on every render. */
|
|
22
|
+
export declare function applyAriaAttributes(el: HTMLElement | undefined, opts: {
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly role?: "img" | "figure";
|
|
25
|
+
readonly description?: string;
|
|
26
|
+
}): void;
|
|
27
|
+
|
|
28
|
+
/** Decay velocity by friction `f` over `dtMs`. `f` defaults to 0.95 /
|
|
29
|
+
* 16ms (≈ ~6% per frame). Returns the new velocity. Below `eps`, the
|
|
30
|
+
* caller should stop the animation. */
|
|
31
|
+
export declare function applyInertiaDecay(velocity: number, dtMs: number, friction?: number): number;
|
|
32
|
+
|
|
33
|
+
export declare type AreaBaseline = "zero" | "first-value" | "last-value" | "min" | "max" | "mean" | "average" | "median" | number | ((window: Float64Array) => number);
|
|
34
|
+
|
|
35
|
+
export declare function AreaChart(props: AreaChartProps): React_2.ReactElement;
|
|
36
|
+
|
|
37
|
+
export declare interface AreaChartProps extends Omit<LineChartProps, "areaFill"> {
|
|
38
|
+
/** Where the bottom of the fill anchors. Default `'min'` (visible window's
|
|
39
|
+
* lowest value). See `AreaBaseline` for all 9 modes. */
|
|
40
|
+
baseline?: AreaBaseline;
|
|
41
|
+
/** Solid alpha fill (`'flat'`) or vertical gradient that fades to 0 at the
|
|
42
|
+
* baseline (`'gradient'`). Default `'flat'` (clean read, low-tier-friendly). */
|
|
43
|
+
fillType?: AreaFillType;
|
|
44
|
+
/** 0–1. Alpha for `'flat'`; top-stop alpha for `'gradient'`. Default 0.6. */
|
|
45
|
+
fillOpacity?: number;
|
|
46
|
+
/** Optional color split at a y-value. **`false`** (default) = single-color
|
|
47
|
+
* fill. **`true`** = split at the resolved baseline (or 0 when baseline
|
|
48
|
+
* is non-numeric), `aboveColor=palette.up`, `belowColor=palette.down`.
|
|
49
|
+
* **Config** = explicit value and/or custom above/below colors. The line
|
|
50
|
+
* stroke is also color-split for a consistent above/below read. */
|
|
51
|
+
thresholdFill?: ThresholdFill;
|
|
52
|
+
/** Multi-series stacking mode (requires the `series` prop with 2+
|
|
53
|
+
* entries; ignored otherwise).
|
|
54
|
+
* - `false` (default): each series renders an overlapping independent
|
|
55
|
+
* fill from the resolved baseline.
|
|
56
|
+
* - `true`: additive stacking - each band stacks on the previous; the
|
|
57
|
+
* sum at each x is visualized.
|
|
58
|
+
* - `'normalized'`: 100%-stacked - every column normalizes to 1 so the
|
|
59
|
+
* chart shows percentage breakdown. The y-axis becomes [0, 1].
|
|
60
|
+
* Stacked modes require all series to share the same `times` view; the
|
|
61
|
+
* lib validates this once at the public API boundary and throws a
|
|
62
|
+
* descriptive error otherwise. */
|
|
63
|
+
stacked?: StackingMode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Area-fill configuration. AreaChart sets this; LineChart renders it as a
|
|
67
|
+
* polygon between the line and a horizontal `baseline` y-value. Internal -
|
|
68
|
+
* LineChart's public surface intentionally has no area fill (that's
|
|
69
|
+
* <AreaChart>'s defining feature). Reused via `<AreaChart>` which forwards this transparently. */
|
|
70
|
+
declare interface AreaFillConfig {
|
|
71
|
+
baseline: AreaBaseline;
|
|
72
|
+
fillType: "flat" | "gradient";
|
|
73
|
+
fillOpacity: number;
|
|
74
|
+
/** Optional threshold split. When set, the area fill renders as two
|
|
75
|
+
* polygons (above + below threshold) and the line stroke is split too.
|
|
76
|
+
* Mutually exclusive with `stacked`; when
|
|
77
|
+
* both are set, `stacked` wins (threshold becomes a no-op). */
|
|
78
|
+
threshold?: AreaFillThreshold;
|
|
79
|
+
/** Multi-series stacking mode. Resolved form (AreaChart maps user-facing
|
|
80
|
+
* `false | true | 'normalized'` to `false | 'additive' | 'normalized'`).
|
|
81
|
+
* - `false` (default): non-stacked. With 2+ series, each band fills
|
|
82
|
+
* independently from the resolved baseline (overlapping fills).
|
|
83
|
+
* - `'additive'`: bands stack, total = sum at each x.
|
|
84
|
+
* - `'normalized'`: bands stack, total = 1 (100%) at each x. */
|
|
85
|
+
stacked?: false | "additive" | "normalized";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare interface AreaFillThreshold {
|
|
89
|
+
/** Domain-space y to split at. `undefined` → use the resolved baseline. */
|
|
90
|
+
readonly value: number | undefined;
|
|
91
|
+
/** Pre-resolved CSS rgba string for above-threshold runs. */
|
|
92
|
+
readonly aboveColor: string;
|
|
93
|
+
/** Pre-resolved CSS rgba string for below-threshold runs. */
|
|
94
|
+
readonly belowColor: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare type AreaFillType = "flat" | "gradient";
|
|
98
|
+
|
|
99
|
+
export declare interface AtrSpecInput extends IndicatorPaneCommon {
|
|
100
|
+
type: "atr";
|
|
101
|
+
period?: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare const AUTO_OPACITY_THRESHOLDS: ReadonlyArray<{
|
|
105
|
+
readonly count: number;
|
|
106
|
+
readonly opacity: number;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
export declare type AxisLabelsMode = "both" | "x-only" | "y-only" | "none";
|
|
110
|
+
|
|
111
|
+
export declare function BarChart(props: BarChartProps): React_2.ReactElement;
|
|
112
|
+
|
|
113
|
+
/** Framework-agnostic BarChart prop shape. Excludes the `tooltip` render-
|
|
114
|
+
* prop field that each framework adapter retypes against its native JSX
|
|
115
|
+
* element type. The controller's `BarChartControllerProps` extends this
|
|
116
|
+
* with an `unknown`-returning tooltip so both adapters' shapes are
|
|
117
|
+
* structurally assignable via covariance. */
|
|
118
|
+
declare interface BarChartBaseProps {
|
|
119
|
+
/** Bar data - single series (categories + values). Mutually
|
|
120
|
+
* exclusive with `series` for multi-series. */
|
|
121
|
+
data?: BarChartSeriesInput;
|
|
122
|
+
/** Multi-series mode: multiple parallel series. Layout follows
|
|
123
|
+
* `grouping` (grouped / stacked / normalized). */
|
|
124
|
+
series?: readonly BarSeriesConfig[];
|
|
125
|
+
/** Multi-series layout: `"grouped"` (side-by-side bars per
|
|
126
|
+
* category), `"stacked"` (vertically stacked), `"normalized"`
|
|
127
|
+
* (stacked to 100%). */
|
|
128
|
+
grouping?: BarGrouping;
|
|
129
|
+
/** Padding between bar groups (0–1 fraction of slot width). */
|
|
130
|
+
groupPadding?: number;
|
|
131
|
+
/** Chart orientation: `"vertical"` (default, value on y) or
|
|
132
|
+
* `"horizontal"` (value on x). */
|
|
133
|
+
orientation?: Orientation;
|
|
134
|
+
/** Render the bar value as a text label on/near the bar. */
|
|
135
|
+
valueLabels?: ValueLabels;
|
|
136
|
+
/** Legend visibility. */
|
|
137
|
+
legend?: LegendVisibility;
|
|
138
|
+
/** Legend anchor corner. */
|
|
139
|
+
legendPosition?: LegendPosition;
|
|
140
|
+
/** Toggle crosshair on hover. */
|
|
141
|
+
crosshairVisible?: boolean;
|
|
142
|
+
/** Crosshair line style. */
|
|
143
|
+
crosshairLineStyle?: GridStyle;
|
|
144
|
+
/** Snap-marker shape. */
|
|
145
|
+
crosshairMarker?: CrosshairMarker;
|
|
146
|
+
/** Chart width in CSS px. Default 800. */
|
|
147
|
+
width?: number;
|
|
148
|
+
/** Chart height in CSS px. Default 300. */
|
|
149
|
+
height?: number;
|
|
150
|
+
/** Color theme. */
|
|
151
|
+
theme?: ThemeInput;
|
|
152
|
+
/** Palette name. */
|
|
153
|
+
palette?: string;
|
|
154
|
+
/** `"Fill"` (default) or `"Outline"`. */
|
|
155
|
+
visualStyle?: "Fill" | "Outline";
|
|
156
|
+
/** Outline-mode fill color. */
|
|
157
|
+
outlineFillColor?: "auto" | string;
|
|
158
|
+
/** Outline-mode fill opacity (0–100). */
|
|
159
|
+
outlineFillOpacity?: number;
|
|
160
|
+
/** Cap the DPR. */
|
|
161
|
+
pixelDensityCap?: number;
|
|
162
|
+
/** Skip cosmetic features for low-end devices. */
|
|
163
|
+
fastMode?: boolean;
|
|
164
|
+
/** Direction-colored aura behind marks. */
|
|
165
|
+
glow?: GlowInput;
|
|
166
|
+
/** Glow color rule. `"auto"` = direction-derived. */
|
|
167
|
+
glowColor?: GlowColorInput;
|
|
168
|
+
/** Pattern fills (hatch, dots, etc.). */
|
|
169
|
+
pattern?: PatternInput;
|
|
170
|
+
/** Pattern scale multiplier. */
|
|
171
|
+
patternScale?: number;
|
|
172
|
+
/** Pattern color rule. `"auto"` = derived from bar color. */
|
|
173
|
+
patternColor?: PatternColorInput;
|
|
174
|
+
/** Force sparkline mode. */
|
|
175
|
+
sparkline?: boolean;
|
|
176
|
+
/** Override the auto-generated `aria-label`. */
|
|
177
|
+
ariaLabel?: string;
|
|
178
|
+
/** Toggle axis labels + spine. */
|
|
179
|
+
axisVisible?: boolean;
|
|
180
|
+
/** Value-axis position (depends on `orientation`). */
|
|
181
|
+
yAxisPosition?: YAxisPosition;
|
|
182
|
+
/** Category-axis position. */
|
|
183
|
+
xAxisPosition?: XAxisPosition;
|
|
184
|
+
/** Padding above/below the value-axis data range (fraction). */
|
|
185
|
+
yAxisPadding?: number;
|
|
186
|
+
/** Toggle gridlines. */
|
|
187
|
+
gridVisible?: boolean;
|
|
188
|
+
/** Gridline style. */
|
|
189
|
+
gridStyle?: GridStyle;
|
|
190
|
+
/** Gridline density. */
|
|
191
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
192
|
+
/** Use accent tint for axis + grid. */
|
|
193
|
+
accents?: boolean;
|
|
194
|
+
/** Locale code. */
|
|
195
|
+
locale?: string;
|
|
196
|
+
/** IANA time zone. */
|
|
197
|
+
timeZone?: string;
|
|
198
|
+
/** Fraction of slot width consumed by the bar body (0–1).
|
|
199
|
+
* Default 0.7. */
|
|
200
|
+
barWidthRatio?: number;
|
|
201
|
+
/** Bar corner radius in CSS px. Default 3. */
|
|
202
|
+
cornerRadius?: number;
|
|
203
|
+
/** Bar border width in CSS px. */
|
|
204
|
+
borderWidth?: number;
|
|
205
|
+
/** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
|
|
206
|
+
digitGrouping?: DigitGrouping;
|
|
207
|
+
/** Compact number abbreviation rule. */
|
|
208
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
209
|
+
/** Decimal-place rule for value labels. */
|
|
210
|
+
decimalPlaces?: DecimalPlaces;
|
|
211
|
+
/** ISO currency code. */
|
|
212
|
+
currency?: string;
|
|
213
|
+
/** Currency display style. */
|
|
214
|
+
currencyDisplay?: CurrencyDisplay;
|
|
215
|
+
/** Percentage precision. */
|
|
216
|
+
percentPrecision?: PercentPrecision;
|
|
217
|
+
/** Date format rule for time-axis category labels. */
|
|
218
|
+
dateFormat?: DateFormat;
|
|
219
|
+
/** Time format rule. */
|
|
220
|
+
timeFormat?: TimeFormat;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** React BarChart prop shape. Extends the framework-agnostic
|
|
224
|
+
* `BarChartBaseProps` (in `charts/bar-chart-helpers.ts`) with the React-
|
|
225
|
+
* specific `tooltip` field whose return type is `React.ReactNode`. */
|
|
226
|
+
export declare interface BarChartProps extends BarChartBaseProps {
|
|
227
|
+
tooltip?: BarChartTooltipProp;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Public input shape - same SoA + AoS pair as LineChart so hosts can
|
|
231
|
+
* share data pipelines between line / area / bar without re-shaping. */
|
|
232
|
+
export declare type BarChartSeriesInput = LineSeriesInput;
|
|
233
|
+
|
|
234
|
+
/** Polymorphic tooltip prop. `undefined` (default) → built-in tooltip;
|
|
235
|
+
* `false` → suppress; function → custom render. */
|
|
236
|
+
export declare type BarChartTooltipProp = undefined | false | ((props: BarChartTooltipProps) => React_2.ReactNode);
|
|
237
|
+
|
|
238
|
+
/** Props passed to a custom tooltip render function. Mirrors
|
|
239
|
+
* `LineChartTooltipProps` but tailored to bar geometry (no
|
|
240
|
+
* threshold-fill semantics; bar-snap uses the slot index). */
|
|
241
|
+
export declare interface BarChartTooltipProps {
|
|
242
|
+
/** Time at the hovered bar (unix-ms). */
|
|
243
|
+
readonly t: number;
|
|
244
|
+
/** Bar index (0-based). */
|
|
245
|
+
readonly idx: number;
|
|
246
|
+
/** Per-series values at this x. */
|
|
247
|
+
readonly seriesValues: readonly BarTooltipSeriesValue[];
|
|
248
|
+
readonly pointerX: number;
|
|
249
|
+
readonly pointerY: number;
|
|
250
|
+
readonly containerWidth: number;
|
|
251
|
+
readonly containerHeight: number;
|
|
252
|
+
readonly theme: Theme;
|
|
253
|
+
readonly palette: Palette;
|
|
254
|
+
readonly locale: string;
|
|
255
|
+
readonly timeZone: string | undefined;
|
|
256
|
+
readonly formatter: ChartFormatter;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
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";
|
|
260
|
+
|
|
261
|
+
/** Multi-series rendering mode. */
|
|
262
|
+
export declare type BarGrouping = "clustered" | "stacked" | "normalized" | "overlapping";
|
|
263
|
+
|
|
264
|
+
/** Multi-series config - one entry per side-by-side bar at each x-slot.
|
|
265
|
+
* Without per-series `color`, the lib auto-
|
|
266
|
+
* cycles `palette.categorical[i]`. All series MUST share the same `times`
|
|
267
|
+
* view (validated at the public API boundary). */
|
|
268
|
+
export declare interface BarSeriesConfig {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly data: BarChartSeriesInput;
|
|
271
|
+
readonly label?: string;
|
|
272
|
+
readonly color?: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Per-series value at the hover slot - every visible series at that x. */
|
|
276
|
+
export declare interface BarTooltipSeriesValue {
|
|
277
|
+
readonly id: string;
|
|
278
|
+
readonly label: string;
|
|
279
|
+
readonly color: string;
|
|
280
|
+
readonly value: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare type BarUpdateAnimation = "none" | "morph + flash-direction" | "morph" | "flash-neutral" | "flash-direction" | "pulse" | "glow" | "tick-line" | "flicker" | "rise";
|
|
284
|
+
|
|
285
|
+
/** Common props every tooltip in the lib receives. Chart-specific
|
|
286
|
+
* tooltips extend this with their `target` payload (hovered point,
|
|
287
|
+
* candle, slice, etc.). */
|
|
288
|
+
export declare interface BaseTooltipProps {
|
|
289
|
+
/** Pointer position relative to the chart container, CSS px. */
|
|
290
|
+
readonly pointerX: number;
|
|
291
|
+
readonly pointerY: number;
|
|
292
|
+
/** Container dimensions, CSS px. */
|
|
293
|
+
readonly containerWidth: number;
|
|
294
|
+
readonly containerHeight: number;
|
|
295
|
+
/** Active theme + palette at the time of hover. */
|
|
296
|
+
readonly theme: Theme;
|
|
297
|
+
readonly palette: Palette;
|
|
298
|
+
/** Active locale + timezone for value formatting. */
|
|
299
|
+
readonly locale: string;
|
|
300
|
+
readonly timeZone: string | undefined;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export declare type BinAlgorithm = "sturges" | "freedman-diaconis" | "scott" | "fixed";
|
|
304
|
+
|
|
305
|
+
declare interface BinaryCandleSeriesInput {
|
|
306
|
+
times: Float64Array;
|
|
307
|
+
opens: Float64Array;
|
|
308
|
+
highs: Float64Array;
|
|
309
|
+
lows: Float64Array;
|
|
310
|
+
closes: Float64Array;
|
|
311
|
+
volumes?: Float64Array;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export declare type BoxSizingInput = number | `atr-${number}` | `percent-${number}` | {
|
|
315
|
+
readonly type: "fixed";
|
|
316
|
+
readonly value: number;
|
|
317
|
+
} | {
|
|
318
|
+
readonly type: "atr";
|
|
319
|
+
readonly period: number;
|
|
320
|
+
} | {
|
|
321
|
+
readonly type: "percent";
|
|
322
|
+
readonly value: number;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/** Accept brand input as OKLCH or hex string. */
|
|
326
|
+
export declare type BrandInput = Oklch | string;
|
|
327
|
+
|
|
328
|
+
export declare type BubbleScale = "linear" | "sqrt";
|
|
329
|
+
|
|
330
|
+
export declare const BULK_BAR_THRESHOLD = 5000;
|
|
331
|
+
|
|
332
|
+
declare interface Candle {
|
|
333
|
+
t: number;
|
|
334
|
+
o: number;
|
|
335
|
+
h: number;
|
|
336
|
+
l: number;
|
|
337
|
+
c: number;
|
|
338
|
+
v?: number;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export declare const CandleChart: React_2.ForwardRefExoticComponent<CandleChartProps & React_2.RefAttributes<CandleChartHandle>>;
|
|
342
|
+
|
|
343
|
+
/** Framework-agnostic CandleChart prop shape. Excludes the eight render-
|
|
344
|
+
* prop fields (`tooltip`, `extremeTooltip`, `volumeBarTooltip`,
|
|
345
|
+
* `staleBanner`, `signalTooltip`, `orderTooltip`, `positionTooltip`,
|
|
346
|
+
* `eventTooltip`) that each framework adapter retypes against its
|
|
347
|
+
* native JSX element type. The controller's `CandleChartControllerProps`
|
|
348
|
+
* extends this with `unknown`-returning render props so both adapters'
|
|
349
|
+
* shapes are structurally assignable via covariance. */
|
|
350
|
+
declare interface CandleChartBaseProps {
|
|
351
|
+
/** Required. OHLC(V) bars - either structured (`{ candles: Array<{t,o,h,l,c,v?}> }`)
|
|
352
|
+
* or binary (per-field `Float64Array`). The binary path is zero-copy. */
|
|
353
|
+
data: CandleSeriesInput;
|
|
354
|
+
/** Older bars prepended to `data` for indicator warm-up. Same shape
|
|
355
|
+
* as `data`. Lets RSI/MACD/etc. have priors so the visible window
|
|
356
|
+
* starts post-warmup with non-NaN values. */
|
|
357
|
+
historyData?: CandleSeriesInput;
|
|
358
|
+
/** When `true` (default) and the dynamic
|
|
359
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
360
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
361
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
362
|
+
partialRepaints?: boolean;
|
|
363
|
+
/** VWAP price-overlay computed by the engine. When set,
|
|
364
|
+
* the engine's `vwap(highs, lows, closes, volumes, sessionStarts)`
|
|
365
|
+
* is computed once per data update and rendered as a line on the
|
|
366
|
+
* price pane. Requires `data.volumes` - silently skipped when
|
|
367
|
+
* volumes are absent. */
|
|
368
|
+
vwap?: {
|
|
369
|
+
/** Defaults to `true` when the `vwap` prop is present. */
|
|
370
|
+
visible?: boolean;
|
|
371
|
+
/** `"auto"` pulls from `palette[theme].indicators.vwap`. */
|
|
372
|
+
color?: "auto" | string;
|
|
373
|
+
/** Defaults to `indicatorLineWidth` from personalization. */
|
|
374
|
+
lineWidth?: number;
|
|
375
|
+
/** Session breakpoints - strictly-increasing indices into the
|
|
376
|
+
* times array. Defaults to `[0]` (whole series is one session). */
|
|
377
|
+
sessionStarts?: Uint32Array;
|
|
378
|
+
};
|
|
379
|
+
/** Engine-backed streaming mode. When
|
|
380
|
+
* set, `chart.onTick(t, p, s)` routes through the engine's
|
|
381
|
+
* `Engine.pushTick` for validate-then-aggregate semantics:
|
|
382
|
+
*
|
|
383
|
+
* - **Validation** - rejects non-positive prices, out-of-range
|
|
384
|
+
* price/volume, backward timestamps (per the anomaly policy).
|
|
385
|
+
* - **Bucket transitions** - engine returns `MutateLast` (extend
|
|
386
|
+
* current bar) or `AppendNew` (current bar closed; new one opens)
|
|
387
|
+
* so the controller correctly extends the series past the live bar.
|
|
388
|
+
* - **Anomaly + audit + telemetry** - pass-through to the engine's
|
|
389
|
+
* `setAnomalyPolicy` / `setAuditCallback` / `setTelemetryCallback`.
|
|
390
|
+
*
|
|
391
|
+
* When omitted, `onTick` falls back to JS-side last-bar-only
|
|
392
|
+
* mutation (suitable for hosts that own bar progression and just
|
|
393
|
+
* want intra-bar high/low/close updates). */
|
|
394
|
+
streaming?: {
|
|
395
|
+
/** Timeframe in minutes. Must match the data's bar spacing. */
|
|
396
|
+
timeframeMinutes: number;
|
|
397
|
+
/** Market spec - controls session-aware bucketing. */
|
|
398
|
+
market: "equity" | "dst-equity" | "crypto-24-7";
|
|
399
|
+
/** Completed-candle ring capacity. */
|
|
400
|
+
capacity?: number;
|
|
401
|
+
/** Validator bounds (scaled-integer per `Market::price_scale.decimals`). */
|
|
402
|
+
minPriceRaw?: number;
|
|
403
|
+
maxPriceRaw?: number;
|
|
404
|
+
maxVolumeRaw?: number;
|
|
405
|
+
/** Optional anomaly policy. Each field accepts a negative value to
|
|
406
|
+
* disable that specific check. */
|
|
407
|
+
anomaly?: {
|
|
408
|
+
maxRelativePriceJump?: number;
|
|
409
|
+
rejectZeroVolumeTrade?: boolean;
|
|
410
|
+
clockSkewToleranceMs?: number;
|
|
411
|
+
maxGapMs?: number;
|
|
412
|
+
};
|
|
413
|
+
/** Observability callbacks - wired into the engine's audit /
|
|
414
|
+
* telemetry surfaces. */
|
|
415
|
+
onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
|
|
416
|
+
onTelemetry?: (name: string) => void;
|
|
417
|
+
};
|
|
418
|
+
/** Candle visual: `"solid"` (default, filled bodies), `"hollow"`
|
|
419
|
+
* (down bodies hollow), `"ohlc-bars"` (open/close ticks), or
|
|
420
|
+
* `"heikin-ashi"` (smoothed Heikin-Ashi transform). */
|
|
421
|
+
candleType?: CandleType;
|
|
422
|
+
/** Fraction of the slot width consumed by the body (0–1). Default
|
|
423
|
+
* 0.7 - bars touch but don't overlap. */
|
|
424
|
+
bodyWidthRatio?: number;
|
|
425
|
+
/** Wick stroke width in CSS px. Default 1.4. */
|
|
426
|
+
wickWidth?: number;
|
|
427
|
+
/** Wick color rule: `"body"` (matches body color, default),
|
|
428
|
+
* `"neutral"`, `"up"`, `"down"`. */
|
|
429
|
+
wickColor?: WickColor;
|
|
430
|
+
/** Minimum body height in CSS px so true-doji bars stay visible.
|
|
431
|
+
* Default 1. */
|
|
432
|
+
dojiMinBodyHeight?: number;
|
|
433
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
434
|
+
crosshairVisible?: boolean;
|
|
435
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
436
|
+
crosshairLineStyle?: GridStyle;
|
|
437
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"` /
|
|
438
|
+
* `"none"`. CandleChart defaults to `"none"`. */
|
|
439
|
+
crosshairMarker?: CrosshairMarker;
|
|
440
|
+
/** Last-price horizontal reference line style. Default `"solid"`. */
|
|
441
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
442
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
443
|
+
lastPriceLabel?: boolean;
|
|
444
|
+
/** Visible-range high/low marker mode: `"lines+labels"` (default),
|
|
445
|
+
* `"labels"`, `"off"`. */
|
|
446
|
+
highLowMarkers?: HighLowMarkers;
|
|
447
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
448
|
+
width?: number;
|
|
449
|
+
/** Chart height in CSS pixels. Default 400 (taller than LineChart
|
|
450
|
+
* to accommodate the volume sub-pane). */
|
|
451
|
+
height?: number;
|
|
452
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"`. */
|
|
453
|
+
theme?: ThemeInput;
|
|
454
|
+
/** Palette name (`"Monochrome"`, `"Classic"`, etc.). */
|
|
455
|
+
palette?: string;
|
|
456
|
+
/** `"Fill"` (default) = solid body fills; `"Outline"` = colored
|
|
457
|
+
* border + translucent body fill. */
|
|
458
|
+
visualStyle?: "Fill" | "Outline";
|
|
459
|
+
/** In Outline mode, the fill color inside the outlined body. */
|
|
460
|
+
outlineFillColor?: "auto" | string;
|
|
461
|
+
/** In Outline mode, alpha of the outline body fill (0–100). */
|
|
462
|
+
outlineFillOpacity?: number;
|
|
463
|
+
/** Body corner radius in CSS px. Default 3. */
|
|
464
|
+
cornerRadius?: number;
|
|
465
|
+
/** Body border width in CSS px. Default 1.4. */
|
|
466
|
+
borderWidth?: number;
|
|
467
|
+
/** Cap the DPR (1–2 typical). */
|
|
468
|
+
pixelDensityCap?: number;
|
|
469
|
+
/** Skip cosmetic features for low-end devices. */
|
|
470
|
+
fastMode?: boolean;
|
|
471
|
+
/** Force sparkline mode (minimal axis-less render). */
|
|
472
|
+
sparkline?: boolean;
|
|
473
|
+
/** Override the auto-generated `aria-label`. */
|
|
474
|
+
ariaLabel?: string;
|
|
475
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
476
|
+
axisVisible?: boolean;
|
|
477
|
+
/** `"left"` or `"right"`. Default `"right"` for candles. */
|
|
478
|
+
yAxisPosition?: YAxisPosition;
|
|
479
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
480
|
+
xAxisPosition?: XAxisPosition;
|
|
481
|
+
/** Fractional padding above/below the y-data range. Default 0.05. */
|
|
482
|
+
yAxisPadding?: number;
|
|
483
|
+
/** Toggle gridlines. */
|
|
484
|
+
gridVisible?: boolean;
|
|
485
|
+
/** Gridline style. */
|
|
486
|
+
gridStyle?: GridStyle;
|
|
487
|
+
/** Gridline density. */
|
|
488
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
489
|
+
/** Use accent tint for axis + grid colors. */
|
|
490
|
+
accents?: boolean;
|
|
491
|
+
/** Locale code (e.g. `"USA"`). */
|
|
492
|
+
locale?: string;
|
|
493
|
+
/** IANA time zone. */
|
|
494
|
+
timeZone?: string;
|
|
495
|
+
/** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
|
|
496
|
+
digitGrouping?: DigitGrouping;
|
|
497
|
+
/** Compact number abbreviation rule (e.g. `"short"` → `"1.2M"`). */
|
|
498
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
499
|
+
/** Decimal-place rule for price labels. */
|
|
500
|
+
decimalPlaces?: DecimalPlaces;
|
|
501
|
+
/** ISO currency code (e.g. `"USD"`). */
|
|
502
|
+
currency?: string;
|
|
503
|
+
/** Currency display style. */
|
|
504
|
+
currencyDisplay?: CurrencyDisplay;
|
|
505
|
+
/** Percentage precision. */
|
|
506
|
+
percentPrecision?: PercentPrecision;
|
|
507
|
+
/** Date format rule. */
|
|
508
|
+
dateFormat?: DateFormat;
|
|
509
|
+
/** Time format rule. */
|
|
510
|
+
timeFormat?: TimeFormat;
|
|
511
|
+
/** Show the volume sub-pane. Requires `data.volumes` to be present.
|
|
512
|
+
* Default `true` when volumes exist. */
|
|
513
|
+
volumeVisible?: boolean;
|
|
514
|
+
/** Volume placement: `"subpane"` (separate pane below price,
|
|
515
|
+
* default) or `"overlay"` (transparent bars on the price pane). */
|
|
516
|
+
volumePlacement?: VolumePlacement;
|
|
517
|
+
/** Fraction of inner height given to the volume pane (0–1).
|
|
518
|
+
* Default 0.25. */
|
|
519
|
+
volumeHeightRatio?: number;
|
|
520
|
+
/** Allow the user to drag the divider between price + volume panes. */
|
|
521
|
+
volumeResizable?: boolean;
|
|
522
|
+
/** Volume bar coloring: `"by-direction"` (matches candle direction,
|
|
523
|
+
* default), `"single-color"`. */
|
|
524
|
+
volumeColoring?: VolumeColoring;
|
|
525
|
+
/** When `volumeColoring === "single-color"`, the bar color. */
|
|
526
|
+
volumeSingleColor?: "auto" | string;
|
|
527
|
+
/** Volume y-axis scale: `"linear"` (default) or `"log"`. */
|
|
528
|
+
volumeScale?: VolumeScale;
|
|
529
|
+
/** Sync the crosshair vertical line across price + volume +
|
|
530
|
+
* indicator panes. Default `true`. */
|
|
531
|
+
crosshairPaneSync?: boolean;
|
|
532
|
+
/** Sub-pane indicators: RSI / MACD / Stochastic / ATR. Each becomes
|
|
533
|
+
* its own pane below volume. */
|
|
534
|
+
indicators?: readonly IndicatorPaneSpec[];
|
|
535
|
+
/** Default line width for indicator lines. */
|
|
536
|
+
indicatorLineWidth?: number;
|
|
537
|
+
/** Default line style for indicator lines. */
|
|
538
|
+
indicatorLineStyle?: IndicatorLineStyle;
|
|
539
|
+
/** Default opacity for indicator lines (0–1). */
|
|
540
|
+
indicatorOpacity?: number;
|
|
541
|
+
/** Live-bar animation. */
|
|
542
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
543
|
+
/** Connection-state badge: `"dot"` (default), `"pill"`, `"off"`.
|
|
544
|
+
* Renders as an HTML overlay above the chart's plot area. */
|
|
545
|
+
connectionIndicator?: ConnectionIndicator;
|
|
546
|
+
/** Visual treatment for stale state. */
|
|
547
|
+
staleVisualization?: StaleVisualization;
|
|
548
|
+
/** Auto-stale timeout in ms. Default 5000. */
|
|
549
|
+
staleThreshold?: number;
|
|
550
|
+
/** Unix-ms of the latest accepted tick. */
|
|
551
|
+
liveSince?: number;
|
|
552
|
+
/** Host-asserted connection state. */
|
|
553
|
+
connectionState?: LiveState;
|
|
554
|
+
/** Anchor corner for the badge + legend overlay. */
|
|
555
|
+
legendPosition?: LegendPosition;
|
|
556
|
+
/** Host-forced reduced-motion override. */
|
|
557
|
+
reducedMotion?: boolean;
|
|
558
|
+
/** Animation when new bars first appear. */
|
|
559
|
+
barEntryAnimation?: BarEntryAnimation;
|
|
560
|
+
/** Animation when the live bar updates. */
|
|
561
|
+
barUpdateAnimation?: BarUpdateAnimation;
|
|
562
|
+
/** Crosshair fade-in duration (ms) on hover-enter. */
|
|
563
|
+
crosshairFadeDuration?: number;
|
|
564
|
+
/** Tooltip fade-in duration (ms). */
|
|
565
|
+
tooltipFadeDuration?: number;
|
|
566
|
+
/** Smooth wheel-zoom interpolation. */
|
|
567
|
+
panZoomSmoothing?: boolean;
|
|
568
|
+
/** Cross-fade transition when the theme changes. */
|
|
569
|
+
themeSwitchTransition?: ThemeSwitchTransition;
|
|
570
|
+
/** Drawing tool annotations (trendlines, fib, horizontal lines, etc.).
|
|
571
|
+
* Host-controlled array - push new drawings via `onDrawingsChange`. */
|
|
572
|
+
drawings?: readonly Drawing[];
|
|
573
|
+
/** Default stroke color for new drawings. */
|
|
574
|
+
drawingDefaultColor?: "auto" | string;
|
|
575
|
+
/** Default stroke width for new drawings. */
|
|
576
|
+
drawingDefaultLineWidth?: number;
|
|
577
|
+
/** Default stroke style for new drawings. */
|
|
578
|
+
drawingDefaultLineStyle?: "solid" | "dashed" | "dotted";
|
|
579
|
+
/** Default fill opacity for filled drawings. */
|
|
580
|
+
drawingFillOpacity?: number;
|
|
581
|
+
/** When to show resize handles: `"always"`, `"on-select"` (default),
|
|
582
|
+
* `"on-hover"`. */
|
|
583
|
+
drawingHandlesMode?: "always" | "on-select" | "on-hover";
|
|
584
|
+
/** Controlled-mode: id of the currently selected drawing. */
|
|
585
|
+
selectedDrawingId?: string;
|
|
586
|
+
/** Whitelist of drawing tool types the user can create. */
|
|
587
|
+
enabledTools?: readonly DrawingType[];
|
|
588
|
+
/** Snap mode for drawing tool placement. */
|
|
589
|
+
drawingSnap?: "free" | "x-axis" | "data";
|
|
590
|
+
/** Delete the selected drawing when the user presses Esc. */
|
|
591
|
+
drawingDeleteOnEsc?: boolean;
|
|
592
|
+
/** Fires when the user adds, modifies, or removes a drawing. */
|
|
593
|
+
onDrawingsChange?: (next: readonly Drawing[]) => void;
|
|
594
|
+
/** Fires when the selected drawing changes. */
|
|
595
|
+
onDrawingSelected?: (id: string | undefined) => void;
|
|
596
|
+
/** Signal markers (buy/sell arrows + confidence). */
|
|
597
|
+
signals?: readonly SignalMarker[];
|
|
598
|
+
/** Signal marker visualization mode. */
|
|
599
|
+
signalMarkers?: SignalMarkerMode;
|
|
600
|
+
/** Order markers (open/active orders with entry/SL/TP). */
|
|
601
|
+
orders?: readonly OrderMarker[];
|
|
602
|
+
/** Order marker visualization mode. */
|
|
603
|
+
orderMarkers?: OrderMarkerMode;
|
|
604
|
+
/** Singleton position marker (current open position). */
|
|
605
|
+
position?: PositionMarker;
|
|
606
|
+
/** Position marker visualization mode. */
|
|
607
|
+
positionMarker?: PositionMarkerMode;
|
|
608
|
+
/** Event markers (earnings, dividends, splits, news). */
|
|
609
|
+
events?: readonly EventMarker[];
|
|
610
|
+
/** Event marker visualization mode. */
|
|
611
|
+
eventMarkers?: EventMarkerMode;
|
|
612
|
+
/** Comparison series rendered as a normalized line overlay on the
|
|
613
|
+
* price pane. */
|
|
614
|
+
compareData?: {
|
|
615
|
+
times: Float64Array;
|
|
616
|
+
closes: Float64Array;
|
|
617
|
+
};
|
|
618
|
+
/** Comparison rendering mode. */
|
|
619
|
+
symbolComparison?: "off" | "normalized-line";
|
|
620
|
+
/** Optional watermark - symbol text, symbol + exchange, or an image. */
|
|
621
|
+
watermark?: "off" | "symbol" | "symbol + exchange" | {
|
|
622
|
+
image: string;
|
|
623
|
+
};
|
|
624
|
+
/** Symbol ticker (e.g. `"AAPL"`) for watermark + tooltip header. */
|
|
625
|
+
symbol?: string;
|
|
626
|
+
/** Exchange code (e.g. `"NYSE"`) for watermark + tooltip header. */
|
|
627
|
+
exchange?: string;
|
|
628
|
+
/** Color-blind augmentation: `"arrows"` adds direction arrows to
|
|
629
|
+
* bar bodies for users who can't distinguish red/green. */
|
|
630
|
+
colorBlindIndicators?: "off" | "arrows";
|
|
631
|
+
/** Direction-colored aura on candle bodies. */
|
|
632
|
+
glow?: GlowInput;
|
|
633
|
+
/** Glow color. */
|
|
634
|
+
glowColor?: GlowColorInput;
|
|
635
|
+
/** Pattern fills. */
|
|
636
|
+
pattern?: PatternInput;
|
|
637
|
+
patternScale?: number;
|
|
638
|
+
patternColor?: PatternColorInput;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
declare interface CandleChartHandle {
|
|
642
|
+
/** Arm the next pointerdown to start drawing this `type`. */
|
|
643
|
+
startDrawing(type: DrawingType): void;
|
|
644
|
+
/** Abort the in-flight tool selection (no shape committed). */
|
|
645
|
+
cancelDrawing(): void;
|
|
646
|
+
/** Whether a drawing tool is currently armed. */
|
|
647
|
+
readonly isDrawing: boolean;
|
|
648
|
+
/** Push a live tick (primitive args).
|
|
649
|
+
* Updates the high/low/close of the most recent bar in-place.
|
|
650
|
+
* Multiple ticks per rAF coalesce into one static draw. */
|
|
651
|
+
onTick(time: number, price: number, size?: number): void;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/** React CandleChart prop shape. Extends the framework-agnostic
|
|
655
|
+
* `CandleChartBaseProps` (in `charts/candle-chart-helpers.ts`) with the
|
|
656
|
+
* eight render-prop fields whose return type is `React.ReactNode`. */
|
|
657
|
+
export declare interface CandleChartProps extends CandleChartBaseProps {
|
|
658
|
+
tooltip?: CandleChartTooltipProp;
|
|
659
|
+
extremeTooltip?: ExtremeTooltipProp;
|
|
660
|
+
volumeBarTooltip?: boolean | ((props: {
|
|
661
|
+
bar: {
|
|
662
|
+
t: number;
|
|
663
|
+
v: number;
|
|
664
|
+
idx: number;
|
|
665
|
+
};
|
|
666
|
+
avg20: number;
|
|
667
|
+
percentile: number;
|
|
668
|
+
}) => React_2.ReactNode);
|
|
669
|
+
staleBanner?: CandleStaleBannerProp;
|
|
670
|
+
signalTooltip?: false | ((p: SignalTooltipProps) => React_2.ReactNode);
|
|
671
|
+
orderTooltip?: false | ((p: OrderTooltipProps) => React_2.ReactNode);
|
|
672
|
+
positionTooltip?: false | ((p: PositionTooltipProps) => React_2.ReactNode);
|
|
673
|
+
eventTooltip?: false | ((p: EventTooltipProps) => React_2.ReactNode);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/** Polymorphic tooltip prop. `undefined` (default) → built-in OHLC
|
|
677
|
+
* tooltip; `false` → suppress; function → custom render. */
|
|
678
|
+
export declare type CandleChartTooltipProp = undefined | false | ((props: CandleChartTooltipProps) => React_2.ReactNode);
|
|
679
|
+
|
|
680
|
+
/** Props passed to a custom CandleChart OHLC tooltip render function (and
|
|
681
|
+
* to the built-in `DefaultCandleTooltip`). Framework-agnostic data shape. */
|
|
682
|
+
export declare interface CandleChartTooltipProps {
|
|
683
|
+
/** Time at the active hover position (unix-ms). */
|
|
684
|
+
t: number;
|
|
685
|
+
/** Bar index in the candle series (0-based). */
|
|
686
|
+
idx: number;
|
|
687
|
+
/** Open / High / Low / Close at the hover bar. For Heikin-Ashi mode
|
|
688
|
+
* these are the HA-transformed values (what the chart is actually
|
|
689
|
+
* rendering); the tooltip stays consistent with what's on screen. */
|
|
690
|
+
o: number;
|
|
691
|
+
h: number;
|
|
692
|
+
l: number;
|
|
693
|
+
c: number;
|
|
694
|
+
/** Direction at hover - `'up'` if `c >= o`, `'down'` if `c < o`,
|
|
695
|
+
* `'doji'` if the body collapsed below the floor and rendered with
|
|
696
|
+
* `palette.doji`. */
|
|
697
|
+
direction: CandleDirection;
|
|
698
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
699
|
+
pointerX: number;
|
|
700
|
+
pointerY: number;
|
|
701
|
+
/** Container dimensions for placement decisions. */
|
|
702
|
+
containerWidth: number;
|
|
703
|
+
containerHeight: number;
|
|
704
|
+
theme: Theme;
|
|
705
|
+
palette: Palette;
|
|
706
|
+
locale: string;
|
|
707
|
+
timeZone: string | undefined;
|
|
708
|
+
formatter: ChartFormatter;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/** Direction signal for the OHLC bar at hover. `'doji'` when the
|
|
712
|
+
* source-data |O−C| would render below `dojiMinBodyHeight` and the chart
|
|
713
|
+
* is showing the doji floor in `palette.doji`. */
|
|
714
|
+
export declare type CandleDirection = "up" | "down" | "doji";
|
|
715
|
+
|
|
716
|
+
declare type CandleSeriesInput = {
|
|
717
|
+
candles: readonly Candle[];
|
|
718
|
+
} | BinaryCandleSeriesInput;
|
|
719
|
+
|
|
720
|
+
/** Polymorphic prop:
|
|
721
|
+
* `undefined | true` - built-in amber pill with pause icon
|
|
722
|
+
* `false` - no banner (overrides staleVisualization)
|
|
723
|
+
* function - custom HTML component (lib positions it top-center). */
|
|
724
|
+
declare type CandleStaleBannerProp = boolean | ((props: CandleStaleBannerRenderProps) => React_2.ReactNode);
|
|
725
|
+
|
|
726
|
+
declare interface CandleStaleBannerRenderProps {
|
|
727
|
+
state: LiveState;
|
|
728
|
+
liveSince: number | undefined;
|
|
729
|
+
theme: Theme;
|
|
730
|
+
palette: Palette;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/** `solid` (Japanese candle), `heikin-ashi`
|
|
734
|
+
* (smoothed via per-bar transform), `ohlc-bars` (Western tick bar). */
|
|
735
|
+
export declare type CandleType = "solid" | "heikin-ashi" | "ohlc-bars";
|
|
736
|
+
|
|
737
|
+
export declare type CellShape = "rect" | "circle";
|
|
738
|
+
|
|
739
|
+
export declare type CenterLabelProp = false | true | string | ((data: DonutCenterLabelData) => React_2.ReactNode);
|
|
740
|
+
|
|
741
|
+
declare class ChartFormatter {
|
|
742
|
+
private readonly opt;
|
|
743
|
+
private readonly resolvedAbbrev;
|
|
744
|
+
private readonly intlCache;
|
|
745
|
+
private readonly dateFmt;
|
|
746
|
+
private readonly timeFmt;
|
|
747
|
+
constructor(opt: ChartFormatterOptions);
|
|
748
|
+
private intlFor;
|
|
749
|
+
formatNumber(n: number, decimalsOverride?: number): string;
|
|
750
|
+
formatPrice(n: number, decimalsOverride?: number): string;
|
|
751
|
+
formatPercent(fraction: number, precisionOverride?: number): string;
|
|
752
|
+
formatDate(t: number): string;
|
|
753
|
+
formatTime(t: number): string;
|
|
754
|
+
private buildDateFmt;
|
|
755
|
+
private buildTimeFmt;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
declare interface ChartFormatterOptions {
|
|
759
|
+
readonly locale: ResolvedLocale;
|
|
760
|
+
readonly digitGrouping: DigitGrouping;
|
|
761
|
+
readonly numberAbbreviation: NumberAbbreviation;
|
|
762
|
+
readonly decimalPlaces: DecimalPlaces;
|
|
763
|
+
readonly currency: string;
|
|
764
|
+
readonly currencyDisplay: CurrencyDisplay;
|
|
765
|
+
readonly percentPrecision: PercentPrecision;
|
|
766
|
+
readonly dateFormat: DateFormat;
|
|
767
|
+
readonly timeFormat: TimeFormat;
|
|
768
|
+
readonly timeZone?: string | undefined;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export declare function ChartGroup(props: ChartGroupProps): React_2.ReactElement;
|
|
772
|
+
|
|
773
|
+
export declare function ChartGroupBrush(props: ChartGroupBrushProps): React_2.ReactElement;
|
|
774
|
+
|
|
775
|
+
export declare interface ChartGroupBrushProps {
|
|
776
|
+
/** Time domain the brush spans (typically the host's full data range). */
|
|
777
|
+
readonly domain: {
|
|
778
|
+
start: number;
|
|
779
|
+
end: number;
|
|
780
|
+
};
|
|
781
|
+
/** CSS width in px (caller-controlled). */
|
|
782
|
+
readonly width?: number;
|
|
783
|
+
/** CSS height in px. */
|
|
784
|
+
readonly height?: number;
|
|
785
|
+
/** Background fill of the unselected track. Defaults to a translucent neutral. */
|
|
786
|
+
readonly trackColor?: string;
|
|
787
|
+
/** Fill of the selected (brushed) range. Defaults to translucent palette.up. */
|
|
788
|
+
readonly selectionColor?: string;
|
|
789
|
+
/** Stroke color of the brush handles. */
|
|
790
|
+
readonly handleColor?: string;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare interface ChartGroupContextValue {
|
|
794
|
+
readonly options: ChartGroupOptions;
|
|
795
|
+
readonly state: ChartGroupState;
|
|
796
|
+
readonly version: number;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export declare function ChartGroupNavigator(props: ChartGroupNavigatorProps): React_2.ReactElement;
|
|
800
|
+
|
|
801
|
+
export declare interface ChartGroupNavigatorProps {
|
|
802
|
+
/** Time-series data to render in the minimap. Use the same source data
|
|
803
|
+
* as the children for a coherent overview; downsampling is the host's
|
|
804
|
+
* responsibility. */
|
|
805
|
+
readonly data: LineSeriesInput;
|
|
806
|
+
/** Visible domain - the navigator covers this full range; the brush
|
|
807
|
+
* controls a sub-range. Defaults to the data's first/last times. */
|
|
808
|
+
readonly domain?: {
|
|
809
|
+
start: number;
|
|
810
|
+
end: number;
|
|
811
|
+
};
|
|
812
|
+
readonly width?: number;
|
|
813
|
+
readonly height?: number;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare interface ChartGroupOptions {
|
|
817
|
+
/** Sync the visible x-domain across the group. */
|
|
818
|
+
readonly syncDomain: boolean;
|
|
819
|
+
readonly syncPanZoom: boolean;
|
|
820
|
+
readonly syncCrosshair: boolean;
|
|
821
|
+
readonly syncYScale: SyncYScale;
|
|
822
|
+
readonly referencePoint: ReferencePoint;
|
|
823
|
+
readonly syncSelection: boolean;
|
|
824
|
+
readonly syncTooltip: boolean;
|
|
825
|
+
/** Whether the group enables a brushable time-range selection. The
|
|
826
|
+
* separate `<ChartGroupBrush>` component reads + writes this state. */
|
|
827
|
+
readonly brush: boolean;
|
|
828
|
+
/** Whether a `<ChartGroupNavigator>` minimap should engage. */
|
|
829
|
+
readonly navigator: boolean;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export declare interface ChartGroupProps extends Partial<ChartGroupOptions> {
|
|
833
|
+
children?: React_2.ReactNode;
|
|
834
|
+
/** Fired when any child publishes a click-selected time and `syncSelection`
|
|
835
|
+
* is on. Receives the new selected time (or null on clear). */
|
|
836
|
+
onSelectionChange?: (time: number | null) => void;
|
|
837
|
+
/** Fired when the brush range changes. Receives `{ start, end }` or null. */
|
|
838
|
+
onBrushChange?: (range: TimeRange | null) => void;
|
|
839
|
+
/** Vertical-pane resize callback. The lib renders no
|
|
840
|
+
* divider chrome itself - host writes the divider; this callback is here
|
|
841
|
+
* to round out the API surface for when host-side divider components
|
|
842
|
+
* forward their drag events through the group. */
|
|
843
|
+
onPaneResize?: (heights: readonly number[]) => void;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export declare interface ChartGroupState {
|
|
847
|
+
/** Last hover-position time observed in any sibling chart. */
|
|
848
|
+
readonly crosshairTime: number | null;
|
|
849
|
+
setCrosshairTime(t: number | null): void;
|
|
850
|
+
/** Last click-selection time. */
|
|
851
|
+
readonly selectedTime: number | null;
|
|
852
|
+
setSelectedTime(t: number | null): void;
|
|
853
|
+
/** Shared visible time-range when `syncDomain: true`. */
|
|
854
|
+
readonly domain: TimeRange | null;
|
|
855
|
+
setDomain(d: TimeRange | null): void;
|
|
856
|
+
/** Shared brush range. */
|
|
857
|
+
readonly brush: TimeRange | null;
|
|
858
|
+
setBrush(b: TimeRange | null): void;
|
|
859
|
+
/** Subscribe to any state change. Returns idempotent unsubscriber. */
|
|
860
|
+
subscribe(listener: () => void): () => void;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export declare type ChartKind = "line" | "area" | "candle" | "bar" | "renko" | "kagi" | "pnf" | "pie" | "donut" | "treemap" | "sunburst" | "heatmap" | "histogram" | "scatter" | "depth" | "sankey";
|
|
864
|
+
|
|
865
|
+
export declare function ChartsProvider(props: ChartsProviderProps): React_2.ReactElement;
|
|
866
|
+
|
|
867
|
+
export declare interface ChartsProviderProps {
|
|
868
|
+
theme?: ThemeInput;
|
|
869
|
+
palette?: string;
|
|
870
|
+
locale?: string;
|
|
871
|
+
timeZone?: string;
|
|
872
|
+
visualStyle?: VisualStyle;
|
|
873
|
+
outlineFillColor?: "auto" | string;
|
|
874
|
+
outlineFillOpacity?: number;
|
|
875
|
+
cornerRadius?: number;
|
|
876
|
+
borderWidth?: number;
|
|
877
|
+
accents?: boolean;
|
|
878
|
+
osTheme?: Theme;
|
|
879
|
+
appTheme?: Theme;
|
|
880
|
+
/** Host-supplied custom palettes. Each gets
|
|
881
|
+
* registered into the global palette registry on mount; downstream
|
|
882
|
+
* charts can reference them by name via the `palette` prop. */
|
|
883
|
+
palettes?: readonly Palette[];
|
|
884
|
+
children?: React_2.ReactNode;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export declare interface ChartsProviderValue {
|
|
888
|
+
theme: ThemeInput;
|
|
889
|
+
palette: string;
|
|
890
|
+
locale: string;
|
|
891
|
+
timeZone: string | undefined;
|
|
892
|
+
visualStyle: VisualStyle;
|
|
893
|
+
/** Outline-mode interior fill color. `'auto'`
|
|
894
|
+
* derives from each mark's own stroke; literal hex/rgba = uniform tint. */
|
|
895
|
+
outlineFillColor: "auto" | string;
|
|
896
|
+
/** Outline-mode interior fill opacity (0–100).
|
|
897
|
+
* Default 15. Doubled in dark mode at draw time. */
|
|
898
|
+
outlineFillOpacity: number;
|
|
899
|
+
/** Corner roundness (CSS px, ≥ 0). Default 3. */
|
|
900
|
+
cornerRadius: number;
|
|
901
|
+
/** Body/segment border width (CSS px, ≥ 0). Default 1.4. */
|
|
902
|
+
borderWidth: number;
|
|
903
|
+
accents: boolean;
|
|
904
|
+
osTheme: Theme;
|
|
905
|
+
appTheme: Theme;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/** Drop every cached offscreen surface. Hosts call this on
|
|
909
|
+
* `onLowMemory` / `didReceiveMemoryWarning`. */
|
|
910
|
+
export declare function clearGlowPool(): void;
|
|
911
|
+
|
|
912
|
+
/** Compile + link a shader program with try/catch - returns `null` on
|
|
913
|
+
* failure so the caller can fall back to canvas2d. */
|
|
914
|
+
export declare function compileShaderProgram(gl: WebGL2RenderingContext, vsSource: string, fsSource: string): WebGLProgram | null;
|
|
915
|
+
|
|
916
|
+
/** Connection-indicator modes. */
|
|
917
|
+
declare type ConnectionIndicator = "off" | "dot" | "pill";
|
|
918
|
+
|
|
919
|
+
/** Polymorphic prop:
|
|
920
|
+
* `'off' | 'dot' | 'pill'` - built-in canvas badge
|
|
921
|
+
* function - custom HTML component, lib positions it. */
|
|
922
|
+
declare type ConnectionIndicatorProp = ConnectionIndicator | ((props: ConnectionIndicatorRenderProps) => React_2.ReactNode);
|
|
923
|
+
|
|
924
|
+
/** Props passed to a custom connection-indicator render-prop. Framework-
|
|
925
|
+
* agnostic data shape - the React adapter renders this via a function
|
|
926
|
+
* returning `React.ReactNode`; the Solid adapter via `JSX.Element`; the
|
|
927
|
+
* controller widens to `unknown`. */
|
|
928
|
+
declare interface ConnectionIndicatorRenderProps {
|
|
929
|
+
state: LiveState;
|
|
930
|
+
liveSince: number | undefined;
|
|
931
|
+
position: LegendPosition;
|
|
932
|
+
theme: Theme;
|
|
933
|
+
palette: Palette;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
declare type CrosshairMarker = "none" | "circle" | "square";
|
|
937
|
+
|
|
938
|
+
export declare type CrosshairMode = "follow" | "sticky";
|
|
939
|
+
|
|
940
|
+
export declare type CrosshairSnap = "free" | "x-axis" | "data";
|
|
941
|
+
|
|
942
|
+
declare type CurrencyDisplay = "none" | "symbol" | "code";
|
|
943
|
+
|
|
944
|
+
export declare type CurveType = CurveTypeName | CurveTypeConfig;
|
|
945
|
+
|
|
946
|
+
export declare interface CurveTypeConfig {
|
|
947
|
+
readonly type: CurveTypeName;
|
|
948
|
+
/** 0–1 - only honored for `cardinal`. Default 0. Higher = looser curve. */
|
|
949
|
+
readonly tension?: number;
|
|
950
|
+
/** 0–1 - only honored for `catmull-rom`. Default 0.5 (centripetal). */
|
|
951
|
+
readonly alpha?: number;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export declare type CurveTypeName = "linear" | "monotone" | "monotone-x" | "monotone-y" | "step" | "step-before" | "step-after" | "bump" | "bump-x" | "bump-y" | "natural" | "basis" | "cardinal" | "catmull-rom";
|
|
955
|
+
|
|
956
|
+
declare type DateFormat = "auto" | "short" | "medium" | "iso";
|
|
957
|
+
|
|
958
|
+
declare type DecimalPlaces = "auto" | number;
|
|
959
|
+
|
|
960
|
+
export declare const DEFAULT_AXIS_LABELS: AxisLabelsMode;
|
|
961
|
+
|
|
962
|
+
export declare const DEFAULT_BIN_ALGORITHM: BinAlgorithm;
|
|
963
|
+
|
|
964
|
+
export declare const DEFAULT_BOX_SIZING: ResolvedBoxSizing;
|
|
965
|
+
|
|
966
|
+
export declare const DEFAULT_BUBBLE_RANGE_PX: readonly [number, number];
|
|
967
|
+
|
|
968
|
+
export declare const DEFAULT_CELL_SHAPE: CellShape;
|
|
969
|
+
|
|
970
|
+
export declare const DEFAULT_DEPTH_FILL_TYPE: DepthFillType;
|
|
971
|
+
|
|
972
|
+
export declare const DEFAULT_GLOW: GlowInput;
|
|
973
|
+
|
|
974
|
+
export declare const DEFAULT_GLOW_COLOR: GlowColorInput;
|
|
975
|
+
|
|
976
|
+
export declare const DEFAULT_GPU_RENDERER: GpuRendererInput;
|
|
977
|
+
|
|
978
|
+
export declare const DEFAULT_HEATMAP_COLOR_SCALE: HeatmapColorScaleType;
|
|
979
|
+
|
|
980
|
+
export declare const DEFAULT_KAGI_THICKNESS_RULE: KagiThicknessRule;
|
|
981
|
+
|
|
982
|
+
export declare const DEFAULT_LABEL_BEHAVIOR: LabelBehavior;
|
|
983
|
+
|
|
984
|
+
export declare const DEFAULT_LABEL_CONTENT: LabelContentPreset;
|
|
985
|
+
|
|
986
|
+
export declare const DEFAULT_LABEL_PLACEMENT: LabelPlacement;
|
|
987
|
+
|
|
988
|
+
export declare const DEFAULT_LABEL_ROTATION: LabelRotation;
|
|
989
|
+
|
|
990
|
+
export declare const DEFAULT_LONG_PRESS_BEHAVIOR: LongPressBehavior;
|
|
991
|
+
|
|
992
|
+
export declare const DEFAULT_NODE_ALIGNMENT: NodeAlignment;
|
|
993
|
+
|
|
994
|
+
export declare const DEFAULT_NULL_BEHAVIOR: NullBehavior;
|
|
995
|
+
|
|
996
|
+
export declare const DEFAULT_NUMBER_FORMAT: NumberFormatPreset;
|
|
997
|
+
|
|
998
|
+
export declare const DEFAULT_PAN_ZOOM_OPTIONS: PanZoomOptions;
|
|
999
|
+
|
|
1000
|
+
export declare const DEFAULT_PATTERN: PatternInput;
|
|
1001
|
+
|
|
1002
|
+
export declare const DEFAULT_PATTERN_COLOR: PatternColorInput;
|
|
1003
|
+
|
|
1004
|
+
export declare const DEFAULT_PATTERN_SCALE = 1;
|
|
1005
|
+
|
|
1006
|
+
export declare const DEFAULT_PNF_SYMBOL_STYLE: PnFSymbolStyle;
|
|
1007
|
+
|
|
1008
|
+
export declare const DEFAULT_POINT_SIZE_PX = 9;
|
|
1009
|
+
|
|
1010
|
+
export declare const DEFAULT_PRICE_RANGE_PCT = 0.05;
|
|
1011
|
+
|
|
1012
|
+
export declare const DEFAULT_RADIUS_PROPORTION: RadiusProportion;
|
|
1013
|
+
|
|
1014
|
+
export declare const DEFAULT_SANKEY_LINK_COLOR: SankeyLinkColorPreset;
|
|
1015
|
+
|
|
1016
|
+
export declare const DEFAULT_SANKEY_VALUE_DISPLAY: SankeyValueDisplayMode;
|
|
1017
|
+
|
|
1018
|
+
export declare const DEFAULT_SORT_ORDER: SortOrder;
|
|
1019
|
+
|
|
1020
|
+
export declare const DEFAULT_SPREAD_DISPLAY: SpreadDisplayMode;
|
|
1021
|
+
|
|
1022
|
+
export declare const DEFAULT_TILE_LAYOUT: TileLayout;
|
|
1023
|
+
|
|
1024
|
+
export declare const DEFAULT_TIME_OFF_SOURCE: TimeOffSource;
|
|
1025
|
+
|
|
1026
|
+
export declare const DEFAULT_TREEMAP_COLOR_SCALE: TreemapColorScale;
|
|
1027
|
+
|
|
1028
|
+
export declare const DEFAULT_VIEW_MODE: ViewMode;
|
|
1029
|
+
|
|
1030
|
+
export declare const DEFAULT_Y_AXIS_MODE: YAxisMode;
|
|
1031
|
+
|
|
1032
|
+
/** Default `aria-label` template. Concise + readable; hosts
|
|
1033
|
+
* override via `ariaLabel` prop when they have more context. */
|
|
1034
|
+
export declare function defaultAriaLabel(opts: {
|
|
1035
|
+
readonly kind: ChartKind;
|
|
1036
|
+
readonly seriesCount?: number;
|
|
1037
|
+
readonly markCount?: number;
|
|
1038
|
+
readonly symbol?: string;
|
|
1039
|
+
}): string;
|
|
1040
|
+
|
|
1041
|
+
export declare function DefaultCandleTooltip(props: CandleChartTooltipProps): React_2.ReactElement;
|
|
1042
|
+
|
|
1043
|
+
/** Built-in tooltip rendered on H/L pill hover when the host doesn't
|
|
1044
|
+
* override `extremeTooltip`. Lightweight - labels the kind ("High" /
|
|
1045
|
+
* "Low") and shows price + bar index. Hosts can pass a function for
|
|
1046
|
+
* full custom render or `false` to suppress. */
|
|
1047
|
+
export declare function DefaultExtremeTooltip(p: ExtremeTooltipProps): React_2.ReactElement;
|
|
1048
|
+
|
|
1049
|
+
export declare function DefaultTooltip(props: LineChartTooltipProps): React_2.ReactElement;
|
|
1050
|
+
|
|
1051
|
+
export declare function DefaultVolumeBarTooltip(props: VolumeBarTooltipProps): React_2.ReactElement;
|
|
1052
|
+
|
|
1053
|
+
export declare const DENSITY_AUTO_THRESHOLD = 50000;
|
|
1054
|
+
|
|
1055
|
+
export declare type DensityInput = "off" | "auto" | "on";
|
|
1056
|
+
|
|
1057
|
+
export declare type DensityRenderMode = "points" | "heatmap";
|
|
1058
|
+
|
|
1059
|
+
export declare function DepthChart(props: DepthChartProps): React_2.ReactElement;
|
|
1060
|
+
|
|
1061
|
+
declare interface DepthChartBaseProps {
|
|
1062
|
+
/** Orderbook data - bids + asks parallel typed arrays. */
|
|
1063
|
+
data?: DepthSeriesInput;
|
|
1064
|
+
/** Default 'auto' (±5%). */
|
|
1065
|
+
priceRange?: PriceRangeInput;
|
|
1066
|
+
/** Default true (solid neutral line). */
|
|
1067
|
+
midLine?: MidLineInput;
|
|
1068
|
+
/** Default 'pill'. */
|
|
1069
|
+
spreadDisplay?: SpreadDisplayInput;
|
|
1070
|
+
/** Default true. */
|
|
1071
|
+
cumulative?: boolean;
|
|
1072
|
+
/** Default 'gradient'. */
|
|
1073
|
+
fillType?: DepthFillType;
|
|
1074
|
+
/** Default false. */
|
|
1075
|
+
levelHighlight?: LevelHighlightInput;
|
|
1076
|
+
/** Per-level data for `levelHighlight` - host-supplied. */
|
|
1077
|
+
highlightLevels?: ReadonlyArray<{
|
|
1078
|
+
readonly price: number;
|
|
1079
|
+
readonly label?: string;
|
|
1080
|
+
}>;
|
|
1081
|
+
legend?: LegendVisibility;
|
|
1082
|
+
legendPosition?: LegendPosition;
|
|
1083
|
+
crosshairVisible?: boolean;
|
|
1084
|
+
crosshairLineStyle?: GridStyle;
|
|
1085
|
+
crosshairMarker?: CrosshairMarker;
|
|
1086
|
+
width?: number;
|
|
1087
|
+
height?: number;
|
|
1088
|
+
theme?: ThemeInput;
|
|
1089
|
+
palette?: string;
|
|
1090
|
+
visualStyle?: "Fill" | "Outline";
|
|
1091
|
+
outlineFillColor?: "auto" | string;
|
|
1092
|
+
outlineFillOpacity?: number;
|
|
1093
|
+
pixelDensityCap?: number;
|
|
1094
|
+
fastMode?: boolean;
|
|
1095
|
+
/** Glow + glow-color axes. */
|
|
1096
|
+
glow?: GlowInput;
|
|
1097
|
+
glowColor?: GlowColorInput;
|
|
1098
|
+
/** Pattern fills. */
|
|
1099
|
+
pattern?: PatternInput;
|
|
1100
|
+
patternScale?: number;
|
|
1101
|
+
patternColor?: PatternColorInput;
|
|
1102
|
+
ariaLabel?: string;
|
|
1103
|
+
axisVisible?: boolean;
|
|
1104
|
+
yAxisPosition?: YAxisPosition;
|
|
1105
|
+
xAxisPosition?: XAxisPosition;
|
|
1106
|
+
yAxisPadding?: number;
|
|
1107
|
+
gridVisible?: boolean;
|
|
1108
|
+
gridStyle?: GridStyle;
|
|
1109
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
1110
|
+
accents?: boolean;
|
|
1111
|
+
locale?: string;
|
|
1112
|
+
timeZone?: string;
|
|
1113
|
+
digitGrouping?: DigitGrouping;
|
|
1114
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1115
|
+
decimalPlaces?: DecimalPlaces;
|
|
1116
|
+
currency?: string;
|
|
1117
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1118
|
+
percentPrecision?: PercentPrecision;
|
|
1119
|
+
dateFormat?: DateFormat;
|
|
1120
|
+
timeFormat?: TimeFormat;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
export declare interface DepthChartProps extends DepthChartBaseProps {
|
|
1124
|
+
tooltip?: DepthChartTooltipProp;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
export declare type DepthChartTooltipProp = undefined | false | ((props: DepthChartTooltipProps) => React_2.ReactNode);
|
|
1128
|
+
|
|
1129
|
+
export declare interface DepthChartTooltipProps {
|
|
1130
|
+
/** Which side the cursor is over. */
|
|
1131
|
+
readonly side: "bid" | "ask";
|
|
1132
|
+
/** Price at the cursor's x. */
|
|
1133
|
+
readonly price: number;
|
|
1134
|
+
/** Cumulative volume at that price (the chart's y value). */
|
|
1135
|
+
readonly cumulativeVolume: number;
|
|
1136
|
+
/** Distance from the mid price as a fraction (e.g. -0.025 = 2.5% below mid). */
|
|
1137
|
+
readonly pctFromMid: number;
|
|
1138
|
+
readonly pointerX: number;
|
|
1139
|
+
readonly pointerY: number;
|
|
1140
|
+
readonly containerWidth: number;
|
|
1141
|
+
readonly containerHeight: number;
|
|
1142
|
+
readonly theme: Theme;
|
|
1143
|
+
readonly palette: Palette;
|
|
1144
|
+
readonly locale: string;
|
|
1145
|
+
readonly timeZone: string | undefined;
|
|
1146
|
+
readonly formatter: ChartFormatter;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export declare type DepthFillType = "flat" | "gradient";
|
|
1150
|
+
|
|
1151
|
+
export declare interface DepthLevel {
|
|
1152
|
+
readonly price: number;
|
|
1153
|
+
readonly size: number;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export declare type DepthLimitInput = number | "all";
|
|
1157
|
+
|
|
1158
|
+
export declare interface DepthSeriesInput {
|
|
1159
|
+
readonly bids: readonly DepthLevel[] | {
|
|
1160
|
+
readonly prices: Float64Array;
|
|
1161
|
+
readonly sizes: Float64Array;
|
|
1162
|
+
};
|
|
1163
|
+
readonly asks: readonly DepthLevel[] | {
|
|
1164
|
+
readonly prices: Float64Array;
|
|
1165
|
+
readonly sizes: Float64Array;
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/** Generate the chart-chrome accent tint. Per the built-ins, the accent
|
|
1170
|
+
* is a desaturated version of the brand pulled toward neutral so it
|
|
1171
|
+
* reads as "muted ink" against the chart background while still
|
|
1172
|
+
* carrying the brand hue. */
|
|
1173
|
+
export declare function deriveAccentTint(brand: BrandInput): Oklch;
|
|
1174
|
+
|
|
1175
|
+
/** Generate `n` categorical colors by rotating hue around the brand.
|
|
1176
|
+
* The brand color sits at slot 0; subsequent slots step `360 / n`
|
|
1177
|
+
* degrees around the OKLCH hue wheel while preserving the brand's L
|
|
1178
|
+
* and C. Palettes are expected to define a usable
|
|
1179
|
+
* categorical array (used by multi-series, pie/donut, treemap, etc.).
|
|
1180
|
+
*
|
|
1181
|
+
* Tunable count - defaults to 8 which matches the built-in palettes. */
|
|
1182
|
+
export declare function deriveCategoricalSet(brand: BrandInput, count?: number): readonly Oklch[];
|
|
1183
|
+
|
|
1184
|
+
export declare function deriveDefaultPalette(brand: BrandInput, opts: DeriveDefaultPaletteOptions): Palette;
|
|
1185
|
+
|
|
1186
|
+
/** Build a complete `Palette` from a brand color. Generates both
|
|
1187
|
+
* `light` and `dark` variants by calling `deriveVariant` twice with
|
|
1188
|
+
* theme-tuned L/C. */
|
|
1189
|
+
export declare interface DeriveDefaultPaletteOptions {
|
|
1190
|
+
readonly name: string;
|
|
1191
|
+
readonly tonalSymmetrySide?: TonalSymmetrySide;
|
|
1192
|
+
readonly tonalSymmetryFlipInDarkMode?: boolean;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
/** Build a `PaletteVariant` (one of `light` or `dark`) from a brand
|
|
1196
|
+
* color. Uses opinionated L/C tuning matching the built-in
|
|
1197
|
+
* Monochrome / Classic / Accessible variants:
|
|
1198
|
+
* - Light theme - up/down at L ≈ 0.70, C ≈ 0.18.
|
|
1199
|
+
* - Dark theme - brightened L ≈ 0.78, C ≈ 0.20 for AA contrast.
|
|
1200
|
+
* Hue derives from the brand. Categorical = 8-step hue rotation. */
|
|
1201
|
+
export declare function deriveVariant(brand: BrandInput, theme: "light" | "dark"): PaletteVariant;
|
|
1202
|
+
|
|
1203
|
+
/** Detect the FastModeContext from `navigator` + `matchMedia`. Safe to
|
|
1204
|
+
* call during SSR (returns an empty context). */
|
|
1205
|
+
export declare function detectFastModeContext(): FastModeContext;
|
|
1206
|
+
|
|
1207
|
+
/** Heuristic - when `true`, treat the device as primarily touch
|
|
1208
|
+
* (collapses crosshair to pin-on-click, opt-in pinch zoom, etc.). */
|
|
1209
|
+
export declare function detectTouchOnly(): boolean;
|
|
1210
|
+
|
|
1211
|
+
declare type DigitGrouping = "international" | "lakh-crore" | "none";
|
|
1212
|
+
|
|
1213
|
+
/** Fixed-capacity ring of dirty rects. Caller pushes rects throughout
|
|
1214
|
+
* the frame; the consumer calls `flushCoalesced()` to get the merged
|
|
1215
|
+
* rect (null when empty). */
|
|
1216
|
+
export declare class DirtyRectRing {
|
|
1217
|
+
private xs;
|
|
1218
|
+
private ys;
|
|
1219
|
+
private ws;
|
|
1220
|
+
private hs;
|
|
1221
|
+
private idx;
|
|
1222
|
+
private filled;
|
|
1223
|
+
push(x: number, y: number, w: number, h: number): void;
|
|
1224
|
+
/** Merge all pending rects into a single bounding box. Resets the
|
|
1225
|
+
* ring. Returns `null` when there's nothing pending. */
|
|
1226
|
+
flushCoalesced(): Rect | null;
|
|
1227
|
+
/** Flush all pending rects into `out` (length = number of rects).
|
|
1228
|
+
* The caller owns the array - pass a reused
|
|
1229
|
+
* scratch to avoid allocation. Returns count of populated entries.
|
|
1230
|
+
* Resets the ring. */
|
|
1231
|
+
flushAll(out: Rect[]): number;
|
|
1232
|
+
/** Discard any pending rects without producing a flush. */
|
|
1233
|
+
clear(): void;
|
|
1234
|
+
size(): number;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
declare interface DivergingConfig {
|
|
1238
|
+
readonly type: "diverging";
|
|
1239
|
+
/** Value mapped to the neutral mid-point. Default 0. */
|
|
1240
|
+
readonly midpoint?: number;
|
|
1241
|
+
/** `[low, high]` data range. When omitted, auto-fits to the data's
|
|
1242
|
+
* symmetric extent at compute time. */
|
|
1243
|
+
readonly domain?: readonly [number, number];
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/** Donut adds a centerLabel slot - string, ComponentType, or render-prop -
|
|
1247
|
+
* rendered as a positioned overlay inside the donut hole. */
|
|
1248
|
+
export declare interface DonutCenterLabelData {
|
|
1249
|
+
readonly totalValue: number;
|
|
1250
|
+
readonly formatter: ChartFormatter;
|
|
1251
|
+
readonly theme: Theme;
|
|
1252
|
+
readonly palette: Palette;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
export declare function DonutChart(props: DonutChartProps): React_2.ReactElement;
|
|
1256
|
+
|
|
1257
|
+
export declare interface DonutChartProps extends PieChartProps {
|
|
1258
|
+
centerLabel?: CenterLabelProp;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
export declare type DowngradeLevel = 0 | 1 | 2 | 3;
|
|
1262
|
+
|
|
1263
|
+
export declare function downgradeOverrides(level: DowngradeLevel): RenderConfigOverrides;
|
|
1264
|
+
|
|
1265
|
+
declare interface Drawing {
|
|
1266
|
+
readonly id: string;
|
|
1267
|
+
readonly type: DrawingType;
|
|
1268
|
+
/** Anchors in data coordinates. Cardinality varies by type:
|
|
1269
|
+
* - 1: horizontal-line (y), vertical-line (t)
|
|
1270
|
+
* - 2: trend-line, rectangle, ellipse, arrow, text (single anchor
|
|
1271
|
+
* point + style.text), fib-retracement, fib-extension, brush
|
|
1272
|
+
* - 3: pitchfork, channel
|
|
1273
|
+
* Validation is host-side at construction; the chart trusts the
|
|
1274
|
+
* cardinality for the type it sees. */
|
|
1275
|
+
readonly anchors: readonly Anchor[];
|
|
1276
|
+
readonly style: DrawingStyle;
|
|
1277
|
+
/** Optional metadata for host bookkeeping; not used by the chart. */
|
|
1278
|
+
readonly meta?: Record<string, unknown>;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
declare interface DrawingStyle {
|
|
1282
|
+
/** Stroke / fill base color (resolved CSS string OR `'auto'` to use
|
|
1283
|
+
* the active palette's `drawings.stroke` slot). */
|
|
1284
|
+
color?: string | "auto";
|
|
1285
|
+
lineWidth?: number;
|
|
1286
|
+
lineStyle?: "solid" | "dashed" | "dotted";
|
|
1287
|
+
fillOpacity?: number;
|
|
1288
|
+
/** Trend-line + arrow only - bool toggles arrowhead at the second
|
|
1289
|
+
* anchor. */
|
|
1290
|
+
arrowhead?: boolean;
|
|
1291
|
+
/** Text-drawing only. */
|
|
1292
|
+
text?: string;
|
|
1293
|
+
fontSize?: number;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
declare type DrawingType = "trend-line" | "horizontal-line" | "vertical-line" | "rectangle" | "ellipse" | "arrow" | "text" | "fib-retracement" | "fib-extension" | "pitchfork" | "channel" | "brush";
|
|
1297
|
+
|
|
1298
|
+
/** Run the glow compositor. When `glow.strength === 0`, this is a thin
|
|
1299
|
+
* pass-through that only invokes the sharp pass on the main context. */
|
|
1300
|
+
export declare function drawWithGlow(mainCtx: CanvasRenderingContext2D, opts: GlowOptions, draw: GlowDrawCallback): void;
|
|
1301
|
+
|
|
1302
|
+
declare type EventKind = "earnings" | "dividend" | "split" | "news";
|
|
1303
|
+
|
|
1304
|
+
declare interface EventMarker {
|
|
1305
|
+
t: number;
|
|
1306
|
+
kind: EventKind;
|
|
1307
|
+
/** Short label (1-2 chars) for the glyph mode. */
|
|
1308
|
+
glyph?: string;
|
|
1309
|
+
/** Full title for the banner mode. */
|
|
1310
|
+
title?: string;
|
|
1311
|
+
meta?: Record<string, unknown>;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
declare type EventMarkerMode = "off" | "glyph-axis" | "vertical-line" | "banner-strip";
|
|
1315
|
+
|
|
1316
|
+
declare interface EventTooltipProps {
|
|
1317
|
+
marker: EventMarker;
|
|
1318
|
+
pointerX: number;
|
|
1319
|
+
pointerY: number;
|
|
1320
|
+
formatter: ChartFormatter;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/** Polymorphic tooltip prop for visible-window high / low pill hover.
|
|
1324
|
+
*
|
|
1325
|
+
* - `true` (default) - built-in `<DefaultExtremeTooltip>`.
|
|
1326
|
+
* - `false` - no tooltip on H/L pill hover.
|
|
1327
|
+
* - function - render-prop receiving `ExtremeTooltipProps`. */
|
|
1328
|
+
export declare type ExtremeTooltipProp = boolean | ((props: ExtremeTooltipProps) => React_2.ReactNode);
|
|
1329
|
+
|
|
1330
|
+
/** Props passed to a custom extreme-tooltip render function (H/L pill hover).
|
|
1331
|
+
* Framework-agnostic data shape - same in both React and Solid. */
|
|
1332
|
+
export declare interface ExtremeTooltipProps {
|
|
1333
|
+
kind: "high" | "low";
|
|
1334
|
+
/** Bar index in the source series. */
|
|
1335
|
+
barIdx: number;
|
|
1336
|
+
price: number;
|
|
1337
|
+
/** Time at the extreme bar (unix-ms). */
|
|
1338
|
+
t: number;
|
|
1339
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
1340
|
+
pointerX: number;
|
|
1341
|
+
pointerY: number;
|
|
1342
|
+
containerWidth: number;
|
|
1343
|
+
containerHeight: number;
|
|
1344
|
+
theme: Theme;
|
|
1345
|
+
palette: Palette;
|
|
1346
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
1347
|
+
locale: string;
|
|
1348
|
+
timeZone: string | undefined;
|
|
1349
|
+
formatter: ChartFormatter;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
export declare interface FastModeContext {
|
|
1353
|
+
/** From `navigator.connection.effectiveType` if present. */
|
|
1354
|
+
readonly effectiveType?: string;
|
|
1355
|
+
/** From `navigator.deviceMemory` (GB). */
|
|
1356
|
+
readonly deviceMemory?: number;
|
|
1357
|
+
/** From `matchMedia('(prefers-reduced-motion: reduce)').matches`. */
|
|
1358
|
+
readonly prefersReducedMotion?: boolean;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
export declare type FastModeInput = boolean | "auto";
|
|
1362
|
+
|
|
1363
|
+
export declare class FrameTimeMonitor {
|
|
1364
|
+
private buf;
|
|
1365
|
+
private idx;
|
|
1366
|
+
private filled;
|
|
1367
|
+
private level;
|
|
1368
|
+
/** Cooldown counter - frames since the last level change. Prevents
|
|
1369
|
+
* the monitor from chasing its tail and downgrading multiple levels
|
|
1370
|
+
* in successive frames. */
|
|
1371
|
+
private cooldown;
|
|
1372
|
+
/** Record one frame's duration (ms). Returns the (possibly new) downgrade
|
|
1373
|
+
* level. Caller checks against the previous level to decide whether to
|
|
1374
|
+
* bust caches / re-render. */
|
|
1375
|
+
recordFrame(ms: number): DowngradeLevel;
|
|
1376
|
+
/** Current downgrade level (caller reads to apply to render config). */
|
|
1377
|
+
currentLevel(): DowngradeLevel;
|
|
1378
|
+
reset(): void;
|
|
1379
|
+
private computeP95;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/** `'auto'` (default) = each mark glows in its own direction color
|
|
1383
|
+
* (`up`/`down`/`doji` from the palette). A literal color (any CSS-color
|
|
1384
|
+
* string, hex, or `oklch(...)`) overrides for uniform brand glow. */
|
|
1385
|
+
export declare type GlowColorInput = "auto" | string;
|
|
1386
|
+
|
|
1387
|
+
/** Glow-pass draw callback. Called once per pass:
|
|
1388
|
+
* - `isGlowPass = true` → the caller draws into `ctx` using the halo
|
|
1389
|
+
* color resolver (or a constant color when `glow.color !== 'auto'`).
|
|
1390
|
+
* The draw should produce only the *shape mass* of the marks; strokes
|
|
1391
|
+
* can be thicker than normal for a fuller aura, but no axis chrome.
|
|
1392
|
+
* - `isGlowPass = false` → the caller draws the actual marks normally on
|
|
1393
|
+
* top of the glow.
|
|
1394
|
+
* The `ctx` is already translated so plot-rect origin maps to (0,0) on
|
|
1395
|
+
* glow passes; the caller does not need to re-apply the translate.
|
|
1396
|
+
*/
|
|
1397
|
+
export declare type GlowDrawCallback = (ctx: CanvasRenderingContext2D, isGlowPass: boolean) => void;
|
|
1398
|
+
|
|
1399
|
+
/** Host-supplied input. Named presets resolve to fixed strengths; numeric
|
|
1400
|
+
* values clamp to `[0, 1]`. */
|
|
1401
|
+
export declare type GlowInput = GlowPreset | number;
|
|
1402
|
+
|
|
1403
|
+
export declare interface GlowOptions {
|
|
1404
|
+
readonly glow: ResolvedGlow;
|
|
1405
|
+
readonly theme: Theme;
|
|
1406
|
+
readonly plotRect: GlowPlotRect;
|
|
1407
|
+
/** Device-pixel ratio multiplier for the offscreen surface. Passed
|
|
1408
|
+
* separately so glow renders crisp on high-DPR displays without
|
|
1409
|
+
* forcing the caller to re-apply `setTransform`. */
|
|
1410
|
+
readonly dpr: number;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/** Plot-rect (CSS px) - the glow's offscreen surface matches this region
|
|
1414
|
+
* exactly so blur stays clipped to the plot. */
|
|
1415
|
+
export declare interface GlowPlotRect {
|
|
1416
|
+
readonly x: number;
|
|
1417
|
+
readonly y: number;
|
|
1418
|
+
readonly w: number;
|
|
1419
|
+
readonly h: number;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export declare type GlowPreset = "off" | "subtle" | "standard" | "intense";
|
|
1423
|
+
|
|
1424
|
+
export declare const GPU_ENGAGE_THRESHOLD = 50000;
|
|
1425
|
+
|
|
1426
|
+
export declare interface GpuEngageContext {
|
|
1427
|
+
/** Visible mark count after downsampling. */
|
|
1428
|
+
readonly visibleMarkCount: number;
|
|
1429
|
+
/** Host-resolved `gpuRenderer`. */
|
|
1430
|
+
readonly gpuRenderer: GpuRendererInput;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
export declare type GpuRendererInput = "auto" | "on" | "off";
|
|
1434
|
+
|
|
1435
|
+
declare type GridStyle = "solid" | "dashed" | "dotted";
|
|
1436
|
+
|
|
1437
|
+
export declare function HeatmapChart(props: HeatmapChartProps): React_2.ReactElement;
|
|
1438
|
+
|
|
1439
|
+
declare interface HeatmapChartBaseProps {
|
|
1440
|
+
/** Row-major matrix of values to color. See `HeatmapMatrixInput`
|
|
1441
|
+
* for the row labels / col labels / values shape. */
|
|
1442
|
+
data?: HeatmapMatrixInput;
|
|
1443
|
+
/** Default 'diverging'. */
|
|
1444
|
+
colorScale?: HeatmapColorScaleInput;
|
|
1445
|
+
/** Default 2 px (gapUnit). */
|
|
1446
|
+
cellPadding?: number;
|
|
1447
|
+
/** Default 'rect'. */
|
|
1448
|
+
cellShape?: CellShape;
|
|
1449
|
+
/** Default false. true = auto-contrast text per cell. */
|
|
1450
|
+
valueDisplay?: boolean;
|
|
1451
|
+
/** Default 'both'. */
|
|
1452
|
+
axisLabels?: AxisLabelsMode;
|
|
1453
|
+
/** Default 'cross-hatch'. */
|
|
1454
|
+
nullBehavior?: NullBehavior;
|
|
1455
|
+
legend?: LegendVisibility;
|
|
1456
|
+
legendPosition?: LegendPosition;
|
|
1457
|
+
crosshairVisible?: boolean;
|
|
1458
|
+
crosshairLineStyle?: GridStyle;
|
|
1459
|
+
crosshairMarker?: CrosshairMarker;
|
|
1460
|
+
width?: number;
|
|
1461
|
+
height?: number;
|
|
1462
|
+
theme?: ThemeInput;
|
|
1463
|
+
palette?: string;
|
|
1464
|
+
visualStyle?: "Fill" | "Outline";
|
|
1465
|
+
outlineFillColor?: "auto" | string;
|
|
1466
|
+
outlineFillOpacity?: number;
|
|
1467
|
+
pixelDensityCap?: number;
|
|
1468
|
+
fastMode?: boolean;
|
|
1469
|
+
/** Glow + glow-color axes. */
|
|
1470
|
+
glow?: GlowInput;
|
|
1471
|
+
glowColor?: GlowColorInput;
|
|
1472
|
+
/** Pattern fills. */
|
|
1473
|
+
pattern?: PatternInput;
|
|
1474
|
+
patternScale?: number;
|
|
1475
|
+
patternColor?: PatternColorInput;
|
|
1476
|
+
ariaLabel?: string;
|
|
1477
|
+
accents?: boolean;
|
|
1478
|
+
locale?: string;
|
|
1479
|
+
timeZone?: string;
|
|
1480
|
+
cornerRadius?: number;
|
|
1481
|
+
borderWidth?: number;
|
|
1482
|
+
digitGrouping?: DigitGrouping;
|
|
1483
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1484
|
+
decimalPlaces?: DecimalPlaces;
|
|
1485
|
+
currency?: string;
|
|
1486
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1487
|
+
percentPrecision?: PercentPrecision;
|
|
1488
|
+
dateFormat?: DateFormat;
|
|
1489
|
+
timeFormat?: TimeFormat;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
export declare interface HeatmapChartProps extends HeatmapChartBaseProps {
|
|
1493
|
+
tooltip?: HeatmapChartTooltipProp;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
export declare type HeatmapChartTooltipProp = undefined | false | ((props: HeatmapChartTooltipProps) => React_2.ReactNode);
|
|
1497
|
+
|
|
1498
|
+
export declare interface HeatmapChartTooltipProps {
|
|
1499
|
+
readonly row: number;
|
|
1500
|
+
readonly col: number;
|
|
1501
|
+
readonly value: number | null;
|
|
1502
|
+
readonly rowLabel: string;
|
|
1503
|
+
readonly colLabel: string;
|
|
1504
|
+
readonly pointerX: number;
|
|
1505
|
+
readonly pointerY: number;
|
|
1506
|
+
readonly containerWidth: number;
|
|
1507
|
+
readonly containerHeight: number;
|
|
1508
|
+
readonly theme: Theme;
|
|
1509
|
+
readonly palette: Palette;
|
|
1510
|
+
readonly locale: string;
|
|
1511
|
+
readonly timeZone: string | undefined;
|
|
1512
|
+
readonly formatter: ChartFormatter;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export declare type HeatmapColorScaleInput = HeatmapColorScaleType | DivergingConfig | SequentialConfig | QualitativeConfig;
|
|
1516
|
+
|
|
1517
|
+
export declare type HeatmapColorScaleType = "sequential" | "diverging" | "qualitative";
|
|
1518
|
+
|
|
1519
|
+
export declare interface HeatmapMatrixInput {
|
|
1520
|
+
/** Number of rows (y-axis cells). */
|
|
1521
|
+
readonly rows: number;
|
|
1522
|
+
/** Number of columns (x-axis cells). */
|
|
1523
|
+
readonly cols: number;
|
|
1524
|
+
/** Cell values, row-major (`values[r * cols + c]`). Length = rows × cols. */
|
|
1525
|
+
readonly values: Float64Array | readonly number[];
|
|
1526
|
+
/** Optional per-row labels (length = rows). When omitted, row indices. */
|
|
1527
|
+
readonly rowLabels?: readonly string[];
|
|
1528
|
+
/** Optional per-column labels (length = cols). When omitted, column indices. */
|
|
1529
|
+
readonly colLabels?: readonly string[];
|
|
1530
|
+
/** Optional null mask, row-major (`1` = null cell, `0` = value). */
|
|
1531
|
+
readonly nullMask?: Uint8Array | readonly number[];
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
/** Convert a sRGB hex string (`#rrggbb` or `#rgb`) to OKLCH. */
|
|
1535
|
+
export declare function hexToOklch(hex: string): Oklch;
|
|
1536
|
+
|
|
1537
|
+
export declare interface HierarchyNode {
|
|
1538
|
+
readonly name: string;
|
|
1539
|
+
/** Optional explicit value. Internal-node values are always overridden
|
|
1540
|
+
* by the sum of leaf-descendant values (treemap layout invariant). */
|
|
1541
|
+
readonly value?: number;
|
|
1542
|
+
/** Optional CSS color override; auto-cycle through palette.categorical. */
|
|
1543
|
+
readonly color?: string;
|
|
1544
|
+
/** Optional signed percent change (e.g. `-2.2`,
|
|
1545
|
+
* `1.7`). When supplied, drives the `'directional'` color scale + the
|
|
1546
|
+
* `'ticker'` label preset (▲/▼ glyph + magnitude). Internal-node deltas
|
|
1547
|
+
* are computed at ingest time as the value-weighted average of leaf
|
|
1548
|
+
* descendants. */
|
|
1549
|
+
readonly delta?: number;
|
|
1550
|
+
/** Optional secondary line rendered below the name in 'ticker' label
|
|
1551
|
+
* layout (e.g. company name beneath the symbol). */
|
|
1552
|
+
readonly sublabel?: string;
|
|
1553
|
+
readonly children?: readonly HierarchyNode[];
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
/** Marker mode for the visible-window high / low. */
|
|
1557
|
+
export declare type HighLowMarkers = "off" | "lines+labels" | "labels-only";
|
|
1558
|
+
|
|
1559
|
+
export declare function HistogramChart(props: HistogramChartProps): React_2.ReactElement;
|
|
1560
|
+
|
|
1561
|
+
declare interface HistogramChartBaseProps {
|
|
1562
|
+
/** Distribution data - raw values that will be binned by the
|
|
1563
|
+
* configured algorithm. See `HistogramSeriesInput`. */
|
|
1564
|
+
data?: HistogramSeriesInput;
|
|
1565
|
+
/** Default 'freedman-diaconis'. */
|
|
1566
|
+
binAlgorithm?: BinAlgorithm;
|
|
1567
|
+
/** Used when `binAlgorithm: 'fixed'`. */
|
|
1568
|
+
binCount?: number;
|
|
1569
|
+
/** `'auto'` → data min. */
|
|
1570
|
+
binStart?: number | "auto";
|
|
1571
|
+
/** `'auto'` → data max. */
|
|
1572
|
+
binEnd?: number | "auto";
|
|
1573
|
+
/** Default 'frequency'. */
|
|
1574
|
+
yAxis?: YAxisMode;
|
|
1575
|
+
/** Default 1.0 (touching bars). */
|
|
1576
|
+
barWidthRatio?: number;
|
|
1577
|
+
/** Default false. */
|
|
1578
|
+
overlay?: HistogramOverlayInput;
|
|
1579
|
+
legend?: LegendVisibility;
|
|
1580
|
+
legendPosition?: LegendPosition;
|
|
1581
|
+
crosshairVisible?: boolean;
|
|
1582
|
+
crosshairLineStyle?: GridStyle;
|
|
1583
|
+
crosshairMarker?: CrosshairMarker;
|
|
1584
|
+
width?: number;
|
|
1585
|
+
height?: number;
|
|
1586
|
+
theme?: ThemeInput;
|
|
1587
|
+
palette?: string;
|
|
1588
|
+
visualStyle?: "Fill" | "Outline";
|
|
1589
|
+
outlineFillColor?: "auto" | string;
|
|
1590
|
+
outlineFillOpacity?: number;
|
|
1591
|
+
pixelDensityCap?: number;
|
|
1592
|
+
fastMode?: boolean;
|
|
1593
|
+
/** Glow + glow-color axes. */
|
|
1594
|
+
glow?: GlowInput;
|
|
1595
|
+
glowColor?: GlowColorInput;
|
|
1596
|
+
/** Pattern fills. */
|
|
1597
|
+
pattern?: PatternInput;
|
|
1598
|
+
patternScale?: number;
|
|
1599
|
+
patternColor?: PatternColorInput;
|
|
1600
|
+
sparkline?: boolean;
|
|
1601
|
+
ariaLabel?: string;
|
|
1602
|
+
axisVisible?: boolean;
|
|
1603
|
+
yAxisPosition?: YAxisPosition;
|
|
1604
|
+
xAxisPosition?: XAxisPosition;
|
|
1605
|
+
yAxisPadding?: number;
|
|
1606
|
+
gridVisible?: boolean;
|
|
1607
|
+
gridStyle?: GridStyle;
|
|
1608
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
1609
|
+
accents?: boolean;
|
|
1610
|
+
locale?: string;
|
|
1611
|
+
timeZone?: string;
|
|
1612
|
+
cornerRadius?: number;
|
|
1613
|
+
borderWidth?: number;
|
|
1614
|
+
digitGrouping?: DigitGrouping;
|
|
1615
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1616
|
+
decimalPlaces?: DecimalPlaces;
|
|
1617
|
+
currency?: string;
|
|
1618
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1619
|
+
percentPrecision?: PercentPrecision;
|
|
1620
|
+
dateFormat?: DateFormat;
|
|
1621
|
+
timeFormat?: TimeFormat;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
export declare interface HistogramChartProps extends HistogramChartBaseProps {
|
|
1625
|
+
tooltip?: HistogramChartTooltipProp;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
export declare type HistogramChartTooltipProp = undefined | false | ((props: HistogramChartTooltipProps) => React_2.ReactNode);
|
|
1629
|
+
|
|
1630
|
+
export declare interface HistogramChartTooltipProps {
|
|
1631
|
+
/** Bin index (0-based). */
|
|
1632
|
+
readonly binIdx: number;
|
|
1633
|
+
/** Lower edge of the bin (data value). */
|
|
1634
|
+
readonly binStart: number;
|
|
1635
|
+
/** Upper edge of the bin (data value). */
|
|
1636
|
+
readonly binEnd: number;
|
|
1637
|
+
/** Raw count in this bin. */
|
|
1638
|
+
readonly count: number;
|
|
1639
|
+
/** Y-value rendered (frequency / density / cumulative). */
|
|
1640
|
+
readonly value: number;
|
|
1641
|
+
readonly pointerX: number;
|
|
1642
|
+
readonly pointerY: number;
|
|
1643
|
+
readonly containerWidth: number;
|
|
1644
|
+
readonly containerHeight: number;
|
|
1645
|
+
readonly theme: Theme;
|
|
1646
|
+
readonly palette: Palette;
|
|
1647
|
+
readonly locale: string;
|
|
1648
|
+
readonly timeZone: string | undefined;
|
|
1649
|
+
readonly formatter: ChartFormatter;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
export declare type HistogramOverlayInput = false | "normal" | "cumulative-line" | (OverlayStyle & {
|
|
1653
|
+
readonly type: HistogramOverlayType;
|
|
1654
|
+
});
|
|
1655
|
+
|
|
1656
|
+
export declare type HistogramOverlayType = "normal" | "cumulative-line";
|
|
1657
|
+
|
|
1658
|
+
export declare type HistogramSeriesInput = {
|
|
1659
|
+
readonly values: Float64Array;
|
|
1660
|
+
} | {
|
|
1661
|
+
readonly values: readonly number[];
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1664
|
+
export declare type IndicatorLineStyle = "solid" | "dashed" | "dotted";
|
|
1665
|
+
|
|
1666
|
+
declare interface IndicatorPaneCommon {
|
|
1667
|
+
/** `'auto'` resolves from `palette.indicators.<type>` at draw time. */
|
|
1668
|
+
color?: "auto" | string;
|
|
1669
|
+
/** Overrides global `indicatorLineWidth`. */
|
|
1670
|
+
lineWidth?: number;
|
|
1671
|
+
/** Overrides global `indicatorLineStyle`. */
|
|
1672
|
+
lineStyle?: IndicatorLineStyle;
|
|
1673
|
+
/** Overrides global `indicatorOpacity`. */
|
|
1674
|
+
opacity?: number;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
export declare type IndicatorPaneSpec = RsiSpecInput | MacdSpecInput | StochasticSpecInput | AtrSpecInput;
|
|
1678
|
+
|
|
1679
|
+
/** Sentinel - when |velocity| drops below this, stop the loop. */
|
|
1680
|
+
export declare const INERTIA_EPSILON = 0.01;
|
|
1681
|
+
|
|
1682
|
+
/** Translate a `KeyboardEvent.key` into an intent. Returns `null` when
|
|
1683
|
+
* the key isn't bound (caller passes through). */
|
|
1684
|
+
export declare function intentFromKey(key: string): KeyboardIntent | null;
|
|
1685
|
+
|
|
1686
|
+
/** Is `SharedArrayBuffer` available + the page is cross-origin-isolated? */
|
|
1687
|
+
export declare function isSharedMemoryAvailable(): boolean;
|
|
1688
|
+
|
|
1689
|
+
/** Cheap probe - returns true if `WebGL2RenderingContext` exists in the
|
|
1690
|
+
* current realm. Doesn't actually allocate a context. */
|
|
1691
|
+
export declare function isWebgl2Available(): boolean;
|
|
1692
|
+
|
|
1693
|
+
export declare function KagiChart(props: KagiChartProps): React_2.ReactElement;
|
|
1694
|
+
|
|
1695
|
+
declare interface KagiChartBaseProps {
|
|
1696
|
+
/** Required OHLC bars - Kagi filters out time and tracks direction
|
|
1697
|
+
* flips by reversal threshold. */
|
|
1698
|
+
data?: CandleSeriesInput;
|
|
1699
|
+
/** Price-distance required to reverse direction. `"auto"` =
|
|
1700
|
+
* ATR-derived; or a fixed value. */
|
|
1701
|
+
reversalThreshold?: BoxSizingInput;
|
|
1702
|
+
/** Rule for thick/thin line transitions (yang vs yin). */
|
|
1703
|
+
thicknessRule?: KagiThicknessRule;
|
|
1704
|
+
/** Stroke width for thick (uptrend) lines. */
|
|
1705
|
+
thickLineWidth?: number;
|
|
1706
|
+
/** Stroke width for thin (downtrend) lines. */
|
|
1707
|
+
thinLineWidth?: number;
|
|
1708
|
+
/** Source field for price comparisons. */
|
|
1709
|
+
source?: TimeOffSource;
|
|
1710
|
+
/** Toggle crosshair on hover. */
|
|
1711
|
+
crosshairVisible?: boolean;
|
|
1712
|
+
/** Crosshair line style. */
|
|
1713
|
+
crosshairLineStyle?: GridStyle;
|
|
1714
|
+
/** Snap-marker shape. */
|
|
1715
|
+
crosshairMarker?: CrosshairMarker;
|
|
1716
|
+
width?: number;
|
|
1717
|
+
height?: number;
|
|
1718
|
+
theme?: ThemeInput;
|
|
1719
|
+
palette?: string;
|
|
1720
|
+
visualStyle?: "Fill" | "Outline";
|
|
1721
|
+
outlineFillColor?: "auto" | string;
|
|
1722
|
+
outlineFillOpacity?: number;
|
|
1723
|
+
pixelDensityCap?: number;
|
|
1724
|
+
fastMode?: boolean;
|
|
1725
|
+
/** Glow + glow-color axes. */
|
|
1726
|
+
glow?: GlowInput;
|
|
1727
|
+
glowColor?: GlowColorInput;
|
|
1728
|
+
/** Pattern fills. */
|
|
1729
|
+
pattern?: PatternInput;
|
|
1730
|
+
patternScale?: number;
|
|
1731
|
+
patternColor?: PatternColorInput;
|
|
1732
|
+
ariaLabel?: string;
|
|
1733
|
+
axisVisible?: boolean;
|
|
1734
|
+
yAxisPosition?: YAxisPosition;
|
|
1735
|
+
xAxisPosition?: XAxisPosition;
|
|
1736
|
+
yAxisPadding?: number;
|
|
1737
|
+
gridVisible?: boolean;
|
|
1738
|
+
gridStyle?: GridStyle;
|
|
1739
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
1740
|
+
accents?: boolean;
|
|
1741
|
+
locale?: string;
|
|
1742
|
+
timeZone?: string;
|
|
1743
|
+
digitGrouping?: DigitGrouping;
|
|
1744
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1745
|
+
decimalPlaces?: DecimalPlaces;
|
|
1746
|
+
currency?: string;
|
|
1747
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1748
|
+
percentPrecision?: PercentPrecision;
|
|
1749
|
+
dateFormat?: DateFormat;
|
|
1750
|
+
timeFormat?: TimeFormat;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
export declare interface KagiChartProps extends KagiChartBaseProps {
|
|
1754
|
+
tooltip?: KagiChartTooltipProp;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
export declare type KagiChartTooltipProp = undefined | false | ((props: KagiChartTooltipProps) => React_2.ReactNode);
|
|
1758
|
+
|
|
1759
|
+
export declare interface KagiChartTooltipProps {
|
|
1760
|
+
readonly idx: number;
|
|
1761
|
+
readonly direction: 1 | -1;
|
|
1762
|
+
readonly thick: boolean;
|
|
1763
|
+
readonly startPrice: number;
|
|
1764
|
+
readonly endPrice: number;
|
|
1765
|
+
readonly pointerX: number;
|
|
1766
|
+
readonly pointerY: number;
|
|
1767
|
+
readonly containerWidth: number;
|
|
1768
|
+
readonly containerHeight: number;
|
|
1769
|
+
readonly theme: Theme;
|
|
1770
|
+
readonly palette: Palette;
|
|
1771
|
+
readonly locale: string;
|
|
1772
|
+
readonly timeZone: string | undefined;
|
|
1773
|
+
readonly formatter: ChartFormatter;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
export declare type KagiThicknessRule = "shoulder-waist" | "previous-high-low";
|
|
1777
|
+
|
|
1778
|
+
export declare interface KeyboardHandlerOptions {
|
|
1779
|
+
/** Called with the resolved intent. Caller decides which intents to
|
|
1780
|
+
* honor (e.g. ScatterChart ignores `go-end` since it has no time axis). */
|
|
1781
|
+
readonly onIntent: (intent: KeyboardIntent, ev: KeyboardEvent) => void;
|
|
1782
|
+
/** When `true` (default), the handler calls `preventDefault()` on the
|
|
1783
|
+
* bound keys so the browser doesn't scroll. */
|
|
1784
|
+
readonly preventDefault?: boolean;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
export declare type KeyboardIntent = "pan-left" | "pan-right" | "pan-up" | "pan-down" | "zoom-in" | "zoom-out" | "reset-zoom" | "reset-domain" | "go-end" | "escape";
|
|
1788
|
+
|
|
1789
|
+
export declare type LabelBehavior = "show-all" | "truncate" | "wrap" | "hide-on-overflow" | "auto";
|
|
1790
|
+
|
|
1791
|
+
export declare interface LabelConfig {
|
|
1792
|
+
position?: ValueLabelPosition;
|
|
1793
|
+
format?: "auto" | ((value: number) => string);
|
|
1794
|
+
/** `'auto'` picks high-contrast based on fill (white on Fill mode,
|
|
1795
|
+
* theme primary text on Outline mode). Hex / rgba string overrides. */
|
|
1796
|
+
color?: "auto" | string;
|
|
1797
|
+
fontSize?: number;
|
|
1798
|
+
fontWeight?: number | "normal" | "bold";
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
export declare type LabelContentInput = LabelContentPreset | ((slice: SliceLabelData) => string);
|
|
1802
|
+
|
|
1803
|
+
export declare type LabelContentPreset = "name" | "value" | "percent" | "name + value" | "name + percent" | "all";
|
|
1804
|
+
|
|
1805
|
+
export declare type LabelPlacement = "inside" | "outside" | "leader-line" | "auto" | "off";
|
|
1806
|
+
|
|
1807
|
+
export declare type LabelRotation = "horizontal" | "radial" | "tangent" | "auto";
|
|
1808
|
+
|
|
1809
|
+
export declare type LastPriceLineStyle = "off" | "solid" | "dashed" | "dotted";
|
|
1810
|
+
|
|
1811
|
+
export declare interface LayerSplitOptions {
|
|
1812
|
+
readonly cssWidth: number;
|
|
1813
|
+
readonly cssHeight: number;
|
|
1814
|
+
/** When `true`, the chart is in sparkline mode; sparklines never use
|
|
1815
|
+
* the dynamic layer (no hover affordances). */
|
|
1816
|
+
readonly sparkline?: boolean;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
/** Corner anchor for the legend. */
|
|
1820
|
+
declare type LegendPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
1821
|
+
|
|
1822
|
+
/** Legend visibility. */
|
|
1823
|
+
declare type LegendVisibility = "always" | "on-hover" | "off";
|
|
1824
|
+
|
|
1825
|
+
declare interface LevelHighlightConfig {
|
|
1826
|
+
/** `'auto'` resolves to `palette.warn` at draw time (visual urgency). */
|
|
1827
|
+
readonly color?: "auto" | string;
|
|
1828
|
+
readonly lineWidth?: number;
|
|
1829
|
+
readonly lineDash?: readonly number[];
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
export declare type LevelHighlightInput = false | true | LevelHighlightConfig;
|
|
1833
|
+
|
|
1834
|
+
export declare const LineChart: React_2.ForwardRefExoticComponent<LineChartProps & React_2.RefAttributes<LineChartHandle>>;
|
|
1835
|
+
|
|
1836
|
+
/** Framework-agnostic LineChart prop shape. Excludes the four render-prop
|
|
1837
|
+
* fields (`tooltip`, `extremeTooltip`, `connectionIndicator`, `staleBanner`)
|
|
1838
|
+
* that each framework adapter retypes against its native JSX element type
|
|
1839
|
+
* (`React.ReactNode` for React, `JSX.Element` for Solid). The controller's
|
|
1840
|
+
* `LineChartControllerProps` extends this with `unknown`-returning render
|
|
1841
|
+
* props so both adapters' shapes are structurally assignable via covariance. */
|
|
1842
|
+
declare interface LineChartBaseProps {
|
|
1843
|
+
/** Primary series data - either structured (`{ points: Array<{t, value}> }`)
|
|
1844
|
+
* or binary (`{ times: Float64Array; values: Float64Array }`). The
|
|
1845
|
+
* binary path is zero-copy. Mutually exclusive with `series` for
|
|
1846
|
+
* multi-series charts. */
|
|
1847
|
+
data?: LineSeriesInput;
|
|
1848
|
+
/** Older data prepended to `data` for indicator warm-up. Lets indicators
|
|
1849
|
+
* (SMA/EMA/etc.) have priors so the visible window starts post-warmup
|
|
1850
|
+
* with non-NaN values. Same shape as `data`. */
|
|
1851
|
+
historyData?: LineSeriesInput;
|
|
1852
|
+
/** Multi-series mode - overrides `data`. Each entry has its own id,
|
|
1853
|
+
* label, color, and `LineSeriesInput`. The first entry is the primary
|
|
1854
|
+
* series; subsequent entries draw as secondary lines. */
|
|
1855
|
+
series?: readonly SeriesConfig[];
|
|
1856
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
1857
|
+
width?: number;
|
|
1858
|
+
/** Chart height in CSS pixels. Default 300. */
|
|
1859
|
+
height?: number;
|
|
1860
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"` (follows
|
|
1861
|
+
* parent provider). Default: inherits from `<ChartsProvider>`. */
|
|
1862
|
+
theme?: ThemeInput;
|
|
1863
|
+
/** Palette name registered in the provider (e.g. `"Monochrome"`,
|
|
1864
|
+
* `"Classic"`, `"Accessible"`). Default: inherits from provider. */
|
|
1865
|
+
palette?: string;
|
|
1866
|
+
/** `"Fill"` (default) = solid up/down body fills. `"Outline"` =
|
|
1867
|
+
* colored border + translucent body fill. */
|
|
1868
|
+
visualStyle?: "Fill" | "Outline";
|
|
1869
|
+
/** In Outline mode, the fill color inside the outlined body.
|
|
1870
|
+
* `"auto"` (default) uses chart background. */
|
|
1871
|
+
outlineFillColor?: "auto" | string;
|
|
1872
|
+
/** In Outline mode, alpha of the outline body fill (0–100). Default 15. */
|
|
1873
|
+
outlineFillOpacity?: number;
|
|
1874
|
+
/** Cap the DPR used for canvas backing-store sizing (1–2 typical).
|
|
1875
|
+
* Reduces memory on hi-DPR screens with marginal sharpness loss.
|
|
1876
|
+
* Default 2. */
|
|
1877
|
+
pixelDensityCap?: number;
|
|
1878
|
+
/** Skip cosmetic features (glow, animations, full DPR) for low-end
|
|
1879
|
+
* devices. Adaptive complexity auto-engages this when fps drops. */
|
|
1880
|
+
fastMode?: boolean;
|
|
1881
|
+
/** Force sparkline mode - minimal axis-less render. Auto-engaged
|
|
1882
|
+
* when `width < 150`. */
|
|
1883
|
+
sparkline?: boolean;
|
|
1884
|
+
/** Override the auto-generated `aria-label` attached to the chart
|
|
1885
|
+
* container. Default summarizes data length + type. */
|
|
1886
|
+
ariaLabel?: string;
|
|
1887
|
+
/** When `true` (default) and the dynamic
|
|
1888
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
1889
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
1890
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
1891
|
+
partialRepaints?: boolean;
|
|
1892
|
+
/** Time-axis mode per the engine boundary.
|
|
1893
|
+
* - `"wall-clock"` (default) - engine's `TimeAxis.wallClock`. Bars
|
|
1894
|
+
* are positioned at their actual unix-ms; off-hours / weekends
|
|
1895
|
+
* leave horizontal gaps.
|
|
1896
|
+
* - `"session-ordinal"` - engine's `TimeAxis.sessionOrdinal` for the
|
|
1897
|
+
* supplied market. Off-session time is collapsed; bars sit
|
|
1898
|
+
* continuously without overnight / weekend gaps. Required for
|
|
1899
|
+
* equity charts (regular session 9:30-16:00, weekdays only). */
|
|
1900
|
+
timeAxisMode?: "wall-clock" | "session-ordinal";
|
|
1901
|
+
/** Market spec for session-ordinal mode. Ignored when `timeAxisMode`
|
|
1902
|
+
* is `"wall-clock"` (the default). */
|
|
1903
|
+
market?: "equity" | "dst-equity" | "crypto-24-7";
|
|
1904
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
1905
|
+
axisVisible?: boolean;
|
|
1906
|
+
/** `"left"` (default) or `"right"`. */
|
|
1907
|
+
yAxisPosition?: YAxisPosition;
|
|
1908
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
1909
|
+
xAxisPosition?: XAxisPosition;
|
|
1910
|
+
/** Fractional padding above/below the y-data range so marks don't
|
|
1911
|
+
* touch the axis edges. Default 0.05 (5%). */
|
|
1912
|
+
yAxisPadding?: number;
|
|
1913
|
+
/** Toggle gridlines. Default `true`. */
|
|
1914
|
+
gridVisible?: boolean;
|
|
1915
|
+
/** Gridline style: `"solid"` / `"dashed"` / `"dotted"`. Default `"solid"`. */
|
|
1916
|
+
gridStyle?: GridStyle;
|
|
1917
|
+
/** Number of gridline ticks - `"sparse"` (~3) / `"normal"` (~5) /
|
|
1918
|
+
* `"dense"` (~8). Default `"normal"`. */
|
|
1919
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
1920
|
+
/** Use the palette's `accentTint` for axis + grid colors instead of
|
|
1921
|
+
* `neutral`. Default `false`. */
|
|
1922
|
+
accents?: boolean;
|
|
1923
|
+
/** Locale code for number/date formatting (e.g. `"USA"`, `"en-US"`).
|
|
1924
|
+
* Default: inherits from provider. */
|
|
1925
|
+
locale?: string;
|
|
1926
|
+
/** IANA time zone for date formatting (e.g. `"America/New_York"`).
|
|
1927
|
+
* Default: inherits from provider. */
|
|
1928
|
+
timeZone?: string;
|
|
1929
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
1930
|
+
crosshairVisible?: boolean;
|
|
1931
|
+
/** How the crosshair snaps to data: `"data"` snaps to nearest data
|
|
1932
|
+
* point, `"free"` follows pointer exactly. Default `"data"`. */
|
|
1933
|
+
crosshairSnap?: CrosshairSnap;
|
|
1934
|
+
/** Crosshair line span: `"horizontal"`, `"vertical"`, or `"both"`. */
|
|
1935
|
+
crosshairMode?: CrosshairMode;
|
|
1936
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
1937
|
+
crosshairLineStyle?: GridStyle;
|
|
1938
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"`
|
|
1939
|
+
* / `"none"`. */
|
|
1940
|
+
crosshairMarker?: CrosshairMarker;
|
|
1941
|
+
indicators?: readonly LineChartIndicatorSpec[];
|
|
1942
|
+
digitGrouping?: DigitGrouping;
|
|
1943
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
1944
|
+
/** Decimal-place rule for price labels. Default 2. */
|
|
1945
|
+
decimalPlaces?: DecimalPlaces;
|
|
1946
|
+
/** ISO currency code (e.g. `"USD"`, `"EUR"`) for currency-formatted
|
|
1947
|
+
* labels. Default: inherit from provider locale. */
|
|
1948
|
+
currency?: string;
|
|
1949
|
+
/** `"symbol"` (default), `"code"`, or `"narrowSymbol"`. */
|
|
1950
|
+
currencyDisplay?: CurrencyDisplay;
|
|
1951
|
+
/** Precision for percentage-style labels. */
|
|
1952
|
+
percentPrecision?: PercentPrecision;
|
|
1953
|
+
/** Date format rule for time-axis labels (`"short"`, `"medium"`,
|
|
1954
|
+
* `"long"`). */
|
|
1955
|
+
dateFormat?: DateFormat;
|
|
1956
|
+
/** Time format rule for intraday tick labels. */
|
|
1957
|
+
timeFormat?: TimeFormat;
|
|
1958
|
+
/** Style of the last-price horizontal reference line: `"solid"` /
|
|
1959
|
+
* `"dashed"` / `"dotted"` / `false` to hide. Default `"solid"`. */
|
|
1960
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
1961
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
1962
|
+
lastPriceLabel?: boolean;
|
|
1963
|
+
/** Override the chart background color (CSS). Default: theme-derived. */
|
|
1964
|
+
chartBgColor?: string;
|
|
1965
|
+
/** Show high + low markers on the visible data range:
|
|
1966
|
+
* `"lines+labels"` (default), `"labels"`, `"off"`. */
|
|
1967
|
+
highLowMarkers?: HighLowMarkers;
|
|
1968
|
+
/** Live-bar animation: `"glow"` / `"dot"` / `"pulse-bar"` / `"none"`. */
|
|
1969
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
1970
|
+
/** Anchor for the connection-indicator badge + legend overlay:
|
|
1971
|
+
* `"top-left"` (default), `"top-right"`, `"bottom-left"`,
|
|
1972
|
+
* `"bottom-right"`. */
|
|
1973
|
+
legendPosition?: LegendPosition;
|
|
1974
|
+
/** Legend visibility: `"on"` (default), `"off"`, `"on-hover"`. */
|
|
1975
|
+
legend?: LegendVisibility;
|
|
1976
|
+
/** Visual treatment for stale connection state: `"banner"`,
|
|
1977
|
+
* `"desaturate-pulse"`, `"desaturate-pulse + banner"`, `"off"`. */
|
|
1978
|
+
staleVisualization?: StaleVisualization;
|
|
1979
|
+
/** Unix-ms timestamp of the latest accepted tick. Used to drive
|
|
1980
|
+
* the live/stale state machine + auto-stale timeout. */
|
|
1981
|
+
liveSince?: number;
|
|
1982
|
+
/** Host-asserted connection state - overrides `liveSince`-derived
|
|
1983
|
+
* state when present. `"live"` / `"stale"` / `"disconnected"`. */
|
|
1984
|
+
connectionState?: LiveState;
|
|
1985
|
+
/** Milliseconds after the last `liveSince` tick before the chart
|
|
1986
|
+
* auto-transitions to `"stale"`. Default 5000. */
|
|
1987
|
+
staleThreshold?: number;
|
|
1988
|
+
/** Host-forced reduced-motion override. When unset the chart reads
|
|
1989
|
+
* the user's `prefers-reduced-motion` media query. */
|
|
1990
|
+
reducedMotion?: boolean;
|
|
1991
|
+
/** Curve interpolation between points: `"linear"`, `"monotone"`,
|
|
1992
|
+
* `"step"`, `"step-before"`, `"step-after"`, `"basis"`, `"natural"`,
|
|
1993
|
+
* `"bump"`, or a parameterized form. Default `"linear"`. */
|
|
1994
|
+
curveType?: CurveType;
|
|
1995
|
+
/** When `curveType` is a `"step-*"` variant, radius (CSS px) for
|
|
1996
|
+
* rounded step corners. `0` (default) = square. */
|
|
1997
|
+
stepEdgeRadius?: number;
|
|
1998
|
+
/** Series stroke width in CSS px. Default 2. */
|
|
1999
|
+
lineWidth?: number;
|
|
2000
|
+
/** Dash pattern: `"solid"`, `"dashed"`, `"dotted"`. */
|
|
2001
|
+
lineDash?: LineDash;
|
|
2002
|
+
/** Multiplier for the dash gap when `lineDash !== "solid"`. */
|
|
2003
|
+
lineDashSpacing?: number;
|
|
2004
|
+
/** Per-point markers along the line: `"circle"`, `"diamond"`,
|
|
2005
|
+
* `"square"`, `"off"`. */
|
|
2006
|
+
pointMarkers?: PointMarkers;
|
|
2007
|
+
/** Area-fill config - when set, renders a filled polygon between the
|
|
2008
|
+
* line and a horizontal baseline. Switches the chart to AreaChart
|
|
2009
|
+
* visuals. See `AreaFillConfig` for full options. */
|
|
2010
|
+
areaFill?: AreaFillConfig;
|
|
2011
|
+
/** Direction-colored aura behind marks. */
|
|
2012
|
+
glow?: GlowInput;
|
|
2013
|
+
/** `'auto'` = direction-colored from palette;
|
|
2014
|
+
* literal color = uniform glow regardless of direction. */
|
|
2015
|
+
glowColor?: GlowColorInput;
|
|
2016
|
+
/** Pattern fills. */
|
|
2017
|
+
pattern?: PatternInput;
|
|
2018
|
+
patternScale?: number;
|
|
2019
|
+
patternColor?: PatternColorInput;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
/** Imperative handle exposed via `ref` on `<LineChart>`. Lets the host
|
|
2023
|
+
* push live-tick updates without re-rendering the React tree.
|
|
2024
|
+
* Binary Data Ingestion: primitive args. */
|
|
2025
|
+
declare interface LineChartHandle {
|
|
2026
|
+
/** Append a live tick (time ms, price). `size` is accepted for API
|
|
2027
|
+
* parity with CandleChart but is unused for line charts. */
|
|
2028
|
+
onTick(time: number, price: number, size?: number): void;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
/** Indicator overlays that LineChart can render on the price pane. VWAP
|
|
2032
|
+
* needs OHLC + volume + session_starts and is only available on
|
|
2033
|
+
* CandleChart. */
|
|
2034
|
+
export declare type LineChartIndicatorSpec = {
|
|
2035
|
+
type: "sma";
|
|
2036
|
+
period: number;
|
|
2037
|
+
color?: string;
|
|
2038
|
+
} | {
|
|
2039
|
+
type: "ema";
|
|
2040
|
+
period: number;
|
|
2041
|
+
color?: string;
|
|
2042
|
+
} | {
|
|
2043
|
+
type: "wma";
|
|
2044
|
+
period: number;
|
|
2045
|
+
color?: string;
|
|
2046
|
+
} | {
|
|
2047
|
+
type: "bollinger";
|
|
2048
|
+
period: number;
|
|
2049
|
+
multiplier: number;
|
|
2050
|
+
color?: string;
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
/** React LineChart prop shape. Extends the framework-agnostic
|
|
2054
|
+
* `LineChartBaseProps` (in `charts/line-chart-helpers.ts`) with the four
|
|
2055
|
+
* React-specific render-prop fields whose return type is `React.ReactNode`.
|
|
2056
|
+
* See `LineChartControllerProps` for the controller's `unknown`-returning
|
|
2057
|
+
* variant of the same shape. */
|
|
2058
|
+
export declare interface LineChartProps extends LineChartBaseProps {
|
|
2059
|
+
tooltip?: LineChartTooltipProp;
|
|
2060
|
+
extremeTooltip?: ExtremeTooltipProp;
|
|
2061
|
+
connectionIndicator?: ConnectionIndicatorProp;
|
|
2062
|
+
staleBanner?: StaleBannerProp;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* Polymorphic tooltip prop:
|
|
2067
|
+
* false - no tooltip
|
|
2068
|
+
* true / undefined - DefaultTooltip with theme-aware styling
|
|
2069
|
+
* function - custom render-prop, called with LineChartTooltipProps
|
|
2070
|
+
*/
|
|
2071
|
+
export declare type LineChartTooltipProp = boolean | ((props: LineChartTooltipProps) => React_2.ReactNode);
|
|
2072
|
+
|
|
2073
|
+
/** Props passed to a custom LineChart tooltip render function (and to the
|
|
2074
|
+
* built-in `DefaultTooltip` in both React and Solid). Framework-agnostic
|
|
2075
|
+
* data shape. */
|
|
2076
|
+
export declare interface LineChartTooltipProps {
|
|
2077
|
+
/** Time at the active hover position (unix-ms). */
|
|
2078
|
+
t: number;
|
|
2079
|
+
/** Value at the active hover position (primary series only). */
|
|
2080
|
+
value: number;
|
|
2081
|
+
/** Bar index in the source series; -1 when free-snap. */
|
|
2082
|
+
idx: number;
|
|
2083
|
+
/** Per-series values at hover.t - primary first, then secondaries. */
|
|
2084
|
+
seriesValues: readonly TooltipSeriesValue[];
|
|
2085
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
2086
|
+
pointerX: number;
|
|
2087
|
+
pointerY: number;
|
|
2088
|
+
/** Container dimensions for placement decisions. */
|
|
2089
|
+
containerWidth: number;
|
|
2090
|
+
containerHeight: number;
|
|
2091
|
+
/** Resolved theme + palette for color matching. */
|
|
2092
|
+
theme: Theme;
|
|
2093
|
+
palette: Palette;
|
|
2094
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
2095
|
+
locale: string;
|
|
2096
|
+
timeZone: string | undefined;
|
|
2097
|
+
/** Per-chart formatter - preferred over `locale` for new tooltip code. */
|
|
2098
|
+
formatter: ChartFormatter;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
export declare type LineDash = "solid" | "dashed" | "dotted" | readonly number[];
|
|
2102
|
+
|
|
2103
|
+
declare interface LinePoint {
|
|
2104
|
+
t: number;
|
|
2105
|
+
value: number;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
declare type LineSeriesInput = {
|
|
2109
|
+
points: readonly LinePoint[];
|
|
2110
|
+
} | {
|
|
2111
|
+
times: Float64Array;
|
|
2112
|
+
values: Float64Array;
|
|
2113
|
+
};
|
|
2114
|
+
|
|
2115
|
+
/** Live-bar indicator modes. */
|
|
2116
|
+
declare type LiveBarIndicator = "none" | "dot" | "badge" | "glow" | "outline" | "pulse-bar";
|
|
2117
|
+
|
|
2118
|
+
declare type LiveState = "live" | "stale" | "disconnected";
|
|
2119
|
+
|
|
2120
|
+
export declare type LongPressBehavior = "crosshair" | "context-menu" | "none";
|
|
2121
|
+
|
|
2122
|
+
export declare interface MacdSpecInput extends IndicatorPaneCommon {
|
|
2123
|
+
type: "macd";
|
|
2124
|
+
fastPeriod?: number;
|
|
2125
|
+
slowPeriod?: number;
|
|
2126
|
+
signalPeriod?: number;
|
|
2127
|
+
histogramVisible?: boolean;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
/** Build a keyboard listener that funnels mapped keys into `onIntent`.
|
|
2131
|
+
* Unmapped keys pass through (no preventDefault). Returns a function
|
|
2132
|
+
* the caller can `removeEventListener` to dispose. */
|
|
2133
|
+
export declare function makeKeyboardHandler(opts: KeyboardHandlerOptions): (ev: KeyboardEvent) => void;
|
|
2134
|
+
|
|
2135
|
+
/** Build a pinch handler. Tracks active pointers and emits scale deltas
|
|
2136
|
+
* on every pointermove during a two-finger gesture. */
|
|
2137
|
+
export declare function makePinchHandler(opts: PinchHandlerOptions): PinchHandler;
|
|
2138
|
+
|
|
2139
|
+
export declare interface MarkerConfig {
|
|
2140
|
+
style?: MarkerStyle;
|
|
2141
|
+
/** Diameter / longest side, in CSS px. Floored to `MIN_MARKER_SIZE` (1.5)
|
|
2142
|
+
* internally so markers don't disappear at extreme zoom-out. Default 5. */
|
|
2143
|
+
size?: number;
|
|
2144
|
+
/** Fill color. `'auto'` = the line's resolved color. `'none'` = no fill. */
|
|
2145
|
+
fill?: "auto" | "none" | string;
|
|
2146
|
+
/** Stroke color. `'auto'` matches `fill`. `'none'` = no stroke. */
|
|
2147
|
+
stroke?: "auto" | "none" | string;
|
|
2148
|
+
/** Stroke width in CSS px. `0` (default) = no border. */
|
|
2149
|
+
strokeWidth?: number;
|
|
2150
|
+
/** Up-arrow color when `style: 'direction'`. `'auto'` = `palette.up`. */
|
|
2151
|
+
upColor?: "auto" | string;
|
|
2152
|
+
/** Down-arrow color when `style: 'direction'`. `'auto'` = `palette.down`. */
|
|
2153
|
+
downColor?: "auto" | string;
|
|
2154
|
+
/** Custom up/down icons for `style: 'direction'`. Defaults to the built-in
|
|
2155
|
+
* chevron when `undefined`. */
|
|
2156
|
+
upIcon?: MarkerIcon;
|
|
2157
|
+
downIcon?: MarkerIcon;
|
|
2158
|
+
/** Required when `style: 'custom'`. Used for every data point. */
|
|
2159
|
+
icon?: MarkerIcon;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
/** Custom-icon shapes accepted by `MarkerConfig.icon` / `upIcon` / `downIcon`.
|
|
2163
|
+
* Evaluated synchronously per draw - no async resolution, no React-component
|
|
2164
|
+
* offscreen rendering (that's a future sweep when we add
|
|
2165
|
+
* bitmap-cache infra). */
|
|
2166
|
+
export declare type MarkerIcon =
|
|
2167
|
+
/** SVG path-data string (e.g. `"M-1,-1 L1,1 ..."`). Parsed to a cached
|
|
2168
|
+
* `Path2D` once per unique string at first use. */
|
|
2169
|
+
string
|
|
2170
|
+
/** Pre-built `Path2D` - used directly. */
|
|
2171
|
+
| Path2D
|
|
2172
|
+
/** Direct-draw function - called per point with translated origin.
|
|
2173
|
+
* Receives a context whose origin is at (x, y) and scaled to half-size,
|
|
2174
|
+
* so the function should draw the shape in [-1, 1] coordinates. */
|
|
2175
|
+
| ((ctx: CanvasRenderingContext2D) => void);
|
|
2176
|
+
|
|
2177
|
+
export declare type MarkerStyle = "circle" | "square" | "diamond" | "triangle" | "triangle-down" | "cross" | "plus" | "star" | "direction" | "custom";
|
|
2178
|
+
|
|
2179
|
+
declare type MarketKind = "equity" | "dst-equity" | "crypto-24-7";
|
|
2180
|
+
|
|
2181
|
+
declare interface MidLineConfig {
|
|
2182
|
+
readonly style?: MidLineStyle;
|
|
2183
|
+
readonly color?: "auto" | string;
|
|
2184
|
+
readonly lineWidth?: number;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
export declare type MidLineInput = false | true | "dashed" | MidLineConfig;
|
|
2188
|
+
|
|
2189
|
+
export declare type MidLineStyle = "solid" | "dashed";
|
|
2190
|
+
|
|
2191
|
+
export declare const MULTI_CHART_THRESHOLD = 4;
|
|
2192
|
+
|
|
2193
|
+
export declare type NodeAlignment = "justify" | "left" | "right" | "center";
|
|
2194
|
+
|
|
2195
|
+
export declare type NullBehavior = "empty" | "cross-hatch" | "background";
|
|
2196
|
+
|
|
2197
|
+
declare type NumberAbbreviation = "off" | "compact" | "lakh-crore" | "auto";
|
|
2198
|
+
|
|
2199
|
+
/** Allow a user-supplied function to bypass all built-in behavior. */
|
|
2200
|
+
export declare type NumberFormatInput = NumberFormatPreset | ((n: number) => string);
|
|
2201
|
+
|
|
2202
|
+
export declare type NumberFormatPreset = "standard" | "compact" | "pk-grouping" | "pk-compact" | "percent" | "currency";
|
|
2203
|
+
|
|
2204
|
+
export declare interface OffscreenContext {
|
|
2205
|
+
/** Total bars in the dataset. */
|
|
2206
|
+
readonly bulkBarCount?: number;
|
|
2207
|
+
/** Charts mounted on the same page sharing the engine. */
|
|
2208
|
+
readonly mountedChartCount?: number;
|
|
2209
|
+
/** Currently-visible marks (after downsampling). */
|
|
2210
|
+
readonly visibleMarkCount?: number;
|
|
2211
|
+
/** Honor host opt-outs (e.g. SSR snapshot mode). */
|
|
2212
|
+
readonly disabled?: boolean;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
declare interface Oklch {
|
|
2216
|
+
L: number;
|
|
2217
|
+
C: number;
|
|
2218
|
+
h: number;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
declare interface OrderMarker {
|
|
2222
|
+
/** Bar t the order lives at (typically the most-recent bar). */
|
|
2223
|
+
t: number;
|
|
2224
|
+
side: OrderSide;
|
|
2225
|
+
entryPrice: number;
|
|
2226
|
+
stopLossPrice?: number;
|
|
2227
|
+
takeProfitPrice?: number;
|
|
2228
|
+
meta?: Record<string, unknown>;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
declare type OrderMarkerMode = "off" | "lines" | "arrows-only" | "lines + zone";
|
|
2232
|
+
|
|
2233
|
+
declare type OrderSide = "buy" | "sell";
|
|
2234
|
+
|
|
2235
|
+
declare interface OrderTooltipProps {
|
|
2236
|
+
marker: OrderMarker;
|
|
2237
|
+
pointerX: number;
|
|
2238
|
+
pointerY: number;
|
|
2239
|
+
formatter: ChartFormatter;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
declare type Orientation = "vertical" | "horizontal";
|
|
2243
|
+
|
|
2244
|
+
declare interface OverlayStyle {
|
|
2245
|
+
/** `'auto'` resolves to `palette.neutral` at draw time. */
|
|
2246
|
+
readonly color?: "auto" | string;
|
|
2247
|
+
readonly lineWidth?: number;
|
|
2248
|
+
readonly lineDash?: readonly number[];
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
declare interface Palette {
|
|
2252
|
+
name: string;
|
|
2253
|
+
light: PaletteVariant;
|
|
2254
|
+
dark: PaletteVariant;
|
|
2255
|
+
tonalSymmetrySide: TonalSymmetrySide;
|
|
2256
|
+
tonalSymmetryFlipInDarkMode: boolean;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
export declare class PaletteValidationError extends Error {
|
|
2260
|
+
readonly paletteName: string;
|
|
2261
|
+
readonly missingSlot: string;
|
|
2262
|
+
readonly name = "PaletteValidationError";
|
|
2263
|
+
constructor(paletteName: string, missingSlot: string);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
declare interface PaletteVariant {
|
|
2267
|
+
up: Oklch;
|
|
2268
|
+
down: Oklch;
|
|
2269
|
+
doji: Oklch;
|
|
2270
|
+
neutral: Oklch;
|
|
2271
|
+
/** Caution / amber - used for stale state (connection indicator + stale
|
|
2272
|
+
* banner). Must read as "warning" without competing with `up`/`down`. */
|
|
2273
|
+
warn: Oklch;
|
|
2274
|
+
accentTint: Oklch;
|
|
2275
|
+
categorical: readonly Oklch[];
|
|
2276
|
+
indicators: {
|
|
2277
|
+
sma: Oklch;
|
|
2278
|
+
ema: Oklch;
|
|
2279
|
+
wma: Oklch;
|
|
2280
|
+
bb: Oklch;
|
|
2281
|
+
fib: Oklch;
|
|
2282
|
+
rsi: Oklch;
|
|
2283
|
+
macd: Oklch;
|
|
2284
|
+
stochastic: Oklch;
|
|
2285
|
+
atr: Oklch;
|
|
2286
|
+
vwap: Oklch;
|
|
2287
|
+
};
|
|
2288
|
+
drawings: {
|
|
2289
|
+
stroke: Oklch;
|
|
2290
|
+
fill: Oklch;
|
|
2291
|
+
handle: Oklch;
|
|
2292
|
+
label: Oklch;
|
|
2293
|
+
};
|
|
2294
|
+
/** Optional event-kind colors. When absent,
|
|
2295
|
+
* the chart falls back to a built-in default for each kind. */
|
|
2296
|
+
events?: {
|
|
2297
|
+
earnings?: Oklch;
|
|
2298
|
+
dividend?: Oklch;
|
|
2299
|
+
split?: Oklch;
|
|
2300
|
+
news?: Oklch;
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
export declare type PanAxis = "x" | "y" | "both";
|
|
2305
|
+
|
|
2306
|
+
export declare type PanEdgeBehavior =
|
|
2307
|
+
/** Hard stop at the data extents. */
|
|
2308
|
+
"stop"
|
|
2309
|
+
/** Allow over-pan with a small empty band. */
|
|
2310
|
+
| "overshoot"
|
|
2311
|
+
/** Wrap around (rarely useful for finance - left for completeness). */
|
|
2312
|
+
| "wrap";
|
|
2313
|
+
|
|
2314
|
+
export declare interface PanZoomOptions {
|
|
2315
|
+
readonly panEnabled: boolean;
|
|
2316
|
+
readonly zoomEnabled: boolean;
|
|
2317
|
+
readonly zoomAnchor: ZoomAnchor;
|
|
2318
|
+
readonly panEdgeBehavior: PanEdgeBehavior;
|
|
2319
|
+
readonly panInertia: boolean;
|
|
2320
|
+
readonly wheelBehavior: WheelBehavior;
|
|
2321
|
+
readonly panAxis: PanAxis;
|
|
2322
|
+
readonly doubleClickReset: boolean;
|
|
2323
|
+
readonly yAxisManualRescale: boolean;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
export declare type PanZoomOptionsInput = {
|
|
2327
|
+
readonly [K in keyof PanZoomOptions]?: PanZoomOptions[K] | undefined;
|
|
2328
|
+
};
|
|
2329
|
+
|
|
2330
|
+
export declare type PatternColorInput = "auto" | string;
|
|
2331
|
+
|
|
2332
|
+
/** Host-supplied input - string preset, config form, or a literal
|
|
2333
|
+
* `CanvasPattern` (full dev control). */
|
|
2334
|
+
export declare type PatternInput = PatternPreset | {
|
|
2335
|
+
readonly type: PatternPreset;
|
|
2336
|
+
readonly scale?: number;
|
|
2337
|
+
readonly lineWidth?: number;
|
|
2338
|
+
readonly color?: string;
|
|
2339
|
+
} | CanvasPattern;
|
|
2340
|
+
|
|
2341
|
+
export 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";
|
|
2342
|
+
|
|
2343
|
+
declare type PercentPrecision = "auto" | number;
|
|
2344
|
+
|
|
2345
|
+
export declare function PieChart(props: PieChartProps): React_2.ReactElement;
|
|
2346
|
+
|
|
2347
|
+
declare interface PieChartBaseProps {
|
|
2348
|
+
/** Slice data - array of `{ name, value, color? }`. Each value
|
|
2349
|
+
* becomes a slice proportional to its share of the total. */
|
|
2350
|
+
data?: PieSeriesInput;
|
|
2351
|
+
/** Default -90° (12 o'clock). Degrees. */
|
|
2352
|
+
startAngle?: number;
|
|
2353
|
+
/** Default 270° (full circle). Degrees. */
|
|
2354
|
+
endAngle?: number;
|
|
2355
|
+
/** Default 3°. Gap between slices, in degrees. */
|
|
2356
|
+
padAngle?: number;
|
|
2357
|
+
/** Default 0 (Pie) / 0.5 (Donut). */
|
|
2358
|
+
innerRadius?: number;
|
|
2359
|
+
/** Default 'auto'. */
|
|
2360
|
+
labelPlacement?: LabelPlacement;
|
|
2361
|
+
/** Default 'name + percent'. */
|
|
2362
|
+
labelContent?: LabelContentInput;
|
|
2363
|
+
/** Default 'value-desc'. */
|
|
2364
|
+
sortOrder?: SortOrder;
|
|
2365
|
+
/** Default false. */
|
|
2366
|
+
smallSliceThreshold?: SmallSliceThresholdInput;
|
|
2367
|
+
legend?: LegendVisibility;
|
|
2368
|
+
legendPosition?: LegendPosition;
|
|
2369
|
+
crosshairVisible?: boolean;
|
|
2370
|
+
crosshairLineStyle?: GridStyle;
|
|
2371
|
+
crosshairMarker?: CrosshairMarker;
|
|
2372
|
+
width?: number;
|
|
2373
|
+
height?: number;
|
|
2374
|
+
theme?: ThemeInput;
|
|
2375
|
+
palette?: string;
|
|
2376
|
+
visualStyle?: "Fill" | "Outline";
|
|
2377
|
+
outlineFillColor?: "auto" | string;
|
|
2378
|
+
outlineFillOpacity?: number;
|
|
2379
|
+
pixelDensityCap?: number;
|
|
2380
|
+
fastMode?: boolean;
|
|
2381
|
+
/** Glow + glow-color axes. */
|
|
2382
|
+
glow?: GlowInput;
|
|
2383
|
+
glowColor?: GlowColorInput;
|
|
2384
|
+
/** Pattern fills. */
|
|
2385
|
+
pattern?: PatternInput;
|
|
2386
|
+
patternScale?: number;
|
|
2387
|
+
patternColor?: PatternColorInput;
|
|
2388
|
+
ariaLabel?: string;
|
|
2389
|
+
accents?: boolean;
|
|
2390
|
+
locale?: string;
|
|
2391
|
+
timeZone?: string;
|
|
2392
|
+
cornerRadius?: number;
|
|
2393
|
+
borderWidth?: number;
|
|
2394
|
+
digitGrouping?: DigitGrouping;
|
|
2395
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
2396
|
+
decimalPlaces?: DecimalPlaces;
|
|
2397
|
+
currency?: string;
|
|
2398
|
+
currencyDisplay?: CurrencyDisplay;
|
|
2399
|
+
percentPrecision?: PercentPrecision;
|
|
2400
|
+
dateFormat?: DateFormat;
|
|
2401
|
+
timeFormat?: TimeFormat;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
export declare interface PieChartProps extends PieChartBaseProps {
|
|
2405
|
+
tooltip?: PieChartTooltipProp;
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
export declare type PieChartTooltipProp = undefined | false | ((props: PieChartTooltipProps) => React_2.ReactNode);
|
|
2409
|
+
|
|
2410
|
+
export declare interface PieChartTooltipProps {
|
|
2411
|
+
/** Slice index in the post-sort/combine order. */
|
|
2412
|
+
readonly idx: number;
|
|
2413
|
+
readonly name: string;
|
|
2414
|
+
readonly value: number;
|
|
2415
|
+
/** 0–1 fraction of the total. */
|
|
2416
|
+
readonly percent: number;
|
|
2417
|
+
readonly color: string;
|
|
2418
|
+
readonly pointerX: number;
|
|
2419
|
+
readonly pointerY: number;
|
|
2420
|
+
readonly containerWidth: number;
|
|
2421
|
+
readonly containerHeight: number;
|
|
2422
|
+
readonly theme: Theme;
|
|
2423
|
+
readonly palette: Palette;
|
|
2424
|
+
readonly locale: string;
|
|
2425
|
+
readonly timeZone: string | undefined;
|
|
2426
|
+
readonly formatter: ChartFormatter;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
export declare type PieSeriesInput = {
|
|
2430
|
+
readonly slices: readonly PieSlice[];
|
|
2431
|
+
} | {
|
|
2432
|
+
readonly values: Float64Array | readonly number[];
|
|
2433
|
+
readonly names: readonly string[];
|
|
2434
|
+
readonly colors?: ReadonlyArray<string | undefined>;
|
|
2435
|
+
};
|
|
2436
|
+
|
|
2437
|
+
export declare interface PieSlice {
|
|
2438
|
+
readonly name: string;
|
|
2439
|
+
readonly value: number;
|
|
2440
|
+
/** Optional CSS color override. When omitted, palette.categorical[i] cycles. */
|
|
2441
|
+
readonly color?: string;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
export declare interface PinchEvent {
|
|
2445
|
+
/** Scale ratio relative to the gesture start (`1 = no change`,
|
|
2446
|
+
* `>1 = zoom in`, `<1 = zoom out`). */
|
|
2447
|
+
readonly scale: number;
|
|
2448
|
+
/** Midpoint of the two pointers, in CSS px on the host element. */
|
|
2449
|
+
readonly centerX: number;
|
|
2450
|
+
readonly centerY: number;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
export declare interface PinchHandler {
|
|
2454
|
+
onPointerDown(ev: PointerEvent): void;
|
|
2455
|
+
onPointerMove(ev: PointerEvent): void;
|
|
2456
|
+
onPointerUp(ev: PointerEvent): void;
|
|
2457
|
+
/** Force-clear the active gesture (e.g. on unmount). */
|
|
2458
|
+
dispose(): void;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
export declare interface PinchHandlerOptions {
|
|
2462
|
+
readonly onPinch: (ev: PinchEvent) => void;
|
|
2463
|
+
readonly onPinchEnd?: () => void;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
declare interface PnFChartBaseProps {
|
|
2467
|
+
/** Required OHLC bars - the chart filters out time and renders X / O
|
|
2468
|
+
* symbols based on price-reversal logic. */
|
|
2469
|
+
data?: CandleSeriesInput;
|
|
2470
|
+
/** Box-size strategy - `"auto"` (ATR-derived) or explicit value. */
|
|
2471
|
+
boxSize?: BoxSizingInput;
|
|
2472
|
+
/** Number of boxes against the trend required to flip direction.
|
|
2473
|
+
* Standard is 3. */
|
|
2474
|
+
reversalCount?: number;
|
|
2475
|
+
/** Source field for price: `"close"` (default) or `"high-low"`. */
|
|
2476
|
+
source?: TimeOffSource;
|
|
2477
|
+
/** Symbol style for X / O columns. */
|
|
2478
|
+
symbolStyle?: PnFSymbolStyle;
|
|
2479
|
+
/** Padding between symbols within a column. */
|
|
2480
|
+
symbolPadding?: number;
|
|
2481
|
+
/** Toggle crosshair on hover. */
|
|
2482
|
+
crosshairVisible?: boolean;
|
|
2483
|
+
/** Crosshair line style. */
|
|
2484
|
+
crosshairLineStyle?: GridStyle;
|
|
2485
|
+
/** Snap-marker shape. */
|
|
2486
|
+
crosshairMarker?: CrosshairMarker;
|
|
2487
|
+
width?: number;
|
|
2488
|
+
height?: number;
|
|
2489
|
+
theme?: ThemeInput;
|
|
2490
|
+
palette?: string;
|
|
2491
|
+
visualStyle?: "Fill" | "Outline";
|
|
2492
|
+
outlineFillColor?: "auto" | string;
|
|
2493
|
+
outlineFillOpacity?: number;
|
|
2494
|
+
pixelDensityCap?: number;
|
|
2495
|
+
fastMode?: boolean;
|
|
2496
|
+
/** Glow + glow-color axes. */
|
|
2497
|
+
glow?: GlowInput;
|
|
2498
|
+
glowColor?: GlowColorInput;
|
|
2499
|
+
/** Pattern fills. */
|
|
2500
|
+
pattern?: PatternInput;
|
|
2501
|
+
patternScale?: number;
|
|
2502
|
+
patternColor?: PatternColorInput;
|
|
2503
|
+
ariaLabel?: string;
|
|
2504
|
+
axisVisible?: boolean;
|
|
2505
|
+
yAxisPosition?: YAxisPosition;
|
|
2506
|
+
xAxisPosition?: XAxisPosition;
|
|
2507
|
+
yAxisPadding?: number;
|
|
2508
|
+
gridVisible?: boolean;
|
|
2509
|
+
gridStyle?: GridStyle;
|
|
2510
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
2511
|
+
accents?: boolean;
|
|
2512
|
+
locale?: string;
|
|
2513
|
+
timeZone?: string;
|
|
2514
|
+
cornerRadius?: number;
|
|
2515
|
+
borderWidth?: number;
|
|
2516
|
+
digitGrouping?: DigitGrouping;
|
|
2517
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
2518
|
+
decimalPlaces?: DecimalPlaces;
|
|
2519
|
+
currency?: string;
|
|
2520
|
+
currencyDisplay?: CurrencyDisplay;
|
|
2521
|
+
percentPrecision?: PercentPrecision;
|
|
2522
|
+
dateFormat?: DateFormat;
|
|
2523
|
+
timeFormat?: TimeFormat;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
export declare interface PnFChartTooltipProps {
|
|
2527
|
+
readonly idx: number;
|
|
2528
|
+
readonly direction: 1 | -1;
|
|
2529
|
+
readonly bottomBox: number;
|
|
2530
|
+
readonly topBox: number;
|
|
2531
|
+
readonly pointerX: number;
|
|
2532
|
+
readonly pointerY: number;
|
|
2533
|
+
readonly containerWidth: number;
|
|
2534
|
+
readonly containerHeight: number;
|
|
2535
|
+
readonly theme: Theme;
|
|
2536
|
+
readonly palette: Palette;
|
|
2537
|
+
readonly locale: string;
|
|
2538
|
+
readonly timeZone: string | undefined;
|
|
2539
|
+
readonly formatter: ChartFormatter;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
export declare type PnFSymbolStyle = "classic" | "filled";
|
|
2543
|
+
|
|
2544
|
+
export declare function PointFigureChart(props: PointFigureChartProps): React_2.ReactElement;
|
|
2545
|
+
|
|
2546
|
+
export declare interface PointFigureChartProps extends PnFChartBaseProps {
|
|
2547
|
+
tooltip?: PointFigureChartTooltipProp;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
export declare type PointFigureChartTooltipProp = undefined | false | ((props: PnFChartTooltipProps) => React_2.ReactNode);
|
|
2551
|
+
|
|
2552
|
+
export declare type PointMarkers = boolean | MarkerConfig;
|
|
2553
|
+
|
|
2554
|
+
export declare type PointOpacityInput = number | "auto";
|
|
2555
|
+
|
|
2556
|
+
declare interface PointSizeConfig {
|
|
2557
|
+
/** `'linear'` (radius linear in value) or `'sqrt'` (area linear in value).
|
|
2558
|
+
* Default `'sqrt'` - perceptually correct for area-encoded bubbles. */
|
|
2559
|
+
readonly scale?: BubbleScale;
|
|
2560
|
+
/** `[minPx, maxPx]` - the rendered diameter range. Default [4, 32]. */
|
|
2561
|
+
readonly range?: readonly [number, number];
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
export declare type PointSizeInput = number | "data-driven" | PointSizeConfig;
|
|
2565
|
+
|
|
2566
|
+
declare interface PositionMarker {
|
|
2567
|
+
t: number;
|
|
2568
|
+
side: "long" | "short";
|
|
2569
|
+
entryPrice: number;
|
|
2570
|
+
/** Quantity in shares / lots - used by P&L pill calculations. */
|
|
2571
|
+
qty: number;
|
|
2572
|
+
meta?: Record<string, unknown>;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
declare type PositionMarkerMode = "off" | "line + pnl-pill" | "arrows-only";
|
|
2576
|
+
|
|
2577
|
+
declare interface PositionTooltipProps {
|
|
2578
|
+
marker: PositionMarker;
|
|
2579
|
+
/** Live last close - for P&L snapshot in the tooltip. */
|
|
2580
|
+
lastClose: number;
|
|
2581
|
+
pointerX: number;
|
|
2582
|
+
pointerY: number;
|
|
2583
|
+
formatter: ChartFormatter;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
export declare type PriceRangeInput = "auto" | number | PriceRangeWindow;
|
|
2587
|
+
|
|
2588
|
+
export declare interface PriceRangeWindow {
|
|
2589
|
+
/** Lower bound as fraction off mid (typically negative). */
|
|
2590
|
+
readonly minPct: number;
|
|
2591
|
+
/** Upper bound as fraction off mid (typically positive). */
|
|
2592
|
+
readonly maxPct: number;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
declare interface QualitativeConfig {
|
|
2596
|
+
readonly type: "qualitative";
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
export declare type RadiusProportion = "uniform" | "value-weighted" | "sqrt-weighted";
|
|
2600
|
+
|
|
2601
|
+
export declare interface Rect {
|
|
2602
|
+
readonly x: number;
|
|
2603
|
+
readonly y: number;
|
|
2604
|
+
readonly w: number;
|
|
2605
|
+
readonly h: number;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
export declare type ReferencePoint = "first-visible" | "last-bar" | number;
|
|
2609
|
+
|
|
2610
|
+
export declare function registerPalette(palette: Palette): void;
|
|
2611
|
+
|
|
2612
|
+
export declare type RegressionLineInput = false | true | (RegressionStyle & {
|
|
2613
|
+
readonly type: "linear";
|
|
2614
|
+
}) | (RegressionStyle & {
|
|
2615
|
+
readonly type: "polynomial";
|
|
2616
|
+
readonly degree?: number;
|
|
2617
|
+
}) | (RegressionStyle & {
|
|
2618
|
+
readonly type: "exponential";
|
|
2619
|
+
}) | (RegressionStyle & {
|
|
2620
|
+
readonly type: "lowess";
|
|
2621
|
+
readonly bandwidth?: number;
|
|
2622
|
+
});
|
|
2623
|
+
|
|
2624
|
+
declare interface RegressionStyle {
|
|
2625
|
+
/** `'auto'` resolves to `palette.neutral` at draw time. */
|
|
2626
|
+
readonly color?: "auto" | string;
|
|
2627
|
+
readonly lineWidth?: number;
|
|
2628
|
+
readonly lineDash?: readonly number[];
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
export declare type RegressionType = "linear" | "polynomial" | "exponential" | "lowess";
|
|
2632
|
+
|
|
2633
|
+
/** Map a downgrade level to the render config the chart should apply. */
|
|
2634
|
+
export declare interface RenderConfigOverrides {
|
|
2635
|
+
readonly disableGlow: boolean;
|
|
2636
|
+
readonly disableAnimations: boolean;
|
|
2637
|
+
readonly capDpr: boolean;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
/** Resolves the polymorphic `extremeTooltip` prop to a React node. Same
|
|
2641
|
+
* shape as the LineChart / BarChart tooltip resolvers - `false`
|
|
2642
|
+
* suppresses, function takes precedence, default routes to the built-
|
|
2643
|
+
* in. */
|
|
2644
|
+
export declare function renderExtremeTooltip(prop: ExtremeTooltipProp | undefined, tooltipProps: ExtremeTooltipProps): React_2.ReactNode;
|
|
2645
|
+
|
|
2646
|
+
export declare function RenkoChart(props: RenkoChartProps): React_2.ReactElement;
|
|
2647
|
+
|
|
2648
|
+
declare interface RenkoChartBaseProps {
|
|
2649
|
+
/** Required OHLC bars - Renko filters out time and renders fixed-
|
|
2650
|
+
* size price-movement bricks. */
|
|
2651
|
+
data?: CandleSeriesInput;
|
|
2652
|
+
/** Default 'atr-14'. */
|
|
2653
|
+
brickSize?: BoxSizingInput;
|
|
2654
|
+
/** Default 2. */
|
|
2655
|
+
reversalThreshold?: number;
|
|
2656
|
+
/** Default 'close'. */
|
|
2657
|
+
source?: TimeOffSource;
|
|
2658
|
+
/** Default 0 (touching bricks). */
|
|
2659
|
+
brickGap?: number;
|
|
2660
|
+
crosshairVisible?: boolean;
|
|
2661
|
+
crosshairLineStyle?: GridStyle;
|
|
2662
|
+
crosshairMarker?: CrosshairMarker;
|
|
2663
|
+
width?: number;
|
|
2664
|
+
height?: number;
|
|
2665
|
+
theme?: ThemeInput;
|
|
2666
|
+
palette?: string;
|
|
2667
|
+
visualStyle?: "Fill" | "Outline";
|
|
2668
|
+
outlineFillColor?: "auto" | string;
|
|
2669
|
+
outlineFillOpacity?: number;
|
|
2670
|
+
pixelDensityCap?: number;
|
|
2671
|
+
fastMode?: boolean;
|
|
2672
|
+
/** Glow + glow-color axes. */
|
|
2673
|
+
glow?: GlowInput;
|
|
2674
|
+
glowColor?: GlowColorInput;
|
|
2675
|
+
/** Pattern fills. */
|
|
2676
|
+
pattern?: PatternInput;
|
|
2677
|
+
patternScale?: number;
|
|
2678
|
+
patternColor?: PatternColorInput;
|
|
2679
|
+
ariaLabel?: string;
|
|
2680
|
+
axisVisible?: boolean;
|
|
2681
|
+
yAxisPosition?: YAxisPosition;
|
|
2682
|
+
xAxisPosition?: XAxisPosition;
|
|
2683
|
+
yAxisPadding?: number;
|
|
2684
|
+
gridVisible?: boolean;
|
|
2685
|
+
gridStyle?: GridStyle;
|
|
2686
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
2687
|
+
accents?: boolean;
|
|
2688
|
+
locale?: string;
|
|
2689
|
+
timeZone?: string;
|
|
2690
|
+
cornerRadius?: number;
|
|
2691
|
+
borderWidth?: number;
|
|
2692
|
+
digitGrouping?: DigitGrouping;
|
|
2693
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
2694
|
+
decimalPlaces?: DecimalPlaces;
|
|
2695
|
+
currency?: string;
|
|
2696
|
+
currencyDisplay?: CurrencyDisplay;
|
|
2697
|
+
percentPrecision?: PercentPrecision;
|
|
2698
|
+
dateFormat?: DateFormat;
|
|
2699
|
+
timeFormat?: TimeFormat;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
export declare interface RenkoChartProps extends RenkoChartBaseProps {
|
|
2703
|
+
tooltip?: RenkoChartTooltipProp;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
export declare type RenkoChartTooltipProp = undefined | false | ((props: RenkoChartTooltipProps) => React_2.ReactNode);
|
|
2707
|
+
|
|
2708
|
+
export declare interface RenkoChartTooltipProps {
|
|
2709
|
+
readonly idx: number;
|
|
2710
|
+
readonly direction: 1 | -1;
|
|
2711
|
+
readonly bottomPrice: number;
|
|
2712
|
+
readonly topPrice: number;
|
|
2713
|
+
readonly sourceTime: number;
|
|
2714
|
+
readonly pointerX: number;
|
|
2715
|
+
readonly pointerY: number;
|
|
2716
|
+
readonly containerWidth: number;
|
|
2717
|
+
readonly containerHeight: number;
|
|
2718
|
+
readonly theme: Theme;
|
|
2719
|
+
readonly palette: Palette;
|
|
2720
|
+
readonly locale: string;
|
|
2721
|
+
readonly timeZone: string | undefined;
|
|
2722
|
+
readonly formatter: ChartFormatter;
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
declare interface ResolvedAtrSpec {
|
|
2726
|
+
type: "atr";
|
|
2727
|
+
period: number;
|
|
2728
|
+
color: "auto" | string;
|
|
2729
|
+
lineWidth: number;
|
|
2730
|
+
lineStyle: IndicatorLineStyle;
|
|
2731
|
+
opacity: number;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
declare interface ResolvedBase {
|
|
2735
|
+
readonly color: "auto" | string;
|
|
2736
|
+
readonly lineWidth: number;
|
|
2737
|
+
readonly lineDash: readonly number[] | null;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
export declare type ResolvedBoxSizing = {
|
|
2741
|
+
readonly type: "fixed";
|
|
2742
|
+
readonly value: number;
|
|
2743
|
+
} | {
|
|
2744
|
+
readonly type: "atr";
|
|
2745
|
+
readonly period: number;
|
|
2746
|
+
} | {
|
|
2747
|
+
readonly type: "percent";
|
|
2748
|
+
readonly value: number;
|
|
2749
|
+
};
|
|
2750
|
+
|
|
2751
|
+
export declare interface ResolvedGlow {
|
|
2752
|
+
/** Normalized strength 0..1. Zero means glow is off; the rendering
|
|
2753
|
+
* primitive short-circuits and avoids the offscreen pass entirely. */
|
|
2754
|
+
readonly strength: number;
|
|
2755
|
+
/** Direction-aware or literal. `'auto'` triggers direction resolution at
|
|
2756
|
+
* draw time using the chart's palette. */
|
|
2757
|
+
readonly color: "auto" | string;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
export declare interface ResolvedHistogramOverlay {
|
|
2761
|
+
readonly type: HistogramOverlayType;
|
|
2762
|
+
readonly color: "auto" | string;
|
|
2763
|
+
readonly lineWidth: number;
|
|
2764
|
+
readonly lineDash: readonly number[] | null;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
export declare type ResolvedIndicatorPaneSpec = ResolvedRsiSpec | ResolvedMacdSpec | ResolvedStochasticSpec | ResolvedAtrSpec;
|
|
2768
|
+
|
|
2769
|
+
export declare interface ResolvedLevelHighlight {
|
|
2770
|
+
readonly color: "auto" | string;
|
|
2771
|
+
readonly lineWidth: number;
|
|
2772
|
+
readonly lineDash: readonly number[] | null;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
declare interface ResolvedLocale {
|
|
2776
|
+
/** Uppercase ISO 3166-1 alpha-3 code. */
|
|
2777
|
+
readonly country: string;
|
|
2778
|
+
/** Platform-formatter locale for international grouping. */
|
|
2779
|
+
readonly baseLocale: string;
|
|
2780
|
+
/** Locale for lakh-crore (lakh/crore) grouping with Latin digits forced.
|
|
2781
|
+
* When undefined, the country has no native lakh-crore-grouping
|
|
2782
|
+
* locale; ChartFormatter falls back to its custom 5-line formatter
|
|
2783
|
+
* when the host opts into lakh-crore grouping. */
|
|
2784
|
+
readonly lakhCroreLocale: string | undefined;
|
|
2785
|
+
/** ISO 4217 currency code paired with this locale by default. */
|
|
2786
|
+
readonly defaultCurrency: string;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
declare interface ResolvedMacdSpec {
|
|
2790
|
+
type: "macd";
|
|
2791
|
+
fastPeriod: number;
|
|
2792
|
+
slowPeriod: number;
|
|
2793
|
+
signalPeriod: number;
|
|
2794
|
+
histogramVisible: boolean;
|
|
2795
|
+
color: "auto" | string;
|
|
2796
|
+
lineWidth: number;
|
|
2797
|
+
lineStyle: IndicatorLineStyle;
|
|
2798
|
+
opacity: number;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
export declare interface ResolvedMidLine {
|
|
2802
|
+
readonly style: MidLineStyle;
|
|
2803
|
+
readonly color: "auto" | string;
|
|
2804
|
+
readonly lineWidth: number;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
export declare interface ResolvedNumberFormat {
|
|
2808
|
+
readonly preset: NumberFormatPreset | null;
|
|
2809
|
+
/** Non-null when the host passed a literal function. */
|
|
2810
|
+
readonly custom: ((n: number) => string) | null;
|
|
2811
|
+
/** Derived `digitGrouping` for the underlying formatter. */
|
|
2812
|
+
readonly digitGrouping: DigitGrouping;
|
|
2813
|
+
/** Derived `numberAbbreviation`. */
|
|
2814
|
+
readonly numberAbbreviation: NumberAbbreviation;
|
|
2815
|
+
/** When the preset is `'percent'` or `'currency'`, the formatter
|
|
2816
|
+
* routes through a percent / currency code path. */
|
|
2817
|
+
readonly mode: "number" | "percent" | "currency";
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
export declare interface ResolvedPattern {
|
|
2821
|
+
readonly type: PatternPreset;
|
|
2822
|
+
readonly scale: number;
|
|
2823
|
+
readonly lineWidth: number;
|
|
2824
|
+
/** `'auto'` triggers per-mark color derivation at draw time (uses the
|
|
2825
|
+
* mark's own fill color with OKLCH L-shift); a literal string forces
|
|
2826
|
+
* uniform pattern color. */
|
|
2827
|
+
readonly color: "auto" | string;
|
|
2828
|
+
/** Literal `CanvasPattern` (custom dev pattern). When non-null, the
|
|
2829
|
+
* rendering primitive uses it directly and ignores `type`. */
|
|
2830
|
+
readonly customPattern: CanvasPattern | null;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
export declare type ResolvedPointSize = {
|
|
2834
|
+
readonly kind: "fixed";
|
|
2835
|
+
readonly size: number;
|
|
2836
|
+
} | {
|
|
2837
|
+
readonly kind: "data-driven";
|
|
2838
|
+
readonly scale: BubbleScale;
|
|
2839
|
+
readonly range: readonly [number, number];
|
|
2840
|
+
};
|
|
2841
|
+
|
|
2842
|
+
export declare type ResolvedRegressionLine = (ResolvedBase & {
|
|
2843
|
+
readonly type: "linear";
|
|
2844
|
+
}) | (ResolvedBase & {
|
|
2845
|
+
readonly type: "polynomial";
|
|
2846
|
+
readonly degree: number;
|
|
2847
|
+
}) | (ResolvedBase & {
|
|
2848
|
+
readonly type: "exponential";
|
|
2849
|
+
}) | (ResolvedBase & {
|
|
2850
|
+
readonly type: "lowess";
|
|
2851
|
+
readonly bandwidth: number;
|
|
2852
|
+
});
|
|
2853
|
+
|
|
2854
|
+
declare interface ResolvedRsiSpec {
|
|
2855
|
+
type: "rsi";
|
|
2856
|
+
period: number;
|
|
2857
|
+
overbought: number;
|
|
2858
|
+
oversold: number;
|
|
2859
|
+
color: "auto" | string;
|
|
2860
|
+
lineWidth: number;
|
|
2861
|
+
lineStyle: IndicatorLineStyle;
|
|
2862
|
+
opacity: number;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
export declare type ResolvedSankeyLinkColor = {
|
|
2866
|
+
readonly kind: SankeyLinkColorPreset;
|
|
2867
|
+
} | {
|
|
2868
|
+
readonly kind: "literal";
|
|
2869
|
+
readonly color: string;
|
|
2870
|
+
};
|
|
2871
|
+
|
|
2872
|
+
export declare interface ResolvedSmallSliceThreshold {
|
|
2873
|
+
readonly threshold: number;
|
|
2874
|
+
readonly label: string;
|
|
2875
|
+
readonly color: "auto" | string;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
declare interface ResolvedStochasticSpec {
|
|
2879
|
+
type: "stochastic";
|
|
2880
|
+
kPeriod: number;
|
|
2881
|
+
dPeriod: number;
|
|
2882
|
+
smoothing: number;
|
|
2883
|
+
overbought: number;
|
|
2884
|
+
oversold: number;
|
|
2885
|
+
color: "auto" | string;
|
|
2886
|
+
lineWidth: number;
|
|
2887
|
+
lineStyle: IndicatorLineStyle;
|
|
2888
|
+
opacity: number;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
/** Resolved + normalized tooltip slot - the chart calls `mode === 'render'`
|
|
2892
|
+
* and invokes `render(props)` to materialise the tooltip, or skips when
|
|
2893
|
+
* `mode === 'off'`. */
|
|
2894
|
+
export declare type ResolvedTooltip<P> = {
|
|
2895
|
+
readonly mode: "off";
|
|
2896
|
+
} | {
|
|
2897
|
+
readonly mode: "default";
|
|
2898
|
+
} | {
|
|
2899
|
+
readonly mode: "render";
|
|
2900
|
+
readonly render: (p: P) => unknown;
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
/** Translate `fastMode: 'auto'` into a concrete boolean using the
|
|
2904
|
+
* context. Three triggers:
|
|
2905
|
+
* - effectiveType is "slow-2g" / "2g"
|
|
2906
|
+
* - deviceMemory ≤ 2 GB
|
|
2907
|
+
* - prefersReducedMotion is set
|
|
2908
|
+
* Any one trigger flips fastMode on. */
|
|
2909
|
+
export declare function resolveFastModeAuto(input: FastModeInput | undefined, ctx: FastModeContext): boolean;
|
|
2910
|
+
|
|
2911
|
+
/** Resolve glow inputs to a normalized form. `fastMode` forces strength
|
|
2912
|
+
* to zero regardless of input. */
|
|
2913
|
+
export declare function resolveGlow(input: GlowInput | undefined, color: GlowColorInput | undefined, fastMode: boolean): ResolvedGlow;
|
|
2914
|
+
|
|
2915
|
+
/** Resolve the halo stroke/fill color used in glow passes for a given
|
|
2916
|
+
* mark direction. Returns a CSS color string ready to assign to
|
|
2917
|
+
* `ctx.strokeStyle` / `ctx.fillStyle`. */
|
|
2918
|
+
export declare function resolveGlowHaloColor(glow: ResolvedGlow, theme: Theme, directionRgba: string): string;
|
|
2919
|
+
|
|
2920
|
+
export declare function resolveGpuRenderer(input: GpuRendererInput | undefined): GpuRendererInput;
|
|
2921
|
+
|
|
2922
|
+
export declare function resolveNumberFormat(input: NumberFormatInput | undefined): ResolvedNumberFormat;
|
|
2923
|
+
|
|
2924
|
+
export declare function resolvePanZoomOptions(input: PanZoomOptionsInput | undefined): PanZoomOptions;
|
|
2925
|
+
|
|
2926
|
+
export declare function resolvePattern(input: PatternInput | undefined, scale: number | undefined, color: PatternColorInput | undefined): ResolvedPattern;
|
|
2927
|
+
|
|
2928
|
+
export declare function resolveTooltip<P>(input: TooltipInput<P> | undefined): ResolvedTooltip<P>;
|
|
2929
|
+
|
|
2930
|
+
export declare interface RsiSpecInput extends IndicatorPaneCommon {
|
|
2931
|
+
type: "rsi";
|
|
2932
|
+
period?: number;
|
|
2933
|
+
overbought?: number;
|
|
2934
|
+
oversold?: number;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
export declare function SankeyChart(props: SankeyChartProps): React_2.ReactElement;
|
|
2938
|
+
|
|
2939
|
+
declare interface SankeyChartBaseProps {
|
|
2940
|
+
/** Flow data - `{ nodes: [{name}], links: [{source, target, value}] }`.
|
|
2941
|
+
* Sankey renders nodes as bars and links as proportional flow ribbons. */
|
|
2942
|
+
data?: SankeyInput;
|
|
2943
|
+
/** Default 'justify'. */
|
|
2944
|
+
nodeAlignment?: NodeAlignment;
|
|
2945
|
+
/** Default 8. */
|
|
2946
|
+
nodePadding?: number;
|
|
2947
|
+
/** Default 16. */
|
|
2948
|
+
nodeWidth?: number;
|
|
2949
|
+
/** Default 0.45. */
|
|
2950
|
+
linkOpacity?: number;
|
|
2951
|
+
/** Default 'source'. */
|
|
2952
|
+
linkColor?: SankeyLinkColorInput;
|
|
2953
|
+
/** Default 6. */
|
|
2954
|
+
iterations?: number;
|
|
2955
|
+
/** Default 'auto'. */
|
|
2956
|
+
labelPosition?: LabelPlacement;
|
|
2957
|
+
/** Default 'name + value'. */
|
|
2958
|
+
labelContent?: LabelContentInput;
|
|
2959
|
+
/** Default false. */
|
|
2960
|
+
valueDisplay?: SankeyValueDisplayInput;
|
|
2961
|
+
/** Default 'flat-categorical'. */
|
|
2962
|
+
colorScale?: TreemapColorScale;
|
|
2963
|
+
crosshairVisible?: boolean;
|
|
2964
|
+
crosshairLineStyle?: GridStyle;
|
|
2965
|
+
crosshairMarker?: CrosshairMarker;
|
|
2966
|
+
width?: number;
|
|
2967
|
+
height?: number;
|
|
2968
|
+
theme?: ThemeInput;
|
|
2969
|
+
palette?: string;
|
|
2970
|
+
visualStyle?: "Fill" | "Outline";
|
|
2971
|
+
outlineFillColor?: "auto" | string;
|
|
2972
|
+
outlineFillOpacity?: number;
|
|
2973
|
+
pixelDensityCap?: number;
|
|
2974
|
+
fastMode?: boolean;
|
|
2975
|
+
/** Glow + glow-color axes. */
|
|
2976
|
+
glow?: GlowInput;
|
|
2977
|
+
glowColor?: GlowColorInput;
|
|
2978
|
+
/** Pattern fills. */
|
|
2979
|
+
pattern?: PatternInput;
|
|
2980
|
+
patternScale?: number;
|
|
2981
|
+
patternColor?: PatternColorInput;
|
|
2982
|
+
ariaLabel?: string;
|
|
2983
|
+
accents?: boolean;
|
|
2984
|
+
locale?: string;
|
|
2985
|
+
timeZone?: string;
|
|
2986
|
+
cornerRadius?: number;
|
|
2987
|
+
borderWidth?: number;
|
|
2988
|
+
digitGrouping?: DigitGrouping;
|
|
2989
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
2990
|
+
decimalPlaces?: DecimalPlaces;
|
|
2991
|
+
currency?: string;
|
|
2992
|
+
currencyDisplay?: CurrencyDisplay;
|
|
2993
|
+
percentPrecision?: PercentPrecision;
|
|
2994
|
+
dateFormat?: DateFormat;
|
|
2995
|
+
timeFormat?: TimeFormat;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
export declare interface SankeyChartProps extends SankeyChartBaseProps {
|
|
2999
|
+
tooltip?: SankeyChartTooltipProp;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
export declare type SankeyChartTooltipProp = undefined | false | ((props: SankeyChartTooltipProps) => React_2.ReactNode);
|
|
3003
|
+
|
|
3004
|
+
export declare interface SankeyChartTooltipProps {
|
|
3005
|
+
readonly target: {
|
|
3006
|
+
kind: "node";
|
|
3007
|
+
idx: number;
|
|
3008
|
+
id: string;
|
|
3009
|
+
name: string;
|
|
3010
|
+
value: number;
|
|
3011
|
+
} | {
|
|
3012
|
+
kind: "link";
|
|
3013
|
+
idx: number;
|
|
3014
|
+
sourceId: string;
|
|
3015
|
+
targetId: string;
|
|
3016
|
+
value: number;
|
|
3017
|
+
};
|
|
3018
|
+
readonly color: string;
|
|
3019
|
+
readonly pointerX: number;
|
|
3020
|
+
readonly pointerY: number;
|
|
3021
|
+
readonly containerWidth: number;
|
|
3022
|
+
readonly containerHeight: number;
|
|
3023
|
+
readonly theme: Theme;
|
|
3024
|
+
readonly palette: Palette;
|
|
3025
|
+
readonly locale: string;
|
|
3026
|
+
readonly timeZone: string | undefined;
|
|
3027
|
+
readonly formatter: ChartFormatter;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
export declare interface SankeyInput {
|
|
3031
|
+
readonly nodes: readonly SankeyNodeInput[];
|
|
3032
|
+
readonly links: readonly SankeyLinkInput[];
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
export declare type SankeyLinkColorInput = SankeyLinkColorPreset | string;
|
|
3036
|
+
|
|
3037
|
+
export declare type SankeyLinkColorPreset = "source" | "target" | "gradient" | "neutral";
|
|
3038
|
+
|
|
3039
|
+
export declare interface SankeyLinkInput {
|
|
3040
|
+
readonly source: string | number;
|
|
3041
|
+
readonly target: string | number;
|
|
3042
|
+
readonly value: number;
|
|
3043
|
+
readonly color?: string;
|
|
3044
|
+
readonly opacity?: number;
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
export declare interface SankeyNodeInput {
|
|
3048
|
+
readonly id: string;
|
|
3049
|
+
readonly name?: string;
|
|
3050
|
+
readonly color?: string;
|
|
3051
|
+
readonly label?: string;
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
export declare type SankeyValueDisplayInput = false | true | "on-link-hover";
|
|
3055
|
+
|
|
3056
|
+
export declare type SankeyValueDisplayMode = "off" | "always" | "on-link-hover";
|
|
3057
|
+
|
|
3058
|
+
export declare function ScatterChart(props: ScatterChartProps): React_2.ReactElement;
|
|
3059
|
+
|
|
3060
|
+
declare interface ScatterChartBaseProps {
|
|
3061
|
+
/** Single-series point data - `xs` + `ys` + optional `sizes`. */
|
|
3062
|
+
data?: ScatterSeriesInput;
|
|
3063
|
+
/** Multi-series - pass an array of named series. */
|
|
3064
|
+
series?: readonly ScatterSeriesConfig[];
|
|
3065
|
+
/** Default 9 (fixed pixel diameter). */
|
|
3066
|
+
pointSize?: PointSizeInput;
|
|
3067
|
+
/** Default 'auto' - lowers per-point alpha at high counts. */
|
|
3068
|
+
pointOpacity?: PointOpacityInput;
|
|
3069
|
+
/** Default false. */
|
|
3070
|
+
regressionLine?: RegressionLineInput;
|
|
3071
|
+
/** Default 'auto' - switches to heatmap at ≥50k points. */
|
|
3072
|
+
density?: DensityInput;
|
|
3073
|
+
/** Inherits LineChart's MarkerConfig - controls point shape + fill/stroke
|
|
3074
|
+
* treatment. `pointSize` overrides the size field. */
|
|
3075
|
+
pointMarker?: PointMarkers;
|
|
3076
|
+
legend?: LegendVisibility;
|
|
3077
|
+
legendPosition?: LegendPosition;
|
|
3078
|
+
crosshairVisible?: boolean;
|
|
3079
|
+
crosshairLineStyle?: GridStyle;
|
|
3080
|
+
crosshairMarker?: CrosshairMarker;
|
|
3081
|
+
width?: number;
|
|
3082
|
+
height?: number;
|
|
3083
|
+
theme?: ThemeInput;
|
|
3084
|
+
palette?: string;
|
|
3085
|
+
visualStyle?: "Fill" | "Outline";
|
|
3086
|
+
outlineFillColor?: "auto" | string;
|
|
3087
|
+
outlineFillOpacity?: number;
|
|
3088
|
+
pixelDensityCap?: number;
|
|
3089
|
+
fastMode?: boolean;
|
|
3090
|
+
/** Glow + glow-color axes. */
|
|
3091
|
+
glow?: GlowInput;
|
|
3092
|
+
glowColor?: GlowColorInput;
|
|
3093
|
+
/** Pattern fills. */
|
|
3094
|
+
pattern?: PatternInput;
|
|
3095
|
+
patternScale?: number;
|
|
3096
|
+
patternColor?: PatternColorInput;
|
|
3097
|
+
sparkline?: boolean;
|
|
3098
|
+
ariaLabel?: string;
|
|
3099
|
+
axisVisible?: boolean;
|
|
3100
|
+
yAxisPosition?: YAxisPosition;
|
|
3101
|
+
xAxisPosition?: XAxisPosition;
|
|
3102
|
+
yAxisPadding?: number;
|
|
3103
|
+
xAxisPadding?: number;
|
|
3104
|
+
gridVisible?: boolean;
|
|
3105
|
+
gridStyle?: GridStyle;
|
|
3106
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
3107
|
+
accents?: boolean;
|
|
3108
|
+
locale?: string;
|
|
3109
|
+
timeZone?: string;
|
|
3110
|
+
digitGrouping?: DigitGrouping;
|
|
3111
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
3112
|
+
decimalPlaces?: DecimalPlaces;
|
|
3113
|
+
currency?: string;
|
|
3114
|
+
currencyDisplay?: CurrencyDisplay;
|
|
3115
|
+
percentPrecision?: PercentPrecision;
|
|
3116
|
+
dateFormat?: DateFormat;
|
|
3117
|
+
timeFormat?: TimeFormat;
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
export declare interface ScatterChartProps extends ScatterChartBaseProps {
|
|
3121
|
+
tooltip?: ScatterChartTooltipProp;
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
export declare type ScatterChartTooltipProp = undefined | false | ((props: ScatterChartTooltipProps) => React_2.ReactNode);
|
|
3125
|
+
|
|
3126
|
+
export declare interface ScatterChartTooltipProps {
|
|
3127
|
+
/** X-coordinate of the hovered point. */
|
|
3128
|
+
readonly x: number;
|
|
3129
|
+
/** Y-coordinate of the hovered point. */
|
|
3130
|
+
readonly y: number;
|
|
3131
|
+
/** Optional size value (when `pointSize` is data-driven). */
|
|
3132
|
+
readonly size: number | null;
|
|
3133
|
+
/** Index into the hovered series. */
|
|
3134
|
+
readonly idx: number;
|
|
3135
|
+
/** Index into the chart's series list (0 = primary, ≥1 = secondaries). */
|
|
3136
|
+
readonly seriesIdx: number;
|
|
3137
|
+
/** Series id (from `series[i].id`, or `'primary'` when only `data` was passed). */
|
|
3138
|
+
readonly seriesId: string;
|
|
3139
|
+
/** Series display label (`series[i].label ?? id`, or `'Value'` for primary-only). */
|
|
3140
|
+
readonly seriesLabel: string;
|
|
3141
|
+
/** Resolved CSS color for this series (categorical[i] cycling already applied). */
|
|
3142
|
+
readonly seriesColor: string;
|
|
3143
|
+
readonly pointerX: number;
|
|
3144
|
+
readonly pointerY: number;
|
|
3145
|
+
readonly containerWidth: number;
|
|
3146
|
+
readonly containerHeight: number;
|
|
3147
|
+
readonly theme: Theme;
|
|
3148
|
+
readonly palette: Palette;
|
|
3149
|
+
readonly locale: string;
|
|
3150
|
+
readonly timeZone: string | undefined;
|
|
3151
|
+
readonly formatter: ChartFormatter;
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
export declare interface ScatterPoint {
|
|
3155
|
+
readonly x: number;
|
|
3156
|
+
readonly y: number;
|
|
3157
|
+
/** Optional 3rd dimension - only consumed when `pointSize` is data-driven. */
|
|
3158
|
+
readonly size?: number;
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
/** Multi-series ScatterChart entry. Always supported.
|
|
3162
|
+
* Without per-series `color`, the lib auto-cycles `palette.categorical[i]`. */
|
|
3163
|
+
declare interface ScatterSeriesConfig {
|
|
3164
|
+
readonly id: string;
|
|
3165
|
+
readonly data: ScatterSeriesInput;
|
|
3166
|
+
readonly label?: string;
|
|
3167
|
+
readonly color?: string;
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
/** AoS or SoA - host picks. SoA is zero-copy on ingest. */
|
|
3171
|
+
export declare type ScatterSeriesInput = {
|
|
3172
|
+
readonly points: readonly ScatterPoint[];
|
|
3173
|
+
} | {
|
|
3174
|
+
readonly xs: Float64Array;
|
|
3175
|
+
readonly ys: Float64Array;
|
|
3176
|
+
readonly sizes?: Float64Array;
|
|
3177
|
+
};
|
|
3178
|
+
|
|
3179
|
+
declare interface SequentialConfig {
|
|
3180
|
+
readonly type: "sequential";
|
|
3181
|
+
/** `[low, high]` data range. When omitted, auto-fits to data extent. */
|
|
3182
|
+
readonly domain?: readonly [number, number];
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
/** Multi-series config - one entry per line on the chart.
|
|
3186
|
+
* Each entry can override the chart-level
|
|
3187
|
+
* curveType / lineWidth / lineDash / lineDashSpacing / pointMarkers for
|
|
3188
|
+
* this one series. Without a per-series `color`, lib auto-cycles
|
|
3189
|
+
* `palette.categorical[i]`. */
|
|
3190
|
+
export declare interface SeriesConfig {
|
|
3191
|
+
readonly id: string;
|
|
3192
|
+
readonly data: LineSeriesInput;
|
|
3193
|
+
readonly label?: string;
|
|
3194
|
+
readonly color?: string;
|
|
3195
|
+
readonly curveType?: CurveType;
|
|
3196
|
+
readonly stepEdgeRadius?: number;
|
|
3197
|
+
readonly lineWidth?: number;
|
|
3198
|
+
readonly lineDash?: LineDash;
|
|
3199
|
+
readonly lineDashSpacing?: number;
|
|
3200
|
+
readonly pointMarkers?: PointMarkers;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
/** Should the chart engage the offscreen-worker render path? */
|
|
3204
|
+
export declare function shouldEngageOffscreenWorker(ctx: OffscreenContext): boolean;
|
|
3205
|
+
|
|
3206
|
+
/** Decide whether the chart should engage the WebGL2 renderer.
|
|
3207
|
+
* Returns false when WebGL2 is unavailable in this environment. */
|
|
3208
|
+
export declare function shouldEngageWebgl(ctx: GpuEngageContext): boolean;
|
|
3209
|
+
|
|
3210
|
+
/** Centralised decision - should this chart use partial dirty-rect
|
|
3211
|
+
* repaints? Same threshold as the two-layer split for consistency. */
|
|
3212
|
+
export declare function shouldUseDirtyRects(cssWidth: number, cssHeight: number): boolean;
|
|
3213
|
+
|
|
3214
|
+
/** Decide whether to engage the two-canvas split. Returns `false` when
|
|
3215
|
+
* the chart is too small or in sparkline mode; `true` otherwise. */
|
|
3216
|
+
export declare function shouldUseLayerSplit(opts: LayerSplitOptions): boolean;
|
|
3217
|
+
|
|
3218
|
+
declare interface SignalMarker {
|
|
3219
|
+
/** Time in ms (matches a candle's t). */
|
|
3220
|
+
t: number;
|
|
3221
|
+
side: SignalSide;
|
|
3222
|
+
/** [0, 1] confidence - drives the marker size scale. */
|
|
3223
|
+
confidence?: number;
|
|
3224
|
+
/** Optional override for the chart's `signalTooltip` data. */
|
|
3225
|
+
meta?: Record<string, unknown>;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
declare type SignalMarkerMode = "off" | "arrows + letter" | "arrows" | "flags" | "dots" | "arrows + label";
|
|
3229
|
+
|
|
3230
|
+
declare type SignalSide = "buy" | "sell";
|
|
3231
|
+
|
|
3232
|
+
declare interface SignalTooltipProps {
|
|
3233
|
+
marker: SignalMarker;
|
|
3234
|
+
/** Bar's center x in CSS px (host can use for absolute positioning). */
|
|
3235
|
+
pointerX: number;
|
|
3236
|
+
pointerY: number;
|
|
3237
|
+
formatter: ChartFormatter;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
export declare interface SliceLabelData {
|
|
3241
|
+
readonly name: string;
|
|
3242
|
+
readonly value: number;
|
|
3243
|
+
/** 0–1 fraction of the total. */
|
|
3244
|
+
readonly percent: number;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
declare interface SmallSliceConfig {
|
|
3248
|
+
/** 0-1 fraction of total. */
|
|
3249
|
+
readonly threshold: number;
|
|
3250
|
+
readonly label?: string;
|
|
3251
|
+
/** `'auto'` resolves to a darker neutral at draw time. */
|
|
3252
|
+
readonly color?: "auto" | string;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
export declare type SmallSliceThresholdInput = false | number | SmallSliceConfig;
|
|
3256
|
+
|
|
3257
|
+
export declare type SortOrder = "value-desc" | "value-asc" | "data-order" | "alphabetical";
|
|
3258
|
+
|
|
3259
|
+
export declare const SPLIT_MIN_PX = 200;
|
|
3260
|
+
|
|
3261
|
+
export declare type SpreadDisplayInput = false | true | "pill" | "inline";
|
|
3262
|
+
|
|
3263
|
+
export declare type SpreadDisplayMode = "off" | "pill" | "inline";
|
|
3264
|
+
|
|
3265
|
+
export declare type StackingMode = false | true | "normalized";
|
|
3266
|
+
|
|
3267
|
+
/** Polymorphic prop:
|
|
3268
|
+
* `undefined | true` - built-in amber pill with pause icon
|
|
3269
|
+
* `false` - no banner (overrides staleVisualization)
|
|
3270
|
+
* function - custom HTML component (lib positions it top-center). */
|
|
3271
|
+
declare type StaleBannerProp = boolean | ((props: StaleBannerRenderProps) => React_2.ReactNode);
|
|
3272
|
+
|
|
3273
|
+
/** Props passed to a custom stale-banner render-prop. Framework-agnostic
|
|
3274
|
+
* data shape - same widening pattern as `ConnectionIndicatorRenderProps`. */
|
|
3275
|
+
declare interface StaleBannerRenderProps {
|
|
3276
|
+
state: LiveState;
|
|
3277
|
+
liveSince: number | undefined;
|
|
3278
|
+
theme: Theme;
|
|
3279
|
+
palette: Palette;
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
/** Chart-wide stale-state visual treatment. */
|
|
3283
|
+
declare type StaleVisualization = "none" | "desaturate-pulse" | "banner" | "desaturate-pulse + banner";
|
|
3284
|
+
|
|
3285
|
+
export declare class StaticLayerCache {
|
|
3286
|
+
private cachedKey;
|
|
3287
|
+
private cachedSurface;
|
|
3288
|
+
/** Stats - flips a counter every hit / miss for benchmark + dev
|
|
3289
|
+
* inspection. Auditable side-effect. */
|
|
3290
|
+
private hits;
|
|
3291
|
+
private misses;
|
|
3292
|
+
/** Returns the cached surface when `key` matches the prior call.
|
|
3293
|
+
* Returns null on miss; caller paints into the surface returned by
|
|
3294
|
+
* `acquireSurface(w, h, dpr)` next. */
|
|
3295
|
+
lookup(key: StaticLayerCacheKey): HTMLCanvasElement | null;
|
|
3296
|
+
/** Acquire (or recycle) the offscreen surface the caller will paint
|
|
3297
|
+
* into. Always recreated on size/DPR change (cheaper than scaling). */
|
|
3298
|
+
acquireSurface(cssWidth: number, cssHeight: number, dpr: number): HTMLCanvasElement;
|
|
3299
|
+
/** Commit the current surface to the cache under `key`. Caller calls
|
|
3300
|
+
* this after painting. */
|
|
3301
|
+
commit(key: StaticLayerCacheKey): void;
|
|
3302
|
+
/** Force a miss on the next lookup. */
|
|
3303
|
+
invalidate(): void;
|
|
3304
|
+
/** Inspection - useful for benches + dev audit. */
|
|
3305
|
+
stats(): {
|
|
3306
|
+
readonly hits: number;
|
|
3307
|
+
readonly misses: number;
|
|
3308
|
+
};
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
export declare interface StaticLayerCacheKey {
|
|
3312
|
+
readonly cssWidth: number;
|
|
3313
|
+
readonly cssHeight: number;
|
|
3314
|
+
readonly dpr: number;
|
|
3315
|
+
readonly themeFingerprint: string;
|
|
3316
|
+
readonly dataFingerprint: string;
|
|
3317
|
+
/** Hosts can suffix any extra state that affects the static layer. */
|
|
3318
|
+
readonly extra: string;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
export declare interface StochasticSpecInput extends IndicatorPaneCommon {
|
|
3322
|
+
type: "stochastic";
|
|
3323
|
+
kPeriod?: number;
|
|
3324
|
+
dPeriod?: number;
|
|
3325
|
+
smoothing?: number;
|
|
3326
|
+
overbought?: number;
|
|
3327
|
+
oversold?: number;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
export declare function SunburstChart(props: SunburstChartProps): React_2.ReactElement;
|
|
3331
|
+
|
|
3332
|
+
declare interface SunburstChartBaseProps {
|
|
3333
|
+
/** Root hierarchy - a tree of `{ name, value?, children? }`. The
|
|
3334
|
+
* chart renders concentric rings, one per depth level. */
|
|
3335
|
+
data?: HierarchyNode;
|
|
3336
|
+
/** Default 'uniform'. */
|
|
3337
|
+
radiusProportion?: RadiusProportion;
|
|
3338
|
+
/** Default 'horizontal'. */
|
|
3339
|
+
labelRotation?: LabelRotation;
|
|
3340
|
+
/** Default false. Same shape as DonutChart's centerLabel. */
|
|
3341
|
+
centerLabel?: boolean | string;
|
|
3342
|
+
/** Inherited from PieChart-related axes - gap between slices. Default 1°. */
|
|
3343
|
+
padAngle?: number;
|
|
3344
|
+
/** Inherited from TreemapChart axes. */
|
|
3345
|
+
labelBehavior?: LabelBehavior;
|
|
3346
|
+
labelContent?: LabelContentInput;
|
|
3347
|
+
depthLimit?: DepthLimitInput;
|
|
3348
|
+
colorScale?: TreemapColorScale;
|
|
3349
|
+
viewMode?: ViewMode;
|
|
3350
|
+
breadcrumb?: boolean;
|
|
3351
|
+
currentPath?: readonly string[];
|
|
3352
|
+
onPathChange?: (path: readonly string[]) => void;
|
|
3353
|
+
legend?: LegendVisibility;
|
|
3354
|
+
legendPosition?: LegendPosition;
|
|
3355
|
+
crosshairVisible?: boolean;
|
|
3356
|
+
crosshairLineStyle?: GridStyle;
|
|
3357
|
+
crosshairMarker?: CrosshairMarker;
|
|
3358
|
+
width?: number;
|
|
3359
|
+
height?: number;
|
|
3360
|
+
theme?: ThemeInput;
|
|
3361
|
+
palette?: string;
|
|
3362
|
+
visualStyle?: "Fill" | "Outline";
|
|
3363
|
+
outlineFillColor?: "auto" | string;
|
|
3364
|
+
outlineFillOpacity?: number;
|
|
3365
|
+
pixelDensityCap?: number;
|
|
3366
|
+
fastMode?: boolean;
|
|
3367
|
+
/** Glow + glow-color axes. */
|
|
3368
|
+
glow?: GlowInput;
|
|
3369
|
+
glowColor?: GlowColorInput;
|
|
3370
|
+
/** Pattern fills. */
|
|
3371
|
+
pattern?: PatternInput;
|
|
3372
|
+
patternScale?: number;
|
|
3373
|
+
patternColor?: PatternColorInput;
|
|
3374
|
+
ariaLabel?: string;
|
|
3375
|
+
accents?: boolean;
|
|
3376
|
+
locale?: string;
|
|
3377
|
+
timeZone?: string;
|
|
3378
|
+
cornerRadius?: number;
|
|
3379
|
+
borderWidth?: number;
|
|
3380
|
+
digitGrouping?: DigitGrouping;
|
|
3381
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
3382
|
+
decimalPlaces?: DecimalPlaces;
|
|
3383
|
+
currency?: string;
|
|
3384
|
+
currencyDisplay?: CurrencyDisplay;
|
|
3385
|
+
percentPrecision?: PercentPrecision;
|
|
3386
|
+
dateFormat?: DateFormat;
|
|
3387
|
+
timeFormat?: TimeFormat;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
export declare interface SunburstChartProps extends SunburstChartBaseProps {
|
|
3391
|
+
tooltip?: SunburstChartTooltipProp;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
export declare type SunburstChartTooltipProp = undefined | false | ((props: SunburstChartTooltipProps) => React_2.ReactNode);
|
|
3395
|
+
|
|
3396
|
+
export declare interface SunburstChartTooltipProps {
|
|
3397
|
+
readonly idx: number;
|
|
3398
|
+
readonly name: string;
|
|
3399
|
+
readonly value: number;
|
|
3400
|
+
readonly percent: number;
|
|
3401
|
+
readonly depth: number;
|
|
3402
|
+
readonly path: readonly string[];
|
|
3403
|
+
readonly color: string;
|
|
3404
|
+
readonly pointerX: number;
|
|
3405
|
+
readonly pointerY: number;
|
|
3406
|
+
readonly containerWidth: number;
|
|
3407
|
+
readonly containerHeight: number;
|
|
3408
|
+
readonly theme: Theme;
|
|
3409
|
+
readonly palette: Palette;
|
|
3410
|
+
readonly locale: string;
|
|
3411
|
+
readonly timeZone: string | undefined;
|
|
3412
|
+
readonly formatter: ChartFormatter;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
export declare type SyncYScale = "off" | "percent" | "absolute";
|
|
3416
|
+
|
|
3417
|
+
declare type Theme = "light" | "dark";
|
|
3418
|
+
|
|
3419
|
+
declare type ThemeInput = "inherit" | "light" | "dark" | "system";
|
|
3420
|
+
|
|
3421
|
+
declare type ThemeSwitchTransition = "fade" | "none";
|
|
3422
|
+
|
|
3423
|
+
export declare type ThresholdFill = false | true | ThresholdFillConfig;
|
|
3424
|
+
|
|
3425
|
+
/** Optional config form of `thresholdFill`. */
|
|
3426
|
+
export declare interface ThresholdFillConfig {
|
|
3427
|
+
/** Domain-space y to split at. Defaults to the resolved baseline value
|
|
3428
|
+
* when the user passes `thresholdFill: true`. */
|
|
3429
|
+
value?: number;
|
|
3430
|
+
/** CSS color for above-threshold runs. Defaults to `palette.up`. */
|
|
3431
|
+
aboveColor?: string;
|
|
3432
|
+
/** CSS color for below-threshold runs. Defaults to `palette.down`. */
|
|
3433
|
+
belowColor?: string;
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
export declare type TileLayout = "squarify" | "slice-and-dice" | "strip" | "slice" | "dice" | "binary";
|
|
3437
|
+
|
|
3438
|
+
declare type TimeFormat = "auto" | "24h" | "12h";
|
|
3439
|
+
|
|
3440
|
+
export declare type TimeOffSource = "close" | "high-low";
|
|
3441
|
+
|
|
3442
|
+
export declare interface TimeRange {
|
|
3443
|
+
readonly start: number;
|
|
3444
|
+
readonly end: number;
|
|
3445
|
+
}
|
|
3446
|
+
|
|
3447
|
+
/** Per-palette declaration of the tonal-symmetry rule.
|
|
3448
|
+
* When `'positive'` or `'negative'`, the
|
|
3449
|
+
* chosen direction renders with the opposite-direction's color as
|
|
3450
|
+
* its stroke and a fully-transparent interior (regardless of
|
|
3451
|
+
* `visualStyle`). The non-chosen direction renders normally per
|
|
3452
|
+
* `visualStyle`. `'none'` disables the rule - both directions render
|
|
3453
|
+
* by their own palette color per `visualStyle`. */
|
|
3454
|
+
declare type TonalSymmetrySide = "positive" | "negative" | "none";
|
|
3455
|
+
|
|
3456
|
+
/** Canonical list of tooltip-slot names the lib exposes.
|
|
3457
|
+
* Stored for audit + documentation; not used at runtime. */
|
|
3458
|
+
export declare const TOOLTIP_SLOT_NAMES: readonly ["tooltip", "markerTooltip", "signalTooltip", "orderTooltip", "positionTooltip", "eventTooltip", "drawingTooltip", "extremeTooltip", "volumeBarTooltip", "livePriceLineTooltip", "indicatorTooltip"];
|
|
3459
|
+
|
|
3460
|
+
/** A tooltip slot's polymorphic input form. Used uniformly across
|
|
3461
|
+
* every tooltip prop (`tooltip`, `markerTooltip`, `signalTooltip`,
|
|
3462
|
+
* `orderTooltip`, `positionTooltip`, `eventTooltip`, `drawingTooltip`,
|
|
3463
|
+
* `extremeTooltip`, `volumeBarTooltip`, `livePriceLineTooltip`,
|
|
3464
|
+
* `indicatorTooltip`). Generic `P` is the chart-specific tooltip
|
|
3465
|
+
* props extending `BaseTooltipProps`. */
|
|
3466
|
+
export declare type TooltipInput<P> = false | true | ((props: P) => unknown);
|
|
3467
|
+
|
|
3468
|
+
/** Per-series value at the hover-x. Every visible
|
|
3469
|
+
* series shows its value at the cursor in multi-series mode. */
|
|
3470
|
+
declare interface TooltipSeriesValue {
|
|
3471
|
+
readonly id: string;
|
|
3472
|
+
readonly label: string;
|
|
3473
|
+
readonly color: string;
|
|
3474
|
+
readonly value: number;
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
export declare type TooltipSlotName = (typeof TOOLTIP_SLOT_NAMES)[number];
|
|
3478
|
+
|
|
3479
|
+
/** Reusable transferable-list builder. Caller passes the typed arrays
|
|
3480
|
+
* whose backing buffers should be transferred (zero-copy), and we
|
|
3481
|
+
* return the `Transferable[]` array `postMessage` consumes. */
|
|
3482
|
+
export declare function transferablesFor(arrs: readonly ArrayBufferView[]): Transferable[];
|
|
3483
|
+
|
|
3484
|
+
export declare function TreemapChart(props: TreemapChartProps): React_2.ReactElement;
|
|
3485
|
+
|
|
3486
|
+
declare interface TreemapChartBaseProps {
|
|
3487
|
+
/** Root hierarchy - `{ name, value?, children? }`. The chart packs
|
|
3488
|
+
* children into rectangles proportional to their value. */
|
|
3489
|
+
data?: HierarchyNode;
|
|
3490
|
+
/** Default 'squarify'. */
|
|
3491
|
+
tileLayout?: TileLayout;
|
|
3492
|
+
/** Default 2 px. */
|
|
3493
|
+
tilePadding?: number;
|
|
3494
|
+
/** Default 4 px. */
|
|
3495
|
+
parentChildPadding?: number;
|
|
3496
|
+
/** Default 'auto'. */
|
|
3497
|
+
labelBehavior?: LabelBehavior;
|
|
3498
|
+
/** Default 'name + percent'. */
|
|
3499
|
+
labelContent?: LabelContentInput;
|
|
3500
|
+
/** Default 'all'. */
|
|
3501
|
+
depthLimit?: DepthLimitInput;
|
|
3502
|
+
/** Default 'flat-categorical'. */
|
|
3503
|
+
colorScale?: TreemapColorScale;
|
|
3504
|
+
/** Default 'nested'. */
|
|
3505
|
+
viewMode?: ViewMode;
|
|
3506
|
+
/** Default true (drill-down only). */
|
|
3507
|
+
breadcrumb?: boolean;
|
|
3508
|
+
/** Controlled-mode current path (drill-down only). When omitted, the
|
|
3509
|
+
* controller manages an internal session-state path. */
|
|
3510
|
+
currentPath?: readonly string[];
|
|
3511
|
+
/** Controlled-mode change handler. Required if `currentPath` is set. */
|
|
3512
|
+
onPathChange?: (path: readonly string[]) => void;
|
|
3513
|
+
legend?: LegendVisibility;
|
|
3514
|
+
legendPosition?: LegendPosition;
|
|
3515
|
+
crosshairVisible?: boolean;
|
|
3516
|
+
crosshairLineStyle?: GridStyle;
|
|
3517
|
+
crosshairMarker?: CrosshairMarker;
|
|
3518
|
+
width?: number;
|
|
3519
|
+
height?: number;
|
|
3520
|
+
theme?: ThemeInput;
|
|
3521
|
+
palette?: string;
|
|
3522
|
+
visualStyle?: "Fill" | "Outline";
|
|
3523
|
+
outlineFillColor?: "auto" | string;
|
|
3524
|
+
outlineFillOpacity?: number;
|
|
3525
|
+
pixelDensityCap?: number;
|
|
3526
|
+
fastMode?: boolean;
|
|
3527
|
+
/** Glow + glow-color axes. */
|
|
3528
|
+
glow?: GlowInput;
|
|
3529
|
+
glowColor?: GlowColorInput;
|
|
3530
|
+
/** Pattern fills. */
|
|
3531
|
+
pattern?: PatternInput;
|
|
3532
|
+
patternScale?: number;
|
|
3533
|
+
patternColor?: PatternColorInput;
|
|
3534
|
+
ariaLabel?: string;
|
|
3535
|
+
accents?: boolean;
|
|
3536
|
+
locale?: string;
|
|
3537
|
+
timeZone?: string;
|
|
3538
|
+
cornerRadius?: number;
|
|
3539
|
+
borderWidth?: number;
|
|
3540
|
+
digitGrouping?: DigitGrouping;
|
|
3541
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
3542
|
+
decimalPlaces?: DecimalPlaces;
|
|
3543
|
+
currency?: string;
|
|
3544
|
+
currencyDisplay?: CurrencyDisplay;
|
|
3545
|
+
percentPrecision?: PercentPrecision;
|
|
3546
|
+
dateFormat?: DateFormat;
|
|
3547
|
+
timeFormat?: TimeFormat;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
export declare interface TreemapChartProps extends TreemapChartBaseProps {
|
|
3551
|
+
tooltip?: TreemapChartTooltipProp;
|
|
3552
|
+
}
|
|
3553
|
+
|
|
3554
|
+
export declare type TreemapChartTooltipProp = undefined | false | ((props: TreemapChartTooltipProps) => React_2.ReactNode);
|
|
3555
|
+
|
|
3556
|
+
export declare interface TreemapChartTooltipProps {
|
|
3557
|
+
readonly idx: number;
|
|
3558
|
+
readonly name: string;
|
|
3559
|
+
readonly value: number;
|
|
3560
|
+
readonly percent: number;
|
|
3561
|
+
readonly depth: number;
|
|
3562
|
+
readonly path: readonly string[];
|
|
3563
|
+
readonly color: string;
|
|
3564
|
+
readonly pointerX: number;
|
|
3565
|
+
readonly pointerY: number;
|
|
3566
|
+
readonly containerWidth: number;
|
|
3567
|
+
readonly containerHeight: number;
|
|
3568
|
+
readonly theme: Theme;
|
|
3569
|
+
readonly palette: Palette;
|
|
3570
|
+
readonly locale: string;
|
|
3571
|
+
readonly timeZone: string | undefined;
|
|
3572
|
+
readonly formatter: ChartFormatter;
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
export declare type TreemapColorScale = "flat-categorical" | "depth-gradient" | "value-heat" | "directional";
|
|
3576
|
+
|
|
3577
|
+
/** Try to obtain a WebGL2 context. Wraps the `getContext` call in
|
|
3578
|
+
* try/catch + reports `null` on any error so the chart can fall back
|
|
3579
|
+
* to canvas2d without crashing. */
|
|
3580
|
+
export declare function tryGetWebgl2(canvas: HTMLCanvasElement): WebGL2RenderingContext | null;
|
|
3581
|
+
|
|
3582
|
+
/** Hook for charts to read shared group state. Returns `null` when no
|
|
3583
|
+
* `<ChartGroup>` is in the React tree - children behave standalone. */
|
|
3584
|
+
export declare function useChartGroup(): ChartGroupContextValue | null;
|
|
3585
|
+
|
|
3586
|
+
export declare function useChartsContext(): ChartsProviderValue;
|
|
3587
|
+
|
|
3588
|
+
export declare function useChartTheme(perChartTheme?: ThemeInput): Theme;
|
|
3589
|
+
|
|
3590
|
+
/** React hook: own a streaming Engine + an SoA mirror; expose
|
|
3591
|
+
* `pushTick` + a `BinaryCandleSeriesInput` snapshot. */
|
|
3592
|
+
export declare function useStreamingCandles(opts: UseStreamingCandlesOptions): UseStreamingCandlesResult;
|
|
3593
|
+
|
|
3594
|
+
export declare interface UseStreamingCandlesOptions {
|
|
3595
|
+
/** Bucket timeframe in minutes (e.g. `1` for 1-minute bars). */
|
|
3596
|
+
timeframeMinutes: number;
|
|
3597
|
+
/** Market kind - controls trading-hours / DST rules. */
|
|
3598
|
+
market: MarketKind;
|
|
3599
|
+
/** Capacity of the bar ring buffer. Once full, the oldest bar is
|
|
3600
|
+
* evicted on the next `AppendNew`. Default `5_000`. */
|
|
3601
|
+
capacity?: number;
|
|
3602
|
+
/** Validator bounds for the engine. */
|
|
3603
|
+
minPriceRaw: number;
|
|
3604
|
+
maxPriceRaw: number;
|
|
3605
|
+
maxVolumeRaw: number;
|
|
3606
|
+
/** Anomaly policy - values < 0 / NaN disable that specific check.
|
|
3607
|
+
* See engine `setAnomalyPolicy`. */
|
|
3608
|
+
anomalyPolicy?: {
|
|
3609
|
+
maxRelativePriceJump?: number;
|
|
3610
|
+
rejectZeroVolumeTrade?: boolean;
|
|
3611
|
+
clockSkewToleranceMs?: number;
|
|
3612
|
+
maxGapMs?: number;
|
|
3613
|
+
};
|
|
3614
|
+
/** Audit callback - fires per-tick `accept` / `reject`, plus
|
|
3615
|
+
* `candle-rolled` and policy-change events. Engine signature:
|
|
3616
|
+
* `(kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number)`. */
|
|
3617
|
+
onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
|
|
3618
|
+
/** Telemetry callback - fires per-tick a counter name string
|
|
3619
|
+
* (`'ticks_accepted'`, `'ticks_rejected_<reason>'`, `'candles_rolled'`). */
|
|
3620
|
+
onTelemetry?: (name: string) => void;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
export declare interface UseStreamingCandlesResult {
|
|
3624
|
+
/** Snapshot of the current bars in `BinaryCandleSeriesInput` form.
|
|
3625
|
+
* The wrapping object is fresh per tick (so React's referential
|
|
3626
|
+
* equality check sees the change), but the underlying typed-array
|
|
3627
|
+
* buffers are reused. Pass directly to `<CandleChart data={candles} />`. */
|
|
3628
|
+
candles: BinaryCandleSeriesInput;
|
|
3629
|
+
/** Number of bars currently in the ring (≤ `capacity`). */
|
|
3630
|
+
length: number;
|
|
3631
|
+
/** Push a tick to the engine. Throws if the engine rejected the
|
|
3632
|
+
* tick (out-of-bounds price/volume, strictly older timestamp). */
|
|
3633
|
+
pushTick: (tsMs: number, priceRaw: number, volumeRaw: number) => void;
|
|
3634
|
+
/** Reset the engine + clear the bar buffer. */
|
|
3635
|
+
reset: () => void;
|
|
3636
|
+
/** Whether the engine is ready (WASM loaded). Pre-init `pushTick`
|
|
3637
|
+
* calls are buffered and replayed once the engine is ready. */
|
|
3638
|
+
ready: boolean;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
export declare type ValueLabelPosition = "auto" | "inside" | "outside" | "top" | "bottom";
|
|
3642
|
+
|
|
3643
|
+
export declare type ValueLabels = false | true | LabelConfig;
|
|
3644
|
+
|
|
3645
|
+
export declare type ViewMode = "nested" | "drill-down";
|
|
3646
|
+
|
|
3647
|
+
export declare const VISIBLE_MARK_THRESHOLD = 50000;
|
|
3648
|
+
|
|
3649
|
+
declare type VisualStyle = "Fill" | "Outline";
|
|
3650
|
+
|
|
3651
|
+
/** Volume-bar tooltip render-prop param shape - framework-agnostic.
|
|
3652
|
+
* Mirrors `VolumeBarTooltipProps` in both `react/tooltips/default-volume-
|
|
3653
|
+
* bar-tooltip` and `solid/tooltips/default-volume-bar-tooltip`. The
|
|
3654
|
+
* controller's `volumeBarTooltip` widens the return type to `unknown`
|
|
3655
|
+
* so both the React adapter (`React.ReactNode`) and the Solid adapter
|
|
3656
|
+
* (`JSX.Element`) pass type-check via covariance. */
|
|
3657
|
+
export declare interface VolumeBarTooltipProps {
|
|
3658
|
+
bar: {
|
|
3659
|
+
t: number;
|
|
3660
|
+
v: number;
|
|
3661
|
+
idx: number;
|
|
3662
|
+
};
|
|
3663
|
+
avg20: number;
|
|
3664
|
+
percentile: number;
|
|
3665
|
+
pointerX: number;
|
|
3666
|
+
pointerY: number;
|
|
3667
|
+
containerWidth: number;
|
|
3668
|
+
containerHeight: number;
|
|
3669
|
+
theme: Theme;
|
|
3670
|
+
palette: Palette;
|
|
3671
|
+
locale: string;
|
|
3672
|
+
timeZone: string | undefined;
|
|
3673
|
+
formatter: ChartFormatter;
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
/** Volume bar coloring mode. */
|
|
3677
|
+
export declare type VolumeColoring = "by-direction" | "single" | "by-magnitude";
|
|
3678
|
+
|
|
3679
|
+
export declare type VolumePlacement = "subpane" | "overlay";
|
|
3680
|
+
|
|
3681
|
+
/** Volume bar scale. */
|
|
3682
|
+
export declare type VolumeScale = "linear" | "log";
|
|
3683
|
+
|
|
3684
|
+
export declare type WheelBehavior =
|
|
3685
|
+
/** Mouse-wheel zooms (default). Hosts may flip to scroll-only. */
|
|
3686
|
+
"zoom"
|
|
3687
|
+
/** Wheel scrolls the page; charts ignore wheel. */
|
|
3688
|
+
| "scroll"
|
|
3689
|
+
/** Wheel zooms only with the modifier key held. */
|
|
3690
|
+
| "ctrl-zoom";
|
|
3691
|
+
|
|
3692
|
+
/** `'body'` = wick tracks the body's directional
|
|
3693
|
+
* color; `'neutral'` = wick uses `palette.neutral`; literal hex =
|
|
3694
|
+
* override. */
|
|
3695
|
+
export declare type WickColor = "body" | "neutral" | string;
|
|
3696
|
+
|
|
3697
|
+
/** Host → worker. The host transfers the `OffscreenCanvas` reference
|
|
3698
|
+
* once during `init`; subsequent paints reuse the same canvas. Numeric
|
|
3699
|
+
* buffers are transferable typed arrays. */
|
|
3700
|
+
export declare type WorkerInput = {
|
|
3701
|
+
readonly kind: "init";
|
|
3702
|
+
readonly canvas: OffscreenCanvas;
|
|
3703
|
+
readonly dpr: number;
|
|
3704
|
+
} | {
|
|
3705
|
+
readonly kind: "resize";
|
|
3706
|
+
readonly cssWidth: number;
|
|
3707
|
+
readonly cssHeight: number;
|
|
3708
|
+
readonly dpr: number;
|
|
3709
|
+
} | {
|
|
3710
|
+
readonly kind: "paint";
|
|
3711
|
+
readonly times: Float64Array;
|
|
3712
|
+
readonly values: Float64Array;
|
|
3713
|
+
readonly payload: Record<string, unknown>;
|
|
3714
|
+
} | {
|
|
3715
|
+
readonly kind: "dispose";
|
|
3716
|
+
};
|
|
3717
|
+
|
|
3718
|
+
/** Worker → host. The host updates UI based on these. */
|
|
3719
|
+
export declare type WorkerOutput = {
|
|
3720
|
+
readonly kind: "ready";
|
|
3721
|
+
} | {
|
|
3722
|
+
readonly kind: "painted";
|
|
3723
|
+
readonly frameMs: number;
|
|
3724
|
+
} | {
|
|
3725
|
+
readonly kind: "error";
|
|
3726
|
+
readonly message: string;
|
|
3727
|
+
};
|
|
3728
|
+
|
|
3729
|
+
declare type XAxisPosition = "top" | "bottom";
|
|
3730
|
+
|
|
3731
|
+
export declare type YAxisMode = "frequency" | "density" | "cumulative";
|
|
3732
|
+
|
|
3733
|
+
declare type YAxisPosition = "left" | "right";
|
|
3734
|
+
|
|
3735
|
+
export declare type ZoomAnchor =
|
|
3736
|
+
/** Anchor at the mouse / touch position (default). */
|
|
3737
|
+
"pointer"
|
|
3738
|
+
/** Anchor at the chart center. */
|
|
3739
|
+
| "center";
|
|
3740
|
+
|
|
3741
|
+
export { }
|