react-native-livechart 4.26.0 → 4.27.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/CustomReferenceLineOverlay.d.ts +8 -1
- package/dist/components/CustomReferenceLineOverlay.d.ts.map +1 -1
- package/dist/components/CustomTooltipOverlay.d.ts +3 -2
- package/dist/components/CustomTooltipOverlay.d.ts.map +1 -1
- package/dist/components/LiveChart.d.ts +1 -1
- package/dist/components/LiveChart.d.ts.map +1 -1
- package/dist/components/LiveChartSeries.d.ts.map +1 -1
- package/dist/components/ReferenceLineOverlay.d.ts +4 -0
- package/dist/components/ReferenceLineOverlay.d.ts.map +1 -1
- package/dist/components/ReferenceValueBadge.d.ts +15 -0
- package/dist/components/ReferenceValueBadge.d.ts.map +1 -0
- package/dist/components/XAxisOverlay.d.ts +17 -0
- package/dist/components/XAxisOverlay.d.ts.map +1 -1
- package/dist/core/liveChartEngineTick.d.ts +4 -0
- package/dist/core/liveChartEngineTick.d.ts.map +1 -1
- package/dist/core/liveChartSeriesEngineTick.d.ts +2 -0
- package/dist/core/liveChartSeriesEngineTick.d.ts.map +1 -1
- package/dist/core/resolveConfig.d.ts +28 -1
- package/dist/core/resolveConfig.d.ts.map +1 -1
- package/dist/core/useLiveChartEngine.d.ts +7 -0
- package/dist/core/useLiveChartEngine.d.ts.map +1 -1
- package/dist/core/useLiveChartSeriesEngine.d.ts +2 -0
- package/dist/core/useLiveChartSeriesEngine.d.ts.map +1 -1
- package/dist/draw/grid.d.ts +2 -2
- package/dist/draw/line.d.ts +15 -1
- package/dist/draw/line.d.ts.map +1 -1
- package/dist/hooks/crosshairShared.d.ts +16 -1
- package/dist/hooks/crosshairShared.d.ts.map +1 -1
- package/dist/hooks/referenceBadgeFont.d.ts +5 -0
- package/dist/hooks/referenceBadgeFont.d.ts.map +1 -0
- package/dist/hooks/resolveChartLayout.d.ts +8 -0
- package/dist/hooks/resolveChartLayout.d.ts.map +1 -1
- package/dist/hooks/useBadge.d.ts +16 -1
- package/dist/hooks/useBadge.d.ts.map +1 -1
- package/dist/hooks/useChartSkiaFont.d.ts +1 -0
- package/dist/hooks/useChartSkiaFont.d.ts.map +1 -1
- package/dist/hooks/useCrosshair.d.ts +7 -2
- package/dist/hooks/useCrosshair.d.ts.map +1 -1
- package/dist/hooks/useCrosshairSeries.d.ts +4 -1
- package/dist/hooks/useCrosshairSeries.d.ts.map +1 -1
- package/dist/hooks/useLatestCallback.d.ts +6 -0
- package/dist/hooks/useLatestCallback.d.ts.map +1 -0
- package/dist/hooks/useMarkers.d.ts.map +1 -1
- package/dist/hooks/usePanScroll.d.ts +3 -1
- package/dist/hooks/usePanScroll.d.ts.map +1 -1
- package/dist/hooks/usePinchZoom.d.ts.map +1 -1
- package/dist/hooks/useReferenceDrag.d.ts +20 -5
- package/dist/hooks/useReferenceDrag.d.ts.map +1 -1
- package/dist/hooks/useReferenceLine.d.ts +24 -12
- package/dist/hooks/useReferenceLine.d.ts.map +1 -1
- package/dist/hooks/useReferenceLinePress.d.ts +4 -2
- package/dist/hooks/useReferenceLinePress.d.ts.map +1 -1
- package/dist/hooks/useReferenceTagStack.d.ts +31 -0
- package/dist/hooks/useReferenceTagStack.d.ts.map +1 -0
- package/dist/hooks/useScrubMarkers.d.ts +12 -0
- package/dist/hooks/useScrubMarkers.d.ts.map +1 -0
- package/dist/hooks/useXAxis.d.ts +1 -1
- package/dist/hooks/useXAxis.d.ts.map +1 -1
- package/dist/hooks/useYAxisScaleGesture.d.ts +34 -0
- package/dist/hooks/useYAxisScaleGesture.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/math/axisBadgeLayout.d.ts +16 -0
- package/dist/math/axisBadgeLayout.d.ts.map +1 -0
- package/dist/math/markers.d.ts +3 -0
- package/dist/math/markers.d.ts.map +1 -1
- package/dist/math/range.d.ts +1 -1
- package/dist/math/range.d.ts.map +1 -1
- package/dist/math/referenceTagStack.d.ts +36 -0
- package/dist/math/referenceTagStack.d.ts.map +1 -0
- package/dist/math/scrubMarkers.d.ts +12 -0
- package/dist/math/scrubMarkers.d.ts.map +1 -0
- package/dist/types.d.ts +202 -32
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/CustomReferenceLineOverlay.tsx +50 -8
- package/src/components/CustomTooltipOverlay.tsx +5 -1
- package/src/components/LiveChart.tsx +560 -138
- package/src/components/LiveChartSeries.tsx +113 -13
- package/src/components/ReferenceLineOverlay.tsx +62 -26
- package/src/components/ReferenceValueBadge.tsx +102 -0
- package/src/components/XAxisOverlay.tsx +104 -1
- package/src/core/liveChartEngineTick.ts +49 -4
- package/src/core/liveChartSeriesEngineTick.ts +37 -0
- package/src/core/resolveConfig.ts +95 -2
- package/src/core/useLiveChartEngine.ts +43 -9
- package/src/core/useLiveChartSeriesEngine.ts +5 -0
- package/src/draw/grid.ts +2 -2
- package/src/draw/line.ts +23 -1
- package/src/hooks/crosshairShared.ts +56 -1
- package/src/hooks/referenceBadgeFont.ts +35 -0
- package/src/hooks/resolveChartLayout.ts +17 -0
- package/src/hooks/useBadge.ts +44 -5
- package/src/hooks/useChartSkiaFont.ts +1 -1
- package/src/hooks/useCrosshair.ts +444 -310
- package/src/hooks/useCrosshairSeries.ts +29 -10
- package/src/hooks/useLatestCallback.ts +15 -0
- package/src/hooks/useMarkers.ts +51 -39
- package/src/hooks/usePanScroll.ts +155 -127
- package/src/hooks/usePinchZoom.ts +84 -63
- package/src/hooks/useReferenceDrag.ts +390 -155
- package/src/hooks/useReferenceLine.ts +453 -277
- package/src/hooks/useReferenceLineGrouping.ts +1 -1
- package/src/hooks/useReferenceLinePress.ts +121 -53
- package/src/hooks/useReferenceTagStack.ts +81 -0
- package/src/hooks/useScrubMarkers.ts +79 -0
- package/src/hooks/useXAxis.ts +11 -2
- package/src/hooks/useYAxisScaleGesture.ts +263 -0
- package/src/index.ts +10 -0
- package/src/math/axisBadgeLayout.ts +37 -0
- package/src/math/markers.ts +28 -3
- package/src/math/range.ts +35 -0
- package/src/math/referenceTagStack.ts +112 -0
- package/src/math/scrubMarkers.ts +55 -0
- package/src/types.ts +207 -32
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BadgeMetrics } from "../types";
|
|
2
|
+
/** Horizontal price-column geometry, independent of the value's vertical position. */
|
|
3
|
+
export interface AxisBadgeConfig {
|
|
4
|
+
float?: boolean;
|
|
5
|
+
alignTextWithYAxis?: boolean;
|
|
6
|
+
showTail?: boolean;
|
|
7
|
+
fontSize?: number;
|
|
8
|
+
metrics?: BadgeMetrics;
|
|
9
|
+
offsetX?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function axisBadgeBounds(width: number, paddingRight: number, textWidth: number, fontSize: number, config?: AxisBadgeConfig): {
|
|
12
|
+
left: number;
|
|
13
|
+
right: number;
|
|
14
|
+
textX: number;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=axisBadgeLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axisBadgeLayout.d.ts","sourceRoot":"","sources":["../../src/math/axisBadgeLayout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,eAAe;;;;EAiBzB"}
|
package/dist/math/markers.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { LiveChartPoint, Marker, SeriesConfig } from "../types";
|
|
|
3
3
|
export interface ProjectedMarker {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
|
+
/** The anchor is on the plot: across within `EDGE_SLOP` of it, up and down
|
|
7
|
+
* within `CULL_MARGIN`. Only visible markers are drawn, clustered, or
|
|
8
|
+
* hit-tested. */
|
|
6
9
|
visible: boolean;
|
|
7
10
|
/** Collapsed cluster member that the representative stands in for — not drawn,
|
|
8
11
|
* not hit-tested. Set by the cluster pass; `false` outside `markerCluster`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/math/markers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIrE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB;oFACgF;IAChF,MAAM,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B;;;+EAG2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/math/markers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIrE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV;;sBAEkB;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB;oFACgF;IAChF,MAAM,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B;;;+EAG2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAyGD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,EAAE,eAAe,EAAE,EACtB,IAAI,EAAE,kBAAkB,GACvB,eAAe,EAAE,CAqBnB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE,kBAAkB,GACvB,eAAe,CAajB;AAED;qCACqC;AACrC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAS1D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,eAAe,EAAE,EAC5B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,GACb,MAAM,CAgBR"}
|
package/dist/math/range.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { LiveChartPoint } from "../types";
|
|
|
3
3
|
* Compute visible Y range from data points + current value.
|
|
4
4
|
* Returns { min, max } with margin applied.
|
|
5
5
|
*/
|
|
6
|
-
export declare function computeRange(visible: LiveChartPoint[], currentValue: number, referenceValue?: number, exaggerate?: boolean, nonNegative?: boolean, maxValue?: number): {
|
|
6
|
+
export declare function computeRange(visible: LiveChartPoint[], currentValue: number, referenceValue?: number, exaggerate?: boolean, nonNegative?: boolean, maxValue?: number, floorRange?: number): {
|
|
7
7
|
min: number;
|
|
8
8
|
max: number;
|
|
9
9
|
};
|
package/dist/math/range.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/math/range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,cAAc,EAAE,EACzB,YAAY,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,UAAU,CAAC,EAAE,OAAO,EACpB,WAAW,CAAC,EAAE,OAAO,EACrB,QAAQ,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/math/range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,cAAc,EAAE,EACzB,YAAY,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,UAAU,CAAC,EAAE,OAAO,EACpB,WAAW,CAAC,EAAE,OAAO,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CA0E9B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Screen rectangles shared by reference-tag drawing and interaction. */
|
|
2
|
+
export interface TagRect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ReferenceTag extends TagRect {
|
|
9
|
+
index: number;
|
|
10
|
+
lineId?: string;
|
|
11
|
+
key: string;
|
|
12
|
+
kind: "name" | "value" | "custom";
|
|
13
|
+
/** Original projected price Y; displacement never changes the price. */
|
|
14
|
+
lineY: number;
|
|
15
|
+
}
|
|
16
|
+
export interface StackedReferenceTag extends ReferenceTag {
|
|
17
|
+
offsetY: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ReferenceTagStack {
|
|
20
|
+
offsets: number[];
|
|
21
|
+
valueOffsets: number[];
|
|
22
|
+
tags: StackedReferenceTag[];
|
|
23
|
+
}
|
|
24
|
+
export declare const EMPTY_TAG_STACK: ReferenceTagStack;
|
|
25
|
+
export declare function overlapsX(a: TagRect, b: TagRect): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Pack only horizontally intersecting columns. Opposite edges stay independent.
|
|
28
|
+
* A fixed value-badge obstacle divides a column into above/below slots; choose
|
|
29
|
+
* the feasible split with the smallest total squared displacement. If there is
|
|
30
|
+
* physically insufficient height, retain every tag in bounds with best-effort
|
|
31
|
+
* spacing rather than hiding levels or moving their prices.
|
|
32
|
+
*/
|
|
33
|
+
export declare function stackReferenceTags(input: ReferenceTag[], top: number, bottom: number, radius?: number, obstacle?: TagRect | null): ReferenceTagStack;
|
|
34
|
+
/** Exact rectangles beat inflated targets when adjacent tags have a small gap. */
|
|
35
|
+
export declare function stackedTagAt(tags: StackedReferenceTag[], x: number, y: number): StackedReferenceTag | null;
|
|
36
|
+
//# sourceMappingURL=referenceTagStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceTagStack.d.ts","sourceRoot":"","sources":["../../src/math/referenceTagStack.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,WAAW,OAAO;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AACvE,MAAM,WAAW,YAAa,SAAQ,OAAO;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IAAG,OAAO,EAAE,MAAM,CAAA;CAAE;AAC7E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,mBAAmB,EAAE,CAAC;CAC7B;AACD,eAAO,MAAM,eAAe,EAAE,iBAA+D,CAAC;AAE9F,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAGzD;AAkBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAK,EAAE,QAAQ,GAAE,OAAO,GAAG,IAAW,GAC/F,iBAAiB,CAoDnB;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAQ1G"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Marker } from "../types";
|
|
2
|
+
export interface ScrubMarkerRange {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
/** Candle buckets are [start, end); line proximity includes both edges. */
|
|
6
|
+
exclusiveEnd: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Timestamp matching deliberately ignores glyph offsets, Y, and clustering. */
|
|
9
|
+
export declare function matchScrubMarkers(markers: Marker[], range: ScrubMarkerRange | null): Marker[];
|
|
10
|
+
/** Convert a horizontal touch tolerance to time using the drawn viewport. */
|
|
11
|
+
export declare function scrubMarkerRange(time: number, now: number, window: number, plotWidth: number, radius: number, candleMode: boolean, candleTime: number | null, candleWidth: number): ScrubMarkerRange | null;
|
|
12
|
+
//# sourceMappingURL=scrubMarkers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrubMarkers.d.ts","sourceRoot":"","sources":["../../src/math/scrubMarkers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7B,MAAM,EAAE,CAOV;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,WAAW,EAAE,MAAM,GAClB,gBAAgB,GAAG,IAAI,CAsBzB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export interface ReferenceLine {
|
|
|
52
52
|
/**
|
|
53
53
|
* Stable identifier for this line. Supply a unique value when `referenceLines`
|
|
54
54
|
* may be reordered so the chart preserves the line's rendered identity.
|
|
55
|
+
* If this line is removed or moves to another index during a drag, that touch
|
|
56
|
+
* is cancelled without committing, even if the line later returns.
|
|
55
57
|
*/
|
|
56
58
|
id?: string;
|
|
57
59
|
/** Form A — the Y-axis value where the horizontal line is drawn. */
|
|
@@ -140,6 +142,15 @@ export interface ReferenceLine {
|
|
|
140
142
|
* `position`. Supersedes the legacy `offAxisBadge`. Default off.
|
|
141
143
|
*/
|
|
142
144
|
badge?: boolean | ReferenceLineBadgeConfig;
|
|
145
|
+
/**
|
|
146
|
+
* A separate Form-A price pill displaying `formatValue(value)` on the UI
|
|
147
|
+
* thread, including during a drag. `true` pins it inside the plot's right
|
|
148
|
+
* edge; `{ position: "axis" }` aligns it with the right price gutter (or the
|
|
149
|
+
* floating axis). Works without a name badge. Both tags pin off-screen and
|
|
150
|
+
* collapse together when grouped. Custom tag renderers replace both pills.
|
|
151
|
+
* Has no effect on series or bands. Default `false`.
|
|
152
|
+
*/
|
|
153
|
+
valueBadge?: boolean | ReferenceLineValueBadgeConfig;
|
|
143
154
|
/**
|
|
144
155
|
* Legacy: when a Form-A `value` falls outside the visible plot, render a pinned
|
|
145
156
|
* edge badge with a directional chevron instead of culling the off-screen line.
|
|
@@ -178,7 +189,10 @@ export interface ReferenceLine {
|
|
|
178
189
|
grabRange?: [number, number];
|
|
179
190
|
/**
|
|
180
191
|
* Snap the dragged value to this increment (e.g. `0.01` for cents, `0.5` for a
|
|
181
|
-
* tick size) so drops land on round levels.
|
|
192
|
+
* tick size) so drops land on round levels. At the plot's edge the line is drawn
|
|
193
|
+
* and dropped on the nearest increment inside the visible range; dragged past
|
|
194
|
+
* the edge, the value the finger sets (and {@link onChange} reports) rounds
|
|
195
|
+
* outward, so the range can widen to it. Omit for free dragging. Applies only
|
|
182
196
|
* while {@link draggable}.
|
|
183
197
|
*/
|
|
184
198
|
snap?: number;
|
|
@@ -190,15 +204,18 @@ export interface ReferenceLine {
|
|
|
190
204
|
*/
|
|
191
205
|
bounds?: [number, number];
|
|
192
206
|
/**
|
|
193
|
-
* Fired on the JS thread *while* dragging, each time the
|
|
194
|
-
* value
|
|
195
|
-
*
|
|
207
|
+
* Fired on the JS thread *while* dragging, each time the finger moves the line
|
|
208
|
+
* to a new (snapped, clamped) value. De-duplicated to value changes — not every
|
|
209
|
+
* frame. When the range moves under a still finger the line follows it without
|
|
210
|
+
* firing this; on release it fires once more if the line ended elsewhere, with
|
|
211
|
+
* the value {@link onCommit} gets (its first call, if the finger never changed
|
|
212
|
+
* the value). Form-A draggable only.
|
|
196
213
|
*/
|
|
197
214
|
onChange?: (value: number) => void;
|
|
198
215
|
/**
|
|
199
216
|
* Fired once on the JS thread when the drag ends (finger up), with the final
|
|
200
|
-
* (snapped, clamped) value. Pair with a controlled
|
|
201
|
-
* Form-A draggable only.
|
|
217
|
+
* (snapped, clamped) value — the one under the finger. Pair with a controlled
|
|
218
|
+
* `value` to persist the move. Form-A draggable only.
|
|
202
219
|
*/
|
|
203
220
|
onCommit?: (value: number) => void;
|
|
204
221
|
/**
|
|
@@ -275,6 +292,14 @@ export interface ReferenceLineBadgeConfig extends BadgeStyleConfig {
|
|
|
275
292
|
*/
|
|
276
293
|
text?: boolean;
|
|
277
294
|
}
|
|
295
|
+
/** Separate price pill for a horizontal reference line. Style defaults match
|
|
296
|
+
* the reference badge; the font falls back to the chart font. */
|
|
297
|
+
export interface ReferenceLineValueBadgeConfig extends BadgeStyleConfig {
|
|
298
|
+
/** `"right"`: inside the plot; `"axis"`: right price column, even when the live
|
|
299
|
+
* badge is hidden or placed left. A floating axis uses the canvas right edge.
|
|
300
|
+
* Default `"right"`. Placement is independent of the name badge. */
|
|
301
|
+
position?: "right" | "axis";
|
|
302
|
+
}
|
|
278
303
|
/**
|
|
279
304
|
* Context passed to a custom {@link LiveChartProps.renderReferenceLine} or
|
|
280
305
|
* {@link LiveChartProps.renderOffAxisReferenceLine} (and their
|
|
@@ -299,6 +324,11 @@ export interface ReferenceLineRenderProps {
|
|
|
299
324
|
valueStr: SharedValue<string>;
|
|
300
325
|
/** Canvas Y pixel of the line, recomputed each frame (`-1` when not laid out). */
|
|
301
326
|
y: SharedValue<number>;
|
|
327
|
+
/** Extra vertical displacement from reference-tag stacking, in canvas pixels.
|
|
328
|
+
* The chart applies it to the custom element automatically; `y` keeps its
|
|
329
|
+
* original projection. Use this to draw a connector, not a second transform.
|
|
330
|
+
* Zero when stacking is off (including LiveChartSeries). */
|
|
331
|
+
tagOffsetY: SharedValue<number>;
|
|
302
332
|
/** Whether the value currently sits within the visible plot range. */
|
|
303
333
|
inRange: SharedValue<boolean>;
|
|
304
334
|
/**
|
|
@@ -311,18 +341,23 @@ export interface ReferenceLineRenderProps {
|
|
|
311
341
|
dragging: SharedValue<boolean>;
|
|
312
342
|
}
|
|
313
343
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
* or an object to tune the proximity radius. Badged off-axis lines group at either
|
|
319
|
-
* plot edge; off-axis lines with no badge are hidden and do not count. Custom tags
|
|
320
|
-
* are excluded.
|
|
344
|
+
* Tag collision behavior for single-series reference lines. `true` uses collapse
|
|
345
|
+
* mode, replacing nearby built-in tags with a count pill. Stack mode keeps each
|
|
346
|
+
* built-in or measured custom tag, separating overlapping horizontal columns
|
|
347
|
+
* while price strokes stay at their values. Hidden off-axis lines do not count.
|
|
321
348
|
*/
|
|
322
349
|
export interface ReferenceLineGroupingConfig {
|
|
323
|
-
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
350
|
+
/** `"collapse"` merges nearby tags into a count (default). `"stack"` keeps
|
|
351
|
+
* each price line and separates overlapping tags by their measured bounds.
|
|
352
|
+
* Custom tags participate in stack mode; separate horizontal columns pack
|
|
353
|
+
* independently. Single-series only. */
|
|
354
|
+
mode?: "collapse" | "stack";
|
|
355
|
+
/** Stack mode: keep tags clear of the visible live value badge. Default `true`.
|
|
356
|
+
* Best effort when there is insufficient plot height; ignored in collapse mode. */
|
|
357
|
+
avoidValueBadge?: boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Collapse mode: proximity radius. Stack mode: minimum center-to-center gap;
|
|
360
|
+
* measured tag heights plus 2 px take precedence. Default `18`.
|
|
326
361
|
*/
|
|
327
362
|
radius?: number;
|
|
328
363
|
/**
|
|
@@ -389,7 +424,7 @@ export interface ChartSegment {
|
|
|
389
424
|
/** Label horizontal anchor within the segment. Default `"left"`. */
|
|
390
425
|
labelPosition?: "left" | "right";
|
|
391
426
|
}
|
|
392
|
-
/**
|
|
427
|
+
/** Grid-line styling for the horizontal value axis and optional xAxis.gridLines. */
|
|
393
428
|
export interface GridStyleConfig {
|
|
394
429
|
/** Stroke color. Defaults to palette `gridLine`. */
|
|
395
430
|
color?: string;
|
|
@@ -664,6 +699,19 @@ export interface BadgeConfig extends BadgeStyleConfig {
|
|
|
664
699
|
tail?: boolean;
|
|
665
700
|
/** Which side of the chart the badge appears on. Default `"right"`. */
|
|
666
701
|
position?: "right" | "left";
|
|
702
|
+
/**
|
|
703
|
+
* Where the value sits in the right-gutter pill. `"center"` centers it in the
|
|
704
|
+
* pill body. `"yAxisColumn"` lines it up with a right-anchored Y-axis label
|
|
705
|
+
* column ({@link YAxisConfig.labelRightMargin}): it starts at the labels'
|
|
706
|
+
* shared left X, and a value wider than every axis label ends at the
|
|
707
|
+
* column's right edge. The pill keeps its shape and the value stays within
|
|
708
|
+
* its `padX` padding (a value that doesn't fit there is centered), so the
|
|
709
|
+
* room on each side follows the right inset and `metrics.badge`. The value
|
|
710
|
+
* moves sideways when the column's width changes (a wider label entering or
|
|
711
|
+
* leaving the axis). Centered without that column on the right side, while
|
|
712
|
+
* the axis floats, and for a `"left"` badge. Default `"center"`.
|
|
713
|
+
*/
|
|
714
|
+
textAlign?: "center" | "yAxisColumn";
|
|
667
715
|
/**
|
|
668
716
|
* When the chart is scrolled back (see `timeScroll`), move the live-price
|
|
669
717
|
* indicators — the badge, the value line, and the live dot — to the price at
|
|
@@ -698,8 +746,27 @@ export interface VolumeConfig {
|
|
|
698
746
|
/** Opacity (0..1) applied to the whole band. Default `0.6`. */
|
|
699
747
|
opacity?: number;
|
|
700
748
|
}
|
|
749
|
+
/** Built-in vertical drag on the price axis. Bounds affect gesture writes only. */
|
|
750
|
+
export interface YAxisScaleGestureConfig {
|
|
751
|
+
/** Smallest multiplier. Positive and finite. Default `0.25`. */
|
|
752
|
+
minScale?: number;
|
|
753
|
+
/** Largest multiplier. Positive and finite, raised to minScale if lower. Default `10`. */
|
|
754
|
+
maxScale?: number;
|
|
755
|
+
/** Vertical points per exponential step (e×). Positive and finite. Default `160`. */
|
|
756
|
+
dragDistance?: number;
|
|
757
|
+
/** Double-tap the axis to animate to `1` (clamped to the bounds). Default `true`. */
|
|
758
|
+
doubleTapReset?: boolean;
|
|
759
|
+
}
|
|
701
760
|
/** Y-axis grid configuration. */
|
|
702
761
|
export interface YAxisConfig {
|
|
762
|
+
/**
|
|
763
|
+
* Opt into vertical price-axis dragging: down widens the range, up zooms in.
|
|
764
|
+
* Uses the rendered axis gutter/label column on either side. Interactive
|
|
765
|
+
* markers and reference badges retain priority. Plot gestures are unchanged.
|
|
766
|
+
* Writes `yRangeScale` when supplied, otherwise an internal multiplier.
|
|
767
|
+
* `true` uses defaults; an object customizes bounds/reset. Default `false`.
|
|
768
|
+
*/
|
|
769
|
+
scaleGesture?: boolean | YAxisScaleGestureConfig;
|
|
703
770
|
/** Price-label side. For left placement, reserve the label gutter with insets.left.
|
|
704
771
|
* Right-side float/labelRightMargin options do not affect left labels. Default "right". */
|
|
705
772
|
side?: "left" | "right";
|
|
@@ -729,7 +796,8 @@ export interface YAxisConfig {
|
|
|
729
796
|
/**
|
|
730
797
|
* Place price labels in a shared left-aligned column whose right edge sits
|
|
731
798
|
* this many pixels from the canvas edge. When omitted, labels keep the
|
|
732
|
-
* default centered-gutter placement.
|
|
799
|
+
* default centered-gutter placement. To line the live badge's value up with
|
|
800
|
+
* the column, set {@link BadgeConfig.textAlign} to `"yAxisColumn"`.
|
|
733
801
|
*/
|
|
734
802
|
labelRightMargin?: number;
|
|
735
803
|
/**
|
|
@@ -810,8 +878,17 @@ export interface AxisLabelConfig {
|
|
|
810
878
|
}
|
|
811
879
|
/** X-axis (time) configuration. */
|
|
812
880
|
export interface XAxisConfig {
|
|
813
|
-
/** Minimum pixel gap between time labels. Default `60`. */
|
|
881
|
+
/** Minimum pixel gap between time labels. Changes apply immediately, even while paused. Default `60`. */
|
|
814
882
|
minGap?: number;
|
|
883
|
+
/**
|
|
884
|
+
* Vertical grid lines at the time-axis ticks, drawn behind the series in the
|
|
885
|
+
* same layer as the horizontal grid. Each line sits under a time label and
|
|
886
|
+
* fades with it. `true` = the {@link LiveChartCoreProps.gridStyle} look, or
|
|
887
|
+
* pass a `GridStyleConfig` to override fields of it (omitted fields fall back
|
|
888
|
+
* to `gridStyle`). Strokes stay inside the plot's horizontal bounds, including
|
|
889
|
+
* while a departing label fades into a gutter. Default `false`.
|
|
890
|
+
*/
|
|
891
|
+
gridLines?: boolean | GridStyleConfig;
|
|
815
892
|
}
|
|
816
893
|
/**
|
|
817
894
|
* Auto-hide both axes while idle (see {@link LiveChartCoreProps.axisAutoHide}).
|
|
@@ -909,8 +986,25 @@ export interface PerSeriesTooltipConfig {
|
|
|
909
986
|
/** Diameter of the dot drawn at each line/guide intersection. Default `8`. */
|
|
910
987
|
intersectionDotSize?: number;
|
|
911
988
|
}
|
|
989
|
+
/** Timestamp matching for marker details while scrubbing. */
|
|
990
|
+
export interface ScrubMarkerConfig {
|
|
991
|
+
/**
|
|
992
|
+
* Horizontal distance in canvas px on either side of the crosshair in line
|
|
993
|
+
* mode. Default `16`; negative values clamp to `0`. Candle mode instead
|
|
994
|
+
* selects the hovered bucket's [time, time + candleWidth) interval.
|
|
995
|
+
*/
|
|
996
|
+
radius?: number;
|
|
997
|
+
}
|
|
912
998
|
/** Crosshair scrub configuration. */
|
|
913
999
|
export interface ScrubConfig {
|
|
1000
|
+
/**
|
|
1001
|
+
* Include matching markers in `onScrub` and `LiveChart.renderTooltip`.
|
|
1002
|
+
* `true` uses a 16 px horizontal tolerance in line mode; an object tunes it.
|
|
1003
|
+
* Candle mode returns all markers in the hovered candle's time bucket.
|
|
1004
|
+
* Matches preserve input order and include stacked/collapsed members,
|
|
1005
|
+
* independent of glyph Y/offsets. Gaps select none. Default `false`.
|
|
1006
|
+
*/
|
|
1007
|
+
markers?: boolean | ScrubMarkerConfig;
|
|
914
1008
|
/** Show the value/time tooltip pill while scrubbing. Default `true`. */
|
|
915
1009
|
tooltip?: boolean;
|
|
916
1010
|
/**
|
|
@@ -1164,6 +1258,12 @@ export interface SelectionDotProps {
|
|
|
1164
1258
|
* for the value/date to update on the UI thread too.
|
|
1165
1259
|
*/
|
|
1166
1260
|
export interface TooltipRenderProps {
|
|
1261
|
+
/**
|
|
1262
|
+
* Markers matched by `scrub.markers`, including their `data`. Empty when
|
|
1263
|
+
* disabled, inactive, in a gap, or without a match. Updated on the UI thread;
|
|
1264
|
+
* bind in an animated component rather than reading during React render.
|
|
1265
|
+
*/
|
|
1266
|
+
markers: SharedValue<Marker[]>;
|
|
1167
1267
|
/**
|
|
1168
1268
|
* Value under the crosshair; `null` when none. In line mode this is the
|
|
1169
1269
|
* interpolated value at the scrub time; in candle mode it's the scrubbed
|
|
@@ -1434,7 +1534,7 @@ export interface Marker {
|
|
|
1434
1534
|
* when `markerCluster: "stacked"` — e.g. buys `"below"`, sells `"above"`.
|
|
1435
1535
|
*/
|
|
1436
1536
|
side?: MarkerSide;
|
|
1437
|
-
/** Pass-through payload surfaced on `onMarkerPress
|
|
1537
|
+
/** Pass-through payload surfaced on `onMarkerPress` and opt-in scrub matches. */
|
|
1438
1538
|
data?: unknown;
|
|
1439
1539
|
}
|
|
1440
1540
|
/** Where a marker glyph sits relative to its anchor (and the stack direction). */
|
|
@@ -1754,6 +1854,11 @@ export interface ScrubSeriesValue {
|
|
|
1754
1854
|
}
|
|
1755
1855
|
/** Base fields shared by single and multi-series scrub callback payloads. */
|
|
1756
1856
|
export interface ScrubPointCore {
|
|
1857
|
+
/**
|
|
1858
|
+
* Matching markers (including `data`) when `scrub.markers` is enabled; `[]`
|
|
1859
|
+
* when none match. Omitted when disabled. See {@link ScrubConfig.markers}.
|
|
1860
|
+
*/
|
|
1861
|
+
markers?: Marker[];
|
|
1757
1862
|
/** Unix timestamp in seconds at the scrub position. */
|
|
1758
1863
|
time: number;
|
|
1759
1864
|
/** Interpolated value at the scrub position. */
|
|
@@ -2061,6 +2166,7 @@ export interface LiveChartHandle {
|
|
|
2061
2166
|
/**
|
|
2062
2167
|
* Reset built-in pinch/time-window zoom to the configured `timeWindow` and
|
|
2063
2168
|
* clear the focal-point offset so the chart follows the live edge again.
|
|
2169
|
+
* On LiveChart with viewport, clears the supplied end/window shared values.
|
|
2064
2170
|
* Safe to call when already reset. A paused chart remains paused.
|
|
2065
2171
|
*
|
|
2066
2172
|
* ```tsx
|
|
@@ -2287,13 +2393,29 @@ export interface LiveChartCoreProps {
|
|
|
2287
2393
|
* axes (prices, market caps).
|
|
2288
2394
|
*/
|
|
2289
2395
|
maxValue?: number;
|
|
2396
|
+
/**
|
|
2397
|
+
* Smallest auto-fitted Y span, in data units. A narrower bounded fit widens
|
|
2398
|
+
* around its midpoint, giving near-flat data room for distinct grid labels
|
|
2399
|
+
* (e.g. pass a few multiples of the display precision). `nonNegative` and
|
|
2400
|
+
* `maxValue` shift the span; if both leave less room than the floor, the hard
|
|
2401
|
+
* bounds win. Manual `yRangeScale` zoom applies afterward and may go below
|
|
2402
|
+
* the floor. Usual range easing applies; static charts re-settle on changes.
|
|
2403
|
+
* Positive finite values only; invalid or overflowing floors are ignored.
|
|
2404
|
+
* Omit for no floor.
|
|
2405
|
+
*/
|
|
2406
|
+
minRange?: number;
|
|
2290
2407
|
/**
|
|
2291
2408
|
* Live manual Y-range multiplier around the fitted midpoint (`1` = auto-fit).
|
|
2292
|
-
*
|
|
2409
|
+
* Enable `yAxis.scaleGesture` or drive it from your own gesture to stretch or
|
|
2293
2410
|
* compress the price scale TradingView-style; the auto-fit keeps tracking
|
|
2294
2411
|
* the visible window underneath. Values must be positive and finite; invalid
|
|
2295
2412
|
* values fall back to `1`. Read on the UI thread each frame. Supported by
|
|
2296
|
-
* both `LiveChart` and `LiveChartSeries`.
|
|
2413
|
+
* both `LiveChart` and `LiveChartSeries`. Static single-series charts also
|
|
2414
|
+
* re-settle when this SharedValue changes, without replacing data. Default `1`.
|
|
2415
|
+
* Series drawing is clipped vertically to the price plot; candle volume bars
|
|
2416
|
+
* remain outside that clip. Automatic volume-band reservation respects an
|
|
2417
|
+
* explicit bottom inset. The built-in axis gesture uses an internal multiplier
|
|
2418
|
+
* when this prop is omitted.
|
|
2297
2419
|
*
|
|
2298
2420
|
* @experimental
|
|
2299
2421
|
*/
|
|
@@ -2428,6 +2550,7 @@ export interface LiveChartCoreProps {
|
|
|
2428
2550
|
* no longer passed — **glides** the window back to the live edge (a brief eased
|
|
2429
2551
|
* animation, not an instant jump); it never stays frozen at the previous scroll
|
|
2430
2552
|
* position. Tune or disable that glide with {@link returnToLive}.
|
|
2553
|
+
* On LiveChart with viewport, disabling gestures preserves the supplied state.
|
|
2431
2554
|
*
|
|
2432
2555
|
* `true` uses the default drag-to-scroll gesture (`"holdToScrub"`); pass a
|
|
2433
2556
|
* {@link TimeScrollConfig} to pick the activation (`"holdToScrub"` or
|
|
@@ -2510,8 +2633,40 @@ export interface LiveChartCoreProps {
|
|
|
2510
2633
|
/** Main chart line styling. */
|
|
2511
2634
|
line?: LineConfig;
|
|
2512
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* UI-thread scroll/zoom state adopted by a single-series {@link LiveChart}.
|
|
2638
|
+
* The app owns leadership and timestamp mapping; gestures write these same values.
|
|
2639
|
+
* @experimental
|
|
2640
|
+
*/
|
|
2641
|
+
export interface ChartViewportControl {
|
|
2642
|
+
/** Right-edge unix timestamp in seconds; null follows this chart's live edge.
|
|
2643
|
+
* Honors times past live. An end before the first retained point falls back to live. */
|
|
2644
|
+
end: SharedValue<number | null>;
|
|
2645
|
+
/** Positive, finite visible width in seconds; null uses the timeWindow prop. */
|
|
2646
|
+
window: SharedValue<number | null>;
|
|
2647
|
+
}
|
|
2648
|
+
/** External viewport state and optional behavior settings for {@link LiveChart}.
|
|
2649
|
+
* Pass an object to adopt its shared values; false/omitted uses private state.
|
|
2650
|
+
* @experimental
|
|
2651
|
+
*/
|
|
2652
|
+
export interface ViewportConfig extends ChartViewportControl {
|
|
2653
|
+
/** Ease non-null window overrides using the chart's smoothing. Default true.
|
|
2654
|
+
* Set false on followers copying a leader's drawn width to avoid easing twice.
|
|
2655
|
+
* Null windows still ease back to timeWindow; Y-range/value smoothing is unchanged. */
|
|
2656
|
+
windowSmoothing?: boolean;
|
|
2657
|
+
}
|
|
2513
2658
|
/** Props for the single-series `LiveChart` component. */
|
|
2514
2659
|
export interface LiveChartProps extends LiveChartCoreProps {
|
|
2660
|
+
/**
|
|
2661
|
+
* Adopt external UI-thread scroll/zoom state. Pan and pinch write the supplied
|
|
2662
|
+
* values; resetZoom() clears both. Non-null overrides survive timeWindow changes
|
|
2663
|
+
* and timeScroll being disabled. External writes work without enabling gestures
|
|
2664
|
+
* and wake autoSleep charts. Single-series line/candle only.
|
|
2665
|
+
* Pass a ViewportConfig object to enable; false/omitted uses private state.
|
|
2666
|
+
* Both shared values are required, so this prop has no true shorthand.
|
|
2667
|
+
* @experimental
|
|
2668
|
+
*/
|
|
2669
|
+
viewport?: false | ViewportConfig;
|
|
2515
2670
|
/** Area gradient fill under the line. `true` = defaults, or pass `GradientConfig`. Default `true`. */
|
|
2516
2671
|
gradient?: boolean | GradientConfig;
|
|
2517
2672
|
/**
|
|
@@ -2606,7 +2761,10 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2606
2761
|
* but `scrub` / `scrubAction` stay available — they're on-demand touch gestures with
|
|
2607
2762
|
* no per-frame cost, so a still chart is still scrubbable. May be toggled at runtime:
|
|
2608
2763
|
* switching back to live restarts the suspended loops and catches up. Frame the data
|
|
2609
|
-
* with `timeWindow` + `nowOverride` (see the historical-data-fill pattern).
|
|
2764
|
+
* with `timeWindow` + `nowOverride` (see the historical-data-fill pattern). Data,
|
|
2765
|
+
* layout, `timeWindow`, and `nowOverride` changes re-settle without restarting the
|
|
2766
|
+
* loop. Entering static mode lands on the new window even when data and framing
|
|
2767
|
+
* change in the same render (for example, a recycled list cell). */
|
|
2610
2768
|
static?: boolean;
|
|
2611
2769
|
/**
|
|
2612
2770
|
* Runtime gate for continuous frame work. Set this SharedValue to `false`
|
|
@@ -2647,8 +2805,20 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2647
2805
|
* Single-series only.
|
|
2648
2806
|
*/
|
|
2649
2807
|
renderOverlay?: (ctx: ChartOverlayContext) => ReactElement | null | undefined;
|
|
2650
|
-
/**
|
|
2808
|
+
/**
|
|
2809
|
+
* JS-thread callback while scrubbing; `null` when scrub ends. With
|
|
2810
|
+
* `scrub.markers` enabled, includes matching markers and also sends `null`
|
|
2811
|
+
* when a valid point becomes unavailable (for example an unpriced gap).
|
|
2812
|
+
*/
|
|
2651
2813
|
onScrub?: (point: ScrubPoint | null) => void;
|
|
2814
|
+
/**
|
|
2815
|
+
* Called on the JS thread when the crosshair enters a different candle,
|
|
2816
|
+
* with a snapshot of its OHLC at entry. Re-entering a candle fires again;
|
|
2817
|
+
* ticks within the same candle do not. Called with `null` when the scrub
|
|
2818
|
+
* ends, enters a gap, or leaves candle mode. Idle in line mode. Unlike
|
|
2819
|
+
* {@link onScrub}, it does not stream per-frame candle updates.
|
|
2820
|
+
*/
|
|
2821
|
+
onScrubCandleChange?: (candle: CandlePoint | null) => void;
|
|
2652
2822
|
/**
|
|
2653
2823
|
* Scrub-action ("order ticket") mode: tap to drop a locked crosshair, drag to
|
|
2654
2824
|
* fine-tune a **price level**, then press the right-gutter action badge to fire
|
|
@@ -2697,14 +2867,12 @@ export interface LiveChartProps extends LiveChartCoreProps {
|
|
|
2697
2867
|
*/
|
|
2698
2868
|
renderOffAxisReferenceLine?: (ctx: ReferenceLineRenderProps) => ReactElement | null | undefined;
|
|
2699
2869
|
/**
|
|
2700
|
-
*
|
|
2701
|
-
*
|
|
2702
|
-
*
|
|
2703
|
-
*
|
|
2704
|
-
*
|
|
2705
|
-
* {@link
|
|
2706
|
-
* custom tag draws itself), so the count reflects only collapsed built-in tags.
|
|
2707
|
-
* Single-series only. Default off.
|
|
2870
|
+
* Resolve nearby Form-A tags. `true` uses the existing count-pill collapse;
|
|
2871
|
+
* `{ mode: "stack" }` separates built-in and custom tags without moving their
|
|
2872
|
+
* price lines. Stacking respects measured tag sizes, separate horizontal
|
|
2873
|
+
* columns, and the visible live value badge (opt out with `avoidValueBadge`).
|
|
2874
|
+
* Count-pill styling/format apply only to collapse mode. Single-series only.
|
|
2875
|
+
* Default off. See {@link ReferenceLineGroupingConfig}.
|
|
2708
2876
|
*/
|
|
2709
2877
|
referenceLineGrouping?: boolean | ReferenceLineGroupingConfig;
|
|
2710
2878
|
/**
|
|
@@ -2774,6 +2942,8 @@ export interface LiveChartSeriesProps extends LiveChartCoreProps {
|
|
|
2774
2942
|
/**
|
|
2775
2943
|
* Worklet callback fired on the UI thread each frame while scrubbing.
|
|
2776
2944
|
* `null` when scrub ends. Update shared values directly — no bridge overhead.
|
|
2945
|
+
* With `scrub.markers` enabled, includes matching markers and also sends
|
|
2946
|
+
* `null` when a previously valid point becomes unavailable.
|
|
2777
2947
|
*
|
|
2778
2948
|
* ```ts
|
|
2779
2949
|
* const scrubData = useSharedValue<ScrubPointMulti | null>(null);
|