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
package/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 brandtnew labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Third-party software
|
|
26
|
+
|
|
27
|
+
This project includes math utilities adapted from liveline (MIT), Copyright (c)
|
|
28
|
+
Benji Taylor. See: <https://github.com/benjitaylor/liveline>
|
|
29
|
+
|
|
30
|
+
The React Native chart implementation in this repository (Skia rendering,
|
|
31
|
+
Reanimated engine, Gesture Handler interactions, and component/hook structure)
|
|
32
|
+
is original work, inspired by the design and behavior of liveline; it is not a
|
|
33
|
+
derivative copy of liveline’s source code beyond the attributed math utilities.
|
package/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/brandtnewlabs/react-native-livechart/main/assets/images/logo.png" alt="react-native-livechart" width="84" height="84" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# react-native-livechart
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/react-native-livechart)
|
|
8
|
+
[](https://github.com/brandtnewlabs/react-native-livechart/actions/workflows/test.yml)
|
|
9
|
+
[](https://github.com/brandtnewlabs/react-native-livechart/blob/main/LICENSE)
|
|
10
|
+
[](https://react-native-livechart.brandtnewlabs.com)
|
|
11
|
+
|
|
12
|
+
High-performance **live** line and candlestick charts for React Native, built on **[@shopify/react-native-skia](https://shopify.github.io/react-native-skia/)**, **[react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/)**, and **[react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/)**. Data and live values flow through Reanimated `SharedValue`s, so the UI thread animates without per-frame JS bridge traffic.
|
|
13
|
+
|
|
14
|
+
📖 **[Documentation →](https://react-native-livechart.brandtnewlabs.com)**
|
|
15
|
+
|
|
16
|
+
<!-- TODO(hero): replace this comment with a demo GIF/screenshot, e.g.:
|
|
17
|
+
<p align="center"><img src="https://raw.githubusercontent.com/brandtnewlabs/react-native-livechart/main/assets/images/demo.gif" alt="react-native-livechart demo" width="320" /></p>
|
|
18
|
+
Capture from the Expo example app (npm start). -->
|
|
19
|
+
|
|
20
|
+
> The design, feature set, and API shape are **conceptually inspired by [liveline](https://github.com/benjitaylor/liveline)** — Benji Taylor's real-time canvas chart for React — reimagined for React Native. This is **not** a fork; see [Acknowledgments](#acknowledgments).
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- 📈 **Line & candlestick** modes (with line/candle morph) in a single component
|
|
25
|
+
- 🧬 **Multi-series** charts with a toggleable legend and per-series live dots
|
|
26
|
+
- 🔍 **Scrubbing** with a crosshair and worklet-friendly `onScrub` payloads
|
|
27
|
+
- ⚡ **Momentum** detection and **degen** effects (particle bursts + shake on big swings)
|
|
28
|
+
- 🏷️ **Trade markers** driven by a `SharedValue` trade stream
|
|
29
|
+
- 🎨 **Theming** with light/dark modes and an accent-driven palette
|
|
30
|
+
- ⏳ **Loading** (breathing-line shell) and **paused** states out of the box
|
|
31
|
+
- 🧵 **SharedValue-driven** rendering — history and live values stay on the UI thread
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install react-native-livechart
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Peer dependencies
|
|
40
|
+
|
|
41
|
+
Install the library's **peer dependencies** in your app (versions should match your React Native / Expo SDK):
|
|
42
|
+
|
|
43
|
+
| Peer | Role |
|
|
44
|
+
| ------------------------------ | ----------------------------------- |
|
|
45
|
+
| `react` | UI |
|
|
46
|
+
| `react-native` | Host |
|
|
47
|
+
| `@shopify/react-native-skia` | Canvas rendering |
|
|
48
|
+
| `react-native-reanimated` | Shared values, animations, worklets |
|
|
49
|
+
| `react-native-worklets` | Required by Reanimated 4+ |
|
|
50
|
+
| `react-native-gesture-handler` | Pan / scrub gestures |
|
|
51
|
+
|
|
52
|
+
Follow the Skia, Reanimated, and Gesture Handler install docs for your toolchain (Babel plugin, `GestureHandlerRootView`, etc.).
|
|
53
|
+
|
|
54
|
+
### Babel (required)
|
|
55
|
+
|
|
56
|
+
The package ships **TypeScript source**; your app's bundler compiles it with the same stack as a typical **Expo / Reanimated 4** project. In practice that means:
|
|
57
|
+
|
|
58
|
+
- **`babel-preset-expo`** (or an equivalent that includes Reanimated's Babel plugin), and
|
|
59
|
+
- **`react-native-worklets/plugin`** — keep it **last** in the `plugins` array, matching this repo's root [`babel.config.js`](https://github.com/brandtnewlabs/react-native-livechart/blob/main/babel.config.js).
|
|
60
|
+
|
|
61
|
+
If you omit Worklets or reorder plugins, worklets in the chart may fail at build or runtime.
|
|
62
|
+
|
|
63
|
+
### Metro / `package.json` exports
|
|
64
|
+
|
|
65
|
+
From **Expo SDK 53+**, Metro resolves `import` using `package.json` **`exports`**, including the **`react-native`** condition (see [Expo Metro: ES Module resolution](https://docs.expo.dev/versions/latest/config/metro/#es-module-resolution)). This library's runtime entry is **`src/index.ts`** under that condition. If you disabled package exports (`unstable_enablePackageExports: false`), align your resolver or re-enable exports so resolution matches the published map.
|
|
66
|
+
|
|
67
|
+
## Quick start
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { useEffect } from "react";
|
|
71
|
+
import { View } from "react-native";
|
|
72
|
+
import { useSharedValue } from "react-native-reanimated";
|
|
73
|
+
import { LiveChart, type LiveChartPoint } from "react-native-livechart";
|
|
74
|
+
|
|
75
|
+
function LivePrice() {
|
|
76
|
+
const data = useSharedValue<LiveChartPoint[]>([]);
|
|
77
|
+
const value = useSharedValue(100);
|
|
78
|
+
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const id = setInterval(() => {
|
|
81
|
+
const next = value.get() + (Math.random() - 0.5) * 2;
|
|
82
|
+
// Reanimated 4: append in place on the UI thread + set the scalar — never `data.value = ...`
|
|
83
|
+
data.modify((arr) => {
|
|
84
|
+
"worklet";
|
|
85
|
+
arr.push({ time: Date.now() / 1000, value: next });
|
|
86
|
+
if (arr.length > 600) arr.shift();
|
|
87
|
+
return arr;
|
|
88
|
+
});
|
|
89
|
+
value.set(next);
|
|
90
|
+
}, 100);
|
|
91
|
+
return () => clearInterval(id);
|
|
92
|
+
}, [data, value]);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<View style={{ height: 240 }}>
|
|
96
|
+
<LiveChart data={data} value={value} accentColor="#3323E6" />
|
|
97
|
+
</View>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Candlestick mode is a prop away:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<LiveChart data={data} value={value} mode="candle" />
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Multi-series with a legend:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { LiveChartSeries, type SeriesConfig } from "react-native-livechart";
|
|
112
|
+
|
|
113
|
+
const series = useSharedValue<SeriesConfig[]>([
|
|
114
|
+
{ id: "btc", label: "BTC", color: "#f7931a", data: [], value: 0 },
|
|
115
|
+
{ id: "eth", label: "ETH", color: "#627eea", data: [], value: 0 },
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
<LiveChartSeries series={series} legend dot />;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## API overview
|
|
122
|
+
|
|
123
|
+
The tables below are a **highlight** — the **canonical, full reference is the TypeScript types and JSDoc** shipped in the source (your editor surfaces them on hover and autocomplete).
|
|
124
|
+
|
|
125
|
+
### `LiveChart` (single series)
|
|
126
|
+
|
|
127
|
+
| Prop | Description |
|
|
128
|
+
| ---------------------------------------- | ------------------------------------------------------------------- |
|
|
129
|
+
| `data` | `SharedValue<LiveChartPoint[]>` — history |
|
|
130
|
+
| `value` | `SharedValue<number>` — live value for interpolation |
|
|
131
|
+
| `theme` | `"light"` or `"dark"` |
|
|
132
|
+
| `accentColor` | Primary accent; palette is derived from it |
|
|
133
|
+
| `timeWindow` | Visible window in seconds (default `30`) |
|
|
134
|
+
| `paused` | Freeze scrolling |
|
|
135
|
+
| `loading` | Breathing-line shell until data is ready |
|
|
136
|
+
| `mode` | `"line"` (default) or `"candle"` |
|
|
137
|
+
| `candles` / `liveCandle` / `candleWidth` | Candlestick mode |
|
|
138
|
+
| `tradeStream` | `SharedValue<TradeEvent[]>` for trade markers |
|
|
139
|
+
| `degen` | Particle burst + shake on momentum swings |
|
|
140
|
+
| `scrub` | Crosshair scrubbing |
|
|
141
|
+
| `momentum` | `true` / `false` / `"up"`, `"down"`, or `"flat"` / `MomentumConfig` |
|
|
142
|
+
| `onScrub` | Callback: `ScrubPoint` or `null` |
|
|
143
|
+
|
|
144
|
+
### `LiveChartSeries` (multi-series)
|
|
145
|
+
|
|
146
|
+
| Prop | Description |
|
|
147
|
+
| ---------------- | ------------------------------------------- |
|
|
148
|
+
| `series` | `SharedValue<SeriesConfig[]>` |
|
|
149
|
+
| `legend` | Toggle chips / compact legend |
|
|
150
|
+
| `dot` | Per-series live dots, pulse, value lines |
|
|
151
|
+
| `onSeriesToggle` | Chip tap |
|
|
152
|
+
| `onScrub` | Worklet-friendly multi-series scrub payload |
|
|
153
|
+
|
|
154
|
+
These tables are a **highlight, not the full surface** (`LiveChart` alone has ~48 props). Other shared props include `font`, `insets`, `smoothing`, `xAxis`, `yAxis`, `referenceLines`, `gridStyle`, `palette`, `markers`, `leftEdgeFade`, `line`, `formatValue`, `formatTime`, and `emptyText`; single-series adds `gradient`, `badge`, `pulse`, `valueLine`, and `showValue`. See the TypeScript types and JSDoc for the complete, canonical reference.
|
|
155
|
+
|
|
156
|
+
## Examples (Expo app in this repo)
|
|
157
|
+
|
|
158
|
+
Run the example from the repository root:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm install
|
|
162
|
+
npm start
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The example app bundles the library from **`src/`**; Metro's [`watchFolders`](https://github.com/brandtnewlabs/react-native-livechart/blob/main/metro.config.js) include the package so Fast Refresh sees edits without a separate library bundler. Optionally run **`npm run build:lib:types:watch`** if you want **`dist/*.d.ts`** regenerated continuously for editor/tsconfig consumers.
|
|
166
|
+
|
|
167
|
+
Screens demonstrate candlestick mode, multi-series, scrub, momentum tuning, degen mode, loading / paused states, and more.
|
|
168
|
+
|
|
169
|
+
## How it works
|
|
170
|
+
|
|
171
|
+
- **Skia** draws grid, line, candles, badges, and overlays on the GPU.
|
|
172
|
+
- **Reanimated** owns timeline layout, smoothing, and scrub state; hooks feed a small engine API on the UI thread.
|
|
173
|
+
- **Gesture Handler** drives scrubbing and chart interactions.
|
|
174
|
+
|
|
175
|
+
A frame-callback engine (`useFrameCallback`) runs a pure tick function on the UI thread each frame, updating display range, time window, and smoothed values, then writing results to `SharedValue`s. Path builders and overlays read those `SharedValue`s inside `useDerivedValue`, so React re-renders stay minimal.
|
|
176
|
+
|
|
177
|
+
## Contributing
|
|
178
|
+
|
|
179
|
+
Contributions are welcome — see [CONTRIBUTING.md](https://github.com/brandtnewlabs/react-native-livechart/blob/main/CONTRIBUTING.md) for the dev setup, the `npm run verify` gate, and the worklets-plugin rule. By participating you agree to the [Code of Conduct](https://github.com/brandtnewlabs/react-native-livechart/blob/main/CODE_OF_CONDUCT.md).
|
|
180
|
+
|
|
181
|
+
## Acknowledgments
|
|
182
|
+
|
|
183
|
+
**[liveline](https://github.com/benjitaylor/liveline)** by **Benji Taylor** (MIT) is the **primary inspiration** for this project: live updating charts, line and candlestick modes (including line/candle morph ideas), multi-series behavior, momentum and degen effects, scrubbing, loading and paused states, theme plus accent-driven palettes, and the overall prop vocabulary — even though names differ here (for example `accentColor` vs `color`, `timeWindow` vs `window`, and `SharedValue` streams instead of React state).
|
|
184
|
+
|
|
185
|
+
This package is a **React Native reimplementation** using **Skia**, **Reanimated**, and **Gesture Handler**. It is **not** the web canvas component ported line-for-line. The codebase **diverged** over time toward more hooks, layout options, and customizability for mobile.
|
|
186
|
+
|
|
187
|
+
**Third-party / adapted code:** math utilities used for chart geometry and smoothing (including Fritsch–Carlson monotone spline tangents, momentum detection, range/lerp helpers, and related pieces) are **adapted from liveline** under the MIT license. See the [LICENSE](https://github.com/brandtnewlabs/react-native-livechart/blob/main/LICENSE) file for the formal notice.
|
|
188
|
+
|
|
189
|
+
### Compared to liveline
|
|
190
|
+
|
|
191
|
+
- **Rendering:** liveline uses a DOM `<canvas>` and `requestAnimationFrame`; this library uses **Skia** on the UI thread.
|
|
192
|
+
- **Data flow:** liveline takes plain `data` / `value` props; here history and live values are **`SharedValue`s** so worklets avoid per-frame JS bridge work.
|
|
193
|
+
- **Input:** scrubbing uses **pan gestures** instead of canvas hover.
|
|
194
|
+
- **Scope:** liveline includes features this repo does not (for example **orderbook** visualization and built-in time-window controls); this repo adds **React Native–specific** pieces (for example trade markers via `tradeStream`) and a more decomposed hook API.
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT — see [LICENSE](https://github.com/brandtnewlabs/react-native-livechart/blob/main/LICENSE).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
interface LabelEntry {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
label: string;
|
|
7
|
+
alpha: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A single pre-allocated text label driven by a shared value array.
|
|
11
|
+
* Reads the entry at `index` — positioned off-screen when the index
|
|
12
|
+
* exceeds the array length.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AnimatedLabel({ entries, index, font, color, }: {
|
|
15
|
+
entries: SharedValue<LabelEntry[]>;
|
|
16
|
+
index: number;
|
|
17
|
+
font: SkFont;
|
|
18
|
+
color: string;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=AnimatedLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedLabel.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,UAAU,UAAU;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,GACN,EAAE;IACD,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,2CAWA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SkFont, type SkPath } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
interface BadgeData {
|
|
4
|
+
path: SkPath;
|
|
5
|
+
textX: number;
|
|
6
|
+
textY: number;
|
|
7
|
+
text: string;
|
|
8
|
+
bgColor: string;
|
|
9
|
+
textColor: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function BadgeOverlay({ badge, font, }: {
|
|
12
|
+
badge: SharedValue<BadgeData>;
|
|
13
|
+
font: SkFont;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=BadgeOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeOverlay.d.ts","sourceRoot":"","sources":["../../src/components/BadgeOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,GACL,EAAE;IACD,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd,2CAcA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import { type ChartPadding } from "../draw/line";
|
|
3
|
+
import type { LiveChartPalette } from "../types";
|
|
4
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
5
|
+
/**
|
|
6
|
+
* Crosshair vertical line + dim region to the right. No tooltip pill —
|
|
7
|
+
* multi-series delivers scrub data via `onScrub` / `onScrubWorklet` callbacks.
|
|
8
|
+
*/
|
|
9
|
+
export declare function CrosshairLine({ scrubX, crosshairOpacity, engine, padding, palette, dimOpacity, crosshairLineColor, crosshairDimColor, }: {
|
|
10
|
+
scrubX: SharedValue<number>;
|
|
11
|
+
crosshairOpacity: SharedValue<number>;
|
|
12
|
+
engine: ChartEngineLayout;
|
|
13
|
+
padding: ChartPadding;
|
|
14
|
+
palette: LiveChartPalette;
|
|
15
|
+
/** Opacity of content right of the crosshair (dstOut fade). Default 0.3. */
|
|
16
|
+
dimOpacity?: number;
|
|
17
|
+
crosshairLineColor?: string;
|
|
18
|
+
crosshairDimColor?: string;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=CrosshairLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrosshairLine.d.ts","sourceRoot":"","sources":["../../src/components/CrosshairLine.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,2CA4DA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
4
|
+
import { type ChartPadding } from "../draw/line";
|
|
5
|
+
import { type TooltipLayout } from "../hooks/crosshairShared";
|
|
6
|
+
import type { LiveChartPalette } from "../types";
|
|
7
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
8
|
+
export declare function CrosshairOverlay({ scrubX, crosshairOpacity, tooltipLayout, engine, padding, palette, font, showTooltip, children, dimOpacity, crosshairLineColor, crosshairDimColor, tooltipBackground, tooltipColor, tooltipBorderColor, }: {
|
|
9
|
+
scrubX: SharedValue<number>;
|
|
10
|
+
crosshairOpacity: SharedValue<number>;
|
|
11
|
+
tooltipLayout: SharedValue<TooltipLayout>;
|
|
12
|
+
engine: ChartEngineLayout;
|
|
13
|
+
padding: ChartPadding;
|
|
14
|
+
palette: LiveChartPalette;
|
|
15
|
+
font: SkFont;
|
|
16
|
+
showTooltip?: boolean;
|
|
17
|
+
/** Optional custom tooltip body rendered in place of the default value/time
|
|
18
|
+
* text (e.g. the multi-line candle stack). Passed as children so it composes
|
|
19
|
+
* instead of being threaded through as a JSX-valued prop. */
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
/** Opacity of content right of the crosshair (dstOut fade). Default 0.3. */
|
|
22
|
+
dimOpacity?: number;
|
|
23
|
+
crosshairLineColor?: string;
|
|
24
|
+
crosshairDimColor?: string;
|
|
25
|
+
tooltipBackground?: string;
|
|
26
|
+
tooltipColor?: string;
|
|
27
|
+
tooltipBorderColor?: string;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=CrosshairOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrosshairOverlay.d.ts","sourceRoot":"","sources":["../../src/components/CrosshairOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,WAAkB,EAClB,QAAQ,EACR,UAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,EAAE;IACD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;kEAE8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAoHA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { LiveChartPalette } from "../types";
|
|
3
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
4
|
+
type DegenPack = SharedValue<Float64Array<ArrayBuffer>>;
|
|
5
|
+
export declare function DegenParticlesOverlay({ pack, packRevision, engine, palette, particleSlotCount, particleBurstDurationSec, particleOpacity, colors, }: {
|
|
6
|
+
pack: DegenPack;
|
|
7
|
+
packRevision: SharedValue<number>;
|
|
8
|
+
engine: ChartEngineLayout;
|
|
9
|
+
palette: LiveChartPalette;
|
|
10
|
+
particleSlotCount: number;
|
|
11
|
+
particleBurstDurationSec: number;
|
|
12
|
+
particleOpacity: number;
|
|
13
|
+
colors: string[] | null;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=DegenParticlesOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DegenParticlesOverlay.d.ts","sourceRoot":"","sources":["../../src/components/DegenParticlesOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,KAAK,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;AA0FxD,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,MAAM,GACP,EAAE;IACD,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzB,2CA0BA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ResolvedPulseConfig } from "../core/resolveConfig";
|
|
3
|
+
import type { LiveChartPalette } from "../types";
|
|
4
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
5
|
+
/**
|
|
6
|
+
* Live dot + expanding pulse ring. Peak ring size uses `pulse.maxRadius` and
|
|
7
|
+
* `pulse.strokeWidth`; chart padding reserves the same outer extent via
|
|
8
|
+
* `pulseRadialOutset` in `draw/line.ts` (see `resolveChartLayout`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function DotOverlay({ dotX, dotY, palette, engine, pulse, }: {
|
|
11
|
+
dotX: SharedValue<number>;
|
|
12
|
+
dotY: SharedValue<number>;
|
|
13
|
+
palette: LiveChartPalette;
|
|
14
|
+
engine: ChartEngineLayout;
|
|
15
|
+
pulse: ResolvedPulseConfig | null;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=DotOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DotOverlay.d.ts","sourceRoot":"","sources":["../../src/components/DotOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAK,GACN,EAAE;IACD,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACnC,2CAyCA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
2
|
+
export declare function LeftEdgeFade({ paddingLeft, fadeWidth, startColor, endColor, engine, }: {
|
|
3
|
+
paddingLeft: number;
|
|
4
|
+
fadeWidth: number;
|
|
5
|
+
startColor: string;
|
|
6
|
+
endColor: string;
|
|
7
|
+
engine: ChartEngineLayout;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=LeftEdgeFade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeftEdgeFade.d.ts","sourceRoot":"","sources":["../../src/components/LeftEdgeFade.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,wBAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,2CAkBA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveChart.d.ts","sourceRoot":"","sources":["../../src/components/LiveChart.tsx"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AAwsBnE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA4C9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveChartSeries.d.ts","sourceRoot":"","sources":["../../src/components/LiveChartSeries.tsx"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,oBAAoB,EAAwB,MAAM,UAAU,CAAC;AAud3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CA4E1D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ViewStyle } from "react-native";
|
|
3
|
+
export interface LiveChartTransitionProps {
|
|
4
|
+
/** Key of the active child to show. Must match a child's `key`. */
|
|
5
|
+
active: string;
|
|
6
|
+
/** Chart elements, each with a unique `key`. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Cross-fade duration in ms. Default `300`. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Keep every child mounted for the lifetime of the transition (only the
|
|
12
|
+
* opacity animates). Each chart's engine then settles its y-range once, up
|
|
13
|
+
* front, so switching is a pure cross-fade with no reveal/range re-animation.
|
|
14
|
+
* Costs more (all engines run continuously). Default `false` (mount the
|
|
15
|
+
* active child + unmount the outgoing one after the fade).
|
|
16
|
+
*/
|
|
17
|
+
keepMounted?: boolean;
|
|
18
|
+
/** Container style. */
|
|
19
|
+
style?: ViewStyle;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Cross-fades between chart instances by `key` (e.g. line ↔ candle). Mounts the
|
|
23
|
+
* active child plus any outgoing child still fading out; unmounts the outgoing
|
|
24
|
+
* child once the fade completes. RN/Reanimated analogue of liveline's
|
|
25
|
+
* `LivelineTransition`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function LiveChartTransition({ active, children, duration, keepMounted, style, }: LiveChartTransitionProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=LiveChartTransition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveChartTransition.d.ts","sourceRoot":"","sources":["../../src/components/LiveChartTransition.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AACf,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAOhE,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAgDD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,QAAc,EACd,WAAmB,EACnB,KAAK,GACN,EAAE,wBAAwB,2CAsC1B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import { type ChartPadding } from "../draw/line";
|
|
4
|
+
import type { LiveChartPalette } from "../types";
|
|
5
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
6
|
+
export declare function LoadingOverlay({ engine, padding, palette, font, morphT, isLoading, isEmpty, emptyText, strokeWidth, badge, badgeTail, }: {
|
|
7
|
+
engine: ChartEngineLayout;
|
|
8
|
+
padding: ChartPadding;
|
|
9
|
+
palette: LiveChartPalette;
|
|
10
|
+
font: SkFont;
|
|
11
|
+
morphT: SharedValue<number>;
|
|
12
|
+
isLoading: SharedValue<boolean>;
|
|
13
|
+
/** Derived or shared; only `.value` is read on the UI thread. */
|
|
14
|
+
isEmpty: SharedValue<boolean> | {
|
|
15
|
+
value: boolean;
|
|
16
|
+
};
|
|
17
|
+
emptyText: string;
|
|
18
|
+
strokeWidth: number;
|
|
19
|
+
/** Mirror the badge prop so labels align with GridOverlay's label positions. */
|
|
20
|
+
badge?: boolean;
|
|
21
|
+
/** Whether the badge tail spike is shown; affects the left inset used for skeleton alignment. */
|
|
22
|
+
badgeTail?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=LoadingOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingOverlay.d.ts","sourceRoot":"","sources":["../../src/components/LoadingOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,MAAM,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO5E,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAkBpE,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,EACT,WAAW,EACX,KAAa,EACb,SAAgB,GACjB,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,iEAAiE;IACjE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iGAAiG;IACjG,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,2CAkOA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
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 { LiveChartPalette, LiveChartPoint, Marker, SeriesConfig } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* Renders the `markers` SharedValue as canvas glyphs. Marker metadata is
|
|
8
|
+
* mirrored into React state when it changes; each glyph projects its own
|
|
9
|
+
* position every frame (keyed by id), so adding/removing markers never makes a
|
|
10
|
+
* surviving glyph flash another marker's position.
|
|
11
|
+
*
|
|
12
|
+
* Glyph precedence per marker: `image` → `icon` (text) → built-in `kind` shape.
|
|
13
|
+
*/
|
|
14
|
+
export declare function MarkerOverlay({ markers, engine, padding, palette, font, series, lineData, }: {
|
|
15
|
+
markers: SharedValue<Marker[]>;
|
|
16
|
+
engine: ChartEngineLayout;
|
|
17
|
+
padding: ChartPadding;
|
|
18
|
+
palette: LiveChartPalette;
|
|
19
|
+
font: SkFont;
|
|
20
|
+
/** Multi-series data, used to anchor markers by `seriesId`. */
|
|
21
|
+
series?: SharedValue<SeriesConfig[]>;
|
|
22
|
+
/** Single-series line data; anchors markers that omit `value`. */
|
|
23
|
+
lineData?: SharedValue<LiveChartPoint[]>;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=MarkerOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkerOverlay.d.ts","sourceRoot":"","sources":["../../src/components/MarkerOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,MAAM,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,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;AAEjD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,MAAM,EAEN,YAAY,EACb,MAAM,UAAU,CAAC;AAyOlB;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,MAAM,EACN,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,MAAM,CAAC,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACrC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;CAC1C,2CA6CA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChartPadding } from "../draw/line";
|
|
2
|
+
import type { ResolvedPulseConfig } from "../core/resolveConfig";
|
|
3
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
export declare function MultiSeriesDots({ engine, padding, colors, radius, pulse, }: {
|
|
5
|
+
engine: MultiEngineState;
|
|
6
|
+
padding: ChartPadding;
|
|
7
|
+
colors: string[];
|
|
8
|
+
radius: number;
|
|
9
|
+
pulse: ResolvedPulseConfig | null;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=MultiSeriesDots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSeriesDots.d.ts","sourceRoot":"","sources":["../../src/components/MultiSeriesDots.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAkFnE,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACnC,2CAgBA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Skia } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { SeriesLineStyle } from "../core/multiSeriesLayout";
|
|
4
|
+
import type { SeriesConfig } from "../types";
|
|
5
|
+
export declare function MultiSeriesStroke({ index, paths, opacities, series, strokeWidth, lineStyle, }: {
|
|
6
|
+
index: number;
|
|
7
|
+
paths: SharedValue<ReturnType<typeof Skia.Path.Make>[]>;
|
|
8
|
+
opacities: SharedValue<number[]>;
|
|
9
|
+
series: SharedValue<SeriesConfig[]>;
|
|
10
|
+
strokeWidth: number;
|
|
11
|
+
/** Per-series static stroke style (dash / width / glow). */
|
|
12
|
+
lineStyle?: SeriesLineStyle;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=MultiSeriesStroke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSeriesStroke.d.ts","sourceRoot":"","sources":["../../src/components/MultiSeriesStroke.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,WAAW,EACX,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxD,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,2CAwDA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import { type SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { TooltipLayout } from "../hooks/crosshairShared";
|
|
4
|
+
import type { LiveChartPalette } from "../types";
|
|
5
|
+
export declare function MultiSeriesTooltipStack({ tooltipLayout, font, palette, }: {
|
|
6
|
+
tooltipLayout: SharedValue<TooltipLayout>;
|
|
7
|
+
font: SkFont;
|
|
8
|
+
palette: LiveChartPalette;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MultiSeriesTooltipStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSeriesTooltipStack.d.ts","sourceRoot":"","sources":["../../src/components/MultiSeriesTooltipStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA+CjD,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,IAAI,EACJ,OAAO,GACR,EAAE;IACD,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;CAC3B,2CAcA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ChartPadding } from "../draw/line";
|
|
3
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
export declare function MultiSeriesValueLabels({ engine, padding, colors, font, dotRadius, }: {
|
|
5
|
+
engine: MultiEngineState;
|
|
6
|
+
padding: ChartPadding;
|
|
7
|
+
colors: string[];
|
|
8
|
+
font: SkFont;
|
|
9
|
+
dotRadius: number;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=MultiSeriesValueLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSeriesValueLabels.d.ts","sourceRoot":"","sources":["../../src/components/MultiSeriesValueLabels.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAiEnE,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,GACV,EAAE;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,2CAgBA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartPadding } from "../draw/line";
|
|
2
|
+
import type { ResolvedValueLineConfig } from "../core/resolveConfig";
|
|
3
|
+
import type { MultiEngineState } from "../core/useLiveChartEngine";
|
|
4
|
+
export declare function MultiSeriesValueLines({ engine, padding, colors, config, }: {
|
|
5
|
+
engine: MultiEngineState;
|
|
6
|
+
padding: ChartPadding;
|
|
7
|
+
colors: string[];
|
|
8
|
+
config: ResolvedValueLineConfig;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MultiSeriesValueLines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSeriesValueLines.d.ts","sourceRoot":"","sources":["../../src/components/MultiSeriesValueLines.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AA4EnE,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,GACP,EAAE;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,uBAAuB,CAAC;CACjC,2CAeA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SkFont } from "@shopify/react-native-skia";
|
|
2
|
+
import type { ChartEngineLayout } from "../core/useLiveChartEngine";
|
|
3
|
+
import type { ChartPadding } from "../draw/line";
|
|
4
|
+
import type { LiveChartPalette, ReferenceLine } from "../types";
|
|
5
|
+
/**
|
|
6
|
+
* Renders one reference line or band into the chart canvas. Handles all three
|
|
7
|
+
* `ReferenceLine` forms (horizontal line, horizontal value band, vertical time
|
|
8
|
+
* band) plus the off-axis badge for an off-screen Form-A value. Self-contained
|
|
9
|
+
* so callers can `.map()` over a variable-length `referenceLines` array.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ReferenceLineOverlay({ engine, padding, line, palette, formatValue, font, }: {
|
|
12
|
+
engine: ChartEngineLayout;
|
|
13
|
+
padding: ChartPadding;
|
|
14
|
+
line: ReferenceLine;
|
|
15
|
+
palette: LiveChartPalette;
|
|
16
|
+
formatValue: (v: number) => string;
|
|
17
|
+
font: SkFont;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=ReferenceLineOverlay.d.ts.map
|