react-native-livechart 4.28.2 → 4.30.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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/dist/components/LiveChart.d.ts.map +1 -1
  3. package/dist/components/LiveChartSeries.d.ts.map +1 -1
  4. package/dist/components/LoadingOverlay.d.ts +6 -1
  5. package/dist/components/LoadingOverlay.d.ts.map +1 -1
  6. package/dist/components/ResetButtonOverlay.d.ts +25 -0
  7. package/dist/components/ResetButtonOverlay.d.ts.map +1 -0
  8. package/dist/constants.d.ts +6 -0
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/core/gestureRangeOwnership.d.ts +13 -0
  11. package/dist/core/gestureRangeOwnership.d.ts.map +1 -0
  12. package/dist/core/liveChartEngineTick.d.ts +33 -1
  13. package/dist/core/liveChartEngineTick.d.ts.map +1 -1
  14. package/dist/core/resolveConfig.d.ts +39 -2
  15. package/dist/core/resolveConfig.d.ts.map +1 -1
  16. package/dist/core/useLiveChartEngine.d.ts +35 -2
  17. package/dist/core/useLiveChartEngine.d.ts.map +1 -1
  18. package/dist/draw/line.d.ts.map +1 -1
  19. package/dist/hooks/resetButtonLayout.d.ts +24 -0
  20. package/dist/hooks/resetButtonLayout.d.ts.map +1 -0
  21. package/dist/hooks/resetView.d.ts +31 -0
  22. package/dist/hooks/resetView.d.ts.map +1 -0
  23. package/dist/hooks/useBadge.d.ts.map +1 -1
  24. package/dist/hooks/useChartPaths.d.ts +3 -1
  25. package/dist/hooks/useChartPaths.d.ts.map +1 -1
  26. package/dist/hooks/useDemandFrameLoop.d.ts.map +1 -1
  27. package/dist/hooks/useLiveDot.d.ts +5 -2
  28. package/dist/hooks/useLiveDot.d.ts.map +1 -1
  29. package/dist/hooks/usePanScroll.d.ts +39 -3
  30. package/dist/hooks/usePanScroll.d.ts.map +1 -1
  31. package/dist/hooks/useReferenceLine.d.ts.map +1 -1
  32. package/dist/hooks/useResetButton.d.ts +41 -0
  33. package/dist/hooks/useResetButton.d.ts.map +1 -0
  34. package/dist/hooks/useYAxisScaleGesture.d.ts +14 -1
  35. package/dist/hooks/useYAxisScaleGesture.d.ts.map +1 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/math/squiggly.d.ts +12 -0
  39. package/dist/math/squiggly.d.ts.map +1 -1
  40. package/dist/types.d.ts +167 -11
  41. package/dist/types.d.ts.map +1 -1
  42. package/package.json +2 -2
  43. package/src/components/LiveChart.tsx +75 -4
  44. package/src/components/LiveChartSeries.tsx +9 -1
  45. package/src/components/LoadingOverlay.tsx +44 -6
  46. package/src/components/ResetButtonOverlay.tsx +129 -0
  47. package/src/constants.ts +7 -0
  48. package/src/core/gestureRangeOwnership.ts +46 -0
  49. package/src/core/liveChartEngineTick.ts +103 -2
  50. package/src/core/resolveConfig.ts +88 -2
  51. package/src/core/useLiveChartEngine.ts +122 -4
  52. package/src/draw/line.ts +13 -5
  53. package/src/hooks/resetButtonLayout.ts +80 -0
  54. package/src/hooks/resetView.ts +92 -0
  55. package/src/hooks/useBadge.ts +18 -5
  56. package/src/hooks/useChartPaths.ts +6 -4
  57. package/src/hooks/useDemandFrameLoop.ts +7 -2
  58. package/src/hooks/useLiveDot.ts +26 -11
  59. package/src/hooks/usePanScroll.ts +177 -5
  60. package/src/hooks/useReferenceLine.ts +4 -1
  61. package/src/hooks/useResetButton.ts +181 -0
  62. package/src/hooks/useYAxisScaleGesture.ts +70 -13
  63. package/src/index.ts +3 -0
  64. package/src/math/squiggly.ts +27 -0
  65. package/src/types.ts +170 -11
@@ -1,6 +1,8 @@
1
1
  import { Gesture } from "react-native-gesture-handler";
2
2
  import { type SharedValue } from "react-native-reanimated";
3
+ import type { ResolvedPriceScrollConfig } from "../core/resolveConfig";
3
4
  import type { ChartPadding } from "../draw/line";
5
+ import type { ChartScale } from "../types";
4
6
  /** Minimum height (px) of the bottom "grab the time ruler" band in axis-drag mode. */
