@ledgerhq/lumen-ui-react 0.1.56 → 0.1.57
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/ai-rules/RULES.md +5 -4
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/XAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/XAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts +9 -0
- package/dist/lib/Components/visualization/Axis/XAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/YAxis.js +85 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Axis/YAxis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts +14 -0
- package/dist/lib/Components/visualization/Axis/YAxis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Axis/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts +80 -0
- package/dist/lib/Components/visualization/Axis/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/CartesianChart.js +107 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +11 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +21 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/RevealAnimationProvider.js +41 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts +15 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/context.js +10 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts +57 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts +35 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/RevealAnimation/utils.js +69 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts +8 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.js +9 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts +3 -0
- package/dist/lib/Components/visualization/CartesianChart/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts +25 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.js +61 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts +18 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.js +15 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts +4 -0
- package/dist/lib/Components/visualization/CartesianChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts +127 -0
- package/dist/lib/Components/visualization/CartesianChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts +5 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/CartesianChart/utils.js +24 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChart.js +90 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.js +61 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +20 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartDescription.js +49 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutChartTitle.js +55 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/DonutRing.js +110 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/RevealAnimation.js +28 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts +18 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +6 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts +12 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useContrastSafeSeries.js +13 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts +8 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/hooks/useDonutLoadingAnimation.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts +7 -0
- package/dist/lib/Components/visualization/DonutChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts +172 -0
- package/dist/lib/Components/visualization/DonutChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts +3 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts +10 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/useDonutSeries.js +16 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts +9 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/useDonutSeries/utils.js +46 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts +37 -0
- package/dist/lib/Components/visualization/DonutChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/DonutChart/utils.js +83 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/Legend.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/Legend.js +23 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts +7 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/LegendItem.js +19 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Legend/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts +32 -0
- package/dist/lib/Components/visualization/Legend/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/Line.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/Line.js +82 -0
- package/dist/lib/Components/visualization/Line/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Line/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/types.d.ts +45 -0
- package/dist/lib/Components/visualization/Line/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts +28 -0
- package/dist/lib/Components/visualization/Line/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Line/utils.js +34 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChart.js +181 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.js +51 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts +8 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/utils.js +8 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts +3 -0
- package/dist/lib/Components/visualization/LineChart/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts +82 -0
- package/dist/lib/Components/visualization/LineChart/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts +56 -0
- package/dist/lib/Components/visualization/LineChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/LineChart/utils.js +57 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts +4 -0
- package/dist/lib/Components/visualization/Point/Point.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/Point.js +122 -0
- package/dist/lib/Components/visualization/Point/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts +7 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/MagneticPointsProvider.js +22 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts +3 -0
- package/dist/lib/Components/visualization/Point/pointContext/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts +30 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/pointContext/magneticPointsContext.js +14 -0
- package/dist/lib/Components/visualization/Point/types.d.ts +110 -0
- package/dist/lib/Components/visualization/Point/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts +33 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/usePointGeometry.js +30 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts +51 -0
- package/dist/lib/Components/visualization/Point/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Point/utils.js +54 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/ReferenceLine.js +42 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts +3 -0
- package/dist/lib/Components/visualization/ReferenceLine/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts +74 -0
- package/dist/lib/Components/visualization/ReferenceLine/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts +21 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/useReferenceLineGeometry.js +49 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts +50 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/ReferenceLine/utils.js +66 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts +9 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.js +50 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts +12 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +82 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts +58 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/DefaultScrubberTooltip/utils.js +80 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/Scrubber.js +114 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts +3 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/ScrubberProvider.js +154 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts +2 -0
- package/dist/lib/Components/visualization/Scrubber/context/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts +8 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/context/scrubberContext.js +9 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts +4 -0
- package/dist/lib/Components/visualization/Scrubber/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts +130 -0
- package/dist/lib/Components/visualization/Scrubber/types.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts +29 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/useScrubberGeometry.js +37 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts +79 -0
- package/dist/lib/Components/visualization/Scrubber/utils.d.ts.map +1 -0
- package/dist/lib/Components/visualization/Scrubber/utils.js +104 -0
- package/dist/lib/Components/visualization/config.d.ts +162 -0
- package/dist/lib/Components/visualization/config.d.ts.map +1 -0
- package/dist/lib/Components/visualization/config.js +156 -0
- package/dist/lib/Components/visualization/index.d.ts +8 -0
- package/dist/lib/Components/visualization/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/index.js +27 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts +18 -0
- package/dist/lib/Components/visualization/utils/domain/domain.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/domain/domain.js +35 -0
- package/dist/lib/Components/visualization/utils/index.d.ts +2 -0
- package/dist/lib/Components/visualization/utils/index.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts +13 -0
- package/dist/lib/Components/visualization/utils/numbers.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/numbers.js +5 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts +47 -0
- package/dist/lib/Components/visualization/utils/scales/scales.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/scales/scales.js +32 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts +35 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.d.ts.map +1 -0
- package/dist/lib/Components/visualization/utils/ticks/ticks.js +23 -0
- package/dist/lib/Components/visualization/utils/types.d.ts +63 -0
- package/dist/lib/Components/visualization/utils/types.d.ts.map +1 -0
- package/dist/libs/design-core/dist/lib/colorContrast/colorContrast.js +15 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hexToHsl.js +14 -0
- package/dist/libs/design-core/dist/lib/colorContrast/hslToHex.js +10 -0
- package/dist/libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js +15 -0
- package/dist/libs/utils-shared/dist/index.js +115 -113
- package/dist/package.json +11 -3
- package/package.json +12 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { DrawingArea, Series } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Value shared by the reveal animation provider.
|
|
5
|
+
*
|
|
6
|
+
* - `clipPathAttr` drives the left-to-right clip wipe consumed by path-based
|
|
7
|
+
* components (e.g. `Line`).
|
|
8
|
+
* - `getPointRevealStyle` returns the opacity fade-in style for accessory
|
|
9
|
+
* components (e.g. `Point`) that must not be clipped, so edge content stays
|
|
10
|
+
* visible.
|
|
11
|
+
*/
|
|
12
|
+
export type RevealAnimationContextValue = {
|
|
13
|
+
/**
|
|
14
|
+
* `clip-path` attribute (`url(#id)`) used by the line/area wipe.
|
|
15
|
+
*/
|
|
16
|
+
clipPathAttr: string;
|
|
17
|
+
/**
|
|
18
|
+
* Builds the opacity fade-in style for an accessory (e.g. `Point`) so it
|
|
19
|
+
* reveals without being clipped, keeping edge content visible.
|
|
20
|
+
*/
|
|
21
|
+
getPointRevealStyle: () => CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
export type EnterTransitionConfig = {
|
|
24
|
+
/**
|
|
25
|
+
* Duration in seconds. @default 0.8
|
|
26
|
+
*/
|
|
27
|
+
duration?: number;
|
|
28
|
+
/**
|
|
29
|
+
* CSS easing function. @default 'linear'
|
|
30
|
+
*/
|
|
31
|
+
easing?: string;
|
|
32
|
+
};
|
|
33
|
+
export type RevealAnimationProps = {
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* The drawing area whose bounds define the clip rectangle.
|
|
37
|
+
*/
|
|
38
|
+
drawingArea: DrawingArea;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to animate the chart.
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
animate?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Transition configuration.
|
|
46
|
+
* @default { enter: { duration: 0.8, easing: 'linear' } }
|
|
47
|
+
*/
|
|
48
|
+
transitions?: {
|
|
49
|
+
enter?: EnterTransitionConfig;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Data series used to compute a fingerprint that restarts
|
|
53
|
+
* the animation when data changes.
|
|
54
|
+
*/
|
|
55
|
+
series: Series[];
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/RevealAnimation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,aAAa,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,qBAAqB,CAAA;KAAE,CAAC;IAChD;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { DrawingArea, Series } from '../../utils/types';
|
|
3
|
+
type RevealAnimationConfig = {
|
|
4
|
+
duration: number;
|
|
5
|
+
easing: string;
|
|
6
|
+
drawingArea: DrawingArea;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Creates the reveal animation for the chart.
|
|
10
|
+
* It returns
|
|
11
|
+
* - the clip id
|
|
12
|
+
* - the clip path animation
|
|
13
|
+
* - and the fade animation.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useRevealAnimation: ({ duration, easing, drawingArea, }: RevealAnimationConfig) => {
|
|
16
|
+
clipId: string;
|
|
17
|
+
clipPathAttr: string;
|
|
18
|
+
clipPathAnimation: {
|
|
19
|
+
keyframe: string;
|
|
20
|
+
style: string;
|
|
21
|
+
};
|
|
22
|
+
fadeAnimation: {
|
|
23
|
+
keyframe: string;
|
|
24
|
+
getPointRevealStyle: () => CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Stable signature of every series' data points, memoized on the `series`
|
|
29
|
+
* reference. Used to key the reveal provider so the reveal animation only
|
|
30
|
+
* replays when the underlying data actually changes — not on unrelated
|
|
31
|
+
* re-renders such as scrubbing or hover.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useDataFingerprint: (series: Series[]) => string;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/RevealAnimation/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI7D,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,oCAIhC,qBAAqB;;;;;;;;;mCA2CO,aAAa;;CAnB3C,CAAC;AA2DF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,KAAG,MAKrD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useMemo as r, useId as m } from "react";
|
|
2
|
+
import { chartConfig as c } from "../../config.js";
|
|
3
|
+
const { reveal: l } = c, A = ({
|
|
4
|
+
duration: a,
|
|
5
|
+
easing: t,
|
|
6
|
+
drawingArea: o
|
|
7
|
+
}) => {
|
|
8
|
+
const e = m(), n = s({
|
|
9
|
+
clipId: e,
|
|
10
|
+
duration: a,
|
|
11
|
+
easing: t
|
|
12
|
+
}), i = p({
|
|
13
|
+
clipId: e,
|
|
14
|
+
duration: a,
|
|
15
|
+
easing: t,
|
|
16
|
+
drawingArea: o
|
|
17
|
+
});
|
|
18
|
+
return r(
|
|
19
|
+
() => ({
|
|
20
|
+
clipId: e,
|
|
21
|
+
clipPathAttr: `url(#${e})`,
|
|
22
|
+
clipPathAnimation: i,
|
|
23
|
+
fadeAnimation: n
|
|
24
|
+
}),
|
|
25
|
+
[e, i, n]
|
|
26
|
+
);
|
|
27
|
+
}, s = ({
|
|
28
|
+
clipId: a,
|
|
29
|
+
duration: t,
|
|
30
|
+
easing: o
|
|
31
|
+
}) => {
|
|
32
|
+
const e = `reveal-fade-${a.replaceAll(":", "")}`;
|
|
33
|
+
return r(
|
|
34
|
+
() => ({
|
|
35
|
+
keyframe: `@keyframes ${e} { from { opacity: 0; } to { opacity: 1; } }`,
|
|
36
|
+
getPointRevealStyle: () => {
|
|
37
|
+
const n = Math.max(
|
|
38
|
+
0,
|
|
39
|
+
t + l.pointFadeInAfterClipInSeconds
|
|
40
|
+
);
|
|
41
|
+
return {
|
|
42
|
+
animation: `${e} ${l.pointFadeDurationInSeconds}s ${o} ${n}s both`
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
[t, o, e]
|
|
47
|
+
);
|
|
48
|
+
}, p = ({
|
|
49
|
+
clipId: a,
|
|
50
|
+
duration: t,
|
|
51
|
+
easing: o,
|
|
52
|
+
drawingArea: e
|
|
53
|
+
}) => {
|
|
54
|
+
const n = `reveal-clip-${a.replaceAll(":", "")}`, i = e.width;
|
|
55
|
+
return r(
|
|
56
|
+
() => ({
|
|
57
|
+
keyframe: `@keyframes ${n} { from { width: 0; } to { width: ${i}px; } }`,
|
|
58
|
+
style: `${n} ${t}s ${o} forwards`
|
|
59
|
+
}),
|
|
60
|
+
[n, t, o, i]
|
|
61
|
+
);
|
|
62
|
+
}, $ = (a) => r(
|
|
63
|
+
() => a.map((t) => t.data?.join(",") ?? "").join("|"),
|
|
64
|
+
[a]
|
|
65
|
+
);
|
|
66
|
+
export {
|
|
67
|
+
$ as useDataFingerprint,
|
|
68
|
+
A as useRevealAnimation
|
|
69
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CartesianChartContextValue } from '../types';
|
|
2
|
+
declare const CartesianChartProvider: import('react').FC<{
|
|
3
|
+
children: import('react').ReactNode;
|
|
4
|
+
value: CartesianChartContextValue;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useCartesianChartContext: () => CartesianChartContextValue;
|
|
7
|
+
export { CartesianChartProvider };
|
|
8
|
+
//# sourceMappingURL=cartesianChartContext.d.ts.map
|
package/dist/lib/Components/visualization/CartesianChart/context/cartesianChartContext.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cartesianChartContext.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/context/cartesianChartContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAO,sBAAsB;;;EACoC,CAAC;AAElE,eAAO,MAAM,wBAAwB,kCAIjC,CAAC;AAEL,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createSafeContext as t } from "../../../../../libs/utils-shared/dist/index.js";
|
|
2
|
+
const [r, e] = t("CartesianChart"), C = () => e({
|
|
3
|
+
consumerName: "useCartesianChartContext",
|
|
4
|
+
contextRequired: !0
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
r as CartesianChartProvider,
|
|
8
|
+
C as useCartesianChartContext
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxisBounds, BaseAxisProps } from '../../Axis';
|
|
2
|
+
import { ChartInset, ChartScaleFunction, DrawingArea, Series } from '../../utils/types';
|
|
3
|
+
import { CartesianChartContextValue } from '../types';
|
|
4
|
+
type UseBuildChartContextParams = {
|
|
5
|
+
series: Series[];
|
|
6
|
+
xAxis?: Partial<BaseAxisProps>;
|
|
7
|
+
yAxis?: Partial<BaseAxisProps>;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
inset: ChartInset;
|
|
11
|
+
axisPadding: ChartInset;
|
|
12
|
+
};
|
|
13
|
+
type AxisRange = {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const computeAxisRange: (drawingArea: DrawingArea) => {
|
|
18
|
+
xRange: AxisRange;
|
|
19
|
+
yRange: AxisRange;
|
|
20
|
+
};
|
|
21
|
+
export declare const buildScale: (domain: AxisBounds, range: AxisRange, scaleType?: BaseAxisProps["scaleType"], nice?: boolean) => ChartScaleFunction;
|
|
22
|
+
export declare const computeDrawingArea: (width: number, height: number, inset: ChartInset, axisPadding: ChartInset) => DrawingArea;
|
|
23
|
+
export declare const useBuildChartContext: ({ series, xAxis, yAxis, width, height, inset, axisPadding, }: UseBuildChartContextParams) => CartesianChartContextValue;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=useBuildChartContext.d.ts.map
|
package/dist/lib/Components/visualization/CartesianChart/context/useBuildChartContext.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBuildChartContext.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/context/useBuildChartContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAW5D,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,MAAM,EACP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9C,eAAO,MAAM,gBAAgB,GAC3B,aAAa,WAAW,KACvB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAMvC,CAAC;AAEH,eAAO,MAAM,UAAU,GACrB,QAAQ,UAAU,EAClB,OAAO,SAAS,EAChB,YAAW,aAAa,CAAC,WAAW,CAAY,EAChD,OAAO,OAAO,KACb,kBAGsD,CAAC;AAE1D,eAAO,MAAM,kBAAkB,GAC7B,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,OAAO,UAAU,EACjB,aAAa,UAAU,KACtB,WAaF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,8DAQlC,0BAA0B,KAAG,0BAiC/B,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useMemo as u } from "react";
|
|
2
|
+
import { computeXDomain as y, computeYDomain as C, computeDataLength as M } from "../../utils/domain/domain.js";
|
|
3
|
+
import { getCategoricalScale as R, getNumericScale as _, isBandScaleType as X } from "../../utils/scales/scales.js";
|
|
4
|
+
const Y = (t) => ({
|
|
5
|
+
xRange: { min: t.x, max: t.x + t.width },
|
|
6
|
+
yRange: {
|
|
7
|
+
min: t.y + t.height,
|
|
8
|
+
max: t.y
|
|
9
|
+
}
|
|
10
|
+
}), f = (t, e, o = "linear", c) => X(o) ? R({ domain: t, range: e }) : _({ scaleType: o, domain: t, range: e, nice: c }), B = (t, e, o, c) => {
|
|
11
|
+
const m = {
|
|
12
|
+
top: o.top + c.top,
|
|
13
|
+
right: o.right + c.right,
|
|
14
|
+
bottom: o.bottom + c.bottom,
|
|
15
|
+
left: o.left + c.left
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
x: m.left,
|
|
19
|
+
y: m.top,
|
|
20
|
+
width: Math.max(0, t - m.left - m.right),
|
|
21
|
+
height: Math.max(0, e - m.top - m.bottom)
|
|
22
|
+
};
|
|
23
|
+
}, N = ({
|
|
24
|
+
series: t,
|
|
25
|
+
xAxis: e,
|
|
26
|
+
yAxis: o,
|
|
27
|
+
width: c,
|
|
28
|
+
height: m,
|
|
29
|
+
inset: l,
|
|
30
|
+
axisPadding: p
|
|
31
|
+
}) => {
|
|
32
|
+
const a = u(
|
|
33
|
+
() => B(c, m, l, p),
|
|
34
|
+
[c, m, l, p]
|
|
35
|
+
);
|
|
36
|
+
return u(() => {
|
|
37
|
+
const { xRange: r, yRange: S } = Y(a);
|
|
38
|
+
let h, g;
|
|
39
|
+
if (a.width > 0 && a.height > 0) {
|
|
40
|
+
const n = y(t, e), b = C(t, o);
|
|
41
|
+
h = f(n, r, e?.scaleType, e?.nice), g = f(b, S, o?.scaleType, o?.nice);
|
|
42
|
+
}
|
|
43
|
+
const i = M(t, e), D = new Map(t.map((n) => [n.id, n]));
|
|
44
|
+
return {
|
|
45
|
+
series: t,
|
|
46
|
+
seriesMap: D,
|
|
47
|
+
getXScale: (n) => h,
|
|
48
|
+
getYScale: (n) => g,
|
|
49
|
+
getXAxisConfig: (n) => e,
|
|
50
|
+
getYAxisConfig: (n) => o,
|
|
51
|
+
drawingArea: a,
|
|
52
|
+
dataLength: i
|
|
53
|
+
};
|
|
54
|
+
}, [t, e, o, a]);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
f as buildScale,
|
|
58
|
+
Y as computeAxisRange,
|
|
59
|
+
B as computeDrawingArea,
|
|
60
|
+
N as useBuildChartContext
|
|
61
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type ShimmerAnimationResult = {
|
|
2
|
+
/**
|
|
3
|
+
* Value for the CSS `animation` shorthand, applied via `style` on the
|
|
4
|
+
* element that should shimmer.
|
|
5
|
+
*/
|
|
6
|
+
animationStyle: string;
|
|
7
|
+
/**
|
|
8
|
+
* `@keyframes` definition to inject inside an SVG `<style>` element.
|
|
9
|
+
*/
|
|
10
|
+
keyframe: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Self-contained shimmer (opacity pulse) for SVG content. Shared by the initial
|
|
14
|
+
* loading placeholder and the transition-loading line.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useShimmerAnimation: () => ShimmerAnimationResult;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useShimmerAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShimmerAnimation.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/CartesianChart/hooks/useShimmerAnimation.ts"],"names":[],"mappings":"AAMA,KAAK,sBAAsB,GAAG;IAC5B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,sBAatC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useId as o, useMemo as m } from "react";
|
|
2
|
+
import { chartConfig as r } from "../../config.js";
|
|
3
|
+
const { shimmer: i } = r, a = () => {
|
|
4
|
+
const e = `shimmer-pulse-${o().replaceAll(":", "")}`;
|
|
5
|
+
return m(
|
|
6
|
+
() => ({
|
|
7
|
+
animationStyle: `${e} ${i.pulseDurationInSeconds}s ${i.pulseEasing} infinite`,
|
|
8
|
+
keyframe: `@keyframes ${e} { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } @media (prefers-reduced-motion: reduce) { @keyframes ${e} { 0%, 100% { opacity: 1; } } }`
|
|
9
|
+
}),
|
|
10
|
+
[e]
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
a as useShimmerAnimation
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/CartesianChart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseAxisProps } from '../Axis';
|
|
3
|
+
import { ChartInset, ChartScaleFunction, DrawingArea, Series } from '../utils/types';
|
|
4
|
+
/**
|
|
5
|
+
* Chart-level scrubbing configuration. Owned here and composed by the chart
|
|
6
|
+
* types and {@link ScrubberProviderProps} so the JSDoc lives in a single place.
|
|
7
|
+
*/
|
|
8
|
+
export type ScrubbingOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Enables scrubbing (hover/touch/keyboard) interactions on the chart.
|
|
11
|
+
* When true, the SVG becomes focusable; add a `<Scrubber>` child to
|
|
12
|
+
* visualise the interaction.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
enableScrubbing?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback fired whenever the scrubber moves to a new data index or is cleared.
|
|
18
|
+
* Receives `undefined` when the scrubber leaves the chart.
|
|
19
|
+
*/
|
|
20
|
+
onScrubberPositionChange?: (index: number | undefined) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Pixel radius within which the scrubber magnetically snaps to registered
|
|
23
|
+
* magnetic `<Point>` components. Requires `enableScrubbing` to be `true`.
|
|
24
|
+
* Set to `0` to disable magnetization.
|
|
25
|
+
* @default 8
|
|
26
|
+
*/
|
|
27
|
+
magnetRadius?: number;
|
|
28
|
+
};
|
|
29
|
+
export type CartesianChartProps = ScrubbingOptions & {
|
|
30
|
+
/**
|
|
31
|
+
* Data series provided to child components via context.
|
|
32
|
+
*/
|
|
33
|
+
series: Series[];
|
|
34
|
+
/**
|
|
35
|
+
* Scale and domain configuration for the x-axis.
|
|
36
|
+
*/
|
|
37
|
+
xAxis?: Partial<BaseAxisProps>;
|
|
38
|
+
/**
|
|
39
|
+
* Scale and domain configuration for the y-axis.
|
|
40
|
+
*/
|
|
41
|
+
yAxis?: Partial<BaseAxisProps>;
|
|
42
|
+
/**
|
|
43
|
+
* Width of the chart.
|
|
44
|
+
* A number is treated as pixels; a string (e.g. `'100%'`) fills the container
|
|
45
|
+
* and enables auto-measurement via `ResizeObserver`.
|
|
46
|
+
* @default '100%'
|
|
47
|
+
*/
|
|
48
|
+
width?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* Height of the chart in pixels.
|
|
51
|
+
* @default 240
|
|
52
|
+
*/
|
|
53
|
+
height?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Extra padding between the SVG edge and the drawing area, added on top of
|
|
56
|
+
* a built-in overflow buffer that prevents content (labels, points, ticks)
|
|
57
|
+
* from being clipped. A number applies uniformly; a partial object sets
|
|
58
|
+
* individual sides (unset sides default to `0`).
|
|
59
|
+
*/
|
|
60
|
+
inset?: number | Partial<ChartInset>;
|
|
61
|
+
/**
|
|
62
|
+
* Space reserved for axes around the drawing area.
|
|
63
|
+
* Shrinks the drawing area by the specified amount on each side.
|
|
64
|
+
*/
|
|
65
|
+
axisPadding?: Partial<ChartInset>;
|
|
66
|
+
/**
|
|
67
|
+
* Accessible label for the chart SVG.
|
|
68
|
+
* @default 'Chart'
|
|
69
|
+
*/
|
|
70
|
+
ariaLabel?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Sets `aria-busy` on the chart SVG to signal that its content is loading.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
ariaBusy?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* HTML content rendered as an absolutely-positioned overlay above the chart
|
|
78
|
+
* SVG, within the same positioned container (so it aligns with the chart
|
|
79
|
+
* footprint). Used for e.g. an empty-state label.
|
|
80
|
+
*/
|
|
81
|
+
overlay?: ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* SVG content rendered inside the chart's context provider.
|
|
84
|
+
*/
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* Whether to animate the chart on mount and data changes.
|
|
88
|
+
* Duration is 0.8 seconds and easing is linear.
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
animate?: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type CartesianChartContextValue = {
|
|
94
|
+
/**
|
|
95
|
+
* All data series registered in the chart.
|
|
96
|
+
*/
|
|
97
|
+
series: Series[];
|
|
98
|
+
/**
|
|
99
|
+
* Lookup map for series by ID. Stable reference when series identity is unchanged.
|
|
100
|
+
*/
|
|
101
|
+
seriesMap: Map<string, Series>;
|
|
102
|
+
/**
|
|
103
|
+
* Returns the x-axis scale. Accepts an optional axis ID for future multi-axis support.
|
|
104
|
+
*/
|
|
105
|
+
getXScale: (id?: string) => ChartScaleFunction | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the y-axis scale. Accepts an optional axis ID for future multi-axis support.
|
|
108
|
+
*/
|
|
109
|
+
getYScale: (id?: string) => ChartScaleFunction | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the x-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
112
|
+
*/
|
|
113
|
+
getXAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the y-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
116
|
+
*/
|
|
117
|
+
getYAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Pixel bounds of the drawable region.
|
|
120
|
+
*/
|
|
121
|
+
drawingArea: DrawingArea;
|
|
122
|
+
/**
|
|
123
|
+
* Number of data points along the x-axis.
|
|
124
|
+
*/
|
|
125
|
+
dataLength: number;
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/CartesianChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,MAAM,EACP,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACnD;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChartInset } from '../utils/types';
|
|
2
|
+
import { CartesianChartProps } from './types';
|
|
3
|
+
export declare const resolveInset: (inset: CartesianChartProps["inset"]) => ChartInset;
|
|
4
|
+
export declare const resolveAxisPadding: (padding: CartesianChartProps["axisPadding"]) => ChartInset;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/CartesianChart/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,YAAY,GACvB,OAAO,mBAAmB,CAAC,OAAO,CAAC,KAClC,UAqBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,mBAAmB,CAAC,aAAa,CAAC,KAC1C,UAQF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { chartConfig as r } from "../config.js";
|
|
2
|
+
const f = (o) => {
|
|
3
|
+
let t;
|
|
4
|
+
return o === void 0 ? t = r.root.zeroPadding : typeof o == "number" ? t = { top: o, right: o, bottom: o, left: o } : t = {
|
|
5
|
+
top: o.top ?? 0,
|
|
6
|
+
right: o.right ?? 0,
|
|
7
|
+
bottom: o.bottom ?? 0,
|
|
8
|
+
left: o.left ?? 0
|
|
9
|
+
}, {
|
|
10
|
+
top: t.top,
|
|
11
|
+
right: t.right,
|
|
12
|
+
bottom: t.bottom,
|
|
13
|
+
left: t.left
|
|
14
|
+
};
|
|
15
|
+
}, l = (o) => o === void 0 ? r.root.zeroPadding : {
|
|
16
|
+
top: o.top ?? 0,
|
|
17
|
+
right: o.right ?? 0,
|
|
18
|
+
bottom: o.bottom ?? 0,
|
|
19
|
+
left: o.left ?? 0
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as resolveAxisPadding,
|
|
23
|
+
f as resolveInset
|
|
24
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DonutChartProps } from './types';
|
|
2
|
+
export declare function DonutChart({ series: seriesProp, size, ariaLabel, loading, activeId: activeIdProp, defaultActiveId, onActiveIdChange, renderCenter, renderCenterActive, enableColorContrast, }: DonutChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ/C,wBAAgB,UAAU,CAAC,EACzB,MAAM,EAAE,UAAU,EAClB,IAAW,EACX,SAAyB,EACzB,OAAe,EACf,QAAQ,EAAE,YAAY,EACtB,eAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAA2B,GAC5B,EAAE,eAAe,2CA4FjB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as I, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as g } from "react";
|
|
3
|
+
import { chartConfig as P } from "../config.js";
|
|
4
|
+
import { DonutChartAnimatedCenter as T } from "./DonutChartAnimatedCenter.js";
|
|
5
|
+
import { DonutRing as j } from "./DonutRing.js";
|
|
6
|
+
import { DonutSizeProvider as y } from "./donutSizeContext.js";
|
|
7
|
+
import { useContrastSafeSeries as A } from "./hooks/useContrastSafeSeries.js";
|
|
8
|
+
import { buildRingSegments as E, DONUT_GEOMETRY as M, getSegmentPercents as N, formatPercentLabel as B } from "./utils.js";
|
|
9
|
+
import { useControllableState as O } from "../../../../utils/useControllableState/useControllableState.js";
|
|
10
|
+
function H({
|
|
11
|
+
series: p,
|
|
12
|
+
size: l = "md",
|
|
13
|
+
ariaLabel: h = "Donut chart",
|
|
14
|
+
loading: c = !1,
|
|
15
|
+
activeId: v,
|
|
16
|
+
defaultActiveId: S = null,
|
|
17
|
+
onActiveIdChange: b,
|
|
18
|
+
renderCenter: s,
|
|
19
|
+
renderCenterActive: a,
|
|
20
|
+
enableColorContrast: x = !1
|
|
21
|
+
}) {
|
|
22
|
+
const n = M[l], e = A(p, x), [o, u] = O({
|
|
23
|
+
prop: v,
|
|
24
|
+
defaultProp: S,
|
|
25
|
+
onChange: b
|
|
26
|
+
}), L = g(
|
|
27
|
+
() => E(e, n),
|
|
28
|
+
[e, n]
|
|
29
|
+
), m = g(() => {
|
|
30
|
+
const t = e.findIndex((f) => f.id === o);
|
|
31
|
+
if (o == null || t === -1)
|
|
32
|
+
return null;
|
|
33
|
+
const r = N(e)[t];
|
|
34
|
+
return {
|
|
35
|
+
...e[t],
|
|
36
|
+
percent: r,
|
|
37
|
+
percentLabel: B(r)
|
|
38
|
+
};
|
|
39
|
+
}, [e, o]), d = () => {
|
|
40
|
+
o !== null && u(null);
|
|
41
|
+
}, R = (t) => {
|
|
42
|
+
const { relatedTarget: r } = t;
|
|
43
|
+
(!(r instanceof Node) || !t.currentTarget.contains(r)) && d();
|
|
44
|
+
}, D = s != null || a != null, C = a != null;
|
|
45
|
+
return /* @__PURE__ */ I(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
role: "presentation",
|
|
49
|
+
"data-testid": "donut-chart",
|
|
50
|
+
style: {
|
|
51
|
+
position: "relative",
|
|
52
|
+
width: n.box,
|
|
53
|
+
height: n.box
|
|
54
|
+
},
|
|
55
|
+
onMouseLeave: d,
|
|
56
|
+
onBlur: R,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ i(
|
|
59
|
+
j,
|
|
60
|
+
{
|
|
61
|
+
segments: L,
|
|
62
|
+
geometry: n,
|
|
63
|
+
ariaLabel: c ? P.donut.loading.ariaLabel : h,
|
|
64
|
+
activeId: o,
|
|
65
|
+
loading: c,
|
|
66
|
+
onSegmentEnter: u
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
D && /* @__PURE__ */ i(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-testid": "donut-center",
|
|
73
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
74
|
+
children: /* @__PURE__ */ i(y, { value: { size: l }, children: C ? /* @__PURE__ */ i(
|
|
75
|
+
T,
|
|
76
|
+
{
|
|
77
|
+
activeSegment: m,
|
|
78
|
+
renderResting: () => s?.({ series: e, activeSegment: null }) ?? null,
|
|
79
|
+
renderActive: (t) => a({ activeSegment: t })
|
|
80
|
+
}
|
|
81
|
+
) : s?.({ activeSegment: m, series: e }) })
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
H as DonutChart
|
|
90
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DonutActiveSegment } from './types';
|
|
3
|
+
type DonutChartAnimatedCenterProps = {
|
|
4
|
+
activeSegment: DonutActiveSegment | null;
|
|
5
|
+
renderResting: () => ReactNode;
|
|
6
|
+
renderActive: (segment: DonutActiveSegment) => ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const DonutChartAnimatedCenter: ({ activeSegment, renderResting, renderActive, }: DonutChartAnimatedCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=DonutChartAnimatedCenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChartAnimatedCenter.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/DonutChart/DonutChartAnimatedCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,KAAK,6BAA6B,GAAG;IACnC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,SAAS,CAAC;IAC/B,YAAY,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,SAAS,CAAC;CAC1D,CAAC;AAKF,eAAO,MAAM,wBAAwB,GAAI,iDAItC,6BAA6B,4CA6D/B,CAAC"}
|