react-native-livechart 4.20.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.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 +32 -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/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/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/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 +188 -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 +320 -43
- 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 +186 -0
- package/src/core/useLiveChartEngine.ts +37 -5
- package/src/draw/candle.ts +1 -1
- package/src/draw/candleGap.ts +132 -0
- 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/useReferenceLine.ts +6 -5
- package/src/hooks/useReferenceLineSeries.ts +101 -0
- package/src/hooks/useThreshold.ts +31 -22
- package/src/index.ts +15 -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 +199 -14
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolvedCandleGapsConfig } from "../core/resolveConfig";
|
|
2
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
/** Batched flat previous-value bridge paths for each semantic line-gap kind. */
|
|
5
|
+
export declare function useLineGapPaths(engine: SingleEngineState, padding: ChartPadding, config: ResolvedCandleGapsConfig): {
|
|
6
|
+
readonly noTradesPath: import("react-native-reanimated").DerivedValue<import("@shopify/react-native-skia").SkPath>;
|
|
7
|
+
readonly unavailablePath: import("react-native-reanimated").DerivedValue<import("@shopify/react-native-skia").SkPath>;
|
|
8
|
+
readonly unknownPath: import("react-native-reanimated").DerivedValue<import("@shopify/react-native-skia").SkPath>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useLineGapPaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLineGapPaths.d.ts","sourceRoot":"","sources":["../../src/hooks/useLineGapPaths.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,gFAAgF;AAChF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,wBAAwB;;;;EAgEjC"}
|
|
@@ -70,9 +70,10 @@ export declare function computeReferenceBadgeRect(line: ReferenceLine, canvasWid
|
|
|
70
70
|
valueOverride?: number): ReferenceBadgeRect | null;
|
|
71
71
|
/**
|
|
72
72
|
* Derives screen-space layout for a single reference line or band. Supports all
|
|
73
|
-
* three `ReferenceLine` forms (horizontal line, horizontal value
|
|
74
|
-
* time band) plus the pill badge for a Form-A value (in-range tag
|
|
75
|
-
* chevron pin).
|
|
73
|
+
* three scalar/band `ReferenceLine` forms (horizontal line, horizontal value
|
|
74
|
+
* band, vertical time band) plus the pill badge for a Form-A value (in-range tag
|
|
75
|
+
* + off-screen chevron pin). The series form is handled by
|
|
76
|
+
* `ReferenceLineSeriesOverlay`.
|
|
76
77
|
*/
|
|
77
78
|
export declare function useReferenceLine(engine: ChartEngineLayout, padding: ChartPadding, line: ReferenceLine | undefined, formatValue: (v: number) => string, font: SkFont,
|
|
78
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReferenceLine.d.ts","sourceRoot":"","sources":["../../src/hooks/useReferenceLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC;IACf,oGAAoG;IACpG,QAAQ,EAAE,OAAO,CAAC;IAClB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,mF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AAM,CAAC;CACX;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM;AACtC,8EAA8E;AAC9E,aAAa,CAAC,EAAE,MAAM,GACrB,kBAAkB,GAAG,IAAI,CAwC3B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAClC,IAAI,EAAE,MAAM;AACZ;;;;;GAKG;AACH,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,EAClC,KAAK,SAAI;AACT,oEAAoE;AACpE,YAAY,CAAC,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC;AACxC,+EAA+E;AAC/E,gBAAgB,CAAC,EAAE,MAAM;AACzB,2EAA2E;AAC3E,UAAU,SAAI;AACd,mFAAmF;AACnF,SAAS,GAAE,MAAa,GACvB,WAAW,CAAC,mBAAmB,CAAC,CA6NlC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
import type { LiveChartPoint } from "../types";
|
|
5
|
+
export interface ReferenceLineSeriesGeometry {
|
|
6
|
+
/** Visible series polyline as `[x, y, …]` screen coordinates. */
|
|
7
|
+
screenPts: SharedValue<number[]>;
|
|
8
|
+
/** Whether any series segment crosses the visible plot. */
|
|
9
|
+
visible: SharedValue<boolean>;
|
|
10
|
+
/** Series value at the chart's current right edge. */
|
|
11
|
+
currentValue: SharedValue<number>;
|
|
12
|
+
/** Canvas Y coordinate of {@link currentValue}. */
|
|
13
|
+
currentY: SharedValue<number>;
|
|
14
|
+
/** Whether the current-value label belongs inside the visible plot. */
|
|
15
|
+
currentVisible: SharedValue<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* UI-thread geometry for a static historical reference-line series. Point
|
|
19
|
+
* buffers ping-pong so Reanimated observes a changed array reference each frame
|
|
20
|
+
* without allocating new intermediate arrays.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useReferenceLineSeries(engine: ChartEngineLayout, padding: ChartPadding, points: LiveChartPoint[], extendToNow: boolean): ReferenceLineSeriesGeometry;
|
|
23
|
+
//# sourceMappingURL=useReferenceLineSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReferenceLineSeries.d.ts","sourceRoot":"","sources":["../../src/hooks/useReferenceLineSeries.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,2DAA2D;IAC3D,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,sDAAsD;IACtD,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,mDAAmD;IACnD,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,uEAAuE;IACvE,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,cAAc,EAAE,EACxB,WAAW,EAAE,OAAO,GACnB,2BAA2B,CA+D7B"}
|
|
@@ -41,15 +41,15 @@ export interface ThresholdSeriesGeometry {
|
|
|
41
41
|
samples: SharedValue<number[]>;
|
|
42
42
|
/** Whether any of the polyline is on-screen (drives marker-line opacity). */
|
|
43
43
|
visible: SharedValue<boolean>;
|
|
44
|
-
/** Threshold value at
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
|
|
44
|
+
/** Threshold value at the configured badge anchor: the visible window's
|
|
45
|
+
* left edge (`"first"`) or its live/right edge (`"last"`). */
|
|
46
|
+
badgeValue: SharedValue<number>;
|
|
47
|
+
/** Pixel-Y of `badgeValue` — anchors the badge. */
|
|
48
|
+
badgeLineY: SharedValue<number>;
|
|
49
|
+
/** Whether the configured badge anchor is on-plot and belongs to a visible
|
|
50
|
+
* part of the threshold. (`visible` can still be true when that one endpoint
|
|
51
|
+
* is off-plot.) */
|
|
52
|
+
badgeVisible: SharedValue<boolean>;
|
|
53
53
|
/** Pixel-X where the threshold ends: the last point's X with `extendToNow`
|
|
54
54
|
* off, else {@link THRESHOLD_NO_CLIP}. The shader paints its plain
|
|
55
55
|
* `restColor` right of it; the marker polyline stops there. */
|
|
@@ -59,14 +59,14 @@ export interface ThresholdSeriesGeometry {
|
|
|
59
59
|
* Per-frame screen geometry for a **time-varying** threshold — a plain
|
|
60
60
|
* `LiveChartPoint[]` `value` or a live `SharedValue<LiveChartPoint[]>` `series`
|
|
61
61
|
* (which wins when both are given): the screen polyline (marker line +
|
|
62
|
-
* fill-band bottom), the shader's pixel-Y `samples[]`, the
|
|
63
|
-
* for the badge, and the `extendToNow` cutoff X. The array buffers
|
|
64
|
-
* (Reanimated only re-notifies subscribers when the returned reference
|
|
62
|
+
* fill-band bottom), the shader's pixel-Y `samples[]`, the configured endpoint
|
|
63
|
+
* value/anchor for the badge, and the `extendToNow` cutoff X. The array buffers
|
|
64
|
+
* ping-pong (Reanimated only re-notifies subscribers when the returned reference
|
|
65
65
|
* changes). When the threshold is a constant `SharedValue<number>` every
|
|
66
66
|
* worklet short-circuits cheaply and {@link useThreshold} drives the render
|
|
67
67
|
* instead.
|
|
68
68
|
*/
|
|
69
|
-
export declare function useThresholdSeries(engine: ChartEngineLayout, padding: ChartPadding, value: ThresholdValue, series?: SharedValue<LiveChartPoint[]> | null, extendToNow?: boolean): ThresholdSeriesGeometry;
|
|
69
|
+
export declare function useThresholdSeries(engine: ChartEngineLayout, padding: ChartPadding, value: ThresholdValue, series?: SharedValue<LiveChartPoint[]> | null, extendToNow?: boolean, labelAnchor?: "first" | "last"): ThresholdSeriesGeometry;
|
|
70
70
|
/**
|
|
71
71
|
* Pack a series geometry + a color set into the {@link ThresholdSplitShader}'s
|
|
72
72
|
* uniforms (one `SharedValue` per paint — stroke vs. the alpha-reduced fill band).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThreshold.d.ts","sourceRoot":"","sources":["../../src/hooks/useThreshold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAYjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,cAAc,EAAE,CAAC;AAEpE,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,aAA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AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,EAC9B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,WAAW,CAAC,QAAQ,CAAC,CAoBvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export { MONO_FONT_FAMILY } from "./lib/monoFontFamily";
|
|
|
15
15
|
export { useDegen } from "./hooks/useDegen";
|
|
16
16
|
export { useTradeStream } from "./hooks/useTradeStream";
|
|
17
17
|
export { usePriceY, useTimeX } from "./hooks/useChartOverlayContext";
|
|
18
|
-
export type { AreaDotsConfig, AxisAutoHideConfig, AxisLabelConfig, BadgeConfig, BadgeMetrics, BadgeStyleConfig, BadgeVariant, CandleMetrics, CandlePoint, CanvasMode, ChartInsets, ChartOverlayContext, ChartPlotRect, ChartScale, ChartSegment, DegenOptions, DegenShakePayload, DotGlowConfig, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LiveChartCoreProps, LiveChartHandle, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, LoadingConfig, Marker, MarkerClusterConfig, MarkerGroupBadge, MarkerKind, MarkerPressEvent, MarkerRenderContext, MarkerSide, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PerSeriesTooltipConfig, PulseConfig, ReferenceLine, ReferenceLineBadgeConfig, ReferenceLineGroupingConfig, ReferenceLineRenderProps, ReturnToLiveConfig, ScrubActionConfig, ScrubActionPoint, ScrubConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, ThresholdConfig, ThresholdLineConfig, TooltipRenderProps, TradeEvent, TransitionConfig, ValueLineConfig, VisibleRange, VolumeConfig, XAxisConfig, YAxisConfig, ZoomConfig, } from "./types";
|
|
18
|
+
export type { AreaDotsConfig, AxisAutoHideConfig, AxisLabelConfig, BadgeConfig, BadgeMetrics, BadgeStyleConfig, BadgeVariant, CandleGap, CandleGapBandStyle, CandleGapBridgeStyle, CandleGapKind, CandleGapLabelStyle, CandleGapStyle, CandleGapsConfig, CandleMetrics, CandlePoint, CanvasMode, ChartGap, ChartGapBandStyle, ChartGapBridgeStyle, ChartGapKind, ChartGapLabelStyle, ChartGapsConfig, ChartGapStyle, ChartInsets, ChartOverlayContext, ChartPlotRect, ChartScale, ChartSegment, DegenOptions, DegenShakePayload, DotGlowConfig, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LiveChartCoreProps, LiveChartHandle, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, LoadingConfig, Marker, MarkerClusterConfig, MarkerGroupBadge, MarkerKind, MarkerPressEvent, MarkerRenderContext, MarkerSide, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PerSeriesTooltipConfig, PulseConfig, ReferenceLine, ReferenceLineBadgeConfig, ReferenceLineGroupingConfig, ReferenceLineRenderProps, ReturnToLiveConfig, ScrubActionConfig, ScrubActionPoint, ScrubConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, ThresholdConfig, ThresholdBadgeRenderProps, ThresholdLineConfig, TooltipRenderProps, TradeEvent, TransitionConfig, ValueLineConfig, VisibleRange, VolumeConfig, XAxisConfig, YAxisConfig, ZoomConfig, } from "./types";
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAC3D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EA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S,EACT,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CandleGap, CandleGapKind, CandlePoint } from "../types";
|
|
2
|
+
/** Built-in, overridable copy for gap bands and scrub tooltips. */
|
|
3
|
+
export declare function candleGapDefaultLabel(kind: CandleGapKind): string;
|
|
4
|
+
/** Find the explicit half-open gap containing `time`. Input must be start-sorted. */
|
|
5
|
+
export declare function pickCandleGapAtTime(gaps: CandleGap[], time: number): CandleGap | null;
|
|
6
|
+
/** Latest real candle strictly before `time`, preferring a newer live candle. */
|
|
7
|
+
export declare function previousCandleAtTime(candles: CandlePoint[], liveCandle: CandlePoint | null, time: number): CandlePoint | null;
|
|
8
|
+
/** Previous observed close for a bridged gap; `null` when no anchor exists. */
|
|
9
|
+
export declare function previousCandleCloseAtTime(candles: CandlePoint[], liveCandle: CandlePoint | null, time: number): number | null;
|
|
10
|
+
/** Whether a real candle starts in the bucket beginning at `bucketTime`. */
|
|
11
|
+
export declare function candleAtBucketTime(candles: CandlePoint[], liveCandle: CandlePoint | null, bucketTime: number, candleWidthSecs: number): CandlePoint | null;
|
|
12
|
+
/**
|
|
13
|
+
* Bucket start under `time`, aligned to the nearest preceding real candle.
|
|
14
|
+
* Returns `null` for a partial edge bucket, a bucket with real OHLC, or a gap
|
|
15
|
+
* without a previous-close anchor.
|
|
16
|
+
*/
|
|
17
|
+
export declare function candleGapBucketStartAtTime(gap: CandleGap, time: number, candles: CandlePoint[], liveCandle: CandlePoint | null, candleWidthSecs: number): number | null;
|
|
18
|
+
//# sourceMappingURL=candleGaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candleGaps.d.ts","sourceRoot":"","sources":["../../src/math/candleGaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtE,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAKjE;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,EAAE,EACjB,IAAI,EAAE,MAAM,GACX,SAAS,GAAG,IAAI,CAYlB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EAAE,EACtB,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,IAAI,EAAE,MAAM,GACX,WAAW,GAAG,IAAI,CAkBpB;AAED,+EAA+E;AAC/E,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EAAE,EACtB,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAGf;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EAAE,EACtB,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CAkBpB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EAAE,EACtB,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI,CAmBf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartPadding } from "../draw/line";
|
|
2
|
+
import type { LiveChartPoint } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Project a historical reference-line series into screen-space `[x, y, …]`
|
|
5
|
+
* points for the visible time window. Window-edge values are interpolated so
|
|
6
|
+
* the path enters and leaves the plot cleanly. The series clamps to its first
|
|
7
|
+
* value on the left and, by default, to its last value at the live edge.
|
|
8
|
+
*
|
|
9
|
+
* Worklet-safe. When `out` is supplied it is cleared and reused.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildReferenceLineSeriesPoints(points: LiveChartPoint[], now: number, windowSecs: number, displayMin: number, displayMax: number, canvasWidth: number, canvasHeight: number, padding: ChartPadding, extendToNow: boolean, out?: number[]): number[];
|
|
12
|
+
//# sourceMappingURL=referenceLineSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceLineSeries.d.ts","sourceRoot":"","sources":["../../src/math/referenceLineSeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,cAAc,EAAE,EACxB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,OAAO,EACpB,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CA0DV"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { FontWeight, ReferenceLine, ReferenceLineBadgeConfig } from "../types";
|
|
2
|
-
/** Which of the
|
|
3
|
-
export type ReferenceLineForm = "line" | "value-band" | "time-band" | "none";
|
|
2
|
+
/** Which of the four reference-line forms a `ReferenceLine` resolves to. */
|
|
3
|
+
export type ReferenceLineForm = "line" | "series" | "value-band" | "time-band" | "none";
|
|
4
4
|
/**
|
|
5
|
-
* Classify a `ReferenceLine` into one of its
|
|
6
|
-
* documented precedence A (line) > B (value band) >
|
|
5
|
+
* Classify a `ReferenceLine` into one of its four forms, applying the
|
|
6
|
+
* documented precedence A (line) > B (series) > C (value band) > D (time band).
|
|
7
7
|
*/
|
|
8
8
|
export declare function referenceLineForm(rl: ReferenceLine): ReferenceLineForm;
|
|
9
9
|
/**
|
|
10
10
|
* Gather every Y value a set of reference lines should contribute to the
|
|
11
11
|
* axis-range computation. Lines flagged `excludeFromRange` are skipped, as are
|
|
12
|
-
* time bands (Form
|
|
12
|
+
* time bands (Form D) which constrain time, not value.
|
|
13
13
|
*/
|
|
14
14
|
export declare function collectReferenceValues(lines: ReferenceLine[]): number[];
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referenceLines.d.ts","sourceRoot":"","sources":["../../src/math/referenceLines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAElB,
|
|
1
|
+
{"version":3,"file":"referenceLines.d.ts","sourceRoot":"","sources":["../../src/math/referenceLines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAElB,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,MAAM,CAAC;AAEX;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,aAAa,GAAG,iBAAiB,CAStE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAgCvE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,MAAM,EAAE,CAgBV;AAoBD;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,wDAAwD;IACxD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;yDACyD;AACzD,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE,qGAAqG;IACrG,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;yDACyD;AACzD,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AA+BtE;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,EAAE,wBAAwB,GAC/B,2BAA2B,CAE7B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,aAAa,GAChB,sBAAsB,GAAG,IAAI,CAmB/B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,IAAI,GAAG,OAAO,GAAG,OAAO,CAK1B"}
|
package/dist/math/spline.d.ts
CHANGED
|
@@ -39,7 +39,11 @@ export type SplinePathSink = {
|
|
|
39
39
|
export declare function drawSpline(path: SplinePathSink, pts: number[], scratch?: SplineScratch,
|
|
40
40
|
/** Straight polyline (`lineTo` per point) instead of the monotone cubic — an
|
|
41
41
|
* angular, hard-edged line. The caller has already `moveTo`'d point 0. */
|
|
42
|
-
linear?: boolean
|
|
42
|
+
linear?: boolean,
|
|
43
|
+
/** First point index to draw (inclusive). The caller must moveTo this point. */
|
|
44
|
+
startPoint?: number,
|
|
45
|
+
/** Last point index to draw (exclusive). Defaults to the full array. */
|
|
46
|
+
endPoint?: number): void;
|
|
43
47
|
/**
|
|
44
48
|
* Value of the Fritsch–Carlson monotone cubic — the same curve {@link drawSpline}
|
|
45
49
|
* renders — at `time`. Use this to anchor overlays (e.g. markers) exactly on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spline.d.ts","sourceRoot":"","sources":["../../src/math/spline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD;AAED;;;;;;;;;;;;;GAaG;AACH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,OAAO,EAAE,CACP,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,KACN,OAAO,CAAC;CACd,CAAC;AAEF,wBAAgB,UAAU,CACxB,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EAAE,EACb,OAAO,CAAC,EAAE,aAAa;AACvB;2EAC2E;AAC3E,MAAM,UAAQ,
|
|
1
|
+
{"version":3,"file":"spline.d.ts","sourceRoot":"","sources":["../../src/math/spline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD;AAED;;;;;;;;;;;;;GAaG;AACH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,OAAO,EAAE,CACP,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,KACN,OAAO,CAAC;CACd,CAAC;AAEF,wBAAgB,UAAU,CACxB,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EAAE,EACb,OAAO,CAAC,EAAE,aAAa;AACvB;2EAC2E;AAC3E,MAAM,UAAQ;AACd,gFAAgF;AAChF,UAAU,SAAI;AACd,wEAAwE;AACxE,QAAQ,SAAkB,QAyE3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EAAE,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAoEf"}
|
package/dist/types.d.ts
CHANGED
|
@@ -32,11 +32,12 @@ export type CanvasMode = "transparent" | "opaque";
|
|
|
32
32
|
*/
|
|
33
33
|
export type BadgeVariant = "default" | "minimal";
|
|
34
34
|
/**
|
|
35
|
-
* A reference line or band drawn into the chart.
|
|
36
|
-
* with precedence A > B > C when fields from more than one are present:
|
|
35
|
+
* A reference line or band drawn into the chart. Four mutually-exclusive forms,
|
|
36
|
+
* with precedence A > B > C > D when fields from more than one are present:
|
|
37
37
|
* - **Form A** — horizontal line at `value`.
|
|
38
|
-
* - **Form B** —
|
|
39
|
-
* - **Form C** —
|
|
38
|
+
* - **Form B** — time-varying line following `series`.
|
|
39
|
+
* - **Form C** — horizontal band between `valueFrom` and `valueTo`.
|
|
40
|
+
* - **Form D** — vertical time band between `from` and `to` (unix seconds).
|
|
40
41
|
*/
|
|
41
42
|
export interface ReferenceLine {
|
|
42
43
|
/**
|
|
@@ -46,13 +47,25 @@ export interface ReferenceLine {
|
|
|
46
47
|
id?: string;
|
|
47
48
|
/** Form A — the Y-axis value where the horizontal line is drawn. */
|
|
48
49
|
value?: number;
|
|
49
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Form B — a time-varying reference line. Points use unix-second timestamps
|
|
52
|
+
* and should be sorted oldest to newest. The first value extends to the left
|
|
53
|
+
* edge; the last value extends to the live edge unless {@link extendToNow} is
|
|
54
|
+
* `false`. Supported by line and candle charts.
|
|
55
|
+
*/
|
|
56
|
+
series?: LiveChartPoint[];
|
|
57
|
+
/**
|
|
58
|
+
* Form B — extend the series' last value flat to the chart's live edge.
|
|
59
|
+
* Set `false` to stop at the last point. Default `true`.
|
|
60
|
+
*/
|
|
61
|
+
extendToNow?: boolean;
|
|
62
|
+
/** Form C — horizontal band lower Y bound (paired with `valueTo`). */
|
|
50
63
|
valueFrom?: number;
|
|
51
|
-
/** Form
|
|
64
|
+
/** Form C — horizontal band upper Y bound (paired with `valueFrom`). */
|
|
52
65
|
valueTo?: number;
|
|
53
|
-
/** Form
|
|
66
|
+
/** Form D — vertical time-band start, unix seconds (paired with `to`). */
|
|
54
67
|
from?: number;
|
|
55
|
-
/** Form
|
|
68
|
+
/** Form D — vertical time-band end, unix seconds (paired with `from`). */
|
|
56
69
|
to?: number;
|
|
57
70
|
/** Optional right-gutter label (e.g. `"Entry"`). */
|
|
58
71
|
label?: string;
|
|
@@ -62,7 +75,7 @@ export interface ReferenceLine {
|
|
|
62
75
|
* (top/bottom for value bands, left/right for time bands); omit for no border.
|
|
63
76
|
*/
|
|
64
77
|
strokeWidth?: number;
|
|
65
|
-
/** Dash pattern as `[dashLength, gapLength]` in pixels (line stroke + band border). */
|
|
78
|
+
/** Dash pattern as `[dashLength, gapLength]` in pixels (line/series stroke + band border). */
|
|
66
79
|
intervals?: [number, number];
|
|
67
80
|
/**
|
|
68
81
|
* Span the **full chart width** — edge to edge through the Y-axis gutter, not
|
|
@@ -70,13 +83,20 @@ export interface ReferenceLine {
|
|
|
70
83
|
* value on the axis (like a price tag). Only the line/band extends; any
|
|
71
84
|
* `label`/`badge` stays anchored inside the plot. For a Form-A line with a
|
|
72
85
|
* `badge`, the full-width line replaces the dashed connector. No effect on a
|
|
73
|
-
* vertical time band. Default `false` (stops at the plot edge). Form A /
|
|
86
|
+
* vertical time band. Default `false` (stops at the plot edge). Form A / C.
|
|
74
87
|
*/
|
|
75
88
|
fullWidth?: boolean;
|
|
76
89
|
/** Line / band color override. Defaults to palette `refLine`. */
|
|
77
90
|
color?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Band fill color override. Defaults to {@link color}, then palette `refLine`.
|
|
93
|
+
* Form C / D only.
|
|
94
|
+
*/
|
|
95
|
+
fillColor?: string;
|
|
78
96
|
/** Fill opacity for a value / time band (0–1). Default `0.16`. */
|
|
79
97
|
fillOpacity?: number;
|
|
98
|
+
/** Opacity for the line, series, or band border stroke (0–1). Default `1`. */
|
|
99
|
+
strokeOpacity?: number;
|
|
80
100
|
/** Label text color. Defaults to `color`, then palette `refLabel`. */
|
|
81
101
|
labelColor?: string;
|
|
82
102
|
/**
|
|
@@ -85,7 +105,7 @@ export interface ReferenceLine {
|
|
|
85
105
|
* (default `"left"`).
|
|
86
106
|
*/
|
|
87
107
|
labelPosition?: "left" | "center" | "right";
|
|
88
|
-
/** Append the formatted
|
|
108
|
+
/** Append the formatted value to the label (Form A/B). Default `false`. */
|
|
89
109
|
showValue?: boolean;
|
|
90
110
|
/**
|
|
91
111
|
* Exclude this line's value(s) from the Y-axis range computation, so it may sit
|
|
@@ -500,6 +520,13 @@ export interface ThresholdLineConfig {
|
|
|
500
520
|
* gutter like a legacy reference line (may overlap y-axis labels). Default `"left"`.
|
|
501
521
|
*/
|
|
502
522
|
labelPosition?: "left" | "right";
|
|
523
|
+
/**
|
|
524
|
+
* Time-varying threshold series only: which visible endpoint supplies the
|
|
525
|
+
* label badge's Y position and optional value. `"first"` samples the
|
|
526
|
+
* threshold at the visible window's left edge; `"last"` uses the live/right
|
|
527
|
+
* edge. Independent of {@link labelPosition}. Default `"last"`.
|
|
528
|
+
*/
|
|
529
|
+
labelAnchor?: "first" | "last";
|
|
503
530
|
/** Line + label color. Defaults to palette `refLine` / `refLabel`. */
|
|
504
531
|
color?: string;
|
|
505
532
|
/** Dash pattern `[dashLength, gapLength]` in pixels. Default `[4, 4]`. */
|
|
@@ -512,6 +539,24 @@ export interface ThresholdLineConfig {
|
|
|
512
539
|
* mirroring `ReferenceLine.labelColor`. */
|
|
513
540
|
labelColor?: string;
|
|
514
541
|
}
|
|
542
|
+
/**
|
|
543
|
+
* Context passed to {@link LiveChartProps.renderThresholdBadge}. The chart
|
|
544
|
+
* floats the returned React Native element over the canvas and pins it to the
|
|
545
|
+
* live threshold on the UI thread. Bind the SharedValues to animated content
|
|
546
|
+
* when its displayed value must update without React re-renders.
|
|
547
|
+
*/
|
|
548
|
+
export interface ThresholdBadgeRenderProps {
|
|
549
|
+
/** Resolved marker-line config for the badge being rendered. */
|
|
550
|
+
line: ThresholdLineConfig;
|
|
551
|
+
/** Live threshold value in Y-axis units. */
|
|
552
|
+
value: SharedValue<number>;
|
|
553
|
+
/** The threshold value formatted with the chart's `formatValue`. */
|
|
554
|
+
valueStr: SharedValue<string>;
|
|
555
|
+
/** Canvas Y pixel of the threshold (`NaN` when geometry is unavailable). */
|
|
556
|
+
y: SharedValue<number>;
|
|
557
|
+
/** Whether the threshold badge currently belongs inside the visible plot. */
|
|
558
|
+
visible: SharedValue<boolean>;
|
|
559
|
+
}
|
|
515
560
|
/** Object form of {@link ThresholdConfig.fill} — band tuning. */
|
|
516
561
|
export interface ThresholdFillConfig {
|
|
517
562
|
/** Band fill opacity (0–1), applied to the above/below colors. Multiplies an
|
|
@@ -1084,6 +1129,12 @@ export interface TooltipRenderProps {
|
|
|
1084
1129
|
* worklet-safe formatter (e.g. the chart's `formatValue`).
|
|
1085
1130
|
*/
|
|
1086
1131
|
candle: SharedValue<CandlePoint | null>;
|
|
1132
|
+
/**
|
|
1133
|
+
* Explicit line or candle gap under the crosshair (`null` outside a
|
|
1134
|
+
* configured gap). A gap never fabricates {@link candle}; inspect this field
|
|
1135
|
+
* for no-trade, unavailable, or unknown-data treatment.
|
|
1136
|
+
*/
|
|
1137
|
+
gap: SharedValue<ChartGap | null>;
|
|
1087
1138
|
}
|
|
1088
1139
|
/** Inner plot rectangle in canvas pixels (a snapshot field of {@link ChartScale}). */
|
|
1089
1140
|
export interface ChartPlotRect {
|
|
@@ -1657,6 +1708,8 @@ export interface ScrubPointCore {
|
|
|
1657
1708
|
export interface ScrubPoint extends ScrubPointCore {
|
|
1658
1709
|
/** In candle mode, the OHLC data of the candle under the crosshair. */
|
|
1659
1710
|
candle?: CandlePoint;
|
|
1711
|
+
/** Explicit chart gap under the crosshair, when a bridged gap supplies the value. */
|
|
1712
|
+
gap?: ChartGap;
|
|
1660
1713
|
}
|
|
1661
1714
|
/** Scrub callback payload for multi-series charts. */
|
|
1662
1715
|
export interface ScrubPointMulti extends ScrubPointCore {
|
|
@@ -1683,6 +1736,102 @@ export interface CandlePoint {
|
|
|
1683
1736
|
*/
|
|
1684
1737
|
volume?: number;
|
|
1685
1738
|
}
|
|
1739
|
+
/** Why a chart time range contains no observed market sample. */
|
|
1740
|
+
export type CandleGapKind = "no-trades" | "unavailable" | "unknown";
|
|
1741
|
+
/**
|
|
1742
|
+
* Explicit metadata for a chart interval without an observed sample. The range
|
|
1743
|
+
* is half-open (`[from, to)`) and uses Unix seconds, matching line points and
|
|
1744
|
+
* {@link CandlePoint.time}. Gaps do not replace or mutate real data.
|
|
1745
|
+
*/
|
|
1746
|
+
export interface CandleGap {
|
|
1747
|
+
/** Inclusive range start as a Unix timestamp in seconds. */
|
|
1748
|
+
from: number;
|
|
1749
|
+
/** Exclusive range end as a Unix timestamp in seconds. Must be greater than {@link from}. */
|
|
1750
|
+
to: number;
|
|
1751
|
+
/** Semantic reason the interval has no observation. */
|
|
1752
|
+
kind: CandleGapKind;
|
|
1753
|
+
/** Optional localized label, e.g. `"Exchange maintenance"`. */
|
|
1754
|
+
label?: string;
|
|
1755
|
+
}
|
|
1756
|
+
/** Previous-value bridge styling for a chart gap. */
|
|
1757
|
+
export interface CandleGapBridgeStyle {
|
|
1758
|
+
/** Mark color. Defaults to palette `refLine`. */
|
|
1759
|
+
color?: string;
|
|
1760
|
+
/** Mark opacity. Default `0.7` when enabled (`0.55` for unavailable gaps). */
|
|
1761
|
+
opacity?: number;
|
|
1762
|
+
/** Mark stroke width in pixels. Default `2`. */
|
|
1763
|
+
strokeWidth?: number;
|
|
1764
|
+
/** Mark cap style. Default `"round"`. */
|
|
1765
|
+
strokeCap?: "butt" | "round" | "square";
|
|
1766
|
+
}
|
|
1767
|
+
/** Full-height time-band styling for a chart gap. */
|
|
1768
|
+
export interface CandleGapBandStyle {
|
|
1769
|
+
/** Band fill color. Defaults to palette `refLine`. */
|
|
1770
|
+
fillColor?: string;
|
|
1771
|
+
/** Band fill opacity. Default `0.12` when enabled (`0.08` for unknown gaps). */
|
|
1772
|
+
fillOpacity?: number;
|
|
1773
|
+
/** Band-edge color. Defaults to palette `refLine`. */
|
|
1774
|
+
borderColor?: string;
|
|
1775
|
+
/** Band-edge opacity. Default `1`. */
|
|
1776
|
+
borderOpacity?: number;
|
|
1777
|
+
/**
|
|
1778
|
+
* Band-edge width in pixels. `0` hides the border. Default `2` (`1` for
|
|
1779
|
+
* unknown gaps).
|
|
1780
|
+
*/
|
|
1781
|
+
borderWidth?: number;
|
|
1782
|
+
/** Band-edge dash pattern. Default `[4, 4]`. */
|
|
1783
|
+
intervals?: [number, number];
|
|
1784
|
+
}
|
|
1785
|
+
/** Label styling for a chart-gap time band. Text comes from {@link CandleGap.label}. */
|
|
1786
|
+
export interface CandleGapLabelStyle {
|
|
1787
|
+
/** Label color. Defaults to palette `refLabel`. */
|
|
1788
|
+
color?: string;
|
|
1789
|
+
/** Label position inside the band. Default `"left"`. */
|
|
1790
|
+
position?: "left" | "right";
|
|
1791
|
+
}
|
|
1792
|
+
/** Per-kind presentation overrides for {@link CandleGapsConfig}. */
|
|
1793
|
+
export interface CandleGapStyle {
|
|
1794
|
+
/**
|
|
1795
|
+
* Previous-close marks. `false` disables them; an object enables and styles
|
|
1796
|
+
* them. Omission preserves the semantic default for the gap kind.
|
|
1797
|
+
*/
|
|
1798
|
+
bridge?: false | CandleGapBridgeStyle;
|
|
1799
|
+
/**
|
|
1800
|
+
* Full-height time band. `false` disables it; an object enables and styles it.
|
|
1801
|
+
* Omission preserves the semantic default for the gap kind.
|
|
1802
|
+
*/
|
|
1803
|
+
band?: false | CandleGapBandStyle;
|
|
1804
|
+
/**
|
|
1805
|
+
* Band label. `false` hides it; an object enables and styles it. Omission
|
|
1806
|
+
* preserves the semantic default for the gap kind.
|
|
1807
|
+
*/
|
|
1808
|
+
label?: false | CandleGapLabelStyle;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Data and optional per-kind styling for explicit chart gaps. Gap metadata is
|
|
1812
|
+
* low-frequency React data (like `referenceLines`); live market data remains in
|
|
1813
|
+
* its SharedValue.
|
|
1814
|
+
*/
|
|
1815
|
+
export interface CandleGapsConfig {
|
|
1816
|
+
/** Sorted, non-overlapping gap ranges. Invalid ranges are ignored. */
|
|
1817
|
+
gaps: CandleGap[];
|
|
1818
|
+
/** Presentation overrides keyed by semantic gap kind. */
|
|
1819
|
+
styles?: Partial<Record<CandleGapKind, CandleGapStyle>>;
|
|
1820
|
+
}
|
|
1821
|
+
/** Semantic reason for a chart interval with no observed market sample. */
|
|
1822
|
+
export type ChartGapKind = CandleGapKind;
|
|
1823
|
+
/** Shared gap metadata used by both line and candlestick charts. */
|
|
1824
|
+
export type ChartGap = CandleGap;
|
|
1825
|
+
/** Previous-value bridge styling shared by line and candlestick gaps. */
|
|
1826
|
+
export type ChartGapBridgeStyle = CandleGapBridgeStyle;
|
|
1827
|
+
/** Full-height time-band styling shared by line and candlestick gaps. */
|
|
1828
|
+
export type ChartGapBandStyle = CandleGapBandStyle;
|
|
1829
|
+
/** Time-band label styling shared by line and candlestick gaps. */
|
|
1830
|
+
export type ChartGapLabelStyle = CandleGapLabelStyle;
|
|
1831
|
+
/** Per-kind gap presentation shared by line and candlestick charts. */
|
|
1832
|
+
export type ChartGapStyle = CandleGapStyle;
|
|
1833
|
+
/** Gap data and per-kind styles shared by line and candlestick charts. */
|
|
1834
|
+
export type ChartGapsConfig = CandleGapsConfig;
|
|
1686
1835
|
/**
|
|
1687
1836
|
* Spatial sizing & motion tokens — the geometry/timing analogue of
|
|
1688
1837
|
* {@link LiveChartPalette}. Where `palette` controls *color*, `metrics` controls
|
|
@@ -2100,7 +2249,7 @@ export interface LiveChartCoreProps {
|
|
|
2100
2249
|
* `render`). Default off.
|
|
2101
2250
|
*/
|
|
2102
2251
|
bottomLabel?: boolean | AxisLabelConfig;
|
|
2103
|
-
/** Reference lines / bands drawn into the chart. Supports all
|
|
2252
|
+
/** Reference lines / bands drawn into the chart. Supports all four `ReferenceLine` forms. */
|
|
2104
2253
|
referenceLines?: ReferenceLine[];
|
|
2105
2254
|
/** Per-instance grid-line styling. Pass an object to override color / width / dash / opacity. */
|
|
2106
2255
|
gridStyle?: GridStyleConfig;
|
|
@@ -2315,10 +2464,19 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2315
2464
|
segments?: ChartSegment[];
|
|
2316
2465
|
/**
|
|
2317
2466
|
* Color the line above vs. below a live threshold value (break-even / average
|
|
2318
|
-
* cost, VWAP, previous close, a peg).
|
|
2319
|
-
*
|
|
2467
|
+
* cost, VWAP, previous close, a peg). Supports a live scalar or a static/live
|
|
2468
|
+
* time-varying series. See {@link ThresholdConfig}.
|
|
2320
2469
|
*/
|
|
2321
2470
|
threshold?: ThresholdConfig;
|
|
2471
|
+
/**
|
|
2472
|
+
* Render the threshold line's badge as a custom **React Native** element
|
|
2473
|
+
* instead of the built-in Skia pill. The chart measures and pins the element
|
|
2474
|
+
* to the threshold's live Y position and configured `labelPosition` on the UI
|
|
2475
|
+
* thread (see {@link ThresholdBadgeRenderProps}); the dashed marker line stays
|
|
2476
|
+
* built in. Requires `threshold.line`. Return `null`/`undefined` to keep the
|
|
2477
|
+
* built-in badge. Single-series line mode only.
|
|
2478
|
+
*/
|
|
2479
|
+
renderThresholdBadge?: (ctx: ThresholdBadgeRenderProps) => ReactElement | null | undefined;
|
|
2322
2480
|
/** Render the live value as a large text overlay in the top-left. Default `false`. */
|
|
2323
2481
|
showValue?: boolean;
|
|
2324
2482
|
/** Tint the `showValue` text by momentum (green up / red down). Default `false`. */
|
|
@@ -2331,6 +2489,22 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2331
2489
|
candleWidth?: number;
|
|
2332
2490
|
/** In-progress candle updated each tick. Must be a SharedValue for UI-thread reads. */
|
|
2333
2491
|
liveCandle?: SharedValue<CandlePoint | null>;
|
|
2492
|
+
/**
|
|
2493
|
+
* Explicit candle-chart gaps. Pass a sorted array for semantic defaults, or a
|
|
2494
|
+
* {@link CandleGapsConfig} to override per-kind styling. Missing timestamps
|
|
2495
|
+
* are never inferred: `"no-trades"` draws neutral previous-close marks,
|
|
2496
|
+
* `"unavailable"` adds a labeled time band, and `"unknown"` leaves price
|
|
2497
|
+
* unfilled. Candle mode only. Default off.
|
|
2498
|
+
*/
|
|
2499
|
+
candleGaps?: CandleGap[] | CandleGapsConfig;
|
|
2500
|
+
/**
|
|
2501
|
+
* Explicit line-chart gaps. Pass a sorted array for semantic defaults, or a
|
|
2502
|
+
* {@link ChartGapsConfig} to override per-kind styling. The normal line and
|
|
2503
|
+
* every area fill stop at the interval boundaries; bridge-enabled kinds draw
|
|
2504
|
+
* a flat previous-value segment. Real samples inside a range take precedence
|
|
2505
|
+
* over its metadata. Line mode only. Default off.
|
|
2506
|
+
*/
|
|
2507
|
+
lineGaps?: ChartGap[] | ChartGapsConfig;
|
|
2334
2508
|
/**
|
|
2335
2509
|
* Live trade fills for optional on-chart markers. Read on the UI thread only —
|
|
2336
2510
|
* pass a `SharedValue` and update from JS via `.value` (same pattern as `data` / `value`).
|