@abdullahjaswal/tickyr-charts-solid 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 +43 -0
- package/dist/animation/animator.d.ts +52 -0
- package/dist/animation/bar-entry.d.ts +44 -0
- package/dist/animation/bar-update.d.ts +38 -0
- package/dist/animation/easings.d.ts +22 -0
- package/dist/animation/index.d.ts +4 -0
- package/dist/charts/bar-chart-controller.d.ts +98 -0
- package/dist/charts/bar-chart-helpers.d.ts +334 -0
- package/dist/charts/candle-chart-controller.d.ts +353 -0
- package/dist/charts/candle-chart-helpers.d.ts +781 -0
- package/dist/charts/depth-chart-controller.d.ts +84 -0
- package/dist/charts/depth-chart-helpers.d.ts +185 -0
- package/dist/charts/depth-series.d.ts +41 -0
- package/dist/charts/heatmap-chart-controller.d.ts +78 -0
- package/dist/charts/heatmap-chart-helpers.d.ts +174 -0
- package/dist/charts/heatmap-color-compute.d.ts +11 -0
- package/dist/charts/hierarchy.d.ts +49 -0
- package/dist/charts/histogram-binning.d.ts +33 -0
- package/dist/charts/histogram-chart-controller.d.ts +82 -0
- package/dist/charts/histogram-chart-helpers.d.ts +199 -0
- package/dist/charts/kagi-chart-controller.d.ts +154 -0
- package/dist/charts/line-chart-controller.d.ts +209 -0
- package/dist/charts/line-chart-helpers.d.ts +606 -0
- package/dist/charts/mark-buffers.d.ts +105 -0
- package/dist/charts/pie-chart-controller.d.ts +83 -0
- package/dist/charts/pie-chart-helpers.d.ts +155 -0
- package/dist/charts/pie-slice-compute.d.ts +44 -0
- package/dist/charts/pnf-chart-controller.d.ts +153 -0
- package/dist/charts/renko-chart-controller.d.ts +151 -0
- package/dist/charts/sankey-chart-controller.d.ts +176 -0
- package/dist/charts/sankey-layout.d.ts +64 -0
- package/dist/charts/scatter-chart-controller.d.ts +90 -0
- package/dist/charts/scatter-chart-helpers.d.ts +257 -0
- package/dist/charts/scatter-density.d.ts +5 -0
- package/dist/charts/scatter-regression.d.ts +27 -0
- package/dist/charts/sunburst-chart-controller.d.ts +107 -0
- package/dist/charts/sunburst-chart-helpers.d.ts +143 -0
- package/dist/charts/sunburst-layout.d.ts +40 -0
- package/dist/charts/time-off-algorithms.d.ts +53 -0
- package/dist/charts/treemap-chart-controller.d.ts +103 -0
- package/dist/charts/treemap-chart-helpers.d.ts +163 -0
- package/dist/charts/treemap-layout.d.ts +29 -0
- package/dist/charts/types.d.ts +38 -0
- package/dist/clock/clock.d.ts +10 -0
- package/dist/composition/chart-group-state.d.ts +46 -0
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/pane.d.ts +33 -0
- package/dist/domain/concat.d.ts +18 -0
- package/dist/domain/drawings.d.ts +44 -0
- package/dist/domain/heikin-ashi.d.ts +9 -0
- package/dist/domain/index.d.ts +7 -0
- package/dist/domain/ingestion.d.ts +7 -0
- package/dist/domain/live-state.d.ts +12 -0
- package/dist/domain/markers.d.ts +38 -0
- package/dist/domain/series.d.ts +22 -0
- package/dist/domain/values.d.ts +32 -0
- package/dist/engine/aggregation.d.ts +15 -0
- package/dist/engine/downsampling.d.ts +3 -0
- package/dist/engine/events.d.ts +14 -0
- package/dist/engine/index.d.ts +13 -0
- package/dist/engine/indicators.d.ts +37 -0
- package/dist/engine/markets.d.ts +8 -0
- package/dist/engine/module.d.ts +8 -0
- package/dist/engine/quadtree.d.ts +18 -0
- package/dist/engine/session.d.ts +11 -0
- package/dist/engine/signals.d.ts +52 -0
- package/dist/engine/streaming.d.ts +20 -0
- package/dist/engine/time-axis.d.ts +16 -0
- package/dist/engine/version.d.ts +16 -0
- package/dist/engine/views.d.ts +3 -0
- package/dist/index.js +17026 -0
- package/dist/interaction/keyboard.d.ts +16 -0
- package/dist/interaction/touch.d.ts +27 -0
- package/dist/perf/adaptive-complexity.d.ts +45 -0
- package/dist/perf/memory-pressure.d.ts +16 -0
- package/dist/perf/offscreen-canvas-host.d.ts +32 -0
- package/dist/perf/offscreen-canvas.d.ts +50 -0
- package/dist/perf/offscreen-canvas.worker.d.ts +1 -0
- package/dist/perf/shared-array-buffer.d.ts +10 -0
- package/dist/perf/visibility.d.ts +39 -0
- package/dist/perf/webgl-renderer.d.ts +24 -0
- package/dist/perf/wire-memory-pressure.d.ts +2 -0
- package/dist/personalization/accessibility.d.ts +16 -0
- package/dist/personalization/axes/animation.d.ts +33 -0
- package/dist/personalization/axes/area-baseline.d.ts +8 -0
- package/dist/personalization/axes/axis-labels.d.ts +3 -0
- package/dist/personalization/axes/bin-algorithm.d.ts +3 -0
- package/dist/personalization/axes/box-sizing.d.ts +22 -0
- package/dist/personalization/axes/cell-shape.d.ts +3 -0
- package/dist/personalization/axes/curve-type.d.ts +11 -0
- package/dist/personalization/axes/density.d.ts +4 -0
- package/dist/personalization/axes/depth-fill-type.d.ts +3 -0
- package/dist/personalization/axes/depth-limit.d.ts +2 -0
- package/dist/personalization/axes/glow.d.ts +21 -0
- package/dist/personalization/axes/heatmap-color-scale.d.ts +31 -0
- package/dist/personalization/axes/histogram-overlay.d.ts +18 -0
- package/dist/personalization/axes/indicator-pane-spec.d.ts +85 -0
- package/dist/personalization/axes/label-behavior.d.ts +3 -0
- package/dist/personalization/axes/label-content.d.ts +17 -0
- package/dist/personalization/axes/label-placement.d.ts +3 -0
- package/dist/personalization/axes/label-rotation.d.ts +3 -0
- package/dist/personalization/axes/level-highlight.d.ts +14 -0
- package/dist/personalization/axes/line-dash.d.ts +2 -0
- package/dist/personalization/axes/mid-line.d.ts +14 -0
- package/dist/personalization/axes/node-alignment.d.ts +3 -0
- package/dist/personalization/axes/null-behavior.d.ts +3 -0
- package/dist/personalization/axes/number-format.d.ts +18 -0
- package/dist/personalization/axes/pan-zoom.d.ts +42 -0
- package/dist/personalization/axes/pattern.d.ts +26 -0
- package/dist/personalization/axes/point-markers.d.ts +55 -0
- package/dist/personalization/axes/point-opacity.d.ts +6 -0
- package/dist/personalization/axes/point-size.d.ts +23 -0
- package/dist/personalization/axes/price-range.d.ts +9 -0
- package/dist/personalization/axes/radius-proportion.d.ts +3 -0
- package/dist/personalization/axes/regression-line.d.ts +36 -0
- package/dist/personalization/axes/sankey-link-color.d.ts +10 -0
- package/dist/personalization/axes/sankey-value-display.d.ts +4 -0
- package/dist/personalization/axes/small-slice-threshold.d.ts +15 -0
- package/dist/personalization/axes/sort-order.d.ts +3 -0
- package/dist/personalization/axes/spread-display.d.ts +4 -0
- package/dist/personalization/axes/stacking.d.ts +17 -0
- package/dist/personalization/axes/tile-layout.d.ts +3 -0
- package/dist/personalization/axes/time-off-axes.d.ts +19 -0
- package/dist/personalization/axes/treemap-color-scale.d.ts +3 -0
- package/dist/personalization/axes/value-labels.d.ts +21 -0
- package/dist/personalization/axes/view-mode.d.ts +3 -0
- package/dist/personalization/axes/volume-coloring.d.ts +24 -0
- package/dist/personalization/axes/y-axis-mode.d.ts +3 -0
- package/dist/personalization/index.d.ts +38 -0
- package/dist/personalization/locale/formatter.d.ts +45 -0
- package/dist/personalization/locale/resolver.d.ts +22 -0
- package/dist/personalization/palette/built-ins.d.ts +10 -0
- package/dist/personalization/palette/derive.d.ts +35 -0
- package/dist/personalization/palette/index.d.ts +6 -0
- package/dist/personalization/palette/oklch.d.ts +19 -0
- package/dist/personalization/palette/registry.d.ts +7 -0
- package/dist/personalization/palette/tonal-symmetry.d.ts +32 -0
- package/dist/personalization/palette/types.d.ts +63 -0
- package/dist/personalization/personalization.d.ts +137 -0
- package/dist/personalization/tooltip-props.d.ts +40 -0
- package/dist/rendering/canvas.d.ts +6 -0
- package/dist/rendering/color-tables.d.ts +52 -0
- package/dist/rendering/dirty-rect-tracker.d.ts +49 -0
- package/dist/rendering/dirty-rect.d.ts +17 -0
- package/dist/rendering/draw/area-fill-threshold.d.ts +19 -0
- package/dist/rendering/draw/area-fill.d.ts +47 -0
- package/dist/rendering/draw/area-gradient.d.ts +35 -0
- package/dist/rendering/draw/axis.d.ts +65 -0
- package/dist/rendering/draw/bar.d.ts +31 -0
- package/dist/rendering/draw/candle-live-treatment.d.ts +43 -0
- package/dist/rendering/draw/candle.d.ts +101 -0
- package/dist/rendering/draw/connection-indicator.d.ts +30 -0
- package/dist/rendering/draw/crosshair.d.ts +27 -0
- package/dist/rendering/draw/drawings.d.ts +64 -0
- package/dist/rendering/draw/grid.d.ts +20 -0
- package/dist/rendering/draw/indicator-band.d.ts +17 -0
- package/dist/rendering/draw/indicator-line.d.ts +15 -0
- package/dist/rendering/draw/last-price.d.ts +36 -0
- package/dist/rendering/draw/line.d.ts +16 -0
- package/dist/rendering/draw/live-bar.d.ts +31 -0
- package/dist/rendering/draw/markers.d.ts +53 -0
- package/dist/rendering/draw/pane-divider.d.ts +22 -0
- package/dist/rendering/draw/point-markers.d.ts +23 -0
- package/dist/rendering/glow/glow.d.ts +40 -0
- package/dist/rendering/index.d.ts +9 -0
- package/dist/rendering/layers/should-split.d.ts +12 -0
- package/dist/rendering/patterns/cross-hatch.d.ts +4 -0
- package/dist/rendering/patterns/pattern-tiles.d.ts +25 -0
- package/dist/rendering/pipeline.d.ts +21 -0
- package/dist/rendering/stacked-layout.d.ts +23 -0
- package/dist/rendering/standardization-tokens.d.ts +26 -0
- package/dist/rendering/static-layer-cache.d.ts +34 -0
- package/dist/rendering/threshold-split.d.ts +14 -0
- package/dist/shared/binary-search.d.ts +2 -0
- package/dist/shared/typed.d.ts +8 -0
- package/dist/solid/chart-group.d.ts +16 -0
- package/dist/solid/charts-provider.d.ts +38 -0
- package/dist/solid/components/area-chart.d.ts +21 -0
- package/dist/solid/components/bar-chart.d.ts +84 -0
- package/dist/solid/components/candle-chart.d.ts +142 -0
- package/dist/solid/components/chart-group-brush.d.ts +13 -0
- package/dist/solid/components/chart-group-navigator.d.ts +12 -0
- package/dist/solid/components/depth-chart.d.ts +8 -0
- package/dist/solid/components/heatmap-chart.d.ts +8 -0
- package/dist/solid/components/histogram-chart.d.ts +8 -0
- package/dist/solid/components/kagi-chart.d.ts +8 -0
- package/dist/solid/components/line-chart.d.ts +110 -0
- package/dist/solid/components/pie-chart.d.ts +20 -0
- package/dist/solid/components/point-figure-chart.d.ts +8 -0
- package/dist/solid/components/renko-chart.d.ts +8 -0
- package/dist/solid/components/sankey-chart.d.ts +8 -0
- package/dist/solid/components/scatter-chart.d.ts +8 -0
- package/dist/solid/components/sunburst-chart.d.ts +8 -0
- package/dist/solid/components/treemap-chart.d.ts +8 -0
- package/dist/solid/hooks/use-chart-theme.d.ts +2 -0
- package/dist/solid/hooks/use-streaming-candles.d.ts +33 -0
- package/dist/solid/index.d.ts +73 -0
- package/dist/solid/tooltips/default-candle-tooltip.d.ts +4 -0
- package/dist/solid/tooltips/default-extreme-tooltip.d.ts +6 -0
- package/dist/solid/tooltips/default-tooltip.d.ts +4 -0
- package/dist/solid/tooltips/default-volume-bar-tooltip.d.ts +4 -0
- package/dist/solid/tooltips/index.d.ts +4 -0
- package/dist/tickyr_charts_wasm-C-sFYtmv.js +828 -0
- package/dist/viewport/category-axis.d.ts +32 -0
- package/dist/viewport/clip-ticks.d.ts +8 -0
- package/dist/viewport/index.d.ts +6 -0
- package/dist/viewport/nice-ticks.d.ts +9 -0
- package/dist/viewport/nice-time-ticks.d.ts +7 -0
- package/dist/viewport/orientation.d.ts +56 -0
- package/dist/viewport/padded-domain.d.ts +16 -0
- package/dist/viewport/scales/linear.d.ts +9 -0
- package/dist/viewport/scales/log.d.ts +9 -0
- package/dist/viewport/scales/time.d.ts +7 -0
- package/dist/viewport/viewport-sizer.d.ts +15 -0
- package/dist/viewport/visible-window.d.ts +5 -0
- package/package.json +41 -0
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import { CandleSeries, CandleSeriesInput, LiveState, Drawing as DrawingT, SignalMarker, OrderMarker, PositionMarker, EventMarker } from '../domain';
|
|
2
|
+
import { Personalization, Palette, Theme, ThemeInput, ThemeSwitchTransition, BarEntryAnimation, BarUpdateAnimation, LiveBarIndicator, ConnectionIndicator, StaleVisualization, LegendPosition, DigitGrouping, NumberAbbreviation, DecimalPlaces, CurrencyDisplay, PercentPrecision, DateFormat, TimeFormat, ChartFormatter } from '../personalization';
|
|
3
|
+
import { Viewport } from '../viewport/viewport-sizer';
|
|
4
|
+
import { LinearScale } from '../viewport/scales/linear';
|
|
5
|
+
import { LogScale } from '../viewport/scales/log';
|
|
6
|
+
import { NiceTick } from '../viewport/nice-ticks';
|
|
7
|
+
import { Rect } from '../rendering/dirty-rect-tracker';
|
|
8
|
+
import { YAxisPosition, XAxisPosition, XAxisTick } from '../rendering/draw/axis';
|
|
9
|
+
import { GridStyle } from '../rendering/draw/grid';
|
|
10
|
+
import { LastPriceLineStyle } from '../rendering/draw/last-price';
|
|
11
|
+
import { CrosshairMarker } from '../rendering/draw/crosshair';
|
|
12
|
+
import { SignalMarkerMode, OrderMarkerMode, PositionMarkerMode, EventMarkerMode } from '../rendering/draw/markers';
|
|
13
|
+
import { IndicatorPaneSpec, ResolvedRsiSpec, ResolvedMacdSpec, ResolvedStochasticSpec, ResolvedAtrSpec, IndicatorLineStyle } from '../personalization/axes/indicator-pane-spec';
|
|
14
|
+
import { VolumeColoring as VolumeColoringInternal } from '../personalization/axes/volume-coloring';
|
|
15
|
+
import { HighLowMarkers } from './line-chart-helpers';
|
|
16
|
+
export type { HighLowMarkers } from './line-chart-helpers';
|
|
17
|
+
/** Direction signal for the OHLC bar at hover. `'doji'` when the
|
|
18
|
+
* source-data |O−C| would render below `dojiMinBodyHeight` and the chart
|
|
19
|
+
* is showing the doji floor in `palette.doji`. */
|
|
20
|
+
export type CandleDirection = "up" | "down" | "doji";
|
|
21
|
+
/** Props passed to a custom CandleChart OHLC tooltip render function (and
|
|
22
|
+
* to the built-in `DefaultCandleTooltip`). Framework-agnostic data shape. */
|
|
23
|
+
export interface CandleChartTooltipProps {
|
|
24
|
+
/** Time at the active hover position (unix-ms). */
|
|
25
|
+
t: number;
|
|
26
|
+
/** Bar index in the candle series (0-based). */
|
|
27
|
+
idx: number;
|
|
28
|
+
/** Open / High / Low / Close at the hover bar. For Heikin-Ashi mode
|
|
29
|
+
* these are the HA-transformed values (what the chart is actually
|
|
30
|
+
* rendering); the tooltip stays consistent with what's on screen. */
|
|
31
|
+
o: number;
|
|
32
|
+
h: number;
|
|
33
|
+
l: number;
|
|
34
|
+
c: number;
|
|
35
|
+
/** Direction at hover - `'up'` if `c >= o`, `'down'` if `c < o`,
|
|
36
|
+
* `'doji'` if the body collapsed below the floor and rendered with
|
|
37
|
+
* `palette.doji`. */
|
|
38
|
+
direction: CandleDirection;
|
|
39
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
40
|
+
pointerX: number;
|
|
41
|
+
pointerY: number;
|
|
42
|
+
/** Container dimensions for placement decisions. */
|
|
43
|
+
containerWidth: number;
|
|
44
|
+
containerHeight: number;
|
|
45
|
+
theme: Theme;
|
|
46
|
+
palette: Palette;
|
|
47
|
+
locale: string;
|
|
48
|
+
timeZone: string | undefined;
|
|
49
|
+
formatter: ChartFormatter;
|
|
50
|
+
}
|
|
51
|
+
/** `solid` (Japanese candle), `heikin-ashi`
|
|
52
|
+
* (smoothed via per-bar transform), `ohlc-bars` (Western tick bar). */
|
|
53
|
+
export type CandleType = "solid" | "heikin-ashi" | "ohlc-bars";
|
|
54
|
+
/** `'body'` = wick tracks the body's directional
|
|
55
|
+
* color; `'neutral'` = wick uses `palette.neutral`; literal hex =
|
|
56
|
+
* override. */
|
|
57
|
+
export type WickColor = "body" | "neutral" | string;
|
|
58
|
+
export type VolumePlacement = "subpane" | "overlay";
|
|
59
|
+
/** Volume bar coloring mode. */
|
|
60
|
+
export type VolumeColoring = "by-direction" | "single" | "by-magnitude";
|
|
61
|
+
/** Volume bar scale. */
|
|
62
|
+
export type VolumeScale = "linear" | "log";
|
|
63
|
+
export interface SignalTooltipProps {
|
|
64
|
+
marker: import('../domain').SignalMarker;
|
|
65
|
+
/** Bar's center x in CSS px (host can use for absolute positioning). */
|
|
66
|
+
pointerX: number;
|
|
67
|
+
pointerY: number;
|
|
68
|
+
formatter: ChartFormatter;
|
|
69
|
+
}
|
|
70
|
+
export interface OrderTooltipProps {
|
|
71
|
+
marker: import('../domain').OrderMarker;
|
|
72
|
+
pointerX: number;
|
|
73
|
+
pointerY: number;
|
|
74
|
+
formatter: ChartFormatter;
|
|
75
|
+
}
|
|
76
|
+
export interface PositionTooltipProps {
|
|
77
|
+
marker: import('../domain').PositionMarker;
|
|
78
|
+
/** Live last close - for P&L snapshot in the tooltip. */
|
|
79
|
+
lastClose: number;
|
|
80
|
+
pointerX: number;
|
|
81
|
+
pointerY: number;
|
|
82
|
+
formatter: ChartFormatter;
|
|
83
|
+
}
|
|
84
|
+
export interface EventTooltipProps {
|
|
85
|
+
marker: import('../domain').EventMarker;
|
|
86
|
+
pointerX: number;
|
|
87
|
+
pointerY: number;
|
|
88
|
+
formatter: ChartFormatter;
|
|
89
|
+
}
|
|
90
|
+
export interface CandleStaleBannerRenderProps {
|
|
91
|
+
state: LiveState;
|
|
92
|
+
liveSince: number | undefined;
|
|
93
|
+
theme: Theme;
|
|
94
|
+
palette: Palette;
|
|
95
|
+
}
|
|
96
|
+
/** Volume-bar tooltip render-prop param shape - framework-agnostic.
|
|
97
|
+
* Mirrors `VolumeBarTooltipProps` in both `react/tooltips/default-volume-
|
|
98
|
+
* bar-tooltip` and `solid/tooltips/default-volume-bar-tooltip`. The
|
|
99
|
+
* controller's `volumeBarTooltip` widens the return type to `unknown`
|
|
100
|
+
* so both the React adapter (`React.ReactNode`) and the Solid adapter
|
|
101
|
+
* (`JSX.Element`) pass type-check via covariance. */
|
|
102
|
+
export interface VolumeBarTooltipProps {
|
|
103
|
+
bar: {
|
|
104
|
+
t: number;
|
|
105
|
+
v: number;
|
|
106
|
+
idx: number;
|
|
107
|
+
};
|
|
108
|
+
avg20: number;
|
|
109
|
+
percentile: number;
|
|
110
|
+
pointerX: number;
|
|
111
|
+
pointerY: number;
|
|
112
|
+
containerWidth: number;
|
|
113
|
+
containerHeight: number;
|
|
114
|
+
theme: Theme;
|
|
115
|
+
palette: Palette;
|
|
116
|
+
locale: string;
|
|
117
|
+
timeZone: string | undefined;
|
|
118
|
+
formatter: ChartFormatter;
|
|
119
|
+
}
|
|
120
|
+
/** Framework-agnostic CandleChart prop shape. Excludes the eight render-
|
|
121
|
+
* prop fields (`tooltip`, `extremeTooltip`, `volumeBarTooltip`,
|
|
122
|
+
* `staleBanner`, `signalTooltip`, `orderTooltip`, `positionTooltip`,
|
|
123
|
+
* `eventTooltip`) that each framework adapter retypes against its
|
|
124
|
+
* native JSX element type. The controller's `CandleChartControllerProps`
|
|
125
|
+
* extends this with `unknown`-returning render props so both adapters'
|
|
126
|
+
* shapes are structurally assignable via covariance. */
|
|
127
|
+
export interface CandleChartBaseProps {
|
|
128
|
+
/** Required. OHLC(V) bars - either structured (`{ candles: Array<{t,o,h,l,c,v?}> }`)
|
|
129
|
+
* or binary (per-field `Float64Array`). The binary path is zero-copy. */
|
|
130
|
+
data: CandleSeriesInput;
|
|
131
|
+
/** Older bars prepended to `data` for indicator warm-up. Same shape
|
|
132
|
+
* as `data`. Lets RSI/MACD/etc. have priors so the visible window
|
|
133
|
+
* starts post-warmup with non-NaN values. */
|
|
134
|
+
historyData?: CandleSeriesInput;
|
|
135
|
+
/** When `true` (default) and the dynamic
|
|
136
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
137
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
138
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
139
|
+
partialRepaints?: boolean;
|
|
140
|
+
/** VWAP price-overlay computed by the engine. When set,
|
|
141
|
+
* the engine's `vwap(highs, lows, closes, volumes, sessionStarts)`
|
|
142
|
+
* is computed once per data update and rendered as a line on the
|
|
143
|
+
* price pane. Requires `data.volumes` - silently skipped when
|
|
144
|
+
* volumes are absent. */
|
|
145
|
+
vwap?: {
|
|
146
|
+
/** Defaults to `true` when the `vwap` prop is present. */
|
|
147
|
+
visible?: boolean;
|
|
148
|
+
/** `"auto"` pulls from `palette[theme].indicators.vwap`. */
|
|
149
|
+
color?: "auto" | string;
|
|
150
|
+
/** Defaults to `indicatorLineWidth` from personalization. */
|
|
151
|
+
lineWidth?: number;
|
|
152
|
+
/** Session breakpoints - strictly-increasing indices into the
|
|
153
|
+
* times array. Defaults to `[0]` (whole series is one session). */
|
|
154
|
+
sessionStarts?: Uint32Array;
|
|
155
|
+
};
|
|
156
|
+
/** Engine-backed streaming mode. When
|
|
157
|
+
* set, `chart.onTick(t, p, s)` routes through the engine's
|
|
158
|
+
* `Engine.pushTick` for validate-then-aggregate semantics:
|
|
159
|
+
*
|
|
160
|
+
* - **Validation** - rejects non-positive prices, out-of-range
|
|
161
|
+
* price/volume, backward timestamps (per the anomaly policy).
|
|
162
|
+
* - **Bucket transitions** - engine returns `MutateLast` (extend
|
|
163
|
+
* current bar) or `AppendNew` (current bar closed; new one opens)
|
|
164
|
+
* so the controller correctly extends the series past the live bar.
|
|
165
|
+
* - **Anomaly + audit + telemetry** - pass-through to the engine's
|
|
166
|
+
* `setAnomalyPolicy` / `setAuditCallback` / `setTelemetryCallback`.
|
|
167
|
+
*
|
|
168
|
+
* When omitted, `onTick` falls back to JS-side last-bar-only
|
|
169
|
+
* mutation (suitable for hosts that own bar progression and just
|
|
170
|
+
* want intra-bar high/low/close updates). */
|
|
171
|
+
streaming?: {
|
|
172
|
+
/** Timeframe in minutes. Must match the data's bar spacing. */
|
|
173
|
+
timeframeMinutes: number;
|
|
174
|
+
/** Market spec - controls session-aware bucketing. */
|
|
175
|
+
market: "equity" | "dst-equity" | "crypto-24-7";
|
|
176
|
+
/** Completed-candle ring capacity. */
|
|
177
|
+
capacity?: number;
|
|
178
|
+
/** Validator bounds (scaled-integer per `Market::price_scale.decimals`). */
|
|
179
|
+
minPriceRaw?: number;
|
|
180
|
+
maxPriceRaw?: number;
|
|
181
|
+
maxVolumeRaw?: number;
|
|
182
|
+
/** Optional anomaly policy. Each field accepts a negative value to
|
|
183
|
+
* disable that specific check. */
|
|
184
|
+
anomaly?: {
|
|
185
|
+
maxRelativePriceJump?: number;
|
|
186
|
+
rejectZeroVolumeTrade?: boolean;
|
|
187
|
+
clockSkewToleranceMs?: number;
|
|
188
|
+
maxGapMs?: number;
|
|
189
|
+
};
|
|
190
|
+
/** Observability callbacks - wired into the engine's audit /
|
|
191
|
+
* telemetry surfaces. */
|
|
192
|
+
onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
|
|
193
|
+
onTelemetry?: (name: string) => void;
|
|
194
|
+
};
|
|
195
|
+
/** Candle visual: `"solid"` (default, filled bodies), `"hollow"`
|
|
196
|
+
* (down bodies hollow), `"ohlc-bars"` (open/close ticks), or
|
|
197
|
+
* `"heikin-ashi"` (smoothed Heikin-Ashi transform). */
|
|
198
|
+
candleType?: CandleType;
|
|
199
|
+
/** Fraction of the slot width consumed by the body (0–1). Default
|
|
200
|
+
* 0.7 - bars touch but don't overlap. */
|
|
201
|
+
bodyWidthRatio?: number;
|
|
202
|
+
/** Wick stroke width in CSS px. Default 1.4. */
|
|
203
|
+
wickWidth?: number;
|
|
204
|
+
/** Wick color rule: `"body"` (matches body color, default),
|
|
205
|
+
* `"neutral"`, `"up"`, `"down"`. */
|
|
206
|
+
wickColor?: WickColor;
|
|
207
|
+
/** Minimum body height in CSS px so true-doji bars stay visible.
|
|
208
|
+
* Default 1. */
|
|
209
|
+
dojiMinBodyHeight?: number;
|
|
210
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
211
|
+
crosshairVisible?: boolean;
|
|
212
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
213
|
+
crosshairLineStyle?: GridStyle;
|
|
214
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"` /
|
|
215
|
+
* `"none"`. CandleChart defaults to `"none"`. */
|
|
216
|
+
crosshairMarker?: CrosshairMarker;
|
|
217
|
+
/** Last-price horizontal reference line style. Default `"solid"`. */
|
|
218
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
219
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
220
|
+
lastPriceLabel?: boolean;
|
|
221
|
+
/** Visible-range high/low marker mode: `"lines+labels"` (default),
|
|
222
|
+
* `"labels"`, `"off"`. */
|
|
223
|
+
highLowMarkers?: HighLowMarkers;
|
|
224
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
225
|
+
width?: number;
|
|
226
|
+
/** Chart height in CSS pixels. Default 400 (taller than LineChart
|
|
227
|
+
* to accommodate the volume sub-pane). */
|
|
228
|
+
height?: number;
|
|
229
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"`. */
|
|
230
|
+
theme?: ThemeInput;
|
|
231
|
+
/** Palette name (`"Monochrome"`, `"Classic"`, etc.). */
|
|
232
|
+
palette?: string;
|
|
233
|
+
/** `"Fill"` (default) = solid body fills; `"Outline"` = colored
|
|
234
|
+
* border + translucent body fill. */
|
|
235
|
+
visualStyle?: "Fill" | "Outline";
|
|
236
|
+
/** In Outline mode, the fill color inside the outlined body. */
|
|
237
|
+
outlineFillColor?: "auto" | string;
|
|
238
|
+
/** In Outline mode, alpha of the outline body fill (0–100). */
|
|
239
|
+
outlineFillOpacity?: number;
|
|
240
|
+
/** Body corner radius in CSS px. Default 3. */
|
|
241
|
+
cornerRadius?: number;
|
|
242
|
+
/** Body border width in CSS px. Default 1.4. */
|
|
243
|
+
borderWidth?: number;
|
|
244
|
+
/** Cap the DPR (1–2 typical). */
|
|
245
|
+
pixelDensityCap?: number;
|
|
246
|
+
/** Skip cosmetic features for low-end devices. */
|
|
247
|
+
fastMode?: boolean;
|
|
248
|
+
/** Force sparkline mode (minimal axis-less render). */
|
|
249
|
+
sparkline?: boolean;
|
|
250
|
+
/** Override the auto-generated `aria-label`. */
|
|
251
|
+
ariaLabel?: string;
|
|
252
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
253
|
+
axisVisible?: boolean;
|
|
254
|
+
/** `"left"` or `"right"`. Default `"right"` for candles. */
|
|
255
|
+
yAxisPosition?: YAxisPosition;
|
|
256
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
257
|
+
xAxisPosition?: XAxisPosition;
|
|
258
|
+
/** Fractional padding above/below the y-data range. Default 0.05. */
|
|
259
|
+
yAxisPadding?: number;
|
|
260
|
+
/** Toggle gridlines. */
|
|
261
|
+
gridVisible?: boolean;
|
|
262
|
+
/** Gridline style. */
|
|
263
|
+
gridStyle?: GridStyle;
|
|
264
|
+
/** Gridline density. */
|
|
265
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
266
|
+
/** Use accent tint for axis + grid colors. */
|
|
267
|
+
accents?: boolean;
|
|
268
|
+
/** Locale code (e.g. `"USA"`). */
|
|
269
|
+
locale?: string;
|
|
270
|
+
/** IANA time zone. */
|
|
271
|
+
timeZone?: string;
|
|
272
|
+
/** Digit-grouping rule (`"thousands"` / `"lakh-crore"` / `"none"`). */
|
|
273
|
+
digitGrouping?: DigitGrouping;
|
|
274
|
+
/** Compact number abbreviation rule (e.g. `"short"` → `"1.2M"`). */
|
|
275
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
276
|
+
/** Decimal-place rule for price labels. */
|
|
277
|
+
decimalPlaces?: DecimalPlaces;
|
|
278
|
+
/** ISO currency code (e.g. `"USD"`). */
|
|
279
|
+
currency?: string;
|
|
280
|
+
/** Currency display style. */
|
|
281
|
+
currencyDisplay?: CurrencyDisplay;
|
|
282
|
+
/** Percentage precision. */
|
|
283
|
+
percentPrecision?: PercentPrecision;
|
|
284
|
+
/** Date format rule. */
|
|
285
|
+
dateFormat?: DateFormat;
|
|
286
|
+
/** Time format rule. */
|
|
287
|
+
timeFormat?: TimeFormat;
|
|
288
|
+
/** Show the volume sub-pane. Requires `data.volumes` to be present.
|
|
289
|
+
* Default `true` when volumes exist. */
|
|
290
|
+
volumeVisible?: boolean;
|
|
291
|
+
/** Volume placement: `"subpane"` (separate pane below price,
|
|
292
|
+
* default) or `"overlay"` (transparent bars on the price pane). */
|
|
293
|
+
volumePlacement?: VolumePlacement;
|
|
294
|
+
/** Fraction of inner height given to the volume pane (0–1).
|
|
295
|
+
* Default 0.25. */
|
|
296
|
+
volumeHeightRatio?: number;
|
|
297
|
+
/** Allow the user to drag the divider between price + volume panes. */
|
|
298
|
+
volumeResizable?: boolean;
|
|
299
|
+
/** Volume bar coloring: `"by-direction"` (matches candle direction,
|
|
300
|
+
* default), `"single-color"`. */
|
|
301
|
+
volumeColoring?: VolumeColoring;
|
|
302
|
+
/** When `volumeColoring === "single-color"`, the bar color. */
|
|
303
|
+
volumeSingleColor?: "auto" | string;
|
|
304
|
+
/** Volume y-axis scale: `"linear"` (default) or `"log"`. */
|
|
305
|
+
volumeScale?: VolumeScale;
|
|
306
|
+
/** Sync the crosshair vertical line across price + volume +
|
|
307
|
+
* indicator panes. Default `true`. */
|
|
308
|
+
crosshairPaneSync?: boolean;
|
|
309
|
+
/** Sub-pane indicators: RSI / MACD / Stochastic / ATR. Each becomes
|
|
310
|
+
* its own pane below volume. */
|
|
311
|
+
indicators?: readonly IndicatorPaneSpec[];
|
|
312
|
+
/** Default line width for indicator lines. */
|
|
313
|
+
indicatorLineWidth?: number;
|
|
314
|
+
/** Default line style for indicator lines. */
|
|
315
|
+
indicatorLineStyle?: IndicatorLineStyle;
|
|
316
|
+
/** Default opacity for indicator lines (0–1). */
|
|
317
|
+
indicatorOpacity?: number;
|
|
318
|
+
/** Live-bar animation. */
|
|
319
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
320
|
+
/** Connection-state badge: `"dot"` (default), `"pill"`, `"off"`.
|
|
321
|
+
* Renders as an HTML overlay above the chart's plot area. */
|
|
322
|
+
connectionIndicator?: ConnectionIndicator;
|
|
323
|
+
/** Visual treatment for stale state. */
|
|
324
|
+
staleVisualization?: StaleVisualization;
|
|
325
|
+
/** Auto-stale timeout in ms. Default 5000. */
|
|
326
|
+
staleThreshold?: number;
|
|
327
|
+
/** Unix-ms of the latest accepted tick. */
|
|
328
|
+
liveSince?: number;
|
|
329
|
+
/** Host-asserted connection state. */
|
|
330
|
+
connectionState?: LiveState;
|
|
331
|
+
/** Anchor corner for the badge + legend overlay. */
|
|
332
|
+
legendPosition?: LegendPosition;
|
|
333
|
+
/** Host-forced reduced-motion override. */
|
|
334
|
+
reducedMotion?: boolean;
|
|
335
|
+
/** Animation when new bars first appear. */
|
|
336
|
+
barEntryAnimation?: BarEntryAnimation;
|
|
337
|
+
/** Animation when the live bar updates. */
|
|
338
|
+
barUpdateAnimation?: BarUpdateAnimation;
|
|
339
|
+
/** Crosshair fade-in duration (ms) on hover-enter. */
|
|
340
|
+
crosshairFadeDuration?: number;
|
|
341
|
+
/** Tooltip fade-in duration (ms). */
|
|
342
|
+
tooltipFadeDuration?: number;
|
|
343
|
+
/** Smooth wheel-zoom interpolation. */
|
|
344
|
+
panZoomSmoothing?: boolean;
|
|
345
|
+
/** Cross-fade transition when the theme changes. */
|
|
346
|
+
themeSwitchTransition?: ThemeSwitchTransition;
|
|
347
|
+
/** Drawing tool annotations (trendlines, fib, horizontal lines, etc.).
|
|
348
|
+
* Host-controlled array - push new drawings via `onDrawingsChange`. */
|
|
349
|
+
drawings?: readonly DrawingT[];
|
|
350
|
+
/** Default stroke color for new drawings. */
|
|
351
|
+
drawingDefaultColor?: "auto" | string;
|
|
352
|
+
/** Default stroke width for new drawings. */
|
|
353
|
+
drawingDefaultLineWidth?: number;
|
|
354
|
+
/** Default stroke style for new drawings. */
|
|
355
|
+
drawingDefaultLineStyle?: "solid" | "dashed" | "dotted";
|
|
356
|
+
/** Default fill opacity for filled drawings. */
|
|
357
|
+
drawingFillOpacity?: number;
|
|
358
|
+
/** When to show resize handles: `"always"`, `"on-select"` (default),
|
|
359
|
+
* `"on-hover"`. */
|
|
360
|
+
drawingHandlesMode?: "always" | "on-select" | "on-hover";
|
|
361
|
+
/** Controlled-mode: id of the currently selected drawing. */
|
|
362
|
+
selectedDrawingId?: string;
|
|
363
|
+
/** Whitelist of drawing tool types the user can create. */
|
|
364
|
+
enabledTools?: readonly import('../domain').DrawingType[];
|
|
365
|
+
/** Snap mode for drawing tool placement. */
|
|
366
|
+
drawingSnap?: "free" | "x-axis" | "data";
|
|
367
|
+
/** Delete the selected drawing when the user presses Esc. */
|
|
368
|
+
drawingDeleteOnEsc?: boolean;
|
|
369
|
+
/** Fires when the user adds, modifies, or removes a drawing. */
|
|
370
|
+
onDrawingsChange?: (next: readonly DrawingT[]) => void;
|
|
371
|
+
/** Fires when the selected drawing changes. */
|
|
372
|
+
onDrawingSelected?: (id: string | undefined) => void;
|
|
373
|
+
/** Signal markers (buy/sell arrows + confidence). */
|
|
374
|
+
signals?: readonly SignalMarker[];
|
|
375
|
+
/** Signal marker visualization mode. */
|
|
376
|
+
signalMarkers?: SignalMarkerMode;
|
|
377
|
+
/** Order markers (open/active orders with entry/SL/TP). */
|
|
378
|
+
orders?: readonly OrderMarker[];
|
|
379
|
+
/** Order marker visualization mode. */
|
|
380
|
+
orderMarkers?: OrderMarkerMode;
|
|
381
|
+
/** Singleton position marker (current open position). */
|
|
382
|
+
position?: PositionMarker;
|
|
383
|
+
/** Position marker visualization mode. */
|
|
384
|
+
positionMarker?: PositionMarkerMode;
|
|
385
|
+
/** Event markers (earnings, dividends, splits, news). */
|
|
386
|
+
events?: readonly EventMarker[];
|
|
387
|
+
/** Event marker visualization mode. */
|
|
388
|
+
eventMarkers?: EventMarkerMode;
|
|
389
|
+
/** Comparison series rendered as a normalized line overlay on the
|
|
390
|
+
* price pane. */
|
|
391
|
+
compareData?: {
|
|
392
|
+
times: Float64Array;
|
|
393
|
+
closes: Float64Array;
|
|
394
|
+
};
|
|
395
|
+
/** Comparison rendering mode. */
|
|
396
|
+
symbolComparison?: "off" | "normalized-line";
|
|
397
|
+
/** Optional watermark - symbol text, symbol + exchange, or an image. */
|
|
398
|
+
watermark?: "off" | "symbol" | "symbol + exchange" | {
|
|
399
|
+
image: string;
|
|
400
|
+
};
|
|
401
|
+
/** Symbol ticker (e.g. `"AAPL"`) for watermark + tooltip header. */
|
|
402
|
+
symbol?: string;
|
|
403
|
+
/** Exchange code (e.g. `"NYSE"`) for watermark + tooltip header. */
|
|
404
|
+
exchange?: string;
|
|
405
|
+
/** Color-blind augmentation: `"arrows"` adds direction arrows to
|
|
406
|
+
* bar bodies for users who can't distinguish red/green. */
|
|
407
|
+
colorBlindIndicators?: "off" | "arrows";
|
|
408
|
+
/** Direction-colored aura on candle bodies. */
|
|
409
|
+
glow?: import('../personalization/axes/glow').GlowInput;
|
|
410
|
+
/** Glow color. */
|
|
411
|
+
glowColor?: import('../personalization/axes/glow').GlowColorInput;
|
|
412
|
+
/** Pattern fills. */
|
|
413
|
+
pattern?: import('../personalization/axes/pattern').PatternInput;
|
|
414
|
+
patternScale?: number;
|
|
415
|
+
patternColor?: import('../personalization/axes/pattern').PatternColorInput;
|
|
416
|
+
}
|
|
417
|
+
export declare const DEFAULT_FONT = "12px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
|
|
418
|
+
export declare const DEFAULT_AXIS_FONT_SIZE = 11;
|
|
419
|
+
export declare const EMPTY_DRAWINGS: readonly DrawingT[];
|
|
420
|
+
export declare const EMPTY_SIGNALS: readonly SignalMarker[];
|
|
421
|
+
export declare const EMPTY_ORDERS: readonly OrderMarker[];
|
|
422
|
+
export declare const EMPTY_EVENTS: readonly EventMarker[];
|
|
423
|
+
/** Watermark image cache. Decoded `Image` instances keyed
|
|
424
|
+
* by URL / data-URI so repeated paints reuse the already-decoded
|
|
425
|
+
* bitmap (object pooling, asynchronous render).
|
|
426
|
+
* When the source is new and still loading, returns `null`; the
|
|
427
|
+
* on-load callback bumps the chart's `watermarkVersion` to trigger a
|
|
428
|
+
* redraw once the bitmap is ready. */
|
|
429
|
+
export declare const _watermarkCache: Map<string, HTMLImageElement | "loading">;
|
|
430
|
+
export declare const _watermarkSubscribers: Set<() => void>;
|
|
431
|
+
export declare function getOrLoadWatermarkImage(src: string): HTMLImageElement | null;
|
|
432
|
+
export declare const STALE_KEYFRAMES_ID = "tickyr-stale-keyframes";
|
|
433
|
+
export declare function ensureStaleKeyframes(): void;
|
|
434
|
+
export declare const LABEL_GAP_PX = 6;
|
|
435
|
+
export declare const TICK_LENGTH_PX = 4;
|
|
436
|
+
export declare const Y_AXIS_RESERVE_PX = 80;
|
|
437
|
+
export declare const X_AXIS_RESERVE_PX = 28;
|
|
438
|
+
export declare const GRID_TARGET: {
|
|
439
|
+
readonly sparse: 4;
|
|
440
|
+
readonly normal: 8;
|
|
441
|
+
readonly dense: 12;
|
|
442
|
+
};
|
|
443
|
+
export declare const DEFAULT_BODY_WIDTH_RATIO = 0.7;
|
|
444
|
+
export declare const DEFAULT_WICK_WIDTH = 1.4;
|
|
445
|
+
export declare const DEFAULT_DOJI_MIN_BODY_PX = 1.5;
|
|
446
|
+
export declare const SPARKLINE_THRESHOLD_PX = 150;
|
|
447
|
+
export declare const DEFAULT_VOLUME_HEIGHT_RATIO = 0.25;
|
|
448
|
+
export declare const PANE_DIVIDER_PX = 4;
|
|
449
|
+
export declare const PANE_DRAG_HANDLE_PX = 5;
|
|
450
|
+
export declare const VOLUME_OVERLAY_ALPHA = 0.4;
|
|
451
|
+
export declare const DEFAULT_INDICATOR_HEIGHT_RATIO = 0.15;
|
|
452
|
+
export declare const DEFAULT_INDICATOR_LINE_WIDTH = 1.5;
|
|
453
|
+
export declare const DEFAULT_INDICATOR_LINE_STYLE: IndicatorLineStyle;
|
|
454
|
+
export declare const DEFAULT_INDICATOR_OPACITY = 0.85;
|
|
455
|
+
/** Indicator compute result - per-bar SoA arrays returned by the
|
|
456
|
+
* engine for each indicator type. NaN values during the warmup period
|
|
457
|
+
* are skipped by the line-draw primitive. */
|
|
458
|
+
export type IndicatorComputeResult = {
|
|
459
|
+
type: "rsi";
|
|
460
|
+
spec: ResolvedRsiSpec;
|
|
461
|
+
values: Float64Array;
|
|
462
|
+
} | {
|
|
463
|
+
type: "atr";
|
|
464
|
+
spec: ResolvedAtrSpec;
|
|
465
|
+
values: Float64Array;
|
|
466
|
+
} | {
|
|
467
|
+
type: "macd";
|
|
468
|
+
spec: ResolvedMacdSpec;
|
|
469
|
+
macd: Float64Array;
|
|
470
|
+
signal: Float64Array;
|
|
471
|
+
histogram: Float64Array;
|
|
472
|
+
} | {
|
|
473
|
+
type: "stochastic";
|
|
474
|
+
spec: ResolvedStochasticSpec;
|
|
475
|
+
k: Float64Array;
|
|
476
|
+
d: Float64Array;
|
|
477
|
+
};
|
|
478
|
+
/** Per-indicator pane layout - pixel rect + the y-scale that maps the
|
|
479
|
+
* indicator's value range into that rect. For RSI / Stochastic this
|
|
480
|
+
* is fixed [0, 100]; for MACD it's centered on 0; for ATR it's the
|
|
481
|
+
* visible-window data range. */
|
|
482
|
+
export interface IndicatorPaneLayout {
|
|
483
|
+
readonly result: IndicatorComputeResult;
|
|
484
|
+
readonly top: number;
|
|
485
|
+
readonly bottom: number;
|
|
486
|
+
readonly height: number;
|
|
487
|
+
readonly yScale: LinearScale;
|
|
488
|
+
readonly dividerY: number;
|
|
489
|
+
}
|
|
490
|
+
/** Pointer-driven hover state. Pins to the candle's slot center (x) and
|
|
491
|
+
* to the close price (y) so the snap marker reads naturally for OHLC
|
|
492
|
+
* data. `pane` indicates which pane the cursor is over - drives:
|
|
493
|
+
* - per-pane crosshair clipping (when `crosshairPaneSync: false`)
|
|
494
|
+
* - which tooltip renders (OHLC vs volume) on hover. */
|
|
495
|
+
export interface HoverState {
|
|
496
|
+
readonly pointerX: number;
|
|
497
|
+
readonly pointerY: number;
|
|
498
|
+
readonly snapX: number;
|
|
499
|
+
readonly snapY: number;
|
|
500
|
+
readonly idx: number;
|
|
501
|
+
readonly t: number;
|
|
502
|
+
readonly o: number;
|
|
503
|
+
readonly h: number;
|
|
504
|
+
readonly l: number;
|
|
505
|
+
readonly c: number;
|
|
506
|
+
readonly v: number;
|
|
507
|
+
readonly direction: CandleDirection;
|
|
508
|
+
readonly pane: "price" | "volume";
|
|
509
|
+
}
|
|
510
|
+
export interface DynamicCfg {
|
|
511
|
+
readonly crosshairVisible: boolean;
|
|
512
|
+
readonly crosshairLineStyle: GridStyle;
|
|
513
|
+
readonly crosshairMarker: CrosshairMarker;
|
|
514
|
+
/** When `true`, vertical crosshair spans
|
|
515
|
+
* both price + volume panes; otherwise it stays within the price
|
|
516
|
+
* pane only. */
|
|
517
|
+
readonly crosshairPaneSync: boolean;
|
|
518
|
+
}
|
|
519
|
+
export interface PillBox {
|
|
520
|
+
readonly x: number;
|
|
521
|
+
readonly y: number;
|
|
522
|
+
readonly width: number;
|
|
523
|
+
readonly height: number;
|
|
524
|
+
}
|
|
525
|
+
export interface ExtremeMarkerState {
|
|
526
|
+
readonly high: {
|
|
527
|
+
idx: number;
|
|
528
|
+
t: number;
|
|
529
|
+
price: number;
|
|
530
|
+
pillBox: PillBox | null;
|
|
531
|
+
};
|
|
532
|
+
readonly low: {
|
|
533
|
+
idx: number;
|
|
534
|
+
t: number;
|
|
535
|
+
price: number;
|
|
536
|
+
pillBox: PillBox | null;
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
export interface ExtremeHoverState {
|
|
540
|
+
readonly kind: "high" | "low";
|
|
541
|
+
readonly pointerX: number;
|
|
542
|
+
readonly pointerY: number;
|
|
543
|
+
readonly idx: number;
|
|
544
|
+
readonly t: number;
|
|
545
|
+
readonly price: number;
|
|
546
|
+
}
|
|
547
|
+
export interface ChartHandle {
|
|
548
|
+
readonly dynamicCtx: CanvasRenderingContext2D | null;
|
|
549
|
+
readonly layout: ChartLayout;
|
|
550
|
+
readonly crosshairLineColor: string;
|
|
551
|
+
readonly crosshairMarkerFill: string;
|
|
552
|
+
readonly crosshairMarkerStroke: string;
|
|
553
|
+
/** Extreme-marker state from the latest static-layer paint. `null`
|
|
554
|
+
* when `highLowMarkers === 'off'`. */
|
|
555
|
+
readonly extremes: ExtremeMarkerState | null;
|
|
556
|
+
/** Last bar's center x in CSS px (for live-bar indicator). */
|
|
557
|
+
readonly lastX: number;
|
|
558
|
+
/** Last bar's close y in CSS px. */
|
|
559
|
+
readonly lastY: number;
|
|
560
|
+
/** Last candle's resolved body top y (after doji floor). */
|
|
561
|
+
readonly lastBodyTop: number;
|
|
562
|
+
/** Last candle's resolved body bottom y. */
|
|
563
|
+
readonly lastBodyBottom: number;
|
|
564
|
+
/** Last candle's wick top (= y of `high`). */
|
|
565
|
+
readonly lastWickTop: number;
|
|
566
|
+
/** Last candle's wick bottom (= y of `low`). */
|
|
567
|
+
readonly lastWickBottom: number;
|
|
568
|
+
/** Half body width in CSS px (= bodyExtent / 2). */
|
|
569
|
+
readonly lastHalfBodyW: number;
|
|
570
|
+
/** Resolved candle body cornerRadius in CSS px (matches the static
|
|
571
|
+
* layer's body roundness - the live-bar dotted-border treatment
|
|
572
|
+
* uses this so its stroke traces the candle's actual silhouette. */
|
|
573
|
+
readonly lastCornerRadius: number;
|
|
574
|
+
/** True when last candle is a doji (|O−C| < `dojiMinBodyHeight`). */
|
|
575
|
+
readonly lastIsDoji: boolean;
|
|
576
|
+
/** True when last close ≥ last open. */
|
|
577
|
+
readonly lastIsUp: boolean;
|
|
578
|
+
readonly directionColor: string;
|
|
579
|
+
readonly accentColor: string;
|
|
580
|
+
readonly bgColor: string;
|
|
581
|
+
readonly textColor: string;
|
|
582
|
+
readonly liveStateColor: string;
|
|
583
|
+
readonly staleStateColor: string;
|
|
584
|
+
readonly disconnectedStateColor: string;
|
|
585
|
+
/** Resolved Personalization snapshot (so the dynamic-layer draw can
|
|
586
|
+
* read liveBarIndicator / connectionIndicator / visualStyle without
|
|
587
|
+
* re-resolving). */
|
|
588
|
+
readonly personalization: Personalization;
|
|
589
|
+
}
|
|
590
|
+
export interface LiveStateInputs {
|
|
591
|
+
readonly liveSince: number | undefined;
|
|
592
|
+
readonly connectionState: LiveState | undefined;
|
|
593
|
+
readonly staleThreshold: number;
|
|
594
|
+
}
|
|
595
|
+
export interface ChartLayout {
|
|
596
|
+
innerLeft: number;
|
|
597
|
+
innerRight: number;
|
|
598
|
+
innerTop: number;
|
|
599
|
+
innerBottom: number;
|
|
600
|
+
/** Maps OHLC value → y pixel within the PRICE pane. Inverted:
|
|
601
|
+
* rangeStart = priceBottom, rangeEnd = priceTop (= innerTop). When
|
|
602
|
+
* no volume sub-pane is active, priceBottom === innerBottom. */
|
|
603
|
+
yScale: LinearScale;
|
|
604
|
+
/** Maps unix-ms time → x pixel. Range = [innerLeft + halfSlot,
|
|
605
|
+
* innerRight - halfSlot] so first/last bar centers sit comfortably
|
|
606
|
+
* inside the axis spine. Shared between price and volume panes. */
|
|
607
|
+
xScale: LinearScale;
|
|
608
|
+
yTicks: readonly NiceTick[];
|
|
609
|
+
xTicks: readonly XAxisTick[];
|
|
610
|
+
startMs: number;
|
|
611
|
+
endMs: number;
|
|
612
|
+
halfSlot: number;
|
|
613
|
+
viewport: Viewport;
|
|
614
|
+
/** Volume sub-pane geometry. `null` when volumes are absent or
|
|
615
|
+
* `volumeVisible === false` or `volumePlacement === 'overlay'`. */
|
|
616
|
+
volumePane: {
|
|
617
|
+
readonly top: number;
|
|
618
|
+
readonly bottom: number;
|
|
619
|
+
readonly height: number;
|
|
620
|
+
/** Maps volume value → y pixel within the volume pane (inverted:
|
|
621
|
+
* rangeStart = bottom, rangeEnd = top). */
|
|
622
|
+
readonly yScale: LinearScale | LogScale;
|
|
623
|
+
/** Y of the divider line between price + volume panes. */
|
|
624
|
+
readonly dividerY: number;
|
|
625
|
+
} | null;
|
|
626
|
+
/** When `volumePlacement === 'overlay'`, the bars draw inside the
|
|
627
|
+
* price pane at this y-range. `null` when not in overlay mode. */
|
|
628
|
+
volumeOverlay: {
|
|
629
|
+
readonly top: number;
|
|
630
|
+
readonly bottom: number;
|
|
631
|
+
readonly yScale: LinearScale | LogScale;
|
|
632
|
+
} | null;
|
|
633
|
+
/** Indicator sub-panes. Empty when no indicators are
|
|
634
|
+
* configured. Order matches `props.indicators`. */
|
|
635
|
+
indicatorPanes: readonly IndicatorPaneLayout[];
|
|
636
|
+
}
|
|
637
|
+
/** Source-of-data resolver. For Solid + OHLC-bars this is the raw
|
|
638
|
+
* CandleSeries arrays; for Heikin-Ashi it's the transformed arrays
|
|
639
|
+
* (cached per series.revisionId). Volumes pass through unchanged
|
|
640
|
+
* regardless of `candleType` - the HA transform smooths OHLC, not
|
|
641
|
+
* per-bar volume. */
|
|
642
|
+
export interface ResolvedSeriesArrays {
|
|
643
|
+
readonly times: Float64Array;
|
|
644
|
+
readonly opens: Float64Array;
|
|
645
|
+
readonly highs: Float64Array;
|
|
646
|
+
readonly lows: Float64Array;
|
|
647
|
+
readonly closes: Float64Array;
|
|
648
|
+
readonly volumes: Float64Array | null;
|
|
649
|
+
readonly length: number;
|
|
650
|
+
}
|
|
651
|
+
export declare function resolveSeriesArrays(series: CandleSeries, candleType: CandleType): ResolvedSeriesArrays;
|
|
652
|
+
export declare function computeYDomain(arr: ResolvedSeriesArrays, padding: number): {
|
|
653
|
+
min: number;
|
|
654
|
+
max: number;
|
|
655
|
+
};
|
|
656
|
+
export declare function computeLayout(opts: {
|
|
657
|
+
arr: ResolvedSeriesArrays;
|
|
658
|
+
viewport: Viewport;
|
|
659
|
+
yAxisPosition: YAxisPosition;
|
|
660
|
+
xAxisPosition: XAxisPosition;
|
|
661
|
+
yAxisPadding: number;
|
|
662
|
+
gridDensity: "sparse" | "normal" | "dense";
|
|
663
|
+
axisVisible: boolean;
|
|
664
|
+
formatter: ChartFormatter;
|
|
665
|
+
/** When `true` AND `arr.volumes !== null` AND placement === 'subpane',
|
|
666
|
+
* the inner area is split into price + volume panes. */
|
|
667
|
+
volumeSubpane: boolean;
|
|
668
|
+
/** When `true` AND `arr.volumes !== null` AND placement === 'overlay',
|
|
669
|
+
* bars draw inside the price pane's bottom region. */
|
|
670
|
+
volumeOverlay: boolean;
|
|
671
|
+
/** Initial (or current session-state) ratio for the volume sub-pane. */
|
|
672
|
+
volumeHeightRatio: number;
|
|
673
|
+
/** Y-scale type for volume bars. */
|
|
674
|
+
volumeScale: VolumeScale;
|
|
675
|
+
/** Indicator compute results, one per `props.indicators[i]`. Each
|
|
676
|
+
* becomes its own sub-pane below price + volume. */
|
|
677
|
+
indicatorResults: readonly IndicatorComputeResult[];
|
|
678
|
+
/** Extra top reserve (CSS px) for HTML overlays - connection
|
|
679
|
+
* indicator badge, legend. Pushes `innerTop` down so the chart's
|
|
680
|
+
* drawing area starts BELOW the overlay band, never overlapping. */
|
|
681
|
+
topBandReserve?: number;
|
|
682
|
+
}): ChartLayout;
|
|
683
|
+
export declare function drawCandleChartGrid(args: {
|
|
684
|
+
ctx: CanvasRenderingContext2D;
|
|
685
|
+
layout: ChartLayout;
|
|
686
|
+
color: string;
|
|
687
|
+
width: number;
|
|
688
|
+
style: GridStyle;
|
|
689
|
+
}): void;
|
|
690
|
+
export declare function drawCandleChartAxes(args: {
|
|
691
|
+
ctx: CanvasRenderingContext2D;
|
|
692
|
+
layout: ChartLayout;
|
|
693
|
+
yAxisPosition: YAxisPosition;
|
|
694
|
+
xAxisPosition: XAxisPosition;
|
|
695
|
+
spineColor: string;
|
|
696
|
+
textColor: string;
|
|
697
|
+
formatter: ChartFormatter;
|
|
698
|
+
}): void;
|
|
699
|
+
export declare function drawFullCandleChart(args: {
|
|
700
|
+
ctx: CanvasRenderingContext2D;
|
|
701
|
+
arr: ResolvedSeriesArrays;
|
|
702
|
+
layout: ChartLayout;
|
|
703
|
+
personalization: Personalization;
|
|
704
|
+
candleType: CandleType;
|
|
705
|
+
bodyWidthRatio: number;
|
|
706
|
+
wickWidth: number;
|
|
707
|
+
wickColor: WickColor;
|
|
708
|
+
dojiMinBodyHeight: number;
|
|
709
|
+
cornerRadius: number;
|
|
710
|
+
borderWidth: number;
|
|
711
|
+
yAxisPosition: YAxisPosition;
|
|
712
|
+
xAxisPosition: XAxisPosition;
|
|
713
|
+
gridVisible: boolean;
|
|
714
|
+
gridStyle: GridStyle;
|
|
715
|
+
axisVisible: boolean;
|
|
716
|
+
accents: boolean;
|
|
717
|
+
lastPriceLine: LastPriceLineStyle;
|
|
718
|
+
lastPriceLabel: boolean;
|
|
719
|
+
highLowMarkers: HighLowMarkers;
|
|
720
|
+
formatter: ChartFormatter;
|
|
721
|
+
chartBgColor: string;
|
|
722
|
+
/** Volume coloring mode. */
|
|
723
|
+
volumeColoring: VolumeColoringInternal;
|
|
724
|
+
volumeSingleColor: "auto" | string;
|
|
725
|
+
/** Entry-animation preset + linear progress in [0, 1]. */
|
|
726
|
+
entryPreset: BarEntryAnimation;
|
|
727
|
+
entryProgress: number;
|
|
728
|
+
/** Last-bar update animation preset + progress + direction sign. */
|
|
729
|
+
updatePreset: BarUpdateAnimation;
|
|
730
|
+
updateProgress: number;
|
|
731
|
+
updateDirSign: 1 | -1 | 0;
|
|
732
|
+
drawings: readonly DrawingT[];
|
|
733
|
+
selectedDrawingId: string | undefined;
|
|
734
|
+
drawingDefaultColor: string;
|
|
735
|
+
drawingDefaultLineWidth: number;
|
|
736
|
+
drawingDefaultLineStyle: "solid" | "dashed" | "dotted";
|
|
737
|
+
drawingFillOpacity: number;
|
|
738
|
+
signals: readonly SignalMarker[];
|
|
739
|
+
signalMarkersMode: SignalMarkerMode;
|
|
740
|
+
orders: readonly OrderMarker[];
|
|
741
|
+
orderMarkersMode: OrderMarkerMode;
|
|
742
|
+
position: PositionMarker | undefined;
|
|
743
|
+
positionMarkerMode: PositionMarkerMode;
|
|
744
|
+
events: readonly EventMarker[];
|
|
745
|
+
eventMarkersMode: EventMarkerMode;
|
|
746
|
+
/** VWAP overlay (per-bar values from engine). Renders as a line on
|
|
747
|
+
* the price pane when `values !== null`. */
|
|
748
|
+
vwapOverlay: {
|
|
749
|
+
readonly values: Float64Array;
|
|
750
|
+
readonly color: string;
|
|
751
|
+
readonly lineWidth: number;
|
|
752
|
+
} | null;
|
|
753
|
+
compareData: {
|
|
754
|
+
times: Float64Array;
|
|
755
|
+
closes: Float64Array;
|
|
756
|
+
} | undefined;
|
|
757
|
+
symbolComparisonMode: "off" | "normalized-line";
|
|
758
|
+
watermark: "off" | "symbol" | "symbol + exchange" | {
|
|
759
|
+
image: string;
|
|
760
|
+
};
|
|
761
|
+
symbol: string | undefined;
|
|
762
|
+
exchange: string | undefined;
|
|
763
|
+
colorBlindIndicators: "off" | "arrows";
|
|
764
|
+
/** Section gating for offscreen caching.
|
|
765
|
+
* - `"all"` (default): everything (current full-paint behavior).
|
|
766
|
+
* - `"bg"`: clear + grid + axes + volume sub-pane + indicator sub-
|
|
767
|
+
* panes. Cached once to an offscreen canvas.
|
|
768
|
+
* - `"bars"`: candle bodies/wicks + last-bar update overlays. The
|
|
769
|
+
* only sections that animate; called per rAF frame.
|
|
770
|
+
* - `"fg"`: drawings + watermark + comparison overlay + markers +
|
|
771
|
+
* last-price + extremes. Cached once to an offscreen canvas.
|
|
772
|
+
*
|
|
773
|
+
* Per-frame the chart pastes the cached BG, paints just the bars,
|
|
774
|
+
* then pastes the cached FG. ~20 fillText + axis paths per-frame
|
|
775
|
+
* → 1 drawImage. */
|
|
776
|
+
phase?: "all" | "bg" | "bars" | "fg";
|
|
777
|
+
}): {
|
|
778
|
+
extremes: ExtremeMarkerState | null;
|
|
779
|
+
};
|
|
780
|
+
export declare function drawCandleChartDynamicLayer(h: ChartHandle, hover: HoverState | null, cfg: DynamicCfg, now: number, reducedMotion: boolean, liveStateInputs: LiveStateInputs, crosshairAlpha?: number, dirtyRects?: readonly Rect[] | null, dirtyCount?: number): void;
|
|
781
|
+
export declare function defaultAriaLabel(series: CandleSeries, candleType: CandleType): string;
|