5
7
  export declare const AXIS_GRAB_MIN_PX = 44;
6
8
  /** Which gesture activates a time-scroll. */
@@ -19,6 +21,17 @@ export interface PanScrollEngineRefs {
19
21
  canvasWidth: SharedValue<number>;
20
22
  /** Canvas height in px (for the axis-drag band hit-test). */
21
23
  canvasHeight: SharedValue<number>;
24
+ /** Price-pan state (see `priceScroll`). All or none; omitted on engines without it. */
25
+ viewRange?: SharedValue<Pick<ChartScale, "min" | "max"> | null>;
26
+ viewRangeGestureOwned?: SharedValue<boolean>;
27
+ /** Eased display range, snapshotted into `viewRange` when a price pan begins. */
28
+ displayMin?: SharedValue<number>;
29
+ displayMax?: SharedValue<number>;
30
+ /** Fitted range the pan may travel `maxOvershoot` spans past. */
31
+ fitMin?: SharedValue<number>;
32
+ fitMax?: SharedValue<number>;
33
+ /** Pinch-zoom override; a non-null width arms an `"afterScale"` price pan. */
34
+ viewWindow?: SharedValue<number | null>;
22
35
  }
23
36
  export interface UsePanScrollOptions {
24
37
  engine: PanScrollEngineRefs;
@@ -76,6 +89,14 @@ export interface UsePanScrollOptions {
76
89
  fling?: boolean;
77
90
  /** Re-clamp parked state on config changes. False for an app-owned viewport. Default true. */
78
91
  clampOnOverscrollChange?: boolean;
92
+ /**
93
+ * Vertical price panning (`holdToScrub` mode only). Resolved from
94
+ * `priceScroll`; `null` keeps the classic horizontal-only pan that fails on
95
+ * vertical travel so a parent vertical scroll wins.
96
+ */
97
+ priceScroll?: ResolvedPriceScrollConfig | null;
98
+ /** Manual Y-range scale; `!== 1` arms an `"afterScale"` price pan. */
99
+ yRangeScale?: SharedValue<number>;
79
100
  }
80
101
  /**
81
102
  * Snap-to-follow zone around the live edge, as a fraction of the window. With
@@ -124,12 +145,27 @@ export declare function flingVelocity(velocityX: number, chartW: number, windowS
124
145
  * a comfortable touch target.
125
146
  */
126
147
  export declare function axisBandTop(canvasHeight: number, padBottom: number): number;
148
+ /**
149
+ * Whether a vertical drag pans price. Mirrored into React state between
150
+ * gestures so the pan's native activation offsets claim vertical travel only
151
+ * while armed; an untouched chart still hands vertical drags to a parent
152
+ * ScrollView.
153
+ */
154
+ export declare function isPriceScrollArmed(activation: "always" | "afterScale", yRangeScale: number, viewWindow: number | null, hasGestureRange: boolean): boolean;
155
+ /**
156
+ * Next price bounds after dragging `changeY` px (drag down ⇒ the plot content
157
+ * moves down ⇒ higher prices come into view ⇒ both bounds rise), clamped so
158
+ * neither bound travels more than `maxOvershoot` spans past the fitted range.
159
+ * Returns `cur` unchanged when the span or plot height is degenerate.
160
+ */
161
+ export declare function nextPriceRange(cur: Pick<ChartScale, "min" | "max">, changeY: number, plotHeight: number, fitMin: number, fitMax: number, maxOvershoot: number): Pick<ChartScale, "min" | "max">;
127
162
  /**
128
163
  * Horizontal pan that scrolls the chart back through time. Pick the activation
129
164
  * with `mode`:
130
165
  * - `"holdToScrub"` — a one-finger drag anywhere (activates on horizontal
131
- * travel; vertical falls through). Scrub must be press-and-hold so a quick
132
- * drag races past it (compose with `Gesture.Race`).
166
+ * travel; vertical falls through unless `priceScroll` is armed, then it
167
+ * pans price). Scrub must be press-and-hold so a quick drag races past it
168
+ * (compose with `Gesture.Race`).
133
169
  * - `"axisDrag"` — a one-finger drag starting in the bottom X-axis band, gated
134
170
  * via `manualActivation` (compose with `Gesture.Exclusive`, this gesture
135
171
  * first: outside the band it fails instantly so scrub runs).
@@ -138,5 +174,5 @@ export declare function axisBandTop(canvasHeight: number, padBottom: number): nu
138
174
  * edge; `null` means "follow live". Dragging (or flinging) back to the live edge
139
175
  * resumes following.
140
176
  */
141
- export declare function usePanScroll({ engine, padding, minTime, enabled, mode, onScrollStart, scrollActive, scrubActive, overscroll, fling, clampOnOverscrollChange, }: UsePanScrollOptions): ReturnType<typeof Gesture.Pan>;
177
+ export declare function usePanScroll({ engine, padding, minTime, enabled, mode, onScrollStart, scrollActive, scrubActive, overscroll, fling, clampOnOverscrollChange, priceScroll, yRangeScale, }: UsePanScrollOptions): ReturnType<typeof Gesture.Pan>;
142
178
  //# sourceMappingURL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MAAM,GACrB,kBAAkB,GAAG,IAAI,CAgB3B"}
@@ -0,0 +1,41 @@
1
+ import { type GestureType } from "react-native-gesture-handler";
2
+ import { type SharedValue } from "react-native-reanimated";
3
+ import type { ResolvedResetButtonConfig } from "../core/resolveConfig";
4
+ import type { ChartEngineLayout, ChartEngineRange, ChartEngineReturnToLive, ChartEngineScroll } from "../core/useLiveChartEngine";
5
+ import type { ChartPadding } from "../draw/line";
6
+ import { type ResetButtonRect } from "./resetButtonLayout";
7
+ interface Options {
8
+ /** `null` hides the button; `resetView()` on the handle still works. */
9
+ config: ResolvedResetButtonConfig | null;
10
+ engine: Pick<ChartEngineLayout, "canvasWidth" | "canvasHeight"> & ChartEngineScroll & ChartEngineRange & ChartEngineReturnToLive & {
11
+ wake?: () => void;
12
+ };
13
+ padding: ChartPadding;
14
+ yRangeScale: SharedValue<number>;
15
+ /** The button hides while the crosshair owns the touch. */
16
+ scrubActive: SharedValue<boolean>;
17
+ /** Resolved `timeScroll.returnToLive` duration (ms). */
18
+ returnToLiveMs: number;
19
+ onResetView?: () => void;
20
+ }
21
+ export interface ResetButtonState {
22
+ /** True while the view differs from the fitted live view (and no scrub). */
23
+ visible: SharedValue<boolean>;
24
+ /** Canvas-px rect the overlay positions itself at and the tap hit-tests. */
25
+ rect: SharedValue<ResetButtonRect>;
26
+ /** Written by the overlay's `onLayout`, so a custom visual of any size works. */
27
+ measuredWidth: SharedValue<number>;
28
+ measuredHeight: SharedValue<number>;
29
+ /** Tap on the button, or `null` when the button is off. Compose ahead of the plot graph. */
30
+ tapGesture: GestureType | null;
31
+ /** JS-thread reset (the handle's `resetView()` and accessibility activation). */
32
+ reset: () => void;
33
+ }
34
+ /**
35
+ * Visibility, placement and the tap of the floating reset-view button. The
36
+ * tap claims only touches that land on the visible button and fails everywhere
37
+ * else, so composed `Exclusive` ahead of the plot gestures it never delays them.
38
+ */
39
+ export declare function useResetButton({ config, engine, padding, yRangeScale, scrubActive, returnToLiveMs, onResetView, }: Options): ResetButtonState;
40
+ export {};
41
+ //# sourceMappingURL=useResetButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResetButton.d.ts","sourceRoot":"","sources":["../../src/hooks/useResetButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAO7B,UAAU,OAAO;IACf,wEAAwE;IACxE,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACzC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,cAAc,CAAC,GAC7D,iBAAiB,GACjB,gBAAgB,GAChB,uBAAuB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAClD,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,2DAA2D;IAC3D,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,4EAA4E;IAC5E,IAAI,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACnC,iFAAiF;IACjF,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,4FAA4F;IAC5F,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,iFAAiF;IACjF,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,MAAM,EACN,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EACd,WAAW,GACZ,EAAE,OAAO,GAAG,gBAAgB,CA4G5B"}
@@ -5,12 +5,18 @@ import type { ResolvedYAxisConfig } from "../core/resolveConfig";
5
5
  import type { ChartEngineLayout } from "../core/useLiveChartEngine";
6
6
  import { type YAxisEntry } from "../draw/grid";
7
7
  import type { ChartPadding } from "../draw/line";
8
+ import type { ChartScale } from "../types";
8
9
  /** Preserve private scale state across gesture/axis toggles on a mounted chart. */
9
10
  export declare function useYAxisScaleValue(external?: SharedValue<number>): SharedValue<number>;
10
11
  /** The reserved gutter, or the actual measured price column when it floats. */
11
12
  export declare function isYAxisScaleHit(x: number, y: number, width: number, height: number, padding: ChartPadding, side: "left" | "right", floating: boolean, labelRightMargin: number | undefined, entries: readonly YAxisEntry[], font: SkFont): boolean;
12
13
  /** Log-space clamping avoids overflow even for very large drag translations. */
13
14
  export declare function draggedYAxisScale(start: number, dy: number, distance: number, min: number, max: number): number;
15
+ /**
16
+ * Scale explicit price bounds about their midpoint by `factor` (> 1 widens).
17
+ * Returns `range` unchanged when the result would be degenerate or overflow.
18
+ */
19
+ export declare function scaledPriceRange(range: Pick<ChartScale, "min" | "max">, factor: number): Pick<ChartScale, "min" | "max">;
14
20
  type Options = {
15
21
  engine: Pick<ChartEngineLayout, "canvasWidth" | "canvasHeight"> & {
16
22
  wake?: () => void;
@@ -27,8 +33,15 @@ type Options = {
27
33
  deferHit?: (x: number, y: number) => boolean;
28
34
  onStart?: () => void;
29
35
  active?: SharedValue<boolean>;
36
+ /**
37
+ * Explicit price bounds (see `priceScroll`). While gesture-owned, a drag
38
+ * scales these about their midpoint instead of `scale`, and a double-tap
39
+ * clears them along with the scale.
40
+ */
41
+ range?: SharedValue<Pick<ChartScale, "min" | "max"> | null>;
42
+ rangeGestureOwned?: SharedValue<boolean>;
30
43
  };
31
44
  /** Owns gutter touches at touch-down; fails immediately everywhere else. */
32
- export declare function useYAxisScaleGesture({ engine, padding, axis, floating, entries, font, scale, gesture, deferHit, onStart, active, }: Options): import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<Record<string, unknown>> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<Record<string, never>> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").TapGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").PanGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").LongPressGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").RotationGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").PinchGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").ForceTouchGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").NativeViewGestureHandlerPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler/lib/typescript/handlers/GestureHandlerEventPayload").HoverGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gestureComposition").ComposedGesture;
45
+ export declare function useYAxisScaleGesture({ engine, padding, axis, floating, entries, font, scale, gesture, deferHit, onStart, active, range, rangeGestureOwned, }: Options): import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<Record<string, unknown>> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<Record<string, never>> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").TapGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").PanGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").LongPressGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").RotationGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").PinchGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").ForceTouchGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler").NativeViewGestureHandlerPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gesture").BaseGesture<import("react-native-gesture-handler/lib/typescript/handlers/GestureHandlerEventPayload").HoverGestureHandlerEventPayload> | import("react-native-gesture-handler/lib/typescript/handlers/gestures/gestureComposition").ComposedGesture;
33
46
  export {};
