@delacour/react-native-charts 0.1.0-alpha.4 → 0.1.0-alpha.5

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/README.md CHANGED
@@ -17,12 +17,13 @@ Docs: [ui.delacour.co.nz/docs/charts](https://ui.delacour.co.nz/docs/charts).
17
17
 
18
18
  ```bash
19
19
  bun add @delacour/react-native-charts@alpha
20
- bunx expo install @shopify/react-native-skia
20
+ bunx expo install @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-worklets
21
21
  ```
22
22
 
23
23
  Peers: `@shopify/react-native-skia`, `react-native-reanimated`,
24
24
  `react-native-gesture-handler`, `react-native-worklets`, `react`,
25
- `react-native`.
25
+ `react-native`. The native four go through `expo install`, so the SDK picks
26
+ versions it can build; `react` and `react-native` are already in any app.
26
27
 
27
28
  Your app needs a `GestureHandlerRootView` at its root. This package does not
28
29
  render one — a nested root is dead weight, and every React Native app that
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@delacour/react-native-charts",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Headless Skia charting primitives for React Native \u2014 no tokens, no className",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/delacournz/delacour-ui.git",
10
- "directory": "packages/charts"
10
+ "directory": "packages/react-native-charts"
11
11
  },
12
12
  "keywords": [
13
13
  "react-native",
@@ -137,24 +137,24 @@ function CursorLine({
137
137
  readonly scrub: ChartScrubState;
138
138
  readonly series: ChartScrubSeriesState | undefined;
139
139
  }): ReactElement {
140
- const at = (): number => {
141
- "worklet";
140
+ // Resolved inline rather than through a component-scope worklet helper.
141
+ // The rule used to call an `at()` worklet from both points' derived values,
142
+ // and on device it never drew — in this chart and every themed tooltip —
143
+ // while the dots, which read their shared values directly, did.
144
+ const position = useDerivedValue(() => {
142
145
  const source = series ?? scrub;
143
- if (axis === "x") return snap ? source.snappedX.value : source.x.value;
144
- return snap ? source.snappedY.value : source.y.value;
145
- };
146
-
147
- const p1 = useDerivedValue(() => {
148
- const value = at();
149
- const position = Number.isFinite(value) ? value : OFFSCREEN;
150
- return axis === "x" ? { x: position, y: bounds.top } : { x: bounds.left, y: position };
146
+ const value =
147
+ axis === "x" ? (snap ? source.snappedX.value : source.x.value) : snap ? source.snappedY.value : source.y.value;
148
+ return Number.isFinite(value) ? value : OFFSCREEN;
151
149
  });
152
150
 
153
- const p2 = useDerivedValue(() => {
154
- const value = at();
155
- const position = Number.isFinite(value) ? value : OFFSCREEN;
156
- return axis === "x" ? { x: position, y: bounds.bottom } : { x: bounds.right, y: position };
157
- });
151
+ const p1 = useDerivedValue(() =>
152
+ axis === "x" ? { x: position.value, y: bounds.top } : { x: bounds.left, y: position.value }
153
+ );
154
+
155
+ const p2 = useDerivedValue(() =>
156
+ axis === "x" ? { x: position.value, y: bounds.bottom } : { x: bounds.right, y: position.value }
157
+ );
158
158
 
159
159
  const alpha = useDerivedValue(() => (scrub.isActive.value ? (opacity ?? 1) : 0));
160
160