react-native-livechart 4.19.0 → 4.21.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/dist/components/CustomThresholdBadgeOverlay.d.ts +18 -0
- package/dist/components/CustomThresholdBadgeOverlay.d.ts.map +1 -0
- package/dist/components/CustomTooltipOverlay.d.ts +4 -2
- package/dist/components/CustomTooltipOverlay.d.ts.map +1 -1
- package/dist/components/LiveChart.d.ts +2 -2
- package/dist/components/LiveChart.d.ts.map +1 -1
- package/dist/components/LiveChartSeries.d.ts +2 -2
- package/dist/components/LiveChartSeries.d.ts.map +1 -1
- package/dist/components/ReferenceLineOverlay.d.ts +9 -4
- package/dist/components/ReferenceLineOverlay.d.ts.map +1 -1
- package/dist/components/ReferenceLineSeriesOverlay.d.ts +19 -0
- package/dist/components/ReferenceLineSeriesOverlay.d.ts.map +1 -0
- package/dist/core/liveChartEngineTick.d.ts +6 -1
- package/dist/core/liveChartEngineTick.d.ts.map +1 -1
- package/dist/core/resolveConfig.d.ts +34 -1
- package/dist/core/resolveConfig.d.ts.map +1 -1
- package/dist/core/useLiveChartEngine.d.ts +9 -1
- package/dist/core/useLiveChartEngine.d.ts.map +1 -1
- package/dist/draw/candle.d.ts +3 -1
- package/dist/draw/candle.d.ts.map +1 -1
- package/dist/draw/candleGap.d.ts +14 -0
- package/dist/draw/candleGap.d.ts.map +1 -0
- package/dist/draw/grid.d.ts +1 -1
- package/dist/draw/grid.d.ts.map +1 -1
- package/dist/draw/lineGap.d.ts +25 -0
- package/dist/draw/lineGap.d.ts.map +1 -0
- package/dist/hooks/crosshairShared.d.ts +7 -3
- package/dist/hooks/crosshairShared.d.ts.map +1 -1
- package/dist/hooks/useCandleGapPaths.d.ts +12 -0
- package/dist/hooks/useCandleGapPaths.d.ts.map +1 -0
- package/dist/hooks/useChartPaths.d.ts +4 -1
- package/dist/hooks/useChartPaths.d.ts.map +1 -1
- package/dist/hooks/useCrosshair.d.ts +9 -5
- package/dist/hooks/useCrosshair.d.ts.map +1 -1
- package/dist/hooks/useLineGapPaths.d.ts +10 -0
- package/dist/hooks/useLineGapPaths.d.ts.map +1 -0
- package/dist/hooks/usePinchZoom.d.ts +7 -0
- package/dist/hooks/usePinchZoom.d.ts.map +1 -1
- package/dist/hooks/useReferenceLine.d.ts +4 -3
- package/dist/hooks/useReferenceLine.d.ts.map +1 -1
- package/dist/hooks/useReferenceLineSeries.d.ts +23 -0
- package/dist/hooks/useReferenceLineSeries.d.ts.map +1 -0
- package/dist/hooks/useThreshold.d.ts +13 -13
- package/dist/hooks/useThreshold.d.ts.map +1 -1
- package/dist/hooks/useYAxis.d.ts +1 -1
- package/dist/hooks/useYAxis.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/math/candleGaps.d.ts +18 -0
- package/dist/math/candleGaps.d.ts.map +1 -0
- package/dist/math/referenceLineSeries.d.ts +12 -0
- package/dist/math/referenceLineSeries.d.ts.map +1 -0
- package/dist/math/referenceLines.d.ts +5 -5
- package/dist/math/referenceLines.d.ts.map +1 -1
- package/dist/math/spline.d.ts +5 -1
- package/dist/math/spline.d.ts.map +1 -1
- package/dist/types.d.ts +212 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CustomThresholdBadgeOverlay.tsx +74 -0
- package/src/components/CustomTooltipOverlay.tsx +7 -3
- package/src/components/LiveChart.tsx +353 -56
- package/src/components/LiveChartSeries.tsx +28 -6
- package/src/components/ReferenceLineOverlay.tsx +38 -7
- package/src/components/ReferenceLineSeriesOverlay.tsx +141 -0
- package/src/core/liveChartEngineTick.ts +34 -1
- package/src/core/resolveConfig.ts +197 -1
- package/src/core/useLiveChartEngine.ts +37 -5
- package/src/draw/candle.ts +1 -1
- package/src/draw/candleGap.ts +132 -0
- package/src/draw/grid.ts +34 -4
- package/src/draw/lineGap.ts +180 -0
- package/src/hooks/crosshairShared.ts +92 -11
- package/src/hooks/useCandleGapPaths.ts +88 -0
- package/src/hooks/useChartPaths.ts +81 -22
- package/src/hooks/useCrosshair.ts +126 -40
- package/src/hooks/useLineGapPaths.ts +76 -0
- package/src/hooks/usePinchZoom.ts +21 -0
- package/src/hooks/useReferenceLine.ts +6 -5
- package/src/hooks/useReferenceLineSeries.ts +101 -0
- package/src/hooks/useThreshold.ts +31 -22
- package/src/hooks/useYAxis.ts +2 -0
- package/src/index.ts +16 -0
- package/src/math/candleGaps.ts +120 -0
- package/src/math/referenceLineSeries.ts +83 -0
- package/src/math/referenceLines.ts +34 -6
- package/src/math/spline.ts +15 -5
- package/src/types.ts +224 -14
package/src/types.ts
CHANGED
|
@@ -56,11 +56,12 @@ export type CanvasMode = "transparent" | "opaque";
|
|
|
56
56
|
export type BadgeVariant = "default" | "minimal";
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* A reference line or band drawn into the chart.
|
|
60
|
-
* with precedence A > B > C when fields from more than one are present:
|
|
59
|
+
* A reference line or band drawn into the chart. Four mutually-exclusive forms,
|
|
60
|
+
* with precedence A > B > C > D when fields from more than one are present:
|
|
61
61
|
* - **Form A** — horizontal line at `value`.
|
|
62
|
-
* - **Form B** —
|
|
63
|
-
* - **Form C** —
|
|
62
|
+
* - **Form B** — time-varying line following `series`.
|
|
63
|
+
* - **Form C** — horizontal band between `valueFrom` and `valueTo`.
|
|
64
|
+
* - **Form D** — vertical time band between `from` and `to` (unix seconds).
|
|
64
65
|
*/
|
|
65
66
|
export interface ReferenceLine {
|
|
66
67
|
/**
|
|
@@ -70,13 +71,25 @@ export interface ReferenceLine {
|
|
|
70
71
|
id?: string;
|
|
71
72
|
/** Form A — the Y-axis value where the horizontal line is drawn. */
|
|
72
73
|
value?: number;
|
|
73
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Form B — a time-varying reference line. Points use unix-second timestamps
|
|
76
|
+
* and should be sorted oldest to newest. The first value extends to the left
|
|
77
|
+
* edge; the last value extends to the live edge unless {@link extendToNow} is
|
|
78
|
+
* `false`. Supported by line and candle charts.
|
|
79
|
+
*/
|
|
80
|
+
series?: LiveChartPoint[];
|
|
81
|
+
/**
|
|
82
|
+
* Form B — extend the series' last value flat to the chart's live edge.
|
|
83
|
+
* Set `false` to stop at the last point. Default `true`.
|
|
84
|
+
*/
|
|
85
|
+
extendToNow?: boolean;
|
|
86
|
+
/** Form C — horizontal band lower Y bound (paired with `valueTo`). */
|
|
74
87
|
valueFrom?: number;
|
|
75
|
-
/** Form
|
|
88
|
+
/** Form C — horizontal band upper Y bound (paired with `valueFrom`). */
|
|
76
89
|
valueTo?: number;
|
|
77
|
-
/** Form
|
|
90
|
+
/** Form D — vertical time-band start, unix seconds (paired with `to`). */
|
|
78
91
|
from?: number;
|
|
79
|
-
/** Form
|
|
92
|
+
/** Form D — vertical time-band end, unix seconds (paired with `from`). */
|
|
80
93
|
to?: number;
|
|
81
94
|
/** Optional right-gutter label (e.g. `"Entry"`). */
|
|
82
95
|
label?: string;
|
|
@@ -86,7 +99,7 @@ export interface ReferenceLine {
|
|
|
86
99
|
* (top/bottom for value bands, left/right for time bands); omit for no border.
|
|
87
100
|
*/
|
|
88
101
|
strokeWidth?: number;
|
|
89
|
-
/** Dash pattern as `[dashLength, gapLength]` in pixels (line stroke + band border). */
|
|
102
|
+
/** Dash pattern as `[dashLength, gapLength]` in pixels (line/series stroke + band border). */
|
|
90
103
|
intervals?: [number, number];
|
|
91
104
|
/**
|
|
92
105
|
* Span the **full chart width** — edge to edge through the Y-axis gutter, not
|
|
@@ -94,13 +107,20 @@ export interface ReferenceLine {
|
|
|
94
107
|
* value on the axis (like a price tag). Only the line/band extends; any
|
|
95
108
|
* `label`/`badge` stays anchored inside the plot. For a Form-A line with a
|
|
96
109
|
* `badge`, the full-width line replaces the dashed connector. No effect on a
|
|
97
|
-
* vertical time band. Default `false` (stops at the plot edge). Form A /
|
|
110
|
+
* vertical time band. Default `false` (stops at the plot edge). Form A / C.
|
|
98
111
|
*/
|
|
99
112
|
fullWidth?: boolean;
|
|
100
113
|
/** Line / band color override. Defaults to palette `refLine`. */
|
|
101
114
|
color?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Band fill color override. Defaults to {@link color}, then palette `refLine`.
|
|
117
|
+
* Form C / D only.
|
|
118
|
+
*/
|
|
119
|
+
fillColor?: string;
|
|
102
120
|
/** Fill opacity for a value / time band (0–1). Default `0.16`. */
|
|
103
121
|
fillOpacity?: number;
|
|
122
|
+
/** Opacity for the line, series, or band border stroke (0–1). Default `1`. */
|
|
123
|
+
strokeOpacity?: number;
|
|
104
124
|
/** Label text color. Defaults to `color`, then palette `refLabel`. */
|
|
105
125
|
labelColor?: string;
|
|
106
126
|
/**
|
|
@@ -109,7 +129,7 @@ export interface ReferenceLine {
|
|
|
109
129
|
* (default `"left"`).
|
|
110
130
|
*/
|
|
111
131
|
labelPosition?: "left" | "center" | "right";
|
|
112
|
-
/** Append the formatted
|
|
132
|
+
/** Append the formatted value to the label (Form A/B). Default `false`. */
|
|
113
133
|
showValue?: boolean;
|
|
114
134
|
/**
|
|
115
135
|
* Exclude this line's value(s) from the Y-axis range computation, so it may sit
|
|
@@ -541,6 +561,13 @@ export interface ThresholdLineConfig {
|
|
|
541
561
|
* gutter like a legacy reference line (may overlap y-axis labels). Default `"left"`.
|
|
542
562
|
*/
|
|
543
563
|
labelPosition?: "left" | "right";
|
|
564
|
+
/**
|
|
565
|
+
* Time-varying threshold series only: which visible endpoint supplies the
|
|
566
|
+
* label badge's Y position and optional value. `"first"` samples the
|
|
567
|
+
* threshold at the visible window's left edge; `"last"` uses the live/right
|
|
568
|
+
* edge. Independent of {@link labelPosition}. Default `"last"`.
|
|
569
|
+
*/
|
|
570
|
+
labelAnchor?: "first" | "last";
|
|
544
571
|
/** Line + label color. Defaults to palette `refLine` / `refLabel`. */
|
|
545
572
|
color?: string;
|
|
546
573
|
/** Dash pattern `[dashLength, gapLength]` in pixels. Default `[4, 4]`. */
|
|
@@ -554,6 +581,25 @@ export interface ThresholdLineConfig {
|
|
|
554
581
|
labelColor?: string;
|
|
555
582
|
}
|
|
556
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Context passed to {@link LiveChartProps.renderThresholdBadge}. The chart
|
|
586
|
+
* floats the returned React Native element over the canvas and pins it to the
|
|
587
|
+
* live threshold on the UI thread. Bind the SharedValues to animated content
|
|
588
|
+
* when its displayed value must update without React re-renders.
|
|
589
|
+
*/
|
|
590
|
+
export interface ThresholdBadgeRenderProps {
|
|
591
|
+
/** Resolved marker-line config for the badge being rendered. */
|
|
592
|
+
line: ThresholdLineConfig;
|
|
593
|
+
/** Live threshold value in Y-axis units. */
|
|
594
|
+
value: SharedValue<number>;
|
|
595
|
+
/** The threshold value formatted with the chart's `formatValue`. */
|
|
596
|
+
valueStr: SharedValue<string>;
|
|
597
|
+
/** Canvas Y pixel of the threshold (`NaN` when geometry is unavailable). */
|
|
598
|
+
y: SharedValue<number>;
|
|
599
|
+
/** Whether the threshold badge currently belongs inside the visible plot. */
|
|
600
|
+
visible: SharedValue<boolean>;
|
|
601
|
+
}
|
|
602
|
+
|
|
557
603
|
/** Object form of {@link ThresholdConfig.fill} — band tuning. */
|
|
558
604
|
export interface ThresholdFillConfig {
|
|
559
605
|
/** Band fill opacity (0–1), applied to the above/below colors. Multiplies an
|
|
@@ -648,6 +694,15 @@ export interface VolumeConfig {
|
|
|
648
694
|
export interface YAxisConfig {
|
|
649
695
|
/** Minimum pixel gap between grid lines. Default `36`. */
|
|
650
696
|
minGap?: number;
|
|
697
|
+
/**
|
|
698
|
+
* Multiplier used to choose and align dynamic "nice" intervals without
|
|
699
|
+
* changing plotted values. Pair it with a `formatValue` that applies the
|
|
700
|
+
* same multiplier. Must be positive and finite; invalid values use `1`.
|
|
701
|
+
* If applying the multiplier to the live range would overflow or underflow,
|
|
702
|
+
* interval selection falls back to source units for that range.
|
|
703
|
+
* Ignored when {@link count} is set. Default `1`.
|
|
704
|
+
*/
|
|
705
|
+
intervalScale?: number;
|
|
651
706
|
/**
|
|
652
707
|
* Show a fixed number of price labels instead of the dynamic nice-interval
|
|
653
708
|
* grid. When set (≥ 2), exactly `count` labels are spaced evenly **in pixels**
|
|
@@ -1134,6 +1189,12 @@ export interface TooltipRenderProps {
|
|
|
1134
1189
|
* worklet-safe formatter (e.g. the chart's `formatValue`).
|
|
1135
1190
|
*/
|
|
1136
1191
|
candle: SharedValue<CandlePoint | null>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Explicit line or candle gap under the crosshair (`null` outside a
|
|
1194
|
+
* configured gap). A gap never fabricates {@link candle}; inspect this field
|
|
1195
|
+
* for no-trade, unavailable, or unknown-data treatment.
|
|
1196
|
+
*/
|
|
1197
|
+
gap: SharedValue<ChartGap | null>;
|
|
1137
1198
|
}
|
|
1138
1199
|
|
|
1139
1200
|
/** Inner plot rectangle in canvas pixels (a snapshot field of {@link ChartScale}). */
|
|
@@ -1734,6 +1795,8 @@ export interface ScrubPointCore {
|
|
|
1734
1795
|
export interface ScrubPoint extends ScrubPointCore {
|
|
1735
1796
|
/** In candle mode, the OHLC data of the candle under the crosshair. */
|
|
1736
1797
|
candle?: CandlePoint;
|
|
1798
|
+
/** Explicit chart gap under the crosshair, when a bridged gap supplies the value. */
|
|
1799
|
+
gap?: ChartGap;
|
|
1737
1800
|
}
|
|
1738
1801
|
|
|
1739
1802
|
/** Scrub callback payload for multi-series charts. */
|
|
@@ -1763,6 +1826,110 @@ export interface CandlePoint {
|
|
|
1763
1826
|
volume?: number;
|
|
1764
1827
|
}
|
|
1765
1828
|
|
|
1829
|
+
/** Why a chart time range contains no observed market sample. */
|
|
1830
|
+
export type CandleGapKind = "no-trades" | "unavailable" | "unknown";
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* Explicit metadata for a chart interval without an observed sample. The range
|
|
1834
|
+
* is half-open (`[from, to)`) and uses Unix seconds, matching line points and
|
|
1835
|
+
* {@link CandlePoint.time}. Gaps do not replace or mutate real data.
|
|
1836
|
+
*/
|
|
1837
|
+
export interface CandleGap {
|
|
1838
|
+
/** Inclusive range start as a Unix timestamp in seconds. */
|
|
1839
|
+
from: number;
|
|
1840
|
+
/** Exclusive range end as a Unix timestamp in seconds. Must be greater than {@link from}. */
|
|
1841
|
+
to: number;
|
|
1842
|
+
/** Semantic reason the interval has no observation. */
|
|
1843
|
+
kind: CandleGapKind;
|
|
1844
|
+
/** Optional localized label, e.g. `"Exchange maintenance"`. */
|
|
1845
|
+
label?: string;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
/** Previous-value bridge styling for a chart gap. */
|
|
1849
|
+
export interface CandleGapBridgeStyle {
|
|
1850
|
+
/** Mark color. Defaults to palette `refLine`. */
|
|
1851
|
+
color?: string;
|
|
1852
|
+
/** Mark opacity. Default `0.7` when enabled (`0.55` for unavailable gaps). */
|
|
1853
|
+
opacity?: number;
|
|
1854
|
+
/** Mark stroke width in pixels. Default `2`. */
|
|
1855
|
+
strokeWidth?: number;
|
|
1856
|
+
/** Mark cap style. Default `"round"`. */
|
|
1857
|
+
strokeCap?: "butt" | "round" | "square";
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
/** Full-height time-band styling for a chart gap. */
|
|
1861
|
+
export interface CandleGapBandStyle {
|
|
1862
|
+
/** Band fill color. Defaults to palette `refLine`. */
|
|
1863
|
+
fillColor?: string;
|
|
1864
|
+
/** Band fill opacity. Default `0.12` when enabled (`0.08` for unknown gaps). */
|
|
1865
|
+
fillOpacity?: number;
|
|
1866
|
+
/** Band-edge color. Defaults to palette `refLine`. */
|
|
1867
|
+
borderColor?: string;
|
|
1868
|
+
/** Band-edge opacity. Default `1`. */
|
|
1869
|
+
borderOpacity?: number;
|
|
1870
|
+
/**
|
|
1871
|
+
* Band-edge width in pixels. `0` hides the border. Default `2` (`1` for
|
|
1872
|
+
* unknown gaps).
|
|
1873
|
+
*/
|
|
1874
|
+
borderWidth?: number;
|
|
1875
|
+
/** Band-edge dash pattern. Default `[4, 4]`. */
|
|
1876
|
+
intervals?: [number, number];
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/** Label styling for a chart-gap time band. Text comes from {@link CandleGap.label}. */
|
|
1880
|
+
export interface CandleGapLabelStyle {
|
|
1881
|
+
/** Label color. Defaults to palette `refLabel`. */
|
|
1882
|
+
color?: string;
|
|
1883
|
+
/** Label position inside the band. Default `"left"`. */
|
|
1884
|
+
position?: "left" | "right";
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
/** Per-kind presentation overrides for {@link CandleGapsConfig}. */
|
|
1888
|
+
export interface CandleGapStyle {
|
|
1889
|
+
/**
|
|
1890
|
+
* Previous-close marks. `false` disables them; an object enables and styles
|
|
1891
|
+
* them. Omission preserves the semantic default for the gap kind.
|
|
1892
|
+
*/
|
|
1893
|
+
bridge?: false | CandleGapBridgeStyle;
|
|
1894
|
+
/**
|
|
1895
|
+
* Full-height time band. `false` disables it; an object enables and styles it.
|
|
1896
|
+
* Omission preserves the semantic default for the gap kind.
|
|
1897
|
+
*/
|
|
1898
|
+
band?: false | CandleGapBandStyle;
|
|
1899
|
+
/**
|
|
1900
|
+
* Band label. `false` hides it; an object enables and styles it. Omission
|
|
1901
|
+
* preserves the semantic default for the gap kind.
|
|
1902
|
+
*/
|
|
1903
|
+
label?: false | CandleGapLabelStyle;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* Data and optional per-kind styling for explicit chart gaps. Gap metadata is
|
|
1908
|
+
* low-frequency React data (like `referenceLines`); live market data remains in
|
|
1909
|
+
* its SharedValue.
|
|
1910
|
+
*/
|
|
1911
|
+
export interface CandleGapsConfig {
|
|
1912
|
+
/** Sorted, non-overlapping gap ranges. Invalid ranges are ignored. */
|
|
1913
|
+
gaps: CandleGap[];
|
|
1914
|
+
/** Presentation overrides keyed by semantic gap kind. */
|
|
1915
|
+
styles?: Partial<Record<CandleGapKind, CandleGapStyle>>;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
/** Semantic reason for a chart interval with no observed market sample. */
|
|
1919
|
+
export type ChartGapKind = CandleGapKind;
|
|
1920
|
+
/** Shared gap metadata used by both line and candlestick charts. */
|
|
1921
|
+
export type ChartGap = CandleGap;
|
|
1922
|
+
/** Previous-value bridge styling shared by line and candlestick gaps. */
|
|
1923
|
+
export type ChartGapBridgeStyle = CandleGapBridgeStyle;
|
|
1924
|
+
/** Full-height time-band styling shared by line and candlestick gaps. */
|
|
1925
|
+
export type ChartGapBandStyle = CandleGapBandStyle;
|
|
1926
|
+
/** Time-band label styling shared by line and candlestick gaps. */
|
|
1927
|
+
export type ChartGapLabelStyle = CandleGapLabelStyle;
|
|
1928
|
+
/** Per-kind gap presentation shared by line and candlestick charts. */
|
|
1929
|
+
export type ChartGapStyle = CandleGapStyle;
|
|
1930
|
+
/** Gap data and per-kind styles shared by line and candlestick charts. */
|
|
1931
|
+
export type ChartGapsConfig = CandleGapsConfig;
|
|
1932
|
+
|
|
1766
1933
|
// ── Metrics (sizing & motion tokens) ─────────────────────────────────────────
|
|
1767
1934
|
|
|
1768
1935
|
/**
|
|
@@ -1942,6 +2109,22 @@ export interface ZoomConfig {
|
|
|
1942
2109
|
maxTimeWindow?: number;
|
|
1943
2110
|
}
|
|
1944
2111
|
|
|
2112
|
+
/** Imperative methods exposed by `LiveChart` and `LiveChartSeries`. */
|
|
2113
|
+
export interface LiveChartHandle {
|
|
2114
|
+
/**
|
|
2115
|
+
* Reset built-in pinch/time-window zoom to the configured `timeWindow` and
|
|
2116
|
+
* clear the focal-point offset so the chart follows the live edge again.
|
|
2117
|
+
* Safe to call when already reset. A paused chart remains paused.
|
|
2118
|
+
*
|
|
2119
|
+
* ```tsx
|
|
2120
|
+
* const chartRef = useRef<LiveChartHandle>(null);
|
|
2121
|
+
* <Button title="Reset zoom" onPress={() => chartRef.current?.resetZoom()} />
|
|
2122
|
+
* <LiveChart ref={chartRef} data={data} value={value} zoom />
|
|
2123
|
+
* ```
|
|
2124
|
+
*/
|
|
2125
|
+
resetZoom(): void;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
1945
2128
|
/**
|
|
1946
2129
|
* The visible time range reported by {@link LiveChartCoreProps.onVisibleRangeChange}.
|
|
1947
2130
|
*
|
|
@@ -2182,7 +2365,7 @@ export interface LiveChartCoreProps {
|
|
|
2182
2365
|
* `render`). Default off.
|
|
2183
2366
|
*/
|
|
2184
2367
|
bottomLabel?: boolean | AxisLabelConfig;
|
|
2185
|
-
/** Reference lines / bands drawn into the chart. Supports all
|
|
2368
|
+
/** Reference lines / bands drawn into the chart. Supports all four `ReferenceLine` forms. */
|
|
2186
2369
|
referenceLines?: ReferenceLine[];
|
|
2187
2370
|
/** Per-instance grid-line styling. Pass an object to override color / width / dash / opacity. */
|
|
2188
2371
|
gridStyle?: GridStyleConfig;
|
|
@@ -2401,10 +2584,21 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2401
2584
|
segments?: ChartSegment[];
|
|
2402
2585
|
/**
|
|
2403
2586
|
* Color the line above vs. below a live threshold value (break-even / average
|
|
2404
|
-
* cost, VWAP, previous close, a peg).
|
|
2405
|
-
*
|
|
2587
|
+
* cost, VWAP, previous close, a peg). Supports a live scalar or a static/live
|
|
2588
|
+
* time-varying series. See {@link ThresholdConfig}.
|
|
2406
2589
|
*/
|
|
2407
2590
|
threshold?: ThresholdConfig;
|
|
2591
|
+
/**
|
|
2592
|
+
* Render the threshold line's badge as a custom **React Native** element
|
|
2593
|
+
* instead of the built-in Skia pill. The chart measures and pins the element
|
|
2594
|
+
* to the threshold's live Y position and configured `labelPosition` on the UI
|
|
2595
|
+
* thread (see {@link ThresholdBadgeRenderProps}); the dashed marker line stays
|
|
2596
|
+
* built in. Requires `threshold.line`. Return `null`/`undefined` to keep the
|
|
2597
|
+
* built-in badge. Single-series line mode only.
|
|
2598
|
+
*/
|
|
2599
|
+
renderThresholdBadge?: (
|
|
2600
|
+
ctx: ThresholdBadgeRenderProps,
|
|
2601
|
+
) => ReactElement | null | undefined;
|
|
2408
2602
|
/** Render the live value as a large text overlay in the top-left. Default `false`. */
|
|
2409
2603
|
showValue?: boolean;
|
|
2410
2604
|
/** Tint the `showValue` text by momentum (green up / red down). Default `false`. */
|
|
@@ -2419,6 +2613,22 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2419
2613
|
candleWidth?: number;
|
|
2420
2614
|
/** In-progress candle updated each tick. Must be a SharedValue for UI-thread reads. */
|
|
2421
2615
|
liveCandle?: SharedValue<CandlePoint | null>;
|
|
2616
|
+
/**
|
|
2617
|
+
* Explicit candle-chart gaps. Pass a sorted array for semantic defaults, or a
|
|
2618
|
+
* {@link CandleGapsConfig} to override per-kind styling. Missing timestamps
|
|
2619
|
+
* are never inferred: `"no-trades"` draws neutral previous-close marks,
|
|
2620
|
+
* `"unavailable"` adds a labeled time band, and `"unknown"` leaves price
|
|
2621
|
+
* unfilled. Candle mode only. Default off.
|
|
2622
|
+
*/
|
|
2623
|
+
candleGaps?: CandleGap[] | CandleGapsConfig;
|
|
2624
|
+
/**
|
|
2625
|
+
* Explicit line-chart gaps. Pass a sorted array for semantic defaults, or a
|
|
2626
|
+
* {@link ChartGapsConfig} to override per-kind styling. The normal line and
|
|
2627
|
+
* every area fill stop at the interval boundaries; bridge-enabled kinds draw
|
|
2628
|
+
* a flat previous-value segment. Real samples inside a range take precedence
|
|
2629
|
+
* over its metadata. Line mode only. Default off.
|
|
2630
|
+
*/
|
|
2631
|
+
lineGaps?: ChartGap[] | ChartGapsConfig;
|
|
2422
2632
|
/**
|
|
2423
2633
|
* Live trade fills for optional on-chart markers. Read on the UI thread only —
|
|
2424
2634
|
* pass a `SharedValue` and update from JS via `.value` (same pattern as `data` / `value`).
|