react-native-livechart 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +33 -0
- package/README.md +198 -0
- package/dist/components/AnimatedLabel.d.ts +21 -0
- package/dist/components/AnimatedLabel.d.ts.map +1 -0
- package/dist/components/BadgeOverlay.d.ts +16 -0
- package/dist/components/BadgeOverlay.d.ts.map +1 -0
- package/dist/components/CrosshairLine.d.ts +20 -0
- package/dist/components/CrosshairLine.d.ts.map +1 -0
- package/dist/components/CrosshairOverlay.d.ts +29 -0
- package/dist/components/CrosshairOverlay.d.ts.map +1 -0
- package/dist/components/DegenParticlesOverlay.d.ts +16 -0
- package/dist/components/DegenParticlesOverlay.d.ts.map +1 -0
- package/dist/components/DotOverlay.d.ts +17 -0
- package/dist/components/DotOverlay.d.ts.map +1 -0
- package/dist/components/LeftEdgeFade.d.ts +9 -0
- package/dist/components/LeftEdgeFade.d.ts.map +1 -0
- package/dist/components/LiveChart.d.ts +3 -0
- package/dist/components/LiveChart.d.ts.map +1 -0
- package/dist/components/LiveChartSeries.d.ts +3 -0
- package/dist/components/LiveChartSeries.d.ts.map +1 -0
- package/dist/components/LiveChartTransition.d.ts +28 -0
- package/dist/components/LiveChartTransition.d.ts.map +1 -0
- package/dist/components/LoadingOverlay.d.ts +24 -0
- package/dist/components/LoadingOverlay.d.ts.map +1 -0
- package/dist/components/MarkerOverlay.d.ts +25 -0
- package/dist/components/MarkerOverlay.d.ts.map +1 -0
- package/dist/components/MultiSeriesDots.d.ts +11 -0
- package/dist/components/MultiSeriesDots.d.ts.map +1 -0
- package/dist/components/MultiSeriesStroke.d.ts +14 -0
- package/dist/components/MultiSeriesStroke.d.ts.map +1 -0
- package/dist/components/MultiSeriesTooltipStack.d.ts +10 -0
- package/dist/components/MultiSeriesTooltipStack.d.ts.map +1 -0
- package/dist/components/MultiSeriesValueLabels.d.ts +11 -0
- package/dist/components/MultiSeriesValueLabels.d.ts.map +1 -0
- package/dist/components/MultiSeriesValueLines.d.ts +10 -0
- package/dist/components/MultiSeriesValueLines.d.ts.map +1 -0
- package/dist/components/ReferenceLineOverlay.d.ts +19 -0
- package/dist/components/ReferenceLineOverlay.d.ts.map +1 -0
- package/dist/components/SeriesToggleChips.d.ts +15 -0
- package/dist/components/SeriesToggleChips.d.ts.map +1 -0
- package/dist/components/TradeStreamOverlay.d.ts +14 -0
- package/dist/components/TradeStreamOverlay.d.ts.map +1 -0
- package/dist/components/ValueLineOverlay.d.ts +16 -0
- package/dist/components/ValueLineOverlay.d.ts.map +1 -0
- package/dist/components/ValueTextOverlay.d.ts +20 -0
- package/dist/components/ValueTextOverlay.d.ts.map +1 -0
- package/dist/components/XAxisOverlay.d.ts +14 -0
- package/dist/components/XAxisOverlay.d.ts.map +1 -0
- package/dist/components/YAxisOverlay.d.ts +23 -0
- package/dist/components/YAxisOverlay.d.ts.map +1 -0
- package/dist/components/seriesMetaSig.d.ts +4 -0
- package/dist/components/seriesMetaSig.d.ts.map +1 -0
- package/dist/constants.d.ts +38 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/core/liveChartEngineTick.d.ts +45 -0
- package/dist/core/liveChartEngineTick.d.ts.map +1 -0
- package/dist/core/liveChartSeriesEngineTick.d.ts +38 -0
- package/dist/core/liveChartSeriesEngineTick.d.ts.map +1 -0
- package/dist/core/multiSeriesLayout.d.ts +22 -0
- package/dist/core/multiSeriesLayout.d.ts.map +1 -0
- package/dist/core/resolveConfig.d.ts +188 -0
- package/dist/core/resolveConfig.d.ts.map +1 -0
- package/dist/core/useLiveChartEngine.d.ts +79 -0
- package/dist/core/useLiveChartEngine.d.ts.map +1 -0
- package/dist/core/useLiveChartSeriesEngine.d.ts +68 -0
- package/dist/core/useLiveChartSeriesEngine.d.ts.map +1 -0
- package/dist/draw/candle.d.ts +25 -0
- package/dist/draw/candle.d.ts.map +1 -0
- package/dist/draw/grid.d.ts +24 -0
- package/dist/draw/grid.d.ts.map +1 -0
- package/dist/draw/line.d.ts +86 -0
- package/dist/draw/line.d.ts.map +1 -0
- package/dist/draw/trade.d.ts +38 -0
- package/dist/draw/trade.d.ts.map +1 -0
- package/dist/hooks/crosshairSeries.d.ts +13 -0
- package/dist/hooks/crosshairSeries.d.ts.map +1 -0
- package/dist/hooks/crosshairShared.d.ts +72 -0
- package/dist/hooks/crosshairShared.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/resolveChartLayout.d.ts +42 -0
- package/dist/hooks/resolveChartLayout.d.ts.map +1 -0
- package/dist/hooks/useBadge.d.ts +14 -0
- package/dist/hooks/useBadge.d.ts.map +1 -0
- package/dist/hooks/useCandlePaths.d.ts +19 -0
- package/dist/hooks/useCandlePaths.d.ts.map +1 -0
- package/dist/hooks/useCanvasLayout.d.ts +12 -0
- package/dist/hooks/useCanvasLayout.d.ts.map +1 -0
- package/dist/hooks/useChartColors.d.ts +20 -0
- package/dist/hooks/useChartColors.d.ts.map +1 -0
- package/dist/hooks/useChartPaths.d.ts +19 -0
- package/dist/hooks/useChartPaths.d.ts.map +1 -0
- package/dist/hooks/useChartReveal.d.ts +30 -0
- package/dist/hooks/useChartReveal.d.ts.map +1 -0
- package/dist/hooks/useChartSkiaFont.d.ts +8 -0
- package/dist/hooks/useChartSkiaFont.d.ts.map +1 -0
- package/dist/hooks/useCrosshair.d.ts +20 -0
- package/dist/hooks/useCrosshair.d.ts.map +1 -0
- package/dist/hooks/useCrosshairSeries.d.ts +10 -0
- package/dist/hooks/useCrosshairSeries.d.ts.map +1 -0
- package/dist/hooks/useDegen.d.ts +17 -0
- package/dist/hooks/useDegen.d.ts.map +1 -0
- package/dist/hooks/useLiveChartHasData.d.ts +17 -0
- package/dist/hooks/useLiveChartHasData.d.ts.map +1 -0
- package/dist/hooks/useLiveDot.d.ts +12 -0
- package/dist/hooks/useLiveDot.d.ts.map +1 -0
- package/dist/hooks/useMarkers.d.ts +15 -0
- package/dist/hooks/useMarkers.d.ts.map +1 -0
- package/dist/hooks/useModeBlend.d.ts +18 -0
- package/dist/hooks/useModeBlend.d.ts.map +1 -0
- package/dist/hooks/useMomentum.d.ts +16 -0
- package/dist/hooks/useMomentum.d.ts.map +1 -0
- package/dist/hooks/useMultiSeriesDegen.d.ts +25 -0
- package/dist/hooks/useMultiSeriesDegen.d.ts.map +1 -0
- package/dist/hooks/useMultiSeriesLinePaths.d.ts +15 -0
- package/dist/hooks/useMultiSeriesLinePaths.d.ts.map +1 -0
- package/dist/hooks/useReferenceLine.d.ts +32 -0
- package/dist/hooks/useReferenceLine.d.ts.map +1 -0
- package/dist/hooks/useReverseMorphEngineInputs.d.ts +24 -0
- package/dist/hooks/useReverseMorphEngineInputs.d.ts.map +1 -0
- package/dist/hooks/useTradeStream.d.ts +12 -0
- package/dist/hooks/useTradeStream.d.ts.map +1 -0
- package/dist/hooks/useXAxis.d.ts +32 -0
- package/dist/hooks/useXAxis.d.ts.map +1 -0
- package/dist/hooks/useYAxis.d.ts +13 -0
- package/dist/hooks/useYAxis.d.ts.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/format.d.ts +5 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/measureFontTextWidth.d.ts +7 -0
- package/dist/lib/measureFontTextWidth.d.ts.map +1 -0
- package/dist/lib/monoFontFamily.d.ts +6 -0
- package/dist/lib/monoFontFamily.d.ts.map +1 -0
- package/dist/math/color.d.ts +5 -0
- package/dist/math/color.d.ts.map +1 -0
- package/dist/math/degenTick.d.ts +57 -0
- package/dist/math/degenTick.d.ts.map +1 -0
- package/dist/math/interpolate.d.ts +7 -0
- package/dist/math/interpolate.d.ts.map +1 -0
- package/dist/math/intervals.d.ts +3 -0
- package/dist/math/intervals.d.ts.map +1 -0
- package/dist/math/lerp.d.ts +7 -0
- package/dist/math/lerp.d.ts.map +1 -0
- package/dist/math/markers.d.ts +44 -0
- package/dist/math/markers.d.ts.map +1 -0
- package/dist/math/momentum.d.ts +8 -0
- package/dist/math/momentum.d.ts.map +1 -0
- package/dist/math/pickCandle.d.ts +8 -0
- package/dist/math/pickCandle.d.ts.map +1 -0
- package/dist/math/range.d.ts +10 -0
- package/dist/math/range.d.ts.map +1 -0
- package/dist/math/referenceLines.d.ts +20 -0
- package/dist/math/referenceLines.d.ts.map +1 -0
- package/dist/math/spline.d.ts +45 -0
- package/dist/math/spline.d.ts.map +1 -0
- package/dist/math/squiggly.d.ts +36 -0
- package/dist/math/squiggly.d.ts.map +1 -0
- package/dist/theme.d.ts +30 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/types.d.ts +720 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +72 -0
- package/src/components/AnimatedLabel.tsx +41 -0
- package/src/components/BadgeOverlay.tsx +39 -0
- package/src/components/CrosshairLine.tsx +90 -0
- package/src/components/CrosshairOverlay.tsx +170 -0
- package/src/components/DegenParticlesOverlay.tsx +141 -0
- package/src/components/DotOverlay.tsx +69 -0
- package/src/components/LeftEdgeFade.tsx +36 -0
- package/src/components/LiveChart.tsx +821 -0
- package/src/components/LiveChartSeries.tsx +607 -0
- package/src/components/LiveChartTransition.tsx +135 -0
- package/src/components/LoadingOverlay.tsx +301 -0
- package/src/components/MarkerOverlay.tsx +331 -0
- package/src/components/MultiSeriesDots.tsx +117 -0
- package/src/components/MultiSeriesStroke.tsx +79 -0
- package/src/components/MultiSeriesTooltipStack.tsx +78 -0
- package/src/components/MultiSeriesValueLabels.tsx +103 -0
- package/src/components/MultiSeriesValueLines.tsx +115 -0
- package/src/components/ReferenceLineOverlay.tsx +317 -0
- package/src/components/SeriesToggleChips.tsx +201 -0
- package/src/components/TradeStreamOverlay.tsx +117 -0
- package/src/components/ValueLineOverlay.tsx +63 -0
- package/src/components/ValueTextOverlay.tsx +43 -0
- package/src/components/XAxisOverlay.tsx +109 -0
- package/src/components/YAxisOverlay.tsx +135 -0
- package/src/components/seriesMetaSig.ts +13 -0
- package/src/constants.ts +44 -0
- package/src/core/liveChartEngineTick.ts +185 -0
- package/src/core/liveChartSeriesEngineTick.ts +163 -0
- package/src/core/multiSeriesLayout.ts +80 -0
- package/src/core/resolveConfig.ts +538 -0
- package/src/core/useLiveChartEngine.ts +207 -0
- package/src/core/useLiveChartSeriesEngine.ts +215 -0
- package/src/draw/candle.ts +210 -0
- package/src/draw/grid.ts +174 -0
- package/src/draw/line.ts +257 -0
- package/src/draw/trade.ts +202 -0
- package/src/hooks/crosshairSeries.ts +78 -0
- package/src/hooks/crosshairShared.ts +296 -0
- package/src/hooks/index.ts +26 -0
- package/src/hooks/resolveChartLayout.ts +144 -0
- package/src/hooks/useBadge.ts +192 -0
- package/src/hooks/useCandlePaths.ts +165 -0
- package/src/hooks/useCanvasLayout.ts +22 -0
- package/src/hooks/useChartColors.ts +48 -0
- package/src/hooks/useChartPaths.ts +121 -0
- package/src/hooks/useChartReveal.ts +123 -0
- package/src/hooks/useChartSkiaFont.ts +34 -0
- package/src/hooks/useCrosshair.ts +250 -0
- package/src/hooks/useCrosshairSeries.ts +163 -0
- package/src/hooks/useDegen.ts +262 -0
- package/src/hooks/useLiveChartHasData.ts +31 -0
- package/src/hooks/useLiveDot.ts +31 -0
- package/src/hooks/useMarkers.ts +95 -0
- package/src/hooks/useModeBlend.ts +52 -0
- package/src/hooks/useMomentum.ts +37 -0
- package/src/hooks/useMultiSeriesDegen.ts +260 -0
- package/src/hooks/useMultiSeriesLinePaths.ts +76 -0
- package/src/hooks/useReferenceLine.ts +212 -0
- package/src/hooks/useReverseMorphEngineInputs.ts +154 -0
- package/src/hooks/useTradeStream.ts +64 -0
- package/src/hooks/useXAxis.ts +200 -0
- package/src/hooks/useYAxis.ts +48 -0
- package/src/index.ts +69 -0
- package/src/lib/format.ts +36 -0
- package/src/lib/measureFontTextWidth.ts +10 -0
- package/src/lib/monoFontFamily.ts +8 -0
- package/src/math/color.ts +31 -0
- package/src/math/degenTick.ts +151 -0
- package/src/math/interpolate.ts +32 -0
- package/src/math/intervals.ts +17 -0
- package/src/math/lerp.ts +17 -0
- package/src/math/markers.ts +175 -0
- package/src/math/momentum.ts +38 -0
- package/src/math/pickCandle.ts +42 -0
- package/src/math/range.ts +54 -0
- package/src/math/referenceLines.ts +56 -0
- package/src/math/spline.ts +183 -0
- package/src/math/squiggly.ts +108 -0
- package/src/theme.ts +231 -0
- package/src/types.ts +789 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
import { type ChartPadding } from "../draw/line";
|
|
5
|
+
import type { CandlePoint, LiveChartPalette, ScrubPoint } from "../types";
|
|
6
|
+
import { type CrosshairState } from "./crosshairShared";
|
|
7
|
+
export type { CrosshairState, TooltipLayout } from "./crosshairShared";
|
|
8
|
+
export type { ScrubPoint };
|
|
9
|
+
export { computeCandleTooltipLayout, computeCrosshairOpacity, computeScrubTime, computeTooltipLayout, computeTooltipLayoutMulti, deriveCrosshairTooltipSingle, deriveScrubValueSingle, HIDDEN_TOOLTIP } from "./crosshairShared";
|
|
10
|
+
export interface CrosshairCandleOpts {
|
|
11
|
+
mode: "line" | "candle";
|
|
12
|
+
candles?: SharedValue<CandlePoint[]>;
|
|
13
|
+
liveCandle?: SharedValue<CandlePoint | null>;
|
|
14
|
+
candleWidthSecs: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Single-series crosshair + scrub. Use `useCrosshairSeries` for `LiveChartSeries`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useCrosshair(engine: SingleEngineState, padding: ChartPadding, _palette: LiveChartPalette, formatValue: (v: number) => string, formatTime: (t: number) => string, font: SkFont, enabled: boolean, onScrub?: (point: ScrubPoint | null) => void, candleOpts?: CrosshairCandleOpts): CrosshairState;
|
|
20
|
+
//# sourceMappingURL=useCrosshair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrosshair.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrosshair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,CAAC;AAEzB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAClC,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,EAC5C,UAAU,CAAC,EAAE,mBAAmB,GAC/B,cAAc,CAgMhB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
2
|
+
import { type ChartPadding } from "../draw/line";
|
|
3
|
+
import type { ScrubPointMulti } from "../types";
|
|
4
|
+
import { type CrosshairState } from "./crosshairShared";
|
|
5
|
+
/**
|
|
6
|
+
* LiveChartSeries crosshair + scrub. No tooltip — data is delivered via
|
|
7
|
+
* `onScrub` worklet callback on the UI thread.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrosshairSeries(engine: MultiEngineState, padding: ChartPadding, enabled: boolean, onScrub?: (point: ScrubPointMulti | null) => void): CrosshairState;
|
|
10
|
+
//# sourceMappingURL=useCrosshairSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCrosshairSeries.d.ts","sourceRoot":"","sources":["../../src/hooks/useCrosshairSeries.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,GAChD,cAAc,CAoIhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DerivedValue, type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ResolvedDegenConfig } from "../core/resolveConfig";
|
|
3
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
import type { DegenShakePayload, Momentum } from "../types";
|
|
5
|
+
export declare function useDegen(engine: SingleEngineState, dotX: SharedValue<number>, dotY: SharedValue<number>, momentumSV: SharedValue<Momentum>, cfg: ResolvedDegenConfig | null, onShake?: (payload: DegenShakePayload) => void): {
|
|
6
|
+
pack: SharedValue<Float64Array<ArrayBuffer>>;
|
|
7
|
+
packRevision: SharedValue<number>;
|
|
8
|
+
shakeTransform: DerivedValue<[
|
|
9
|
+
{
|
|
10
|
+
translateX: number;
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
translateY: number;
|
|
14
|
+
}
|
|
15
|
+
]>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useDegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDegen.d.ts","sourceRoot":"","sources":["../../src/hooks/useDegen.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE5D,wBAAgB,QAAQ,CACtB,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,EACjC,GAAG,EAAE,mBAAmB,GAAG,IAAI,EAC/B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAC7C;IACD,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,YAAY,CAC1B;QAAC;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;QAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;KAAC,CACjD,CAAC;CACH,CAyOA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { CandlePoint, LiveChartPoint } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Data presence for {@link LiveChart}: line mode needs ≥2 points;
|
|
5
|
+
* candle mode needs ≥2 committed candles (`liveCandle` alone does not count).
|
|
6
|
+
*
|
|
7
|
+
* {@link useChartReveal} seeds its first-paint state off `hasData` directly (in a
|
|
8
|
+
* layout effect), so no JS-thread snapshot is read during render here.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useLiveChartHasData({ isCandle, data, candles, }: {
|
|
11
|
+
isCandle: boolean;
|
|
12
|
+
data: SharedValue<LiveChartPoint[]>;
|
|
13
|
+
candles: SharedValue<CandlePoint[]> | undefined;
|
|
14
|
+
}): {
|
|
15
|
+
hasData: SharedValue<boolean>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useLiveChartHasData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveChartHasData.d.ts","sourceRoot":"","sources":["../../src/hooks/useLiveChartHasData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,IAAI,EACJ,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,CAAC;CACjD,GAAG;IACF,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/B,CAUA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
2
|
+
import type { ChartPadding } from "../draw/line";
|
|
3
|
+
/**
|
|
4
|
+
* Derive the live dot position (right edge of the chart, mapped to current value).
|
|
5
|
+
* Returns `{ dotX, dotY }` as shared values. Coordinates are set to `-100`
|
|
6
|
+
* (off-screen sentinel) when canvas dimensions are unavailable.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useLiveDot(engine: SingleEngineState, padding: ChartPadding): {
|
|
9
|
+
readonly dotX: import("react-native-reanimated").DerivedValue<number>;
|
|
10
|
+
readonly dotY: import("react-native-reanimated").DerivedValue<number>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useLiveDot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveDot.d.ts","sourceRoot":"","sources":["../../src/hooks/useLiveDot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY;;;EAqB1E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Gesture } from "react-native-gesture-handler";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
4
|
+
import type { ChartPadding } from "../draw/line";
|
|
5
|
+
import { type ProjectedMarker } from "../math/markers";
|
|
6
|
+
import type { LiveChartPoint, Marker, MarkerHoverEvent, SeriesConfig } from "../types";
|
|
7
|
+
/**
|
|
8
|
+
* Projects markers to screen positions each frame and builds a tap gesture that
|
|
9
|
+
* hit-tests against them, firing `onMarkerHover` (or `null` on a miss).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useMarkers(engine: ChartEngineLayout, padding: ChartPadding, markers: SharedValue<Marker[]>, active: boolean, hitRadius: number, onMarkerHover?: (event: MarkerHoverEvent | null) => void, seriesSV?: SharedValue<SeriesConfig[]>, lineData?: SharedValue<LiveChartPoint[]>): {
|
|
12
|
+
projected: SharedValue<ProjectedMarker[]>;
|
|
13
|
+
tapGesture: ReturnType<typeof Gesture.Tap>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useMarkers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkers.d.ts","sourceRoot":"","sources":["../../src/hooks/useMarkers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,EAC9B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,EACxD,QAAQ,CAAC,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,EACtC,QAAQ,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,GACvC;IAAE,SAAS,EAAE,WAAW,CAAC,eAAe,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CA8D3F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
export interface ModeBlendState {
|
|
3
|
+
/** 0 = fully line, 1 = fully candle */
|
|
4
|
+
modeBlend: SharedValue<number>;
|
|
5
|
+
/** line opacity = reveal.lineOpacity * (1 - modeBlend) */
|
|
6
|
+
lineGroupOpacity: SharedValue<number>;
|
|
7
|
+
/** candle opacity = reveal.lineOpacity * modeBlend */
|
|
8
|
+
candleGroupOpacity: SharedValue<number>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Animated crossfade between line and candle chart layers.
|
|
12
|
+
*
|
|
13
|
+
* `modeBlend` animates 0→1 when `isCandle` becomes true, 1→0 when false.
|
|
14
|
+
* The derived opacities multiply by `lineOpacity` from `useChartReveal`
|
|
15
|
+
* so the reveal and mode-switch animations compose correctly.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useModeBlend(isCandle: boolean, lineOpacity: SharedValue<number>): ModeBlendState;
|
|
18
|
+
//# sourceMappingURL=useModeBlend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModeBlend.d.ts","sourceRoot":"","sources":["../../src/hooks/useModeBlend.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,0DAA0D;IAC1D,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,sDAAsD;IACtD,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,OAAO,EACjB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,cAAc,CAqBhB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { Momentum, MomentumConfig } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the momentum prop to a detected or forced momentum value.
|
|
6
|
+
* - `true` = auto-detect from data with defaults
|
|
7
|
+
* - `false` = disabled, always 'flat'
|
|
8
|
+
* - `'up'` / `'down'` / `'flat'` = forced value
|
|
9
|
+
* - `MomentumConfig` = auto-detect with custom threshold/lookback
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveMomentumProp(prop: boolean | Momentum | MomentumConfig, data: readonly {
|
|
12
|
+
time: number;
|
|
13
|
+
value: number;
|
|
14
|
+
}[]): Momentum;
|
|
15
|
+
export declare function useMomentum(engine: SingleEngineState, momentumProp?: boolean | Momentum | MomentumConfig): SharedValue<Momentum>;
|
|
16
|
+
//# sourceMappingURL=useMomentum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMomentum.d.ts","sourceRoot":"","sources":["../../src/hooks/useMomentum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,EACzC,IAAI,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAC/C,QAAQ,CAYV;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,EACzB,YAAY,GAAE,OAAO,GAAG,QAAQ,GAAG,cAAqB,GACvD,WAAW,CAAC,QAAQ,CAAC,CAIvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type DerivedValue, type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ResolvedDegenConfig } from "../core/resolveConfig";
|
|
3
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
import type { ChartPadding } from "../draw/line";
|
|
5
|
+
import type { DegenShakePayload } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* Multi-series degen: **every** visible series sparks a burst off its own
|
|
8
|
+
* endpoint dot on an up-momentum swing — in that series' color (its particles
|
|
9
|
+
* carry the series index as their `colorIndex`) — plus one shared chart shake
|
|
10
|
+
* re-armed from the strongest swing each frame. Reuses the single-series
|
|
11
|
+
* particle/shake math (`math/degenTick`).
|
|
12
|
+
*/
|
|
13
|
+
export declare function useMultiSeriesDegen(engine: MultiEngineState, padding: ChartPadding, cfg: ResolvedDegenConfig | null, onShake?: (payload: DegenShakePayload) => void): {
|
|
14
|
+
pack: SharedValue<Float64Array<ArrayBuffer>>;
|
|
15
|
+
packRevision: SharedValue<number>;
|
|
16
|
+
shakeTransform: DerivedValue<[
|
|
17
|
+
{
|
|
18
|
+
translateX: number;
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
translateY: number;
|
|
22
|
+
}
|
|
23
|
+
]>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useMultiSeriesDegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMultiSeriesDegen.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultiSeriesDegen.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,mBAAmB,GAAG,IAAI,EAC/B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAC7C;IACD,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,YAAY,CAC1B;QAAC;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;QAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;KAAC,CACjD,CAAC;CACH,CAgOA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Skia } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
import { type ChartPadding } from "../draw/line";
|
|
5
|
+
/**
|
|
6
|
+
* One derived shared value holding up to `MAX_MULTI_SERIES` Skia paths (unused slots are empty paths).
|
|
7
|
+
*
|
|
8
|
+
* Each slot ping-pongs between two persistent `SkPath`s so `MultiSeriesStroke`'s
|
|
9
|
+
* per-slot `useDerivedValue(() => paths.value[index])` sees a fresh reference each
|
|
10
|
+
* tick (otherwise Reanimated's setter short-circuits and Skia never repaints).
|
|
11
|
+
* No new JSI-backed `SkPath` is allocated per frame. See {@link useChartPaths}
|
|
12
|
+
* for the memory rationale.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useMultiSeriesLinePaths(engine: MultiEngineState, padding: ChartPadding): SharedValue<ReturnType<typeof Skia.Path.Make>[]>;
|
|
15
|
+
//# sourceMappingURL=useMultiSeriesLinePaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMultiSeriesLinePaths.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultiSeriesLinePaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAGlE;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,YAAY,GACpB,WAAW,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAuDlD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
3
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
4
|
+
import type { ChartPadding } from "../draw/line";
|
|
5
|
+
import type { ReferenceLine } from "../types";
|
|
6
|
+
/** Screen-space geometry for one reference line / band, recomputed each frame. */
|
|
7
|
+
export interface ReferenceLineLayout {
|
|
8
|
+
visible: boolean;
|
|
9
|
+
/** Line y, or band top-edge y. */
|
|
10
|
+
y: number;
|
|
11
|
+
/** Band bottom-edge y (value/time band); equals `y` for a plain line. */
|
|
12
|
+
yBottom: number;
|
|
13
|
+
/** Left x extent. */
|
|
14
|
+
x1: number;
|
|
15
|
+
/** Right x extent. */
|
|
16
|
+
x2: number;
|
|
17
|
+
/** Resolved label text (with appended value when `showValue`). */
|
|
18
|
+
label: string;
|
|
19
|
+
labelX: number;
|
|
20
|
+
labelY: number;
|
|
21
|
+
/** True when a Form-A line is off-screen and its off-axis badge is showing. */
|
|
22
|
+
offAxis: boolean;
|
|
23
|
+
/** Off-axis chevron points up (target above range) vs down (below). */
|
|
24
|
+
chevronUp: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Derives screen-space layout for a single reference line or band. Supports all
|
|
28
|
+
* three `ReferenceLine` forms (horizontal line, horizontal value band, vertical
|
|
29
|
+
* time band) plus the off-axis badge for an off-screen Form-A value.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useReferenceLine(engine: ChartEngineLayout, padding: ChartPadding, line: ReferenceLine | undefined, formatValue: (v: number) => string, font: SkFont): SharedValue<ReferenceLineLayout>;
|
|
32
|
+
//# sourceMappingURL=useReferenceLine.d.ts.map
|
|
@@ -0,0 +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,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,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,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,SAAS,EAAE,OAAO,CAAC;CACpB;AAkBD;;;;GAIG;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,GACX,WAAW,CAAC,mBAAmB,CAAC,CAuJlC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { CandlePoint, LiveChartPoint, SeriesConfig } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* While `morphT` animates down after data clears, keep feeding the engine the
|
|
5
|
+
* last stashed line/candle snapshot.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSingleChartReverseMorphInputs({ isCandle, data, candles, liveCandle, hasData, morphT, }: {
|
|
8
|
+
isCandle: boolean;
|
|
9
|
+
data: SharedValue<LiveChartPoint[]>;
|
|
10
|
+
candles: SharedValue<CandlePoint[]> | undefined;
|
|
11
|
+
liveCandle: SharedValue<CandlePoint | null> | undefined;
|
|
12
|
+
hasData: SharedValue<boolean>;
|
|
13
|
+
morphT: SharedValue<number>;
|
|
14
|
+
}): {
|
|
15
|
+
lineEngineData: SharedValue<LiveChartPoint[]>;
|
|
16
|
+
candlesEngine: SharedValue<CandlePoint[]>;
|
|
17
|
+
liveEngine: SharedValue<CandlePoint | null>;
|
|
18
|
+
};
|
|
19
|
+
export declare function useMultiSeriesReverseMorphInputs({ series, hasData, morphT, }: {
|
|
20
|
+
series: SharedValue<SeriesConfig[]>;
|
|
21
|
+
hasData: SharedValue<boolean>;
|
|
22
|
+
morphT: SharedValue<number>;
|
|
23
|
+
}): SharedValue<SeriesConfig[]>;
|
|
24
|
+
//# sourceMappingURL=useReverseMorphEngineInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReverseMorphEngineInputs.d.ts","sourceRoot":"","sources":["../../src/hooks/useReverseMorphEngineInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI1E;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,CAAC;IAChD,UAAU,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACxD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC7B,GAAG;IACF,cAAc,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1C,UAAU,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC7C,CAwDA;AAYD,wBAAgB,gCAAgC,CAAC,EAC/C,MAAM,EACN,OAAO,EACP,MAAM,GACP,EAAE;IACD,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC7B,GAAG,WAAW,CAAC,YAAY,EAAE,CAAC,CA8C9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { SingleEngineState } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
import { type TradeMarker } from "../draw/trade";
|
|
5
|
+
import type { TradeEvent } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* Process live trade events into projected on-chart markers.
|
|
8
|
+
* Runs a frame callback that ticks the trade-stream state and produces
|
|
9
|
+
* `TradeMarker[]` positioned within the chart area.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTradeStream(engine: SingleEngineState, tradeStream: SharedValue<TradeEvent[]>, padding: ChartPadding, active: boolean): SharedValue<TradeMarker[]>;
|
|
12
|
+
//# sourceMappingURL=useTradeStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTradeStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useTradeStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,EACtC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,OAAO,GACd,WAAW,CAAC,WAAW,EAAE,CAAC,CAoC5B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
export interface XAxisEntry {
|
|
5
|
+
x: number;
|
|
6
|
+
label: string;
|
|
7
|
+
alpha: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build a fresh label cache that re-formats every tick's `text` with
|
|
11
|
+
* `formatTime`, preserving each entry's `alpha`. The cache (see {@link useXAxis})
|
|
12
|
+
* formats each tick once for allocation reasons; this refreshes it when the
|
|
13
|
+
* `formatTime` prop changes. Returns a NEW object (and new entry objects) rather
|
|
14
|
+
* than mutating `cache` in place — the cache is also read inside the derived
|
|
15
|
+
* value worklet, and mutating an already-serialized object from the JS thread
|
|
16
|
+
* is unsafe under Reanimated's worklet model. Replacing the SharedValue with a
|
|
17
|
+
* fresh object propagates cleanly to the UI thread.
|
|
18
|
+
*/
|
|
19
|
+
export declare function reformatXAxisLabels(cache: Record<number, {
|
|
20
|
+
alpha: number;
|
|
21
|
+
text: string;
|
|
22
|
+
}>, formatTime: (t: number) => string): Record<number, {
|
|
23
|
+
alpha: number;
|
|
24
|
+
text: string;
|
|
25
|
+
}>;
|
|
26
|
+
/** Insertion sort — worklet-safe, no callback functions. */
|
|
27
|
+
export declare function insertionSortByX(arr: XAxisEntry[]): void;
|
|
28
|
+
export declare function useXAxis(engine: ChartEngineLayout, padding: ChartPadding, formatTime: (t: number) => string, font: SkFont): {
|
|
29
|
+
xAxisEntries: import("react-native-reanimated").DerivedValue<XAxisEntry[]>;
|
|
30
|
+
font: SkFont;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useXAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useXAxis.d.ts","sourceRoot":"","sources":["../../src/hooks/useXAxis.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACtD,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAChC,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAMjD;AAUD,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,QAajD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EACjC,IAAI,EAAE,MAAM;;;EAmIb"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
/**
|
|
5
|
+
* Compute Y-axis grid entries (values + labels) with animated fade-in/out.
|
|
6
|
+
* Uses `computeGridEntries` to pick nice intervals and track label alpha for
|
|
7
|
+
* smooth transitions when the value range changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useYAxis(engine: ChartEngineLayout, padding: ChartPadding, formatValue: (v: number) => string, font: SkFont, minGap?: number): {
|
|
10
|
+
yAxisEntries: import("react-native-reanimated").DerivedValue<import("../draw/grid").YAxisEntry[]>;
|
|
11
|
+
font: SkFont;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useYAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useYAxis.d.ts","sourceRoot":"","sources":["../../src/hooks/useYAxis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAClC,IAAI,EAAE,MAAM,EACZ,MAAM,SAAK;;;EA6BZ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API — stable exports for `react-native-livechart` consumers.
|
|
3
|
+
*
|
|
4
|
+
* @remarks Conceptually inspired by [liveline](https://github.com/benjitaylor/liveline)
|
|
5
|
+
* (Benji Taylor) — live charts for React. This package is a separate React Native
|
|
6
|
+
* implementation on Skia and Reanimated, not a fork of the web library.
|
|
7
|
+
*/
|
|
8
|
+
import { LiveChart } from "./components/LiveChart";
|
|
9
|
+
import { LiveChartSeries } from "./components/LiveChartSeries";
|
|
10
|
+
import { LiveChartTransition } from "./components/LiveChartTransition";
|
|
11
|
+
export { LiveChart, LiveChartSeries, LiveChartTransition };
|
|
12
|
+
export type { LiveChartTransitionProps } from "./components/LiveChartTransition";
|
|
13
|
+
export { formatTime, formatValue } from "./lib/format";
|
|
14
|
+
export { MONO_FONT_FAMILY } from "./lib/monoFontFamily";
|
|
15
|
+
export { useDegen } from "./hooks/useDegen";
|
|
16
|
+
export { useTradeStream } from "./hooks/useTradeStream";
|
|
17
|
+
export type { BadgeConfig, BadgeVariant, CandlePoint, ChartInsets, DegenOptions, DegenShakePayload, FontConfig, FontWeight, GradientConfig, GridStyleConfig, LeftEdgeFadeConfig, LegendConfig, LegendStyle, LineConfig, LiveChartCoreProps, LiveChartPalette, LiveChartPoint, LiveChartProps, LiveChartSeriesProps, Marker, MarkerHoverEvent, MarkerKind, Momentum, MomentumConfig, MultiSeriesDotConfig, PulseConfig, ReferenceLine, ScrubConfig, ScrubPoint, ScrubPointCore, ScrubPointMulti, ScrubSeriesValue, SeriesConfig, ThemeMode, TradeEvent, ValueLineConfig, XAxisConfig, YAxisConfig, } from "./types";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,YAAY,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAwB7C;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO5C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
/**
|
|
3
|
+
* Horizontal layout width for `text` via Skia `measureText` (replaces deprecated `getTextWidth`).
|
|
4
|
+
* Marked worklet for use inside Reanimated `useDerivedValue`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function measureFontTextWidth(font: SkFont, text: string): number;
|
|
7
|
+
//# sourceMappingURL=measureFontTextWidth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measureFontTextWidth.d.ts","sourceRoot":"","sources":["../../src/lib/measureFontTextWidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monoFontFamily.d.ts","sourceRoot":"","sources":["../../src/lib/monoFontFamily.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAC2C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Parse hex color (#rgb or #rrggbb) to [r, g, b]. Worklet-safe (no regex). */
|
|
2
|
+
export declare function hexToRgb(hex: string): [number, number, number];
|
|
3
|
+
/** Interpolate between two RGB triples. Returns `rgb(r,g,b)` string. */
|
|
4
|
+
export declare function lerpColor(a: [number, number, number], b: [number, number, number], t: number): string;
|
|
5
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/math/color.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAgB9D;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CACvB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3B,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3B,CAAC,EAAE,MAAM,GACR,MAAM,CAMR"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Deterministic pseudo-random hash for reproducible particle variation. */
|
|
2
|
+
export declare function hash(a: number, b: number): number;
|
|
3
|
+
export interface SpawnParams {
|
|
4
|
+
/** Origin x — center of the burst (px). */
|
|
5
|
+
ox: number;
|
|
6
|
+
/** Origin y — center of the burst (px). */
|
|
7
|
+
oy: number;
|
|
8
|
+
/** Scale multiplier applied to speed and size. */
|
|
9
|
+
sc: number;
|
|
10
|
+
/** Number of particles to spawn in this burst. */
|
|
11
|
+
burst: number;
|
|
12
|
+
/** Central emission angle (radians). */
|
|
13
|
+
baseAngle: number;
|
|
14
|
+
/** Angular spread around `baseAngle` (radians). */
|
|
15
|
+
spread: number;
|
|
16
|
+
/** Horizontal position jitter (±half, px). */
|
|
17
|
+
jx: number;
|
|
18
|
+
/** Vertical position jitter (±half, px). */
|
|
19
|
+
jy: number;
|
|
20
|
+
/** Minimum initial speed (px/s, before `sc`). */
|
|
21
|
+
sMin: number;
|
|
22
|
+
/** Maximum initial speed (px/s, before `sc`). */
|
|
23
|
+
sMax: number;
|
|
24
|
+
/** Minimum particle radius (px, before `sc`). */
|
|
25
|
+
szMin: number;
|
|
26
|
+
/** Maximum particle radius (px, before `sc`). */
|
|
27
|
+
szMax: number;
|
|
28
|
+
/** Current timestamp (seconds). */
|
|
29
|
+
now: number;
|
|
30
|
+
/** Ring-buffer rotation index for slot allocation. */
|
|
31
|
+
baseRot: number;
|
|
32
|
+
/** Total number of slots in the ring buffer. */
|
|
33
|
+
slots: number;
|
|
34
|
+
/**
|
|
35
|
+
* Color list index written to every particle in this burst. Use a fixed value
|
|
36
|
+
* (e.g. a series index) to color the whole burst uniformly, or `-1` to cycle
|
|
37
|
+
* the renderer's color list per particle (the particle's loop index is stored).
|
|
38
|
+
* Defaults to `-1`.
|
|
39
|
+
*/
|
|
40
|
+
colorIndex?: number;
|
|
41
|
+
}
|
|
42
|
+
/** Write `p.burst` particles into the ring buffer starting at `p.baseRot`. Returns the next rotation index. */
|
|
43
|
+
export declare function spawnBurst(buf: Float64Array, p: SpawnParams): number;
|
|
44
|
+
export interface ShakeResult {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
active: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Compute screen-shake displacement with exponential decay envelope. */
|
|
50
|
+
export declare function computeShake(elapsed: number, dur: number, sc: number, sint: number): ShakeResult;
|
|
51
|
+
/**
|
|
52
|
+
* Advance all particles by `dtSec`: apply velocity, drag, and expire particles older than `burstDur`.
|
|
53
|
+
* Returns the number of particles still alive after the tick, so callers can skip per-frame
|
|
54
|
+
* repaint work (bumping `packRevision`) when the field is empty.
|
|
55
|
+
*/
|
|
56
|
+
export declare function tickParticles(buf: Float64Array, slots: number, now: number, burstDur: number, drag: number, dtSec: number): number;
|
|
57
|
+
//# sourceMappingURL=degenTick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"degenTick.d.ts","sourceRoot":"","sources":["../../src/math/degenTick.ts"],"names":[],"mappings":"AAqBA,4EAA4E;AAC5E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+GAA+G;AAC/G,wBAAgB,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAuBpE;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,WAAW,CAWb;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,CAmBR"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LiveChartPoint } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Binary search to find interpolated value at a given time.
|
|
4
|
+
* Returns null if time is outside data range.
|
|
5
|
+
*/
|
|
6
|
+
export declare function interpolateAtTime(points: LiveChartPoint[], time: number): number | null;
|
|
7
|
+
//# sourceMappingURL=interpolate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/math/interpolate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EAAE,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAsBf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intervals.d.ts","sourceRoot":"","sources":["../../src/math/intervals.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAe3D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-rate-independent exponential lerp.
|
|
3
|
+
* `speed` is the fraction approached per frame at 60fps.
|
|
4
|
+
* At lower frame rates, dt is larger so we approach more per frame.
|
|
5
|
+
*/
|
|
6
|
+
export declare function lerp(current: number, target: number, speed: number, dt?: number): number;
|
|
7
|
+
//# sourceMappingURL=lerp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lerp.d.ts","sourceRoot":"","sources":["../../src/math/lerp.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,EAAE,SAAqB,GACtB,MAAM,CAIR"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LiveChartPoint, Marker, SeriesConfig } from "../types";
|
|
2
|
+
/** Screen-space position for one marker, index-aligned with the marker array. */
|
|
3
|
+
export interface ProjectedMarker {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ProjectMarkersOpts {
|
|
9
|
+
canvasWidth: number;
|
|
10
|
+
canvasHeight: number;
|
|
11
|
+
padTop: number;
|
|
12
|
+
padBottom: number;
|
|
13
|
+
padLeft: number;
|
|
14
|
+
padRight: number;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
displayWindow: number;
|
|
17
|
+
displayMin: number;
|
|
18
|
+
displayMax: number;
|
|
19
|
+
/** Multi-series data, used to anchor markers by `seriesId`. */
|
|
20
|
+
series?: SeriesConfig[];
|
|
21
|
+
/** Single-series line data; anchors markers that omit `value` (and `seriesId`). */
|
|
22
|
+
lineData?: LiveChartPoint[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Project markers to screen positions, mutating `out` in place (reused buffer).
|
|
26
|
+
* y comes from `value` (absolute) or, failing that, from interpolating the
|
|
27
|
+
* `seriesId` series' data at the marker's time. Returns `out`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function projectMarkers(markers: Marker[], out: ProjectedMarker[], opts: ProjectMarkersOpts): ProjectedMarker[];
|
|
30
|
+
/**
|
|
31
|
+
* Project a single marker by its anchor fields, returning a fresh
|
|
32
|
+
* `ProjectedMarker`. Used per-glyph at render so each glyph owns its position
|
|
33
|
+
* (no shared index buffer → no flicker when the marker array reorders).
|
|
34
|
+
*/
|
|
35
|
+
export declare function projectPoint(time: number, value: number | undefined, seriesId: string | undefined, opts: ProjectMarkersOpts): ProjectedMarker;
|
|
36
|
+
/** Stable signature over marker id / kind / color / icon / size / image-presence
|
|
37
|
+
* (snapshot sync, not per-tick). */
|
|
38
|
+
export declare function markersSignature(markers: Marker[]): string;
|
|
39
|
+
/**
|
|
40
|
+
* Index of the nearest visible marker within `radius` px of `(x, y)`, or `-1`.
|
|
41
|
+
* Ties resolve to the later index (drawn on top).
|
|
42
|
+
*/
|
|
43
|
+
export declare function nearestMarkerIndex(positions: ProjectedMarker[], x: number, y: number, radius: number): number;
|
|
44
|
+
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -0,0 +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;AAGrE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,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;CAC7B;AAsED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,EAAE,eAAe,EAAE,EACtB,IAAI,EAAE,kBAAkB,GACvB,eAAe,EAAE,CAanB;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,CAKjB;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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LiveChartPoint, Momentum } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-detect momentum from recent data points.
|
|
4
|
+
* Uses the full lookback window for threshold calculation
|
|
5
|
+
* but only the last 5 points for active velocity.
|
|
6
|
+
*/
|
|
7
|
+
export declare function detectMomentum(points: LiveChartPoint[], lookback?: number, threshold?: number): Momentum;
|
|
8
|
+
//# sourceMappingURL=momentum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"momentum.d.ts","sourceRoot":"","sources":["../../src/math/momentum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EAAE,EACxB,QAAQ,SAAK,EACb,SAAS,SAAO,GACf,QAAQ,CA0BV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CandlePoint } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Find the candle whose time bucket contains `time`.
|
|
4
|
+
* Each candle spans [candle.time, candle.time + candleWidthSecs).
|
|
5
|
+
* Includes the live candle if it overlaps. Returns null if no match.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pickCandleAtTime(candles: CandlePoint[], liveCandle: CandlePoint | null, time: number, candleWidthSecs: number): CandlePoint | null;
|
|
8
|
+
//# sourceMappingURL=pickCandle.d.ts.map
|