@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,606 @@
|
|
|
1
|
+
import { LineSeries, LineSeriesInput, LiveState } from '../domain';
|
|
2
|
+
import { Personalization, LiveBarIndicator, ThemeInput, Theme, Palette, LegendPosition, LegendVisibility, StaleVisualization, 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 { NiceTick } from '../viewport/nice-ticks';
|
|
6
|
+
import { YAxisPosition, XAxisPosition, XAxisTick } from '../rendering/draw/axis';
|
|
7
|
+
import { GridStyle } from '../rendering/draw/grid';
|
|
8
|
+
import { Rect } from '../rendering/dirty-rect-tracker';
|
|
9
|
+
import { CrosshairMarker } from '../rendering/draw/crosshair';
|
|
10
|
+
import { StackingLayout } from '../rendering/stacked-layout';
|
|
11
|
+
import { LastPriceLineStyle } from '../rendering/draw/last-price';
|
|
12
|
+
import { AreaBaseline } from '../personalization/axes/area-baseline';
|
|
13
|
+
import { CurveType } from '../personalization/axes/curve-type';
|
|
14
|
+
import { LineDash } from '../personalization/axes/line-dash';
|
|
15
|
+
import { PointMarkers, ResolvedMarkerConfig } from '../personalization/axes/point-markers';
|
|
16
|
+
import { TimeAxisHandle } from '../engine';
|
|
17
|
+
import { CurveFactory } from 'd3-shape';
|
|
18
|
+
export type CrosshairSnap = "free" | "x-axis" | "data";
|
|
19
|
+
export type CrosshairMode = "follow" | "sticky";
|
|
20
|
+
/** Per-series value at the hover-x. Every visible
|
|
21
|
+
* series shows its value at the cursor in multi-series mode. */
|
|
22
|
+
export interface TooltipSeriesValue {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly color: string;
|
|
26
|
+
readonly value: number;
|
|
27
|
+
}
|
|
28
|
+
/** Props passed to a custom LineChart tooltip render function (and to the
|
|
29
|
+
* built-in `DefaultTooltip` in both React and Solid). Framework-agnostic
|
|
30
|
+
* data shape. */
|
|
31
|
+
export interface LineChartTooltipProps {
|
|
32
|
+
/** Time at the active hover position (unix-ms). */
|
|
33
|
+
t: number;
|
|
34
|
+
/** Value at the active hover position (primary series only). */
|
|
35
|
+
value: number;
|
|
36
|
+
/** Bar index in the source series; -1 when free-snap. */
|
|
37
|
+
idx: number;
|
|
38
|
+
/** Per-series values at hover.t - primary first, then secondaries. */
|
|
39
|
+
seriesValues: readonly TooltipSeriesValue[];
|
|
40
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
41
|
+
pointerX: number;
|
|
42
|
+
pointerY: number;
|
|
43
|
+
/** Container dimensions for placement decisions. */
|
|
44
|
+
containerWidth: number;
|
|
45
|
+
containerHeight: number;
|
|
46
|
+
/** Resolved theme + palette for color matching. */
|
|
47
|
+
theme: Theme;
|
|
48
|
+
palette: Palette;
|
|
49
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
50
|
+
locale: string;
|
|
51
|
+
timeZone: string | undefined;
|
|
52
|
+
/** Per-chart formatter - preferred over `locale` for new tooltip code. */
|
|
53
|
+
formatter: ChartFormatter;
|
|
54
|
+
}
|
|
55
|
+
/** Marker mode for the visible-window high / low. */
|
|
56
|
+
export type HighLowMarkers = "off" | "lines+labels" | "labels-only";
|
|
57
|
+
/** Props passed to a custom extreme-tooltip render function (H/L pill hover).
|
|
58
|
+
* Framework-agnostic data shape - same in both React and Solid. */
|
|
59
|
+
export interface ExtremeTooltipProps {
|
|
60
|
+
kind: "high" | "low";
|
|
61
|
+
/** Bar index in the source series. */
|
|
62
|
+
barIdx: number;
|
|
63
|
+
price: number;
|
|
64
|
+
/** Time at the extreme bar (unix-ms). */
|
|
65
|
+
t: number;
|
|
66
|
+
/** Pointer position in CSS pixels relative to the chart container. */
|
|
67
|
+
pointerX: number;
|
|
68
|
+
pointerY: number;
|
|
69
|
+
containerWidth: number;
|
|
70
|
+
containerHeight: number;
|
|
71
|
+
theme: Theme;
|
|
72
|
+
palette: Palette;
|
|
73
|
+
/** Resolved platform locale (e.g. "en-US"). */
|
|
74
|
+
locale: string;
|
|
75
|
+
timeZone: string | undefined;
|
|
76
|
+
formatter: ChartFormatter;
|
|
77
|
+
}
|
|
78
|
+
export interface AreaFillThreshold {
|
|
79
|
+
/** Domain-space y to split at. `undefined` → use the resolved baseline. */
|
|
80
|
+
readonly value: number | undefined;
|
|
81
|
+
/** Pre-resolved CSS rgba string for above-threshold runs. */
|
|
82
|
+
readonly aboveColor: string;
|
|
83
|
+
/** Pre-resolved CSS rgba string for below-threshold runs. */
|
|
84
|
+
readonly belowColor: string;
|
|
85
|
+
}
|
|
86
|
+
/** Area-fill configuration. AreaChart sets this; LineChart renders it as a
|
|
87
|
+
* polygon between the line and a horizontal `baseline` y-value. Internal -
|
|
88
|
+
* LineChart's public surface intentionally has no area fill (that's
|
|
89
|
+
* <AreaChart>'s defining feature). Reused via `<AreaChart>` which forwards this transparently. */
|
|
90
|
+
export interface AreaFillConfig {
|
|
91
|
+
baseline: AreaBaseline;
|
|
92
|
+
fillType: "flat" | "gradient";
|
|
93
|
+
fillOpacity: number;
|
|
94
|
+
/** Optional threshold split. When set, the area fill renders as two
|
|
95
|
+
* polygons (above + below threshold) and the line stroke is split too.
|
|
96
|
+
* Mutually exclusive with `stacked`; when
|
|
97
|
+
* both are set, `stacked` wins (threshold becomes a no-op). */
|
|
98
|
+
threshold?: AreaFillThreshold;
|
|
99
|
+
/** Multi-series stacking mode. Resolved form (AreaChart maps user-facing
|
|
100
|
+
* `false | true | 'normalized'` to `false | 'additive' | 'normalized'`).
|
|
101
|
+
* - `false` (default): non-stacked. With 2+ series, each band fills
|
|
102
|
+
* independently from the resolved baseline (overlapping fills).
|
|
103
|
+
* - `'additive'`: bands stack, total = sum at each x.
|
|
104
|
+
* - `'normalized'`: bands stack, total = 1 (100%) at each x. */
|
|
105
|
+
stacked?: false | "additive" | "normalized";
|
|
106
|
+
}
|
|
107
|
+
/** Multi-series config - one entry per line on the chart.
|
|
108
|
+
* Each entry can override the chart-level
|
|
109
|
+
* curveType / lineWidth / lineDash / lineDashSpacing / pointMarkers for
|
|
110
|
+
* this one series. Without a per-series `color`, lib auto-cycles
|
|
111
|
+
* `palette.categorical[i]`. */
|
|
112
|
+
export interface SeriesConfig {
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly data: LineSeriesInput;
|
|
115
|
+
readonly label?: string;
|
|
116
|
+
readonly color?: string;
|
|
117
|
+
readonly curveType?: CurveType;
|
|
118
|
+
readonly stepEdgeRadius?: number;
|
|
119
|
+
readonly lineWidth?: number;
|
|
120
|
+
readonly lineDash?: LineDash;
|
|
121
|
+
readonly lineDashSpacing?: number;
|
|
122
|
+
readonly pointMarkers?: PointMarkers;
|
|
123
|
+
}
|
|
124
|
+
/** Indicator overlays that LineChart can render on the price pane. VWAP
|
|
125
|
+
* needs OHLC + volume + session_starts and is only available on
|
|
126
|
+
* CandleChart. */
|
|
127
|
+
export type LineChartIndicatorSpec = {
|
|
128
|
+
type: "sma";
|
|
129
|
+
period: number;
|
|
130
|
+
color?: string;
|
|
131
|
+
} | {
|
|
132
|
+
type: "ema";
|
|
133
|
+
period: number;
|
|
134
|
+
color?: string;
|
|
135
|
+
} | {
|
|
136
|
+
type: "wma";
|
|
137
|
+
period: number;
|
|
138
|
+
color?: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: "bollinger";
|
|
141
|
+
period: number;
|
|
142
|
+
multiplier: number;
|
|
143
|
+
color?: string;
|
|
144
|
+
};
|
|
145
|
+
/** Props passed to a custom connection-indicator render-prop. Framework-
|
|
146
|
+
* agnostic data shape - the React adapter renders this via a function
|
|
147
|
+
* returning `React.ReactNode`; the Solid adapter via `JSX.Element`; the
|
|
148
|
+
* controller widens to `unknown`. */
|
|
149
|
+
export interface ConnectionIndicatorRenderProps {
|
|
150
|
+
state: LiveState;
|
|
151
|
+
liveSince: number | undefined;
|
|
152
|
+
position: LegendPosition;
|
|
153
|
+
theme: Theme;
|
|
154
|
+
palette: Palette;
|
|
155
|
+
}
|
|
156
|
+
/** Props passed to a custom stale-banner render-prop. Framework-agnostic
|
|
157
|
+
* data shape - same widening pattern as `ConnectionIndicatorRenderProps`. */
|
|
158
|
+
export interface StaleBannerRenderProps {
|
|
159
|
+
state: LiveState;
|
|
160
|
+
liveSince: number | undefined;
|
|
161
|
+
theme: Theme;
|
|
162
|
+
palette: Palette;
|
|
163
|
+
}
|
|
164
|
+
/** Framework-agnostic LineChart prop shape. Excludes the four render-prop
|
|
165
|
+
* fields (`tooltip`, `extremeTooltip`, `connectionIndicator`, `staleBanner`)
|
|
166
|
+
* that each framework adapter retypes against its native JSX element type
|
|
167
|
+
* (`React.ReactNode` for React, `JSX.Element` for Solid). The controller's
|
|
168
|
+
* `LineChartControllerProps` extends this with `unknown`-returning render
|
|
169
|
+
* props so both adapters' shapes are structurally assignable via covariance. */
|
|
170
|
+
export interface LineChartBaseProps {
|
|
171
|
+
/** Primary series data - either structured (`{ points: Array<{t, value}> }`)
|
|
172
|
+
* or binary (`{ times: Float64Array; values: Float64Array }`). The
|
|
173
|
+
* binary path is zero-copy. Mutually exclusive with `series` for
|
|
174
|
+
* multi-series charts. */
|
|
175
|
+
data?: LineSeriesInput;
|
|
176
|
+
/** Older data prepended to `data` for indicator warm-up. Lets indicators
|
|
177
|
+
* (SMA/EMA/etc.) have priors so the visible window starts post-warmup
|
|
178
|
+
* with non-NaN values. Same shape as `data`. */
|
|
179
|
+
historyData?: LineSeriesInput;
|
|
180
|
+
/** Multi-series mode - overrides `data`. Each entry has its own id,
|
|
181
|
+
* label, color, and `LineSeriesInput`. The first entry is the primary
|
|
182
|
+
* series; subsequent entries draw as secondary lines. */
|
|
183
|
+
series?: readonly SeriesConfig[];
|
|
184
|
+
/** Chart width in CSS pixels. Default 800. */
|
|
185
|
+
width?: number;
|
|
186
|
+
/** Chart height in CSS pixels. Default 300. */
|
|
187
|
+
height?: number;
|
|
188
|
+
/** Color theme - `"light"`, `"dark"`, or `"inherit"` (follows
|
|
189
|
+
* parent provider). Default: inherits from `<ChartsProvider>`. */
|
|
190
|
+
theme?: ThemeInput;
|
|
191
|
+
/** Palette name registered in the provider (e.g. `"Monochrome"`,
|
|
192
|
+
* `"Classic"`, `"Accessible"`). Default: inherits from provider. */
|
|
193
|
+
palette?: string;
|
|
194
|
+
/** `"Fill"` (default) = solid up/down body fills. `"Outline"` =
|
|
195
|
+
* colored border + translucent body fill. */
|
|
196
|
+
visualStyle?: "Fill" | "Outline";
|
|
197
|
+
/** In Outline mode, the fill color inside the outlined body.
|
|
198
|
+
* `"auto"` (default) uses chart background. */
|
|
199
|
+
outlineFillColor?: "auto" | string;
|
|
200
|
+
/** In Outline mode, alpha of the outline body fill (0–100). Default 15. */
|
|
201
|
+
outlineFillOpacity?: number;
|
|
202
|
+
/** Cap the DPR used for canvas backing-store sizing (1–2 typical).
|
|
203
|
+
* Reduces memory on hi-DPR screens with marginal sharpness loss.
|
|
204
|
+
* Default 2. */
|
|
205
|
+
pixelDensityCap?: number;
|
|
206
|
+
/** Skip cosmetic features (glow, animations, full DPR) for low-end
|
|
207
|
+
* devices. Adaptive complexity auto-engages this when fps drops. */
|
|
208
|
+
fastMode?: boolean;
|
|
209
|
+
/** Force sparkline mode - minimal axis-less render. Auto-engaged
|
|
210
|
+
* when `width < 150`. */
|
|
211
|
+
sparkline?: boolean;
|
|
212
|
+
/** Override the auto-generated `aria-label` attached to the chart
|
|
213
|
+
* container. Default summarizes data length + type. */
|
|
214
|
+
ariaLabel?: string;
|
|
215
|
+
/** When `true` (default) and the dynamic
|
|
216
|
+
* layer is above ~200×200 px, dirty-rect repaints clip the clear +
|
|
217
|
+
* draw to V-strip + H-strip + live-bar regions instead of clearing
|
|
218
|
+
* the entire canvas. Set `false` to force full-layer repaints. */
|
|
219
|
+
partialRepaints?: boolean;
|
|
220
|
+
/** Time-axis mode per the engine boundary.
|
|
221
|
+
* - `"wall-clock"` (default) - engine's `TimeAxis.wallClock`. Bars
|
|
222
|
+
* are positioned at their actual unix-ms; off-hours / weekends
|
|
223
|
+
* leave horizontal gaps.
|
|
224
|
+
* - `"session-ordinal"` - engine's `TimeAxis.sessionOrdinal` for the
|
|
225
|
+
* supplied market. Off-session time is collapsed; bars sit
|
|
226
|
+
* continuously without overnight / weekend gaps. Required for
|
|
227
|
+
* equity charts (regular session 9:30-16:00, weekdays only). */
|
|
228
|
+
timeAxisMode?: "wall-clock" | "session-ordinal";
|
|
229
|
+
/** Market spec for session-ordinal mode. Ignored when `timeAxisMode`
|
|
230
|
+
* is `"wall-clock"` (the default). */
|
|
231
|
+
market?: "equity" | "dst-equity" | "crypto-24-7";
|
|
232
|
+
/** Toggle axis tick labels + spine. Default `true`. */
|
|
233
|
+
axisVisible?: boolean;
|
|
234
|
+
/** `"left"` (default) or `"right"`. */
|
|
235
|
+
yAxisPosition?: YAxisPosition;
|
|
236
|
+
/** `"bottom"` (default) or `"top"`. */
|
|
237
|
+
xAxisPosition?: XAxisPosition;
|
|
238
|
+
/** Fractional padding above/below the y-data range so marks don't
|
|
239
|
+
* touch the axis edges. Default 0.05 (5%). */
|
|
240
|
+
yAxisPadding?: number;
|
|
241
|
+
/** Toggle gridlines. Default `true`. */
|
|
242
|
+
gridVisible?: boolean;
|
|
243
|
+
/** Gridline style: `"solid"` / `"dashed"` / `"dotted"`. Default `"solid"`. */
|
|
244
|
+
gridStyle?: GridStyle;
|
|
245
|
+
/** Number of gridline ticks - `"sparse"` (~3) / `"normal"` (~5) /
|
|
246
|
+
* `"dense"` (~8). Default `"normal"`. */
|
|
247
|
+
gridDensity?: "sparse" | "normal" | "dense";
|
|
248
|
+
/** Use the palette's `accentTint` for axis + grid colors instead of
|
|
249
|
+
* `neutral`. Default `false`. */
|
|
250
|
+
accents?: boolean;
|
|
251
|
+
/** Locale code for number/date formatting (e.g. `"USA"`, `"en-US"`).
|
|
252
|
+
* Default: inherits from provider. */
|
|
253
|
+
locale?: string;
|
|
254
|
+
/** IANA time zone for date formatting (e.g. `"America/New_York"`).
|
|
255
|
+
* Default: inherits from provider. */
|
|
256
|
+
timeZone?: string;
|
|
257
|
+
/** Toggle the crosshair overlay on hover. Default `true`. */
|
|
258
|
+
crosshairVisible?: boolean;
|
|
259
|
+
/** How the crosshair snaps to data: `"data"` snaps to nearest data
|
|
260
|
+
* point, `"free"` follows pointer exactly. Default `"data"`. */
|
|
261
|
+
crosshairSnap?: CrosshairSnap;
|
|
262
|
+
/** Crosshair line span: `"horizontal"`, `"vertical"`, or `"both"`. */
|
|
263
|
+
crosshairMode?: CrosshairMode;
|
|
264
|
+
/** Crosshair line style: `"solid"` / `"dashed"` / `"dotted"`. */
|
|
265
|
+
crosshairLineStyle?: GridStyle;
|
|
266
|
+
/** Snap-marker shape at the data intersection: `"circle"` / `"square"`
|
|
267
|
+
* / `"none"`. */
|
|
268
|
+
crosshairMarker?: CrosshairMarker;
|
|
269
|
+
indicators?: readonly LineChartIndicatorSpec[];
|
|
270
|
+
digitGrouping?: DigitGrouping;
|
|
271
|
+
numberAbbreviation?: NumberAbbreviation;
|
|
272
|
+
/** Decimal-place rule for price labels. Default 2. */
|
|
273
|
+
decimalPlaces?: DecimalPlaces;
|
|
274
|
+
/** ISO currency code (e.g. `"USD"`, `"EUR"`) for currency-formatted
|
|
275
|
+
* labels. Default: inherit from provider locale. */
|
|
276
|
+
currency?: string;
|
|
277
|
+
/** `"symbol"` (default), `"code"`, or `"narrowSymbol"`. */
|
|
278
|
+
currencyDisplay?: CurrencyDisplay;
|
|
279
|
+
/** Precision for percentage-style labels. */
|
|
280
|
+
percentPrecision?: PercentPrecision;
|
|
281
|
+
/** Date format rule for time-axis labels (`"short"`, `"medium"`,
|
|
282
|
+
* `"long"`). */
|
|
283
|
+
dateFormat?: DateFormat;
|
|
284
|
+
/** Time format rule for intraday tick labels. */
|
|
285
|
+
timeFormat?: TimeFormat;
|
|
286
|
+
/** Style of the last-price horizontal reference line: `"solid"` /
|
|
287
|
+
* `"dashed"` / `"dotted"` / `false` to hide. Default `"solid"`. */
|
|
288
|
+
lastPriceLine?: LastPriceLineStyle;
|
|
289
|
+
/** Show the last price as a pill on the y-axis. Default `true`. */
|
|
290
|
+
lastPriceLabel?: boolean;
|
|
291
|
+
/** Override the chart background color (CSS). Default: theme-derived. */
|
|
292
|
+
chartBgColor?: string;
|
|
293
|
+
/** Show high + low markers on the visible data range:
|
|
294
|
+
* `"lines+labels"` (default), `"labels"`, `"off"`. */
|
|
295
|
+
highLowMarkers?: HighLowMarkers;
|
|
296
|
+
/** Live-bar animation: `"glow"` / `"dot"` / `"pulse-bar"` / `"none"`. */
|
|
297
|
+
liveBarIndicator?: LiveBarIndicator;
|
|
298
|
+
/** Anchor for the connection-indicator badge + legend overlay:
|
|
299
|
+
* `"top-left"` (default), `"top-right"`, `"bottom-left"`,
|
|
300
|
+
* `"bottom-right"`. */
|
|
301
|
+
legendPosition?: LegendPosition;
|
|
302
|
+
/** Legend visibility: `"on"` (default), `"off"`, `"on-hover"`. */
|
|
303
|
+
legend?: LegendVisibility;
|
|
304
|
+
/** Visual treatment for stale connection state: `"banner"`,
|
|
305
|
+
* `"desaturate-pulse"`, `"desaturate-pulse + banner"`, `"off"`. */
|
|
306
|
+
staleVisualization?: StaleVisualization;
|
|
307
|
+
/** Unix-ms timestamp of the latest accepted tick. Used to drive
|
|
308
|
+
* the live/stale state machine + auto-stale timeout. */
|
|
309
|
+
liveSince?: number;
|
|
310
|
+
/** Host-asserted connection state - overrides `liveSince`-derived
|
|
311
|
+
* state when present. `"live"` / `"stale"` / `"disconnected"`. */
|
|
312
|
+
connectionState?: LiveState;
|
|
313
|
+
/** Milliseconds after the last `liveSince` tick before the chart
|
|
314
|
+
* auto-transitions to `"stale"`. Default 5000. */
|
|
315
|
+
staleThreshold?: number;
|
|
316
|
+
/** Host-forced reduced-motion override. When unset the chart reads
|
|
317
|
+
* the user's `prefers-reduced-motion` media query. */
|
|
318
|
+
reducedMotion?: boolean;
|
|
319
|
+
/** Curve interpolation between points: `"linear"`, `"monotone"`,
|
|
320
|
+
* `"step"`, `"step-before"`, `"step-after"`, `"basis"`, `"natural"`,
|
|
321
|
+
* `"bump"`, or a parameterized form. Default `"linear"`. */
|
|
322
|
+
curveType?: CurveType;
|
|
323
|
+
/** When `curveType` is a `"step-*"` variant, radius (CSS px) for
|
|
324
|
+
* rounded step corners. `0` (default) = square. */
|
|
325
|
+
stepEdgeRadius?: number;
|
|
326
|
+
/** Series stroke width in CSS px. Default 2. */
|
|
327
|
+
lineWidth?: number;
|
|
328
|
+
/** Dash pattern: `"solid"`, `"dashed"`, `"dotted"`. */
|
|
329
|
+
lineDash?: LineDash;
|
|
330
|
+
/** Multiplier for the dash gap when `lineDash !== "solid"`. */
|
|
331
|
+
lineDashSpacing?: number;
|
|
332
|
+
/** Per-point markers along the line: `"circle"`, `"diamond"`,
|
|
333
|
+
* `"square"`, `"off"`. */
|
|
334
|
+
pointMarkers?: PointMarkers;
|
|
335
|
+
/** Area-fill config - when set, renders a filled polygon between the
|
|
336
|
+
* line and a horizontal baseline. Switches the chart to AreaChart
|
|
337
|
+
* visuals. See `AreaFillConfig` for full options. */
|
|
338
|
+
areaFill?: AreaFillConfig;
|
|
339
|
+
/** Direction-colored aura behind marks. */
|
|
340
|
+
glow?: import('../personalization/axes/glow').GlowInput;
|
|
341
|
+
/** `'auto'` = direction-colored from palette;
|
|
342
|
+
* literal color = uniform glow regardless of direction. */
|
|
343
|
+
glowColor?: import('../personalization/axes/glow').GlowColorInput;
|
|
344
|
+
/** Pattern fills. */
|
|
345
|
+
pattern?: import('../personalization/axes/pattern').PatternInput;
|
|
346
|
+
patternScale?: number;
|
|
347
|
+
patternColor?: import('../personalization/axes/pattern').PatternColorInput;
|
|
348
|
+
}
|
|
349
|
+
export declare const STALE_KEYFRAMES_ID = "tickyr-stale-keyframes";
|
|
350
|
+
export declare function ensureStaleKeyframes(): void;
|
|
351
|
+
export declare const SPARKLINE_THRESHOLD_PX = 150;
|
|
352
|
+
export declare const DEFAULT_FONT = "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
|
|
353
|
+
export declare const DEFAULT_AXIS_FONT_SIZE = 11;
|
|
354
|
+
export declare const Y_AXIS_RESERVE_PX = 80;
|
|
355
|
+
export declare const X_AXIS_RESERVE_PX = 26;
|
|
356
|
+
export declare const TICK_LENGTH_PX = 4;
|
|
357
|
+
export declare const LABEL_GAP_PX = 4;
|
|
358
|
+
export declare const DEFAULT_SERIES_STROKE = 2;
|
|
359
|
+
export declare const GRID_TARGET: Record<"sparse" | "normal" | "dense", number>;
|
|
360
|
+
export declare function liveBarMaxRadius(mode: LiveBarIndicator): number;
|
|
361
|
+
export interface ChartLayout {
|
|
362
|
+
viewport: Viewport;
|
|
363
|
+
innerLeft: number;
|
|
364
|
+
innerRight: number;
|
|
365
|
+
innerTop: number;
|
|
366
|
+
innerBottom: number;
|
|
367
|
+
yScale: LinearScale;
|
|
368
|
+
yTicks: NiceTick[];
|
|
369
|
+
xTicks: XAxisTick[];
|
|
370
|
+
startMs: number;
|
|
371
|
+
endMs: number;
|
|
372
|
+
}
|
|
373
|
+
export interface ChartHandle {
|
|
374
|
+
staticCtx: CanvasRenderingContext2D;
|
|
375
|
+
dynamicCtx: CanvasRenderingContext2D | null;
|
|
376
|
+
layout: ChartLayout;
|
|
377
|
+
personalization: Personalization;
|
|
378
|
+
timeAxis: TimeAxisHandle;
|
|
379
|
+
crosshairLineColor: string;
|
|
380
|
+
crosshairMarkerFill: string;
|
|
381
|
+
crosshairMarkerStroke: string;
|
|
382
|
+
/** When `areaFill.threshold` is on, the crosshair marker re-colors to
|
|
383
|
+
* match whichever side of the threshold the hover.value lands on
|
|
384
|
+
* (above/below). Null when no threshold split is active - the static
|
|
385
|
+
* `crosshairMarkerStroke` wins. */
|
|
386
|
+
thresholdMarker: {
|
|
387
|
+
y: number;
|
|
388
|
+
aboveStroke: string;
|
|
389
|
+
belowStroke: string;
|
|
390
|
+
} | null;
|
|
391
|
+
extremes: ExtremeMarkerState | null;
|
|
392
|
+
lastX: number;
|
|
393
|
+
lastY: number;
|
|
394
|
+
directionColor: string;
|
|
395
|
+
/** Multi-series - secondary series' last (x, y) + resolved color, so
|
|
396
|
+
* the live-bar marker can render at each line's tip. */
|
|
397
|
+
secondaryLastPositions: ReadonlyArray<{
|
|
398
|
+
x: number;
|
|
399
|
+
y: number;
|
|
400
|
+
color: string;
|
|
401
|
+
}>;
|
|
402
|
+
/** Per-secondary lookup data so the crosshair can drop a snap marker on
|
|
403
|
+
* each series at the cursor x. */
|
|
404
|
+
secondaryLookups: ReadonlyArray<{
|
|
405
|
+
times: Float64Array;
|
|
406
|
+
values: Float64Array;
|
|
407
|
+
color: string;
|
|
408
|
+
}>;
|
|
409
|
+
accentColor: string;
|
|
410
|
+
bgColor: string;
|
|
411
|
+
liveBarFontSize: number;
|
|
412
|
+
liveStateColor: string;
|
|
413
|
+
staleStateColor: string;
|
|
414
|
+
disconnectedStateColor: string;
|
|
415
|
+
textColor: string;
|
|
416
|
+
}
|
|
417
|
+
export interface LiveStateInputs {
|
|
418
|
+
liveSince: number | undefined;
|
|
419
|
+
connectionState: LiveState | undefined;
|
|
420
|
+
staleThreshold: number;
|
|
421
|
+
}
|
|
422
|
+
export interface DynamicCfg {
|
|
423
|
+
crosshairVisible: boolean;
|
|
424
|
+
crosshairLineStyle: GridStyle;
|
|
425
|
+
crosshairMarker: CrosshairMarker;
|
|
426
|
+
}
|
|
427
|
+
export declare const DEFAULT_DYNAMIC_CFG: DynamicCfg;
|
|
428
|
+
export interface ExtremeMarkerState {
|
|
429
|
+
high: {
|
|
430
|
+
idx: number;
|
|
431
|
+
t: number;
|
|
432
|
+
price: number;
|
|
433
|
+
pillBox: {
|
|
434
|
+
x: number;
|
|
435
|
+
y: number;
|
|
436
|
+
width: number;
|
|
437
|
+
height: number;
|
|
438
|
+
} | null;
|
|
439
|
+
};
|
|
440
|
+
low: {
|
|
441
|
+
idx: number;
|
|
442
|
+
t: number;
|
|
443
|
+
price: number;
|
|
444
|
+
pillBox: {
|
|
445
|
+
x: number;
|
|
446
|
+
y: number;
|
|
447
|
+
width: number;
|
|
448
|
+
height: number;
|
|
449
|
+
} | null;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
export interface HoverState {
|
|
453
|
+
pointerX: number;
|
|
454
|
+
pointerY: number;
|
|
455
|
+
snapX: number;
|
|
456
|
+
snapY: number;
|
|
457
|
+
idx: number;
|
|
458
|
+
t: number;
|
|
459
|
+
value: number;
|
|
460
|
+
}
|
|
461
|
+
export interface ExtremeHoverState {
|
|
462
|
+
kind: "high" | "low";
|
|
463
|
+
pointerX: number;
|
|
464
|
+
pointerY: number;
|
|
465
|
+
idx: number;
|
|
466
|
+
t: number;
|
|
467
|
+
price: number;
|
|
468
|
+
}
|
|
469
|
+
export type ResolvedIndicator = {
|
|
470
|
+
spec: Extract<LineChartIndicatorSpec, {
|
|
471
|
+
type: "sma" | "ema" | "wma";
|
|
472
|
+
}>;
|
|
473
|
+
kind: "single";
|
|
474
|
+
values: Float64Array;
|
|
475
|
+
color: string;
|
|
476
|
+
} | {
|
|
477
|
+
spec: Extract<LineChartIndicatorSpec, {
|
|
478
|
+
type: "bollinger";
|
|
479
|
+
}>;
|
|
480
|
+
kind: "bollinger";
|
|
481
|
+
upper: Float64Array;
|
|
482
|
+
middle: Float64Array;
|
|
483
|
+
lower: Float64Array;
|
|
484
|
+
color: string;
|
|
485
|
+
/** Translucent fill color for the area between upper and lower -
|
|
486
|
+
* alpha varies with `visualStyle` (Fill = 0.14, Outline = 0.05). */
|
|
487
|
+
bandFill: string;
|
|
488
|
+
};
|
|
489
|
+
export declare function findExtremeIndices(series: LineSeries): {
|
|
490
|
+
highIdx: number;
|
|
491
|
+
lowIdx: number;
|
|
492
|
+
};
|
|
493
|
+
export declare function defaultAriaLabel(series: LineSeries): string;
|
|
494
|
+
export declare function computeYDomain(series: LineSeries, padding: number, indicators: readonly ResolvedIndicator[], areaBaselineY: number | undefined, secondarySeries?: readonly {
|
|
495
|
+
ingested: LineSeries;
|
|
496
|
+
}[], stackedTop?: Float64Array | undefined): {
|
|
497
|
+
min: number;
|
|
498
|
+
max: number;
|
|
499
|
+
};
|
|
500
|
+
export declare function xToPxLinear(t: number, layout: ChartLayout): number;
|
|
501
|
+
export declare function pxToTime(px: number, layout: ChartLayout): number;
|
|
502
|
+
export declare function indicatorPaletteColor(spec: LineChartIndicatorSpec, personalization: Personalization): string;
|
|
503
|
+
export declare function computeIndicator(spec: LineChartIndicatorSpec, series: LineSeries, personalization: Personalization,
|
|
504
|
+
/** Number of leading bars in `series` that are warmup-only (from
|
|
505
|
+
* `historyData`). Indicator outputs are sliced to drop these so
|
|
506
|
+
* the result aligns with the visible-only series. */
|
|
507
|
+
historyLen: number): Promise<ResolvedIndicator>;
|
|
508
|
+
export declare function computeLayout(opts: {
|
|
509
|
+
series: LineSeries;
|
|
510
|
+
viewport: Viewport;
|
|
511
|
+
yAxisPosition: YAxisPosition;
|
|
512
|
+
xAxisPosition: XAxisPosition;
|
|
513
|
+
yAxisPadding: number;
|
|
514
|
+
gridDensity: "sparse" | "normal" | "dense";
|
|
515
|
+
axisVisible: boolean;
|
|
516
|
+
timeAxis: TimeAxisHandle;
|
|
517
|
+
indicators: readonly ResolvedIndicator[];
|
|
518
|
+
liveBarIndicator: LiveBarIndicator;
|
|
519
|
+
formatter: ChartFormatter;
|
|
520
|
+
/** AreaChart's resolved baseline (domain-space y); extends y-domain. */
|
|
521
|
+
areaBaselineY: number | undefined;
|
|
522
|
+
/** Multi-series secondary entries; their value extents extend y-domain. */
|
|
523
|
+
secondarySeries: readonly SecondarySeriesDraw[];
|
|
524
|
+
/** When stacked-area is on, the cumulative-top across all bands per x.
|
|
525
|
+
* Forces the y-domain to [0, max(stackTop)] regardless of raw values. */
|
|
526
|
+
stackedTop: Float64Array | undefined;
|
|
527
|
+
/** Vertical space (CSS px) reserved at the top of the canvas for the
|
|
528
|
+
* legend overlay, when the legend is on-screen and anchored to a top
|
|
529
|
+
* corner. Pushes innerTop down so the legend never overlaps data. */
|
|
530
|
+
legendReserveTop: number;
|
|
531
|
+
/** Vertical space reserved at the bottom for a bottom-anchored legend. */
|
|
532
|
+
legendReserveBottom: number;
|
|
533
|
+
}): ChartLayout;
|
|
534
|
+
export declare function drawSparkline(ctx: CanvasRenderingContext2D, series: LineSeries, viewport: Viewport, personalization: Personalization, path: Path2D, areaFill: AreaFillConfig | undefined, curveFactory: CurveFactory, lineWidth: number, lineDashPattern: number[]): void;
|
|
535
|
+
export interface DrawFullArgs {
|
|
536
|
+
ctx: CanvasRenderingContext2D;
|
|
537
|
+
series: LineSeries;
|
|
538
|
+
layout: ChartLayout;
|
|
539
|
+
personalization: Personalization;
|
|
540
|
+
path: Path2D;
|
|
541
|
+
yAxisPosition: YAxisPosition;
|
|
542
|
+
xAxisPosition: XAxisPosition;
|
|
543
|
+
gridVisible: boolean;
|
|
544
|
+
gridStyle: GridStyle;
|
|
545
|
+
axisVisible: boolean;
|
|
546
|
+
accents: boolean;
|
|
547
|
+
indicators: readonly ResolvedIndicator[];
|
|
548
|
+
lastPriceLine: LastPriceLineStyle;
|
|
549
|
+
lastPriceLabel: boolean;
|
|
550
|
+
lastPriceText: string;
|
|
551
|
+
chartBgColor: string;
|
|
552
|
+
highLowMarkers: HighLowMarkers;
|
|
553
|
+
highIdx: number;
|
|
554
|
+
lowIdx: number;
|
|
555
|
+
formatter: ChartFormatter;
|
|
556
|
+
/** AreaChart fill polygon. Resolved baseline + opacity; color is auto-
|
|
557
|
+
* derived from the line direction (up/down). Undefined = LineChart mode. */
|
|
558
|
+
areaFill: AreaFillConfig | undefined;
|
|
559
|
+
areaBaselineY: number | undefined;
|
|
560
|
+
/** Resolved d3-shape curve factory for the line + area top-edge. */
|
|
561
|
+
curveFactory: CurveFactory;
|
|
562
|
+
/** Stroke width for the main series line. */
|
|
563
|
+
lineWidth: number;
|
|
564
|
+
/** Pre-resolved dash pattern for the main series line. Empty = solid. */
|
|
565
|
+
lineDashPattern: number[];
|
|
566
|
+
/** Resolved marker config, or null when `pointMarkers` is false / undefined. */
|
|
567
|
+
markers: ResolvedMarkerConfig | null;
|
|
568
|
+
/** Pre-resolved color for the primary series. `undefined` = use the
|
|
569
|
+
* direction-aware palette.up/down. Passed by AreaChart / multi-series
|
|
570
|
+
* mode to override direction logic. */
|
|
571
|
+
primaryColorOverride: string | undefined;
|
|
572
|
+
/** Additional series to render on top of the primary. Each one carries
|
|
573
|
+
* its own resolved style + color. Empty array = single-series mode. */
|
|
574
|
+
secondarySeries: readonly SecondarySeriesDraw[];
|
|
575
|
+
/** Pre-built stacked-area layout. When non-null:
|
|
576
|
+
* - Area fills draw as N vertically-stacked bands (`drawStackedAreaFill`).
|
|
577
|
+
* - Each line stroke (primary + each secondary) follows that band's
|
|
578
|
+
* cumulative top instead of the raw series values.
|
|
579
|
+
* - Y-domain extends from 0 to max(stackTop). For 'normalized', that's
|
|
580
|
+
* [0, 1].
|
|
581
|
+
* - `areaFill.threshold`, last-price line, last-price label, H/L
|
|
582
|
+
* markers, and indicator overlays are all suppressed (their
|
|
583
|
+
* single-series semantics don't compose with stacked bands).
|
|
584
|
+
* Null = non-stacked path (overlapping fills for multi-series, single
|
|
585
|
+
* fill for single-series - both go through the original code path). */
|
|
586
|
+
stackedLayout: StackingLayout | null;
|
|
587
|
+
}
|
|
588
|
+
/** A non-primary series rendered alongside the main series. Carries the
|
|
589
|
+
* ingested data + a fully-resolved per-series style so the draw loop is
|
|
590
|
+
* configuration-free. */
|
|
591
|
+
export interface SecondarySeriesDraw {
|
|
592
|
+
readonly ingested: LineSeries;
|
|
593
|
+
readonly color: string;
|
|
594
|
+
readonly curveFactory: CurveFactory;
|
|
595
|
+
readonly lineWidth: number;
|
|
596
|
+
readonly lineDashPattern: number[];
|
|
597
|
+
readonly markers: ResolvedMarkerConfig | null;
|
|
598
|
+
}
|
|
599
|
+
export interface DrawFullResult {
|
|
600
|
+
extremes: ExtremeMarkerState | null;
|
|
601
|
+
}
|
|
602
|
+
export declare function drawFullLineChart(args: DrawFullArgs): DrawFullResult;
|
|
603
|
+
/** Single owner of the dynamic-layer draw - clears, paints the live-bar
|
|
604
|
+
* + connection indicator (per personalization), and draws the crosshair
|
|
605
|
+
* on top when hovered. Both pointer events and the rAF loop call this. */
|
|
606
|
+
export declare function drawDynamicLayer(h: ChartHandle, hover: HoverState | null, now: number, reducedMotion: boolean, cfg: DynamicCfg, liveStateInputs: LiveStateInputs, dirtyRects?: readonly Rect[] | null, dirtyCount?: number): void;
|