34
47
  //# sourceMappingURL=useYAxisScaleGesture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useYAxisScaleGesture.d.ts","sourceRoot":"","sources":["../../src/hooks/useYAxisScaleGesture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,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CAAC,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5D,iBAAiB,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC1C,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAgB,EAChB,OAAO,EACP,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,iBAAiB,GAClB,EAAE,OAAO,qsDAgLT"}
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, CandleGap, CandleGapBandStyle, CandleGapBridgeStyle, CandleGapKind, CandleGapLabelStyle, CandleGapStyle, CandleGapsConfig, CandleMetrics, CandlePoint, CanvasMode, ChartGap, ChartGapBandStyle, ChartGapBridgeStyle, ChartGapKind, ChartGapLabelStyle, ChartGapsConfig, ChartGapStyle, ChartInsets, ChartOverlayContext, ChartPlotRect, ChartScale, ChartSegment, ChartViewportControl, DegenOptions, DegenShakePayload, DotConfig, DotGlowConfig, DotRingConfig, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LineStyleConfig, LiveChartCoreProps, LiveChartFrameStats, LiveChartHandle, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, LoadingConfig, Marker, MarkerClusterConfig, MarkerGroupBadge, MarkerKind, MarkerPressEvent, MarkerRenderContext, MarkerSide, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PerSeriesTooltipConfig, PulseConfig, RangeAnimationConfig, SeriesRangeAnimationConfig, ReferenceLine, ReferenceLineBadgeConfig, ReferenceLineValueBadgeConfig, ReferenceLineGroupingConfig, ReferenceLineRenderProps, ReturnToLiveConfig, ScrubActionConfig, ScrubActionPoint, ScrubConfig, ScrubMarkerConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, ThresholdConfig, ThresholdBadgeRenderProps, ThresholdFillConfig, ThresholdLineConfig, TimeScrollConfig, TooltipRenderProps, TradeEvent, TransitionConfig, ValueLineConfig, ViewportConfig, VisibleRange, VolumeConfig, XAxisConfig, YAxisConfig, YAxisScaleGestureConfig, 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, ChartViewportControl, DegenOptions, DegenShakePayload, DotConfig, DotGlowConfig, DotRingConfig, EmptyStateMetrics, FontConfig, FontWeight, GradientConfig, GridMetrics, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LineStyleConfig, LiveChartCoreProps, LiveChartFrameStats, LiveChartHandle, LiveChartMetrics, LiveChartMetricsOverride, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, LoadingConfig, Marker, MarkerClusterConfig, MarkerGroupBadge, MarkerKind, MarkerPressEvent, MarkerRenderContext, MarkerSide, Momentum, MomentumConfig, MotionMetrics, MultiSeriesDotConfig, PerSeriesTooltipConfig, PriceScrollConfig, PulseConfig, RangeAnimationConfig, SeriesRangeAnimationConfig, ReferenceLine, ReferenceLineBadgeConfig, ReferenceLineValueBadgeConfig, ReferenceLineGroupingConfig, ReferenceLineRenderProps, ResetButtonConfig, ResetButtonRenderProps, ReturnToLiveConfig, ScrubActionConfig, ScrubActionPoint, ScrubConfig, ScrubMarkerConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SelectionDotConfig, SelectionDotProps, SelectionDotRingConfig, SeriesConfig, ThemeMode, ThresholdConfig, ThresholdBadgeRenderProps, ThresholdFillConfig, ThresholdLineConfig, TimeScrollConfig, TooltipRenderProps, TradeEvent, TransitionConfig, ValueLineConfig, ViewportConfig, VisibleRange, VolumeConfig, XAxisConfig, YAxisConfig, YAxisScaleGestureConfig, ZoomConfig, } from "./types";
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -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,MA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EACZ,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,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,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,UAAU,GACX,MAAM,SAAS,CAAC"}
@@ -18,6 +18,18 @@ export declare function squigglyYAt(x: number, centerY: number, t: number, base?
18
18
  * keeps the wave continuous where the shell hands over to the morph.
19
19
  */
20
20
  export declare function squiggleClockSeconds(): number;
21
+ /**
22
+ * The squiggle's animated time (ms) after one more frame, toward
23
+ * `LoadingConfig.freezeAfterMs`. A frame counts its delta clamped to
24
+ * 0–{@link MAX_FRAME_DELTA_MS}, so the first frame back from the background (or
25
+ * after a stall) counts as one frame, not as the time away.
26
+ */
27
+ export declare function squiggleShownMsAfterFrame(shownMs: number, frameMs: number): number;
28
+ /**
29
+ * Whether the squiggle has used up `freezeAfterMs` and is frozen. `undefined`
30
+ * never freezes; `0` or less freezes from the start.
31
+ */
32
+ export declare function squiggleFrozen(shownMs: number, freezeAfterMs: number | undefined): boolean;
21
33
  /**
22
34
  * Build a flat [x0,y0,x1,y1,...] point array for a standalone squiggly line
23
35
  * spanning the full chart area (used in loading / empty state).
@@ -1 +1 @@
1
- {"version":3,"file":"squiggly.d.ts","sourceRoot":"","sources":["../../src/math/squiggly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EACf,CAAC,EAAE,MAAM,EACT,IAAI,SAAK,EACT,KAAK,SAAI,GACR,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,YAAY,EACrB,CAAC,EAAE,MAAM,EACT,IAAI,SAAK,EACT,KAAK,SAAI,EACT,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAqBV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EACf,IAAI,SAAK,EACT,KAAK,SAAI,EACT,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAUV;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,EAAE,MAAM,EAAE,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAqBV"}
1
+ {"version":3,"file":"squiggly.d.ts","sourceRoot":"","sources":["../../src/math/squiggly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EACf,CAAC,EAAE,MAAM,EACT,IAAI,SAAK,EACT,KAAK,SAAI,GACR,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,OAAO,CAGT;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,YAAY,EACrB,CAAC,EAAE,MAAM,EACT,IAAI,SAAK,EACT,KAAK,SAAI,EACT,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAqBV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EACf,IAAI,SAAK,EACT,KAAK,SAAI,EACT,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAUV;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,EAAE,MAAM,EAAE,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,MAAM,EAAE,GACb,MAAM,EAAE,CAqBV"}
package/dist/types.d.ts CHANGED
@@ -710,11 +710,17 @@ export interface BadgeConfig extends BadgeStyleConfig {
710
710
  * column ({@link YAxisConfig.labelRightMargin}): it starts at the labels'
711
711
  * shared left X, and a value wider than every axis label ends at the
712
712
  * column's right edge. The pill keeps its shape and the value stays within
713
- * its `padX` padding (a value that doesn't fit there is centered), so the
714
- * room on each side follows the right inset and `metrics.badge`. The value
715
- * moves sideways when the column's width changes (a wider label entering or
716
- * leaving the axis). Centered without that column on the right side, while
717
- * the axis floats, and for a `"left"` badge. Default `"center"`.
713
+ * its `padX` padding, so the room on each side follows the right inset and
714
+ * `metrics.badge`. Next to the tail, whose taper keeps the value off the
715
+ * outline, a pill too narrow for both paddings gives up the left one first,
716
+ * then the right one, so the value moves continuously as the pill narrows:
717
+ * with room for its right padding it ends `padX` from the pill's end (the
718
+ * column's right edge when `marginEdge + padX` equals `labelRightMargin`).
719
+ * A value wider than a tailed pill's body, or one that doesn't fit both
720
+ * paddings of a pill without a tail, is centered. The value moves sideways
721
+ * when the column's width changes (a wider label entering or leaving the
722
+ * axis). Centered without that column on the right side, while the axis
723
+ * floats, and for a `"left"` badge. Default `"center"`.
718
724
  */
719
725
  textAlign?: "center" | "yAxisColumn";
720
726
  /**
@@ -1763,7 +1769,9 @@ export interface DotConfig {
1763
1769
  * dot must stay aligned with its badge. Single-series `LiveChart` only
1764
1770
  * (multi-series dots already ride each line's end while scrolled). Default
1765
1771
  * `false` (the dot stays pinned to the right edge with its pulse suppressed
1766
- * while scrolled back).
1772
+ * while scrolled back). With an external viewport or positive windowBuffer,
1773
+ * a line dot already tracks the recorded endpoint; this option still controls
1774
+ * its scroll-back visibility and pulse.
1767
1775
  *
1768
1776
  * @experimental
1769
1777
  */
@@ -2191,6 +2199,16 @@ export interface LiveChartHandle {
2191
2199
  * ```
2192
2200
  */
2193
2201
  resetZoom(): void;
2202
+ /**
2203
+ * Return to the fitted live view: {@link resetZoom} plus `yRangeScale` → 1 and
2204
+ * a gesture-owned price range cleared, gliding the right edge back to live
2205
+ * with the `timeScroll.returnToLive` timing. What the `resetButton` runs.
2206
+ * Safe to call when already fitted. On LiveChartSeries, which has no price
2207
+ * pan, it is `resetZoom()` plus `yRangeScale` → 1.
2208
+ *
2209
+ * @experimental
2210
+ */
2211
+ resetView(): void;
2194
2212
  }
2195
2213
  /**
2196
2214
  * The visible time range reported by {@link LiveChartCoreProps.onVisibleRangeChange}.
@@ -2275,6 +2293,13 @@ export interface LoadingConfig {
2275
2293
  * squiggle with no placeholder ticks. Default `true`.
2276
2294
  */
2277
2295
  axisLabels?: boolean;
2296
+ /**
2297
+ * Freezes the squiggle once it has animated this long (ms) each time the
2298
+ * loading or empty shell appears; it moves again when the shell next appears.
2299
+ * Counted in frames drawn, so time in the background doesn't count. `0` or
2300
+ * less freezes it from the start. Default `undefined`: no limit.
2301
+ */
2302
+ freezeAfterMs?: number;
2278
2303
  }
2279
2304
  /** Y-range easing shared by both charts, independent of value/window tracking. */
2280
2305
  export interface RangeAnimationConfig {
@@ -2370,7 +2395,8 @@ export interface LiveChartCoreProps {
2370
2395
  * `true` shows the shell with the defaults; pass a {@link LoadingConfig} to
2371
2396
  * restyle it — `color` / `strokeWidth` for the squiggle + skeleton, `amplitude`
2372
2397
  * / `speed` for the breathing wave, `axisLabels` to toggle the skeleton
2373
- * placeholders. `false` / omitted is "not loading". Toggle between the config
2398
+ * placeholders, `freezeAfterMs` to freeze the wave after a while.
2399
+ * `false` / omitted is "not loading". Toggle between the config
2374
2400
  * and `false` as data loads (e.g. `loading={isLoading && cfg}`). The loading→live
2375
2401
  * reveal duration is governed separately by {@link TransitionConfig.reveal} (the
2376
2402
  * `transitions` prop).
@@ -2572,7 +2598,10 @@ export interface LiveChartCoreProps {
2572
2598
  /**
2573
2599
  * Right-edge buffer as a fraction of `timeWindow`. Pushes the live edge past the
2574
2600
  * current time so the latest point has breathing room; pass `0` to land the latest
2575
- * point exactly at the right edge. Default `0`.
2601
+ * point exactly at the right edge. In line-mode LiveChart, a positive buffer
2602
+ * stops the line/dot at the last recorded point; the badge and value line use
2603
+ * that recorded price. badge.followViewEdge retains its edge-pinned indicators.
2604
+ * Default `0`.
2576
2605
  */
2577
2606
  windowBuffer?: number;
2578
2607
  /**
@@ -2676,15 +2705,28 @@ export interface LiveChartCoreProps {
2676
2705
  }
2677
2706
  /**
2678
2707
  * UI-thread scroll/zoom state adopted by a single-series {@link LiveChart}.
2679
- * The app owns leadership and timestamp mapping; gestures write these same values.
2708
+ * The app owns leadership and timestamp mapping; gestures write end/window.
2680
2709
  * @experimental
2681
2710
  */
2682
2711
  export interface ChartViewportControl {
2683
2712
  /** Right-edge unix timestamp in seconds; null follows this chart's live edge.
2684
- * Honors times past live. An end before the first retained point falls back to live. */
2713
+ * Honors times past live. Before the first retained point, falls back to live
2714
+ * unless a valid explicit range is supplied. */
2685
2715
  end: SharedValue<number | null>;
2686
2716
  /** Positive, finite visible width in seconds; null uses the timeWindow prop. */
2687
2717
  window: SharedValue<number | null>;
2718
+ /**
2719
+ * Exact price bounds while end is finite and non-null, including empty past or
2720
+ * future space. Both bounds and their difference must be finite, with min < max.
2721
+ * Applied immediately, overriding automatic fitting, range easing, nonNegative,
2722
+ * maxValue, minRange, and yRangeScale. Invalid/null/omitted bounds use auto-fit.
2723
+ * App-written bounds are ignored while end is null (including after resetZoom()).
2724
+ * With priceScroll, gestures write this range too: gesture-owned bounds stay
2725
+ * active while following live and obey the chart's hard bounds. A later app
2726
+ * write or replacement range SharedValue restores the app-owned contract;
2727
+ * resetView(), axis double-tap and framing changes preserve app-written bounds.
2728
+ */
2729
+ range?: SharedValue<Pick<ChartScale, "min" | "max"> | null>;
2688
2730
  }
2689
2731
  /** External viewport state and optional behavior settings for {@link LiveChart}.
2690
2732
  * Pass an object to adopt its shared values; false/omitted uses private state.
@@ -2693,9 +2735,84 @@ export interface ChartViewportControl {
2693
2735
  export interface ViewportConfig extends ChartViewportControl {
2694
2736
  /** Ease non-null window overrides using the chart's smoothing. Default true.
2695
2737
  * Set false on followers copying a leader's drawn width to avoid easing twice.
2696
- * Null windows still ease back to timeWindow; Y-range/value smoothing is unchanged. */
2738
+ * Null windows still ease back to timeWindow; value and automatic Y-range
2739
+ * smoothing are unchanged. Explicit range bounds always apply immediately. */
2697
2740
  windowSmoothing?: boolean;
2698
2741
  }
2742
+ /**
2743
+ * Vertical price panning (see {@link LiveChartProps.priceScroll}).
2744
+ *
2745
+ * @experimental Prototype — gesture model and API may change.
2746
+ */
2747
+ export interface PriceScrollConfig {
2748
+ /**
2749
+ * When a vertical drag on the plot pans the price window:
2750
+ * - `"afterScale"` (default) — only once the range was manually changed (a
2751
+ * price-axis drag, a pinch, or an earlier price pan), so an untouched chart
2752
+ * still lets a parent ScrollView scroll.
2753
+ * - `"always"` — every vertical drag pans price.
2754
+ */
2755
+ activation?: "always" | "afterScale";
2756
+ /**
2757
+ * How far the window may travel past the fitted range, as a multiple of the
2758
+ * visible price span. Default `1`.
2759
+ */
2760
+ maxOvershoot?: number;
2761
+ }
2762
+ /**
2763
+ * Floating reset-view button (see {@link LiveChartProps.resetButton}).
2764
+ *
2765
+ * @experimental
2766
+ */
2767
+ export interface ResetButtonConfig {
2768
+ /** Where the button sits inside the plot rect. Default `"bottom-center"`. */
2769
+ placement?: "bottom-center" | "bottom-right";
2770
+ /**
2771
+ * Which manual states show the button. Each defaults to `true`; set one to
2772
+ * `false` to ignore that state.
2773
+ */
2774
+ showFor?: {
2775
+ /** A scaled price axis (`yRangeScale !== 1`). */
2776
+ yScale?: boolean;
2777
+ /** A vertically panned price window (`priceScroll`). */
2778
+ priceScroll?: boolean;
2779
+ /** A window scrolled back from the live edge (`timeScroll`). */
2780
+ timeScroll?: boolean;
2781
+ /** A pinched window width (`zoom`). */
2782
+ zoom?: boolean;
2783
+ };
2784
+ /** Distance from the plot's bottom (and right) edge, in px. Default `12`. */
2785
+ margin?: number;
2786
+ /** Fade duration in ms when the button appears or hides. Default `160`. */
2787
+ fadeMs?: number;
2788
+ /**
2789
+ * Built-in button only: glyph rendered in the chart's font family, like
2790
+ * {@link ScrubActionConfig.icon}. Default `"↺"`.
2791
+ */
2792
+ icon?: string;
2793
+ /** Built-in button only: diameter in px. Default `36`. */
2794
+ size?: number;
2795
+ /** Built-in button only: fill color. Defaults to `palette.badgeBg`. */
2796
+ color?: string;
2797
+ /** Built-in button only: glyph color. Defaults to `palette.badgeText`. */
2798
+ iconColor?: string;
2799
+ /** Built-in button only: screen-reader label. The library ships no text of its own. */
2800
+ accessibilityLabel?: string;
2801
+ }
2802
+ /**
2803
+ * Handed to {@link LiveChartProps.renderResetButton}.
2804
+ *
2805
+ * @experimental
2806
+ */
2807
+ export interface ResetButtonRenderProps {
2808
+ /** True while the view differs from the fitted live view. */
2809
+ visible: SharedValue<boolean>;
2810
+ /**
2811
+ * Runs `resetView()`. Wire to `onAccessibilityTap` on iOS and the `activate`
2812
+ * action through `accessibilityActions` / `onAccessibilityAction` on Android.
2813
+ */
2814
+ reset: () => void;
2815
+ }
2699
2816
  /** Props for the single-series `LiveChart` component. */
2700
2817
  export interface LiveChartProps extends LiveChartCoreProps {
2701
2818
  /**
@@ -2705,9 +2822,48 @@ export interface LiveChartProps extends LiveChartCoreProps {
2705
2822
  * and wake autoSleep charts. Single-series line/candle only.
2706
2823
  * Pass a ViewportConfig object to enable; false/omitted uses private state.
2707
2824
  * Both shared values are required, so this prop has no true shorthand.
2825
+ * Optional range supplies exact price bounds while end is non-null. In line
2826
+ * mode the line/dot stop at the last recorded point, with badge/value line at
2827
+ * that price; badge.followViewEdge keeps its edge-pinned indicators.
2708
2828
  * @experimental
2709
2829
  */
2710
2830
  viewport?: false | ViewportConfig;
2831
+ /**
2832
+ * Drag the plot vertically to move the price window — with `timeScroll` this
2833
+ * gives free X/Y panning. The pan writes the viewport's price `range` (the
2834
+ * supplied `viewport.range` shared value when one is given, private state
2835
+ * otherwise), which then holds while new data streams in. A later app write
2836
+ * or replacement range SharedValue relinquishes gesture ownership. A price-axis drag
2837
+ * scales that range, and a double-tap on the axis, `resetView()` or a
2838
+ * `snapKey` / mode change clears it. Rides on the `timeScroll` pan, so it
2839
+ * requires `timeScroll`. `true` = defaults, or pass a {@link PriceScrollConfig}.
2840
+ * Default `false`.
2841
+ *
2842
+ * @experimental Prototype — gesture model and API may change.
2843
+ */
2844
+ priceScroll?: boolean | PriceScrollConfig;
2845
+ /**
2846
+ * Floating button that appears once the user has left the fitted live view
2847
+ * (time pan, pinch, price-axis scale or price pan) and returns to it in one
2848
+ * tap (see {@link LiveChartHandle.resetView}). `true` = the built-in round
2849
+ * glyph button, or pass a {@link ResetButtonConfig}. Default `false`.
2850
+ *
2851
+ * @experimental
2852
+ */
2853
+ resetButton?: boolean | ResetButtonConfig;
2854
+ /**
2855
+ * Custom visual for `resetButton`. The chart owns placement, visibility, fade
2856
+ * and the tap, so return a plain view rather than a pressable; the wrapper is
2857
+ * measured, so any size works. Called on the JS thread once per render.
2858
+ *
2859
+ * @experimental
2860
+ */
2861
+ renderResetButton?: (props: ResetButtonRenderProps) => ReactElement;
2862
+ /**
2863
+ * Called on the JS thread after the reset overrides are applied on the UI
2864
+ * thread (button tap or `resetView()`). Return animations may still be running.
2865
+ */
2866
+ onResetView?: () => void;
2711
2867
  /** Area gradient fill under the line. `true` = defaults, or pass `GradientConfig`. Default `true`. */
2712
2868
  gradient?: boolean | GradientConfig;
2713
2869
  /**