@ledgerhq/lumen-ui-rnative-visualization 0.1.17 → 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 +4 -3
- 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 +4 -3
- 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 +30 -23
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +61 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/index.js +4 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/index.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.js → RevealAnimation/RevealAnimationProvider.js} +13 -13
- 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/hooks/useShimmerAnimation.js +37 -0
- package/dist/module/lib/Components/CartesianChart/hooks/useShimmerAnimation.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 +18 -11
- package/dist/module/lib/Components/Line/Line.js.map +1 -1
- package/dist/module/lib/Components/Line/constants.js +5 -0
- package/dist/module/lib/Components/Line/constants.js.map +1 -0
- package/dist/module/lib/Components/Line/types.js +2 -0
- package/dist/module/lib/Components/Line/utils.js +38 -11
- package/dist/module/lib/Components/Line/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.test.js +49 -3
- package/dist/module/lib/Components/Line/utils.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.js +131 -27
- package/dist/module/lib/Components/LineChart/LineChart.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.test.js +147 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js +72 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.js +47 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/index.js +4 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/index.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/types.js +4 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/types.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.js +22 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.test.js +21 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/utils.js +83 -0
- package/dist/module/lib/Components/LineChart/utils.js.map +1 -0
- package/dist/module/lib/Components/LineChart/utils.test.js +174 -0
- package/dist/module/lib/Components/LineChart/utils.test.js.map +1 -0
- 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/ReferenceLine/ReferenceLine.js +4 -4
- package/dist/module/lib/Components/ReferenceLine/ReferenceLine.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/constants.js +2 -2
- package/dist/module/lib/Components/ReferenceLine/constants.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/utils.js +2 -1
- package/dist/module/lib/Components/ReferenceLine/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js +2 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/Scrubber.js +2 -2
- package/dist/module/lib/Components/Scrubber/Scrubber.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js +10 -2
- 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/module/lib/Components/Scrubber/utils.js +3 -2
- package/dist/module/lib/Components/Scrubber/utils.js.map +1 -1
- package/dist/module/lib/utils/numbers.js +16 -0
- package/dist/module/lib/utils/numbers.js.map +1 -0
- package/dist/module/lib/utils/ticks/ticks.js +0 -16
- package/dist/module/lib/utils/ticks/ticks.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/CartesianChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +18 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/index.d.ts.map +1 -0
- 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 +15 -2
- 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/hooks/useShimmerAnimation.d.ts +13 -0
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts +12 -0
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts.map +1 -1
- 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/constants.d.ts +3 -0
- package/dist/typescript/src/lib/Components/Line/constants.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Line/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Line/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/types.d.ts +15 -0
- package/dist/typescript/src/lib/Components/Line/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/utils.d.ts +11 -6
- 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/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/utils.d.ts +14 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts +41 -1
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/utils.d.ts +43 -0
- package/dist/typescript/src/lib/Components/LineChart/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/ReferenceLine.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/constants.d.ts +2 -2
- package/dist/typescript/src/lib/Components/ReferenceLine/constants.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/Scrubber.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/numbers.d.ts +13 -0
- package/dist/typescript/src/lib/utils/numbers.d.ts.map +1 -0
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts +1 -11
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/types.d.ts +27 -2
- package/dist/typescript/src/lib/utils/types.d.ts.map +1 -1
- package/package.json +3 -3
- 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 +29 -32
- package/src/lib/Components/Axis/YAxis/YAxis.test.tsx +12 -0
- package/src/lib/Components/Axis/YAxis/YAxis.tsx +29 -32
- package/src/lib/Components/CartesianChart/CartesianChart.tsx +30 -24
- package/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.tsx +68 -0
- package/src/lib/Components/CartesianChart/ChartEmptyLabel/index.ts +1 -0
- 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} +11 -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 +16 -2
- package/src/lib/Components/CartesianChart/RevealAnimation/utils.ts +87 -0
- package/src/lib/Components/CartesianChart/hooks/useShimmerAnimation.ts +52 -0
- package/src/lib/Components/CartesianChart/types.ts +12 -0
- package/src/lib/Components/CartesianChart/utils.ts +2 -1
- package/src/lib/Components/Line/Line.tsx +26 -14
- package/src/lib/Components/Line/constants.ts +2 -0
- package/src/lib/Components/Line/index.ts +1 -1
- package/src/lib/Components/Line/types.ts +17 -0
- package/src/lib/Components/Line/utils.test.ts +77 -3
- package/src/lib/Components/Line/utils.ts +63 -12
- package/src/lib/Components/LineChart/LineChart.test.tsx +135 -0
- package/src/lib/Components/LineChart/LineChart.tsx +157 -38
- package/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.tsx +39 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.tsx +72 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/index.ts +2 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/types.ts +3 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/utils.test.ts +22 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/utils.ts +24 -0
- package/src/lib/Components/LineChart/types.ts +49 -1
- package/src/lib/Components/LineChart/utils.test.ts +196 -0
- package/src/lib/Components/LineChart/utils.ts +107 -0
- package/src/lib/Components/Point/Point.tsx +7 -4
- package/src/lib/Components/ReferenceLine/ReferenceLine.tsx +8 -4
- package/src/lib/Components/ReferenceLine/constants.ts +2 -2
- package/src/lib/Components/ReferenceLine/utils.ts +2 -1
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts +2 -1
- package/src/lib/Components/Scrubber/Scrubber.tsx +13 -2
- package/src/lib/Components/Scrubber/ScrubberProvider.test.tsx +83 -1
- package/src/lib/Components/Scrubber/ScrubberProvider.tsx +17 -2
- package/src/lib/Components/Scrubber/utils.ts +3 -5
- package/src/lib/utils/index.ts +1 -0
- package/src/lib/utils/numbers.ts +15 -0
- package/src/lib/utils/ticks/ticks.ts +1 -23
- package/src/lib/utils/types.ts +35 -2
- 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/RevealClip/utils.js +0 -32
- package/dist/module/lib/Components/CartesianChart/RevealClip/utils.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/RevealClip/utils.d.ts +0 -17
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/utils.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/RevealClip/utils.ts +0 -51
- /package/dist/module/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.js +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
import { useAnimatedProps } from 'react-native-reanimated';
|
|
5
|
+
export const RevealAnimationContext = /*#__PURE__*/createContext(undefined);
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Clip-path attribute for path-based consumers (e.g. `Line`).
|
|
9
|
+
* Returns `undefined` when the reveal animation is disabled.
|
|
10
|
+
*/
|
|
11
|
+
export const usePathReveal = () => {
|
|
12
|
+
return useContext(RevealAnimationContext)?.clipPathAttr;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Raw shared opacity value for the point/accessory fade. Returns `undefined`
|
|
17
|
+
* when the reveal animation is disabled. Prefer {@link useRevealFadeProps} in
|
|
18
|
+
* components; this is the low-level primitive for custom needs.
|
|
19
|
+
*/
|
|
20
|
+
export const usePointReveal = () => {
|
|
21
|
+
return useContext(RevealAnimationContext)?.pointOpacity;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Ready-to-use animated props for accessory components (e.g. `Point`) that
|
|
26
|
+
* fade in with the reveal instead of being clipped. Spread directly onto any
|
|
27
|
+
* animated SVG element via `animatedProps`
|
|
28
|
+
*/
|
|
29
|
+
export const useRevealFadeProps = () => {
|
|
30
|
+
const pointOpacity = usePointReveal();
|
|
31
|
+
return useAnimatedProps(() => ({
|
|
32
|
+
opacity: pointOpacity?.value ?? 1
|
|
33
|
+
}), [pointOpacity]);
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useAnimatedProps","RevealAnimationContext","undefined","usePathReveal","clipPathAttr","usePointReveal","pointOpacity","useRevealFadeProps","opacity","value"],"sourceRoot":"../../../../../../src","sources":["lib/Components/CartesianChart/RevealAnimation/context.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAEjD,SAASC,gBAAgB,QAAQ,yBAAyB;AAI1D,OAAO,MAAMC,sBAAsB,gBAAGH,aAAa,CAEjDI,SAAS,CAAC;;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAA0B;EACrD,OAAOJ,UAAU,CAACE,sBAAsB,CAAC,EAAEG,YAAY;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAuC;EACnE,OAAON,UAAU,CAACE,sBAAsB,CAAC,EAAEK,YAAY;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAA2C;EAC3E,MAAMD,YAAY,GAAGD,cAAc,CAAC,CAAC;EACrC,OAAOL,gBAAgB,CACrB,OAAO;IAAEQ,OAAO,EAAEF,YAAY,EAAEG,KAAK,IAAI;EAAE,CAAC,CAAC,EAC7C,CAACH,YAAY,CACf,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RevealAnimationProvider","usePathReveal","useRevealFadeProps"],"sourceRoot":"../../../../../../src","sources":["lib/Components/CartesianChart/RevealAnimation/index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,8BAA2B;AACnE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,cAAW","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["lib/Components/CartesianChart/RevealAnimation/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useId, useMemo, useRef } from 'react';
|
|
4
|
+
import { useAnimatedProps, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { OVERFLOW_BUFFER } from "../utils.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Duration in ms of an individual point's opacity fade-in.
|
|
9
|
+
*/
|
|
10
|
+
const POINT_FADE_DURATION_IN_MS = 200;
|
|
11
|
+
const POINT_FADE_IN_AFTER_CLIP_IN_MS = -100;
|
|
12
|
+
/**
|
|
13
|
+
* Drives the two reveal animations:
|
|
14
|
+
* - the left-to-right clip-path wipe (animated `Rect` width, including the
|
|
15
|
+
* {@link OVERFLOW_BUFFER} so edge content is revealed too), and
|
|
16
|
+
* - the point fade-in, delayed so points appear as the wipe finishes.
|
|
17
|
+
*
|
|
18
|
+
* On a data change the shared values are reset to `0` (hidden) *synchronously
|
|
19
|
+
* during render* — before the new line/points are committed and painted — so
|
|
20
|
+
* they never paint once at the previous cycle's end values (a visible flash).
|
|
21
|
+
* The effect then animates them back in.
|
|
22
|
+
*/
|
|
23
|
+
export const useRevealAnimation = ({
|
|
24
|
+
durationMs,
|
|
25
|
+
drawingArea,
|
|
26
|
+
dataFingerprint
|
|
27
|
+
}) => {
|
|
28
|
+
const clipId = useId();
|
|
29
|
+
const clipWidth = useSharedValue(0);
|
|
30
|
+
const pointOpacity = useSharedValue(0);
|
|
31
|
+
const previousFingerprint = useRef(null);
|
|
32
|
+
if (previousFingerprint.current !== dataFingerprint) {
|
|
33
|
+
previousFingerprint.current = dataFingerprint;
|
|
34
|
+
clipWidth.value = 0;
|
|
35
|
+
pointOpacity.value = 0;
|
|
36
|
+
}
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
clipWidth.value = withTiming(drawingArea.width + OVERFLOW_BUFFER.left + OVERFLOW_BUFFER.right, {
|
|
39
|
+
duration: durationMs
|
|
40
|
+
});
|
|
41
|
+
pointOpacity.value = withDelay(Math.max(durationMs + POINT_FADE_IN_AFTER_CLIP_IN_MS, 0), withTiming(1, {
|
|
42
|
+
duration: POINT_FADE_DURATION_IN_MS
|
|
43
|
+
}));
|
|
44
|
+
}, [drawingArea.width, durationMs, clipWidth, pointOpacity, dataFingerprint]);
|
|
45
|
+
const animatedRectProps = useAnimatedProps(() => ({
|
|
46
|
+
width: clipWidth.value
|
|
47
|
+
}));
|
|
48
|
+
return {
|
|
49
|
+
clipId,
|
|
50
|
+
animatedRectProps,
|
|
51
|
+
pointOpacity
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Stable signature of every series' data points, memoized on the `series`
|
|
57
|
+
* reference. Used to key the reveal provider so the reveal animation only
|
|
58
|
+
* replays when the underlying data actually changes — not on unrelated
|
|
59
|
+
* re-renders such as scrubbing or hover.
|
|
60
|
+
*/
|
|
61
|
+
export const useDataFingerprint = series => {
|
|
62
|
+
return useMemo(() => series.map(s => s.data?.join(',') ?? '').join('|'), [series]);
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useId","useMemo","useRef","useAnimatedProps","useSharedValue","withDelay","withTiming","OVERFLOW_BUFFER","POINT_FADE_DURATION_IN_MS","POINT_FADE_IN_AFTER_CLIP_IN_MS","useRevealAnimation","durationMs","drawingArea","dataFingerprint","clipId","clipWidth","pointOpacity","previousFingerprint","current","value","width","left","right","duration","Math","max","animatedRectProps","useDataFingerprint","series","map","s","data","join"],"sourceRoot":"../../../../../../src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,CAACI,WAAW,CAACQ,KAAK,EAAET,UAAU,EAAEI,SAAS,EAAEC,YAAY,EAAEH,eAAe,CAAC,CAAC;EAE7E,MAAMa,iBAAiB,GAAGvB,gBAAgB,CAAC,OAAO;IAChDiB,KAAK,EAAEL,SAAS,CAACI;EACnB,CAAC,CAAC,CAAC;EAEH,OAAO;IAAEL,MAAM;IAAEY,iBAAiB;IAAEV;EAAa,CAAC;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,kBAAkB,GAAIC,MAAgB,IAAa;EAC9D,OAAO3B,OAAO,CACZ,MAAM2B,MAAM,CAACC,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,EAAEC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAACA,IAAI,CAAC,GAAG,CAAC,EAC1D,CAACJ,MAAM,CACT,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { cancelAnimation, Easing, useAnimatedProps, useReducedMotion, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
5
|
+
const HALF_PULSE_DURATION_IN_MS = 1000;
|
|
6
|
+
const MIN_OPACITY = 0.5;
|
|
7
|
+
/**
|
|
8
|
+
* Self-contained shimmer (opacity pulse) for SVG content, the RN counterpart of
|
|
9
|
+
* the web's CSS-keyframe shimmer. Shared by the initial loading placeholder and
|
|
10
|
+
* the transition-loading line. Honors the user's reduced-motion preference by
|
|
11
|
+
* keeping the content fully opaque.
|
|
12
|
+
*/
|
|
13
|
+
export const useShimmerAnimation = (animate = true) => {
|
|
14
|
+
const opacity = useSharedValue(1);
|
|
15
|
+
const reducedMotion = useReducedMotion();
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (animate && !reducedMotion) {
|
|
18
|
+
opacity.value = withRepeat(withTiming(MIN_OPACITY, {
|
|
19
|
+
duration: HALF_PULSE_DURATION_IN_MS,
|
|
20
|
+
easing: Easing.inOut(Easing.ease)
|
|
21
|
+
}), -1, true);
|
|
22
|
+
} else {
|
|
23
|
+
cancelAnimation(opacity);
|
|
24
|
+
opacity.value = 1;
|
|
25
|
+
}
|
|
26
|
+
return () => {
|
|
27
|
+
cancelAnimation(opacity);
|
|
28
|
+
};
|
|
29
|
+
}, [animate, reducedMotion, opacity]);
|
|
30
|
+
const animatedProps = useAnimatedProps(() => ({
|
|
31
|
+
opacity: opacity.value
|
|
32
|
+
}));
|
|
33
|
+
return {
|
|
34
|
+
animatedProps
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=useShimmerAnimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","cancelAnimation","Easing","useAnimatedProps","useReducedMotion","useSharedValue","withRepeat","withTiming","HALF_PULSE_DURATION_IN_MS","MIN_OPACITY","useShimmerAnimation","animate","opacity","reducedMotion","value","duration","easing","inOut","ease","animatedProps"],"sourceRoot":"../../../../../../src","sources":["lib/Components/CartesianChart/hooks/useShimmerAnimation.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SACEC,eAAe,EACfC,MAAM,EACNC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,MAAMC,yBAAyB,GAAG,IAAI;AACtC,MAAMC,WAAW,GAAG,GAAG;AAMvB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGA,CAACC,OAAO,GAAG,IAAI,KAA6B;EAC7E,MAAMC,OAAO,GAAGP,cAAc,CAAC,CAAC,CAAC;EACjC,MAAMQ,aAAa,GAAGT,gBAAgB,CAAC,CAAC;EAExCJ,SAAS,CAAC,MAAM;IACd,IAAIW,OAAO,IAAI,CAACE,aAAa,EAAE;MAC7BD,OAAO,CAACE,KAAK,GAAGR,UAAU,CACxBC,UAAU,CAACE,WAAW,EAAE;QACtBM,QAAQ,EAAEP,yBAAyB;QACnCQ,MAAM,EAAEd,MAAM,CAACe,KAAK,CAACf,MAAM,CAACgB,IAAI;MAClC,CAAC,CAAC,EACF,CAAC,CAAC,EACF,IACF,CAAC;IACH,CAAC,MAAM;MACLjB,eAAe,CAACW,OAAO,CAAC;MACxBA,OAAO,CAACE,KAAK,GAAG,CAAC;IACnB;IAEA,OAAO,MAAM;MACXb,eAAe,CAACW,OAAO,CAAC;IAC1B,CAAC;EACH,CAAC,EAAE,CAACD,OAAO,EAAEE,aAAa,EAAED,OAAO,CAAC,CAAC;EAErC,MAAMO,aAAa,GAAGhB,gBAAgB,CAAC,OAAO;IAAES,OAAO,EAAEA,OAAO,CAACE;EAAM,CAAC,CAAC,CAAC;EAE1E,OAAO;IAAEK;EAAc,CAAC;AAC1B,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_HEIGHT","OVERFLOW_BUFFER","top","right","bottom","left","OVERFLOW_OFFSET","position","ZERO_PADDING","resolveInset","inset","consumer","undefined","resolveAxisPadding","padding"],"sourceRoot":"../../../../../src","sources":["lib/Components/CartesianChart/utils.ts"],"mappings":";;AAGA,OAAO,MAAMA,cAAc,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAA2B,GAAG;EACzCC,GAAG,EAAE,EAAE;EACPC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,IAAI,EAAE;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG;EAC7BC,QAAQ,EAAE,UAAmB;EAC7BL,GAAG,EAAE,CAACD,eAAe,CAACC,GAAG;EACzBG,IAAI,EAAE,CAACJ,eAAe,CAACI;AACzB,CAAC;
|
|
1
|
+
{"version":3,"names":["DEFAULT_HEIGHT","OVERFLOW_BUFFER","top","right","bottom","left","OVERFLOW_OFFSET","position","ZERO_PADDING","resolveInset","inset","consumer","undefined","resolveAxisPadding","padding"],"sourceRoot":"../../../../../src","sources":["lib/Components/CartesianChart/utils.ts"],"mappings":";;AAGA,OAAO,MAAMA,cAAc,GAAG,GAAG;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAA2B,GAAG;EACzCC,GAAG,EAAE,EAAE;EACPC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,IAAI,EAAE;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAG;EAC7BC,QAAQ,EAAE,UAAmB;EAC7BL,GAAG,EAAE,CAACD,eAAe,CAACC,GAAG;EACzBG,IAAI,EAAE,CAACJ,eAAe,CAACI;AACzB,CAAC;AAED,OAAO,MAAMG,YAAwB,GAAG;EACtCN,GAAG,EAAE,CAAC;EACNC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAE;AACR,CAAC;AAED,OAAO,MAAMI,YAAY,GACvBC,KAAmC,IACpB;EACf,IAAIC,QAAoB;EACxB,IAAID,KAAK,KAAKE,SAAS,EAAE;IACvBD,QAAQ,GAAGH,YAAY;EACzB,CAAC,MAAM,IAAI,OAAOE,KAAK,KAAK,QAAQ,EAAE;IACpCC,QAAQ,GAAG;MAAET,GAAG,EAAEQ,KAAK;MAAEP,KAAK,EAAEO,KAAK;MAAEN,MAAM,EAAEM,KAAK;MAAEL,IAAI,EAAEK;IAAM,CAAC;EACrE,CAAC,MAAM;IACLC,QAAQ,GAAG;MACTT,GAAG,EAAEQ,KAAK,CAACR,GAAG,IAAI,CAAC;MACnBC,KAAK,EAAEO,KAAK,CAACP,KAAK,IAAI,CAAC;MACvBC,MAAM,EAAEM,KAAK,CAACN,MAAM,IAAI,CAAC;MACzBC,IAAI,EAAEK,KAAK,CAACL,IAAI,IAAI;IACtB,CAAC;EACH;EAEA,OAAO;IACLH,GAAG,EAAES,QAAQ,CAACT,GAAG,GAAGD,eAAe,CAACC,GAAG;IACvCC,KAAK,EAAEQ,QAAQ,CAACR,KAAK,GAAGF,eAAe,CAACE,KAAK;IAC7CC,MAAM,EAAEO,QAAQ,CAACP,MAAM,GAAGH,eAAe,CAACG,MAAM;IAChDC,IAAI,EAAEM,QAAQ,CAACN,IAAI,GAAGJ,eAAe,CAACI;EACxC,CAAC;AACH,CAAC;AAED,OAAO,MAAMQ,kBAAkB,GAC7BC,OAA2C,IAC5B;EACf,IAAIA,OAAO,KAAKF,SAAS,EAAE,OAAOJ,YAAY;EAC9C,OAAO;IACLN,GAAG,EAAEY,OAAO,CAACZ,GAAG,IAAI,CAAC;IACrBC,KAAK,EAAEW,OAAO,CAACX,KAAK,IAAI,CAAC;IACzBC,MAAM,EAAEU,OAAO,CAACV,MAAM,IAAI,CAAC;IAC3BC,IAAI,EAAES,OAAO,CAACT,IAAI,IAAI;EACxB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { useTheme } from '@ledgerhq/lumen-ui-rnative';
|
|
3
4
|
import { useId, useMemo } from 'react';
|
|
4
5
|
import { Defs, G, LinearGradient, Path, Stop } from 'react-native-svg';
|
|
5
6
|
import { isNumericScale } from "../../utils/scales/scales.js";
|
|
6
7
|
import { useCartesianChartContext } from "../CartesianChart/context/index.js";
|
|
7
|
-
import {
|
|
8
|
+
import { usePathReveal } from "../CartesianChart/RevealAnimation/index.js";
|
|
9
|
+
import { LINE_AREA_GRADIENT_OPACITY, LINE_STROKE_WIDTH } from "./constants.js";
|
|
8
10
|
import { buildAreaPath, buildLinePath, toScaledPoints } from "./utils.js";
|
|
9
11
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
-
const STROKE_WIDTH = 2;
|
|
11
|
-
const AREA_GRADIENT_OPACITY = 0.2;
|
|
12
12
|
export const Line = ({
|
|
13
13
|
seriesId,
|
|
14
14
|
stroke,
|
|
15
15
|
showArea = false,
|
|
16
|
-
areaType: _areaType = 'gradient'
|
|
16
|
+
areaType: _areaType = 'gradient',
|
|
17
|
+
curve,
|
|
18
|
+
connectNulls
|
|
17
19
|
}) => {
|
|
18
20
|
const {
|
|
19
21
|
getXScale,
|
|
@@ -22,16 +24,21 @@ export const Line = ({
|
|
|
22
24
|
drawingArea,
|
|
23
25
|
seriesMap
|
|
24
26
|
} = useCartesianChartContext();
|
|
25
|
-
const clipPath =
|
|
27
|
+
const clipPath = usePathReveal();
|
|
26
28
|
const xScale = getXScale();
|
|
27
29
|
const yScale = getYScale();
|
|
28
30
|
const xAxisConfig = getXAxisConfig();
|
|
31
|
+
const {
|
|
32
|
+
theme
|
|
33
|
+
} = useTheme();
|
|
29
34
|
const gradientId = useId();
|
|
30
35
|
const seriesData = seriesMap.get(seriesId);
|
|
31
|
-
const resolvedStroke = stroke ?? seriesData?.stroke;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
36
|
+
const resolvedStroke = stroke ?? seriesData?.stroke ?? theme.colors.border.muted;
|
|
37
|
+
const resolvedCurve = curve ?? seriesData?.curve;
|
|
38
|
+
const resolvedConnectNulls = connectNulls ?? seriesData?.connectNulls ?? false;
|
|
39
|
+
const points = useMemo(() => seriesData?.data && xScale && yScale && isNumericScale(yScale) ? toScaledPoints(seriesData.data, xScale, yScale, xAxisConfig?.data, resolvedConnectNulls) : null, [seriesData, xScale, yScale, xAxisConfig, resolvedConnectNulls]);
|
|
40
|
+
const linePath = useMemo(() => points ? buildLinePath(points, resolvedCurve) : null, [points, resolvedCurve]);
|
|
41
|
+
const areaPath = useMemo(() => showArea && points && drawingArea ? buildAreaPath(points, drawingArea, resolvedCurve) : null, [showArea, points, drawingArea, resolvedCurve]);
|
|
35
42
|
if (!linePath) {
|
|
36
43
|
return null;
|
|
37
44
|
}
|
|
@@ -48,7 +55,7 @@ export const Line = ({
|
|
|
48
55
|
children: [/*#__PURE__*/_jsx(Stop, {
|
|
49
56
|
offset: "0%",
|
|
50
57
|
stopColor: resolvedStroke,
|
|
51
|
-
stopOpacity:
|
|
58
|
+
stopOpacity: LINE_AREA_GRADIENT_OPACITY
|
|
52
59
|
}), /*#__PURE__*/_jsx(Stop, {
|
|
53
60
|
offset: "100%",
|
|
54
61
|
stopColor: resolvedStroke,
|
|
@@ -66,7 +73,7 @@ export const Line = ({
|
|
|
66
73
|
d: linePath,
|
|
67
74
|
fill: "none",
|
|
68
75
|
stroke: resolvedStroke,
|
|
69
|
-
strokeWidth:
|
|
76
|
+
strokeWidth: LINE_STROKE_WIDTH,
|
|
70
77
|
strokeLinecap: "round",
|
|
71
78
|
strokeLinejoin: "round"
|
|
72
79
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useId","useMemo","Defs","G","LinearGradient","Path","Stop","isNumericScale","useCartesianChartContext","
|
|
1
|
+
{"version":3,"names":["useTheme","useId","useMemo","Defs","G","LinearGradient","Path","Stop","isNumericScale","useCartesianChartContext","usePathReveal","LINE_AREA_GRADIENT_OPACITY","LINE_STROKE_WIDTH","buildAreaPath","buildLinePath","toScaledPoints","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Line","seriesId","stroke","showArea","areaType","_areaType","curve","connectNulls","getXScale","getYScale","getXAxisConfig","drawingArea","seriesMap","clipPath","xScale","yScale","xAxisConfig","theme","gradientId","seriesData","get","resolvedStroke","colors","border","muted","resolvedCurve","resolvedConnectNulls","points","data","linePath","areaPath","children","id","x1","y1","x2","y2","offset","stopColor","stopOpacity","testID","d","fill","strokeWidth","strokeLinecap","strokeLinejoin"],"sourceRoot":"../../../../../src","sources":["lib/Components/Line/Line.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,KAAK,EAAEC,OAAO,QAAQ,OAAO;AACtC,SA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IAAI;YACXC,SAAS,EAAEjB,cAAe;YAC1BkB,WAAW,EAAElD;UAA2B,CACzC,CAAC,eACFM,IAAA,CAACV,IAAI;YAACoD,MAAM,EAAC,MAAM;YAACC,SAAS,EAAEjB,cAAe;YAACkB,WAAW,EAAE;UAAE,CAAE,CAAC;QAAA,CACnD;MAAC,CACb,CAAC,eACP5C,IAAA,CAACX,IAAI;QACHwD,MAAM,EAAC,WAAW;QAClBC,CAAC,EAAEX,QAAS;QACZY,IAAI,EAAE,QAAQxB,UAAU,GAAI;QAC5BhB,MAAM,EAAC;MAAM,CACd,CAAC;IAAA,CACF,CACH,eACDP,IAAA,CAACX,IAAI;MACHwD,MAAM,EAAC,WAAW;MAClBC,CAAC,EAAEZ,QAAS;MACZa,IAAI,EAAC,MAAM;MACXxC,MAAM,EAAEmB,cAAe;MACvBsB,WAAW,EAAErD,iBAAkB;MAC/BsD,aAAa,EAAC,OAAO;MACrBC,cAAc,EAAC;IAAO,CACvB,CAAC;EAAA,CACD,CAAC;AAER,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LINE_STROKE_WIDTH","LINE_AREA_GRADIENT_OPACITY"],"sourceRoot":"../../../../../src","sources":["lib/Components/Line/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,iBAAiB,GAAG,CAAC;AAClC,OAAO,MAAMC,0BAA0B,GAAG,IAAI","ignoreList":[]}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { area, curveBumpX, line } from 'd3-shape';
|
|
3
|
+
import { area, curveBumpX, curveLinear, curveMonotoneX, curveNatural, curveStep, curveStepAfter, curveStepBefore, line } from 'd3-shape';
|
|
4
|
+
import { isFiniteNumber } from "../../utils/numbers.js";
|
|
4
5
|
import { isCategoricalScale } from "../../utils/scales/scales.js";
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Maps the public `CurveType` values to their d3-shape curve factories.
|
|
8
|
+
*/
|
|
9
|
+
const CURVE_FACTORIES = {
|
|
10
|
+
bump: curveBumpX,
|
|
11
|
+
linear: curveLinear,
|
|
12
|
+
monotone: curveMonotoneX,
|
|
13
|
+
natural: curveNatural,
|
|
14
|
+
step: curveStep,
|
|
15
|
+
stepAfter: curveStepAfter,
|
|
16
|
+
stepBefore: curveStepBefore
|
|
17
|
+
};
|
|
18
|
+
const DEFAULT_CURVE = 'bump';
|
|
19
|
+
const getCurveFactory = (curve = DEFAULT_CURVE) => CURVE_FACTORIES[curve] ?? CURVE_FACTORIES[DEFAULT_CURVE];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Project series data into scaled [x, y] pixel coordinates.
|
|
7
23
|
*
|
|
8
24
|
* When `xData` contains numeric values, those values are fed into the scale
|
|
9
25
|
* instead of the array index so the points honour a numeric X domain.
|
|
@@ -11,33 +27,44 @@ import { isCategoricalScale } from "../../utils/scales/scales.js";
|
|
|
11
27
|
* When `xData` is provided, iteration is capped at `xData.length` so a series
|
|
12
28
|
* with more points than the axis has labels does not overflow past the right
|
|
13
29
|
* edge of the chart. The axis is treated as authoritative for the X domain.
|
|
30
|
+
*
|
|
31
|
+
* Non-finite values (e.g. `null`) are handled according to `connectNulls`:
|
|
32
|
+
* - `false` (default): kept as `[x, null]` holes so the line/area break into
|
|
33
|
+
* gaps via the generators' `.defined()` check.
|
|
34
|
+
* - `true`: skipped entirely so the line is drawn continuously across gaps.
|
|
14
35
|
*/
|
|
15
|
-
export const toScaledPoints = (data, xScale, yScale, xData) => {
|
|
36
|
+
export const toScaledPoints = (data, xScale, yScale, xData, connectNulls = false) => {
|
|
16
37
|
const pts = [];
|
|
17
38
|
const limit = xData ? Math.min(data.length, xData.length) : data.length;
|
|
39
|
+
let finiteCount = 0;
|
|
18
40
|
for (let i = 0; i < limit; i++) {
|
|
19
41
|
const value = data[i];
|
|
20
|
-
|
|
42
|
+
const isFiniteValue = isFiniteNumber(value);
|
|
43
|
+
if (!isFiniteValue && connectNulls) continue;
|
|
21
44
|
const xInput = xData && typeof xData[i] === 'number' ? xData[i] : i;
|
|
22
45
|
const x = isCategoricalScale(xScale) ? (xScale(xInput) ?? 0) + xScale.bandwidth() / 2 : xScale(xInput);
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
if (!isFiniteValue) {
|
|
47
|
+
pts.push([x, null]);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
pts.push([x, yScale(value)]);
|
|
51
|
+
finiteCount++;
|
|
25
52
|
}
|
|
26
|
-
return
|
|
53
|
+
return finiteCount >= 2 ? pts : null;
|
|
27
54
|
};
|
|
28
55
|
|
|
29
56
|
/**
|
|
30
57
|
* Build the SVG `d` attribute for the line stroke.
|
|
31
58
|
*/
|
|
32
|
-
export const buildLinePath = points => {
|
|
33
|
-
return line().x(d => d[0]).y(d => d[1]).curve(
|
|
59
|
+
export const buildLinePath = (points, curve) => {
|
|
60
|
+
return line().defined(d => d[1] !== null).x(d => d[0]).y(d => d[1]).curve(getCurveFactory(curve))(points) ?? null;
|
|
34
61
|
};
|
|
35
62
|
|
|
36
63
|
/**
|
|
37
64
|
* Build the SVG `d` attribute for the filled area beneath the line.
|
|
38
65
|
*/
|
|
39
|
-
export const buildAreaPath = (points, drawingArea) => {
|
|
66
|
+
export const buildAreaPath = (points, drawingArea, curve) => {
|
|
40
67
|
const yBottom = drawingArea.y + drawingArea.height;
|
|
41
|
-
return area().x(d => d[0]).y0(yBottom).y1(d => d[1]).curve(
|
|
68
|
+
return area().defined(d => d[1] !== null).x(d => d[0]).y0(yBottom).y1(d => d[1]).curve(getCurveFactory(curve))(points) ?? null;
|
|
42
69
|
};
|
|
43
70
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["area","curveBumpX","line","isCategoricalScale","toScaledPoints","data","xScale","yScale","xData","pts","limit","Math","min","length","i","value","xInput","x","bandwidth","
|
|
1
|
+
{"version":3,"names":["area","curveBumpX","curveLinear","curveMonotoneX","curveNatural","curveStep","curveStepAfter","curveStepBefore","line","isFiniteNumber","isCategoricalScale","CURVE_FACTORIES","bump","linear","monotone","natural","step","stepAfter","stepBefore","DEFAULT_CURVE","getCurveFactory","curve","toScaledPoints","data","xScale","yScale","xData","connectNulls","pts","limit","Math","min","length","finiteCount","i","value","isFiniteValue","xInput","x","bandwidth","push","buildLinePath","points","defined","d","y","buildAreaPath","drawingArea","yBottom","height","y0","y1"],"sourceRoot":"../../../../../src","sources":["lib/Components/Line/utils.ts"],"mappings":";;AAAA,SACEA,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,IAAI,QAEC,UAAU;AAEjB,SAASC,cAAc,QAAQ,wBAAqB;AACpD,SAASC,kBAAkB,QAAQ,8BAA2B;AAU9D;AACA;AACA;AACA,MAAMC,eAAgD,GAAG;EACvDC,IAAI,EAAEX,UAAU;EAChBY,MAAM,EAAEX,WAAW;EACnBY,QAAQ,EAAEX,cAAc;EACxBY,OAAO,EAAEX,YAAY;EACrBY,IAAI,EAAEX,SAAS;EACfY,SAAS,EAAEX,cAAc;EACzBY,UAAU,EAAEX;AACd,CAAC;AAED,MAAMY,aAAwB,GAAG,MAAM;AAEvC,MAAMC,eAAe,GAAGA,CAACC,KAAgB,GAAGF,aAAa,KACvDR,eAAe,CAACU,KAAK,CAAC,IAAIV,eAAe,CAACQ,aAAa,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAGA,CAC5BC,IAAuB,EACvBC,MAA0B,EAC1BC,MAAoB,EACpBC,KAAoC,EACpCC,YAAY,GAAG,KAAK,KACD;EACnB,MAAMC,GAAY,GAAG,EAAE;EACvB,MAAMC,KAAK,GAAGH,KAAK,GAAGI,IAAI,CAACC,GAAG,CAACR,IAAI,CAACS,MAAM,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C,CAAW,CAAC,CACxBvB,KAAK,CAACD,eAAe,CAACC,KAAK,CAAC,CAAC,CAACqB,MAAM,CAAC,IAAI,IAAI;AAEpD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMI,aAAa,GAAGA,CAC3BJ,MAAe,EACfK,WAAwB,EACxB1B,KAAiB,KACC;EAClB,MAAM2B,OAAO,GAAGD,WAAW,CAACF,CAAC,GAAGE,WAAW,CAACE,MAAM;EAElD,OACEjD,IAAI,CAAQ,CAAC,CACV2C,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAC7BN,CAAC,CAAEM,CAAC,IAAKA,CAAC,CAAC,CAAC,CAAC,CAAC,CACdM,EAAE,CAACF,OAAO,CAAC,CACXG,EAAE,CAAEP,CAAC,IAAKA,CAAC,CAAC,CAAC,CAAW,CAAC,CACzBvB,KAAK,CAACD,eAAe,CAACC,KAAK,CAAC,CAAC,CAACqB,MAAM,CAAC,IAAI,IAAI;AAEpD,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from '@jest/globals';
|
|
4
4
|
import { getCategoricalScale, getNumericScale } from "../../utils/scales/scales.js";
|
|
5
|
-
import { toScaledPoints } from "./utils.js";
|
|
5
|
+
import { buildLinePath, toScaledPoints } from "./utils.js";
|
|
6
6
|
const xScale = getNumericScale({
|
|
7
7
|
scaleType: 'linear',
|
|
8
8
|
domain: {
|
|
@@ -45,14 +45,23 @@ describe('toScaledPoints', () => {
|
|
|
45
45
|
expect(points[0][0]).toBe(0);
|
|
46
46
|
expect(points[points.length - 1][0]).toBe(800);
|
|
47
47
|
});
|
|
48
|
-
it('
|
|
48
|
+
it('keeps null values as holes by default so the line breaks', () => {
|
|
49
49
|
const data = [10, null, 30, 40, 50, 60, 70, 80, 90];
|
|
50
50
|
const xData = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
|
|
51
51
|
const points = toScaledPoints(data, xScale, yScale, xData);
|
|
52
52
|
expect(points).not.toBeNull();
|
|
53
|
-
expect(points).toHaveLength(
|
|
53
|
+
expect(points).toHaveLength(8);
|
|
54
|
+
expect(points[1][1]).toBeNull();
|
|
54
55
|
expect(points[points.length - 1][0]).toBe(800 / 7 * 7);
|
|
55
56
|
});
|
|
57
|
+
it('skips null values when connectNulls is true', () => {
|
|
58
|
+
const data = [10, null, 30, 40, 50, 60, 70, 80, 90];
|
|
59
|
+
const xData = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
|
|
60
|
+
const points = toScaledPoints(data, xScale, yScale, xData, true);
|
|
61
|
+
expect(points).not.toBeNull();
|
|
62
|
+
expect(points).toHaveLength(7);
|
|
63
|
+
expect(points.every(p => p[1] !== null)).toBe(true);
|
|
64
|
+
});
|
|
56
65
|
it('uses numeric xData values as the x input', () => {
|
|
57
66
|
const data = [10, 20, 30];
|
|
58
67
|
const customX = [0, 3.5, 7];
|
|
@@ -85,4 +94,41 @@ describe('toScaledPoints', () => {
|
|
|
85
94
|
expect(toScaledPoints(data, xScale, yScale, xData)).toBeNull();
|
|
86
95
|
});
|
|
87
96
|
});
|
|
97
|
+
describe('buildLinePath', () => {
|
|
98
|
+
const points = [[0, 100], [50, 20], [100, 60]];
|
|
99
|
+
it('defaults to the bump curve (cubic beziers)', () => {
|
|
100
|
+
const path = buildLinePath(points);
|
|
101
|
+
expect(path).not.toBeNull();
|
|
102
|
+
expect(path).toContain('C');
|
|
103
|
+
});
|
|
104
|
+
it('draws straight segments for the linear curve', () => {
|
|
105
|
+
const path = buildLinePath(points, 'linear');
|
|
106
|
+
expect(path).toBe('M0,100L50,20L100,60');
|
|
107
|
+
});
|
|
108
|
+
it('uses cubic beziers for smooth curves', () => {
|
|
109
|
+
expect(buildLinePath(points, 'natural')).toContain('C');
|
|
110
|
+
expect(buildLinePath(points, 'monotone')).toContain('C');
|
|
111
|
+
});
|
|
112
|
+
it('draws orthogonal segments for the step curve', () => {
|
|
113
|
+
const path = buildLinePath(points, 'step');
|
|
114
|
+
expect(path).not.toBeNull();
|
|
115
|
+
expect(path).not.toContain('C');
|
|
116
|
+
expect(path).toBe('M0,100L25,100L25,20L75,20L75,60L100,60');
|
|
117
|
+
});
|
|
118
|
+
it('falls back to the default curve for unknown values', () => {
|
|
119
|
+
const path = buildLinePath(points, 'unknown');
|
|
120
|
+
expect(path).toBe(buildLinePath(points));
|
|
121
|
+
});
|
|
122
|
+
it('breaks the path into segments at null holes', () => {
|
|
123
|
+
const gapped = [[0, 100], [50, 80], [100, null], [150, 60], [200, 40]];
|
|
124
|
+
const path = buildLinePath(gapped, 'linear');
|
|
125
|
+
expect(path).not.toBeNull();
|
|
126
|
+
expect(path.match(/M/g)).toHaveLength(2);
|
|
127
|
+
expect(path).toBe('M0,100L50,80M150,60L200,40');
|
|
128
|
+
});
|
|
129
|
+
it('draws a single continuous segment when there are no holes', () => {
|
|
130
|
+
const path = buildLinePath(points, 'linear');
|
|
131
|
+
expect(path.match(/M/g)).toHaveLength(1);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
88
134
|
//# sourceMappingURL=utils.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["describe","expect","it","getCategoricalScale","getNumericScale","toScaledPoints","xScale","scaleType","domain","min","max","range","nice","yScale","data","points","not","toBeNull","toHaveLength","toBe","toBeCloseTo","xData","length","customX","bandScale","padding","bandwidth"],"sourceRoot":"../../../../../src","sources":["lib/Components/Line/utils.test.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,eAAe;AAEpD,SACEC,mBAAmB,EACnBC,eAAe,QACV,8BAA2B;AAElC,SAASC,cAAc,QAAQ,YAAS;
|
|
1
|
+
{"version":3,"names":["describe","expect","it","getCategoricalScale","getNumericScale","buildLinePath","toScaledPoints","xScale","scaleType","domain","min","max","range","nice","yScale","data","points","not","toBeNull","toHaveLength","toBe","toBeCloseTo","xData","length","every","p","customX","bandScale","padding","bandwidth","path","toContain","gapped","match"],"sourceRoot":"../../../../../src","sources":["lib/Components/Line/utils.test.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,eAAe;AAEpD,SACEC,mBAAmB,EACnBC,eAAe,QACV,8BAA2B;AAElC,SAASC,aAAa,EAAEC,cAAc,QAAQ,YAAS;AAEvD,MAAMC,MAAM,GAAGH,eAAe,CAAC;EAC7BI,SAAS,EAAE,QAAQ;EACnBC,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAE,CAAC;EAC1BC,KAAK,EAAE;IAAEF,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAI,CAAC;EAC3BE,IAAI,EAAE;AACR,CAAC,CAAC;AAEF,MAAMC,MAAM,GAAGV,eAAe,CAAC;EAC7BI,SAAS,EAAE,QAAQ;EACnBC,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAC;IAAEC,GAAG,EAAE;EAAI,CAAC;EAC5BC,KAAK,EAAE;IAAEF,GAAG,EAAE,GAAG;IAAEC,GAAG,EAAE;EAAE;AAC5B,CAAC,CAAC;AAEFX,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BE,EAAE,CAAC,iDAAiD,EAAE,MAAM;IAC1D,MAAMa,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACzB,MAAMC,MAAM,GAAGV,cAAc,CAACS,IAAI,EAAER,MAAM,EAAEO,MAAM,CAAC;IAEnDb,MAAM,CAACe,MAAM,CAAC,CAACC,GAAG,CAACC,QAAQ,CAAC,CAAC;IAC7BjB,MAAM,CAACe,MAAM,CAAC,CAACG,YAAY,CAAC,CAAC,CAAC;IAC9BlB,MAAM,CAACe,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACI,IAAI,CAAC,CAAC,CAAC;IAC7BnB,MAAM,CAACe,MAAM,CAAE,CA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