@ledgerhq/lumen-ui-rnative-visualization 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/lib/Components/Axis/XAxis/XAxis.js +2 -1
- package/dist/module/lib/Components/Axis/XAxis/XAxis.js.map +1 -1
- package/dist/module/lib/Components/Axis/XAxis/XAxis.test.js +14 -0
- package/dist/module/lib/Components/Axis/XAxis/XAxis.test.js.map +1 -1
- package/dist/module/lib/Components/Axis/YAxis/YAxis.js +2 -1
- package/dist/module/lib/Components/Axis/YAxis/YAxis.js.map +1 -1
- package/dist/module/lib/Components/Axis/YAxis/YAxis.test.js +14 -0
- package/dist/module/lib/Components/Axis/YAxis/YAxis.test.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js +2 -2
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.js → RevealAnimation/RevealAnimationProvider.js} +12 -11
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.test.js → RevealAnimation/RevealAnimationProvider.test.js} +51 -12
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.test.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/context.js +35 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/context.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/index.js +5 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/index.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/types.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/utils.js +64 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/utils.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/utils.js +1 -1
- package/dist/module/lib/Components/CartesianChart/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/Line.js +6 -4
- package/dist/module/lib/Components/Line/Line.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.js +19 -9
- package/dist/module/lib/Components/Line/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.test.js +22 -2
- package/dist/module/lib/Components/Line/utils.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.js +23 -8
- package/dist/module/lib/Components/LineChart/LineChart.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.test.js +69 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js +2 -2
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js.map +1 -1
- package/dist/module/lib/Components/Point/Point.js +6 -4
- package/dist/module/lib/Components/Point/Point.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js +8 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.test.js +79 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.test.js.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts +6 -0
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/XAxis/XAxis.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/YAxis/YAxis.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/context.d.ts +22 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.d.ts +14 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/utils.d.ts +33 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/Line.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Line/Line.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/types.d.ts +7 -0
- package/dist/typescript/src/lib/Components/Line/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/utils.d.ts +8 -4
- package/dist/typescript/src/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts +13 -1
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/types.d.ts +7 -0
- package/dist/typescript/src/lib/utils/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/lib/Components/Axis/Axis.types.ts +6 -0
- package/src/lib/Components/Axis/XAxis/XAxis.test.tsx +12 -0
- package/src/lib/Components/Axis/XAxis/XAxis.tsx +16 -14
- package/src/lib/Components/Axis/YAxis/YAxis.test.tsx +12 -0
- package/src/lib/Components/Axis/YAxis/YAxis.tsx +16 -14
- package/src/lib/Components/CartesianChart/CartesianChart.tsx +3 -3
- package/src/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.test.tsx → RevealAnimation/RevealAnimationProvider.test.tsx} +60 -17
- package/src/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.tsx → RevealAnimation/RevealAnimationProvider.tsx} +10 -11
- package/src/lib/Components/CartesianChart/RevealAnimation/context.ts +39 -0
- package/src/lib/Components/CartesianChart/RevealAnimation/index.ts +2 -0
- package/src/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.ts +15 -1
- package/src/lib/Components/CartesianChart/RevealAnimation/utils.ts +87 -0
- package/src/lib/Components/CartesianChart/utils.ts +2 -1
- package/src/lib/Components/Line/Line.tsx +13 -4
- package/src/lib/Components/Line/types.ts +7 -0
- package/src/lib/Components/Line/utils.test.ts +36 -2
- package/src/lib/Components/Line/utils.ts +24 -9
- package/src/lib/Components/LineChart/LineChart.test.tsx +71 -0
- package/src/lib/Components/LineChart/LineChart.tsx +21 -3
- package/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.tsx +2 -2
- package/src/lib/Components/LineChart/types.ts +15 -1
- package/src/lib/Components/Point/Point.tsx +7 -4
- package/src/lib/Components/Scrubber/ScrubberProvider.test.tsx +83 -1
- package/src/lib/Components/Scrubber/ScrubberProvider.tsx +15 -1
- package/src/lib/utils/types.ts +7 -0
- package/dist/module/lib/Components/CartesianChart/RevealClip/RevealClipDefs.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/RevealClipDefs.test.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/context.js +0 -8
- package/dist/module/lib/Components/CartesianChart/RevealClip/context.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/index.js +0 -5
- package/dist/module/lib/Components/CartesianChart/RevealClip/index.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/types.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/hooks/useDataFingerprint.js +0 -13
- package/dist/module/lib/Components/CartesianChart/hooks/useDataFingerprint.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/hooks/useRevealClipAnimation.js +0 -27
- package/dist/module/lib/Components/CartesianChart/hooks/useRevealClipAnimation.js.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts +0 -3
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/context.d.ts +0 -7
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/context.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/index.d.ts +0 -3
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/index.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/types.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useDataFingerprint.d.ts +0 -9
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useDataFingerprint.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useRevealClipAnimation.d.ts +0 -14
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useRevealClipAnimation.d.ts.map +0 -1
- package/src/lib/Components/CartesianChart/RevealClip/context.ts +0 -13
- package/src/lib/Components/CartesianChart/RevealClip/index.ts +0 -2
- package/src/lib/Components/CartesianChart/hooks/useDataFingerprint.ts +0 -16
- package/src/lib/Components/CartesianChart/hooks/useRevealClipAnimation.ts +0 -43
- /package/dist/module/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.js +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Series } from '../../../utils/types';
|
|
2
|
-
/**
|
|
3
|
-
* Stable signature of every series' data points, memoized on the `series`
|
|
4
|
-
* reference. Used to key the reveal-clip provider so the reveal animation only
|
|
5
|
-
* replays when the underlying data actually changes — not on unrelated
|
|
6
|
-
* re-renders such as scrubbing or hover.
|
|
7
|
-
*/
|
|
8
|
-
export declare const useDataFingerprint: (series: Series[]) => string;
|
|
9
|
-
//# sourceMappingURL=useDataFingerprint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDataFingerprint.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/CartesianChart/hooks/useDataFingerprint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,KAAG,MAKrD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useAnimatedProps } from 'react-native-reanimated';
|
|
2
|
-
import type { DrawingArea } from '../../../utils/types';
|
|
3
|
-
type RevealClipAnimationConfig = {
|
|
4
|
-
durationMs: number;
|
|
5
|
-
drawingArea: DrawingArea;
|
|
6
|
-
dataFingerprint: string;
|
|
7
|
-
};
|
|
8
|
-
type RevealClipAnimationResult = {
|
|
9
|
-
clipId: string;
|
|
10
|
-
animatedRectProps: ReturnType<typeof useAnimatedProps>;
|
|
11
|
-
};
|
|
12
|
-
export declare const useRevealClipAnimation: ({ durationMs, drawingArea, dataFingerprint, }: RevealClipAnimationConfig) => RevealClipAnimationResult;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=useRevealClipAnimation.d.ts.map
|
package/dist/typescript/src/lib/Components/CartesianChart/hooks/useRevealClipAnimation.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRevealClipAnimation.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/CartesianChart/hooks/useRevealClipAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,KAAK,yBAAyB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,+CAIpC,yBAAyB,KAAG,yBAiB9B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
type RevealClipContextValue = {
|
|
4
|
-
clipPathAttr: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const RevealClipContext = createContext<
|
|
8
|
-
RevealClipContextValue | undefined
|
|
9
|
-
>(undefined);
|
|
10
|
-
|
|
11
|
-
export const useRevealClip = (): string | undefined => {
|
|
12
|
-
return useContext(RevealClipContext)?.clipPathAttr;
|
|
13
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { Series } from '../../../utils/types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stable signature of every series' data points, memoized on the `series`
|
|
7
|
-
* reference. Used to key the reveal-clip provider so the reveal animation only
|
|
8
|
-
* replays when the underlying data actually changes — not on unrelated
|
|
9
|
-
* re-renders such as scrubbing or hover.
|
|
10
|
-
*/
|
|
11
|
-
export const useDataFingerprint = (series: Series[]): string => {
|
|
12
|
-
return useMemo(
|
|
13
|
-
() => series.map((s) => s.data?.join(',') ?? '').join('|'),
|
|
14
|
-
[series],
|
|
15
|
-
);
|
|
16
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useEffect, useId } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
useAnimatedProps,
|
|
4
|
-
useSharedValue,
|
|
5
|
-
withTiming,
|
|
6
|
-
} from 'react-native-reanimated';
|
|
7
|
-
|
|
8
|
-
import type { DrawingArea } from '../../../utils/types';
|
|
9
|
-
import { OVERFLOW_BUFFER } from '../utils';
|
|
10
|
-
|
|
11
|
-
type RevealClipAnimationConfig = {
|
|
12
|
-
durationMs: number;
|
|
13
|
-
drawingArea: DrawingArea;
|
|
14
|
-
dataFingerprint: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type RevealClipAnimationResult = {
|
|
18
|
-
clipId: string;
|
|
19
|
-
animatedRectProps: ReturnType<typeof useAnimatedProps>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const useRevealClipAnimation = ({
|
|
23
|
-
durationMs,
|
|
24
|
-
drawingArea,
|
|
25
|
-
dataFingerprint,
|
|
26
|
-
}: RevealClipAnimationConfig): RevealClipAnimationResult => {
|
|
27
|
-
const clipId = useId();
|
|
28
|
-
const width = useSharedValue(0);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
width.value = 0;
|
|
32
|
-
width.value = withTiming(
|
|
33
|
-
drawingArea.width + OVERFLOW_BUFFER.left + OVERFLOW_BUFFER.right,
|
|
34
|
-
{ duration: durationMs },
|
|
35
|
-
);
|
|
36
|
-
}, [drawingArea.width, durationMs, width, dataFingerprint]);
|
|
37
|
-
|
|
38
|
-
const animatedRectProps = useAnimatedProps(() => ({
|
|
39
|
-
width: width.value,
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
return { clipId, animatedRectProps };
|
|
43
|
-
};
|
|
File without changes
|