@ledgerhq/lumen-ui-react 0.1.56 → 0.1.58
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/index.js +176 -172
- package/dist/lib/Components/core/DotIcon/DotIcon.d.ts +0 -13
- package/dist/lib/Components/core/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/lib/Components/core/DotIcon/DotIcon.js +15 -28
- package/dist/lib/Components/core/DotIcon/getDotIconProps.d.ts +66 -0
- package/dist/lib/Components/core/DotIcon/getDotIconProps.d.ts.map +1 -0
- package/dist/lib/Components/core/DotIcon/getDotIconProps.js +19 -0
- package/dist/lib/Components/core/DotIcon/index.d.ts +9 -1
- package/dist/lib/Components/core/DotIcon/index.d.ts.map +1 -1
- package/dist/lib/Components/core/DotIcon/index.js +10 -0
- package/dist/lib/Components/core/DotSymbol/DotSymbol.d.ts +1 -5
- package/dist/lib/Components/core/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +14 -33
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts +102 -0
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts.map +1 -0
- package/dist/lib/Components/core/DotSymbol/getDotSymbolProps.js +25 -0
- package/dist/lib/Components/core/DotSymbol/index.d.ts +14 -1
- package/dist/lib/Components/core/DotSymbol/index.d.ts.map +1 -1
- package/dist/lib/Components/core/DotSymbol/index.js +15 -0
- package/dist/lib/Components/core/Tooltip/Tooltip.d.ts +0 -8
- package/dist/lib/Components/core/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/lib/Components/core/Tooltip/Tooltip.js +1 -1
- 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 +12 -4
- package/package.json +12 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type LegendItem = {
|
|
2
|
+
/**
|
|
3
|
+
* Stable identifier for the series or segment.
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Human-readable label.
|
|
8
|
+
* Falls back to `id` when omitted.
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Swatch color.
|
|
13
|
+
* Falls back to the neutral default when omitted.
|
|
14
|
+
*/
|
|
15
|
+
color?: string;
|
|
16
|
+
};
|
|
17
|
+
export type LegendProps = {
|
|
18
|
+
/**
|
|
19
|
+
* Series or segments to display in the legend.
|
|
20
|
+
*/
|
|
21
|
+
series: LegendItem[];
|
|
22
|
+
/**
|
|
23
|
+
* Accessible label for the legend group.
|
|
24
|
+
* @default 'Legend'
|
|
25
|
+
*/
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Additional custom CSS classes to apply to the root list.
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Legend/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Line/Line.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzC,eAAO,MAAM,IAAI,iDA8Ff,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as N, useId as O, useMemo as d } from "react";
|
|
3
|
+
import { chartConfig as b } from "../config.js";
|
|
4
|
+
import { isNumericScale as A } from "../utils/scales/scales.js";
|
|
5
|
+
import { toScaledPoints as G, buildLinePath as I, buildAreaPath as M } from "./utils.js";
|
|
6
|
+
import { useCartesianChartContext as T } from "../CartesianChart/context/cartesianChartContext.js";
|
|
7
|
+
import { usePathReveal as W } from "../CartesianChart/RevealAnimation/context.js";
|
|
8
|
+
const { color: X, strokeWidth: D, line: F } = b, J = N(function({
|
|
9
|
+
seriesId: g,
|
|
10
|
+
stroke: x,
|
|
11
|
+
showArea: i = !1,
|
|
12
|
+
areaType: Y = "gradient",
|
|
13
|
+
curve: C,
|
|
14
|
+
connectNulls: k
|
|
15
|
+
}) {
|
|
16
|
+
const { getXScale: y, getYScale: P, getXAxisConfig: S, drawingArea: s, seriesMap: v } = T(), L = W(), l = y(), n = P(), p = S(), f = O(), t = v.get(g), r = (x ?? t?.stroke) || X.stroke, a = C ?? t?.curve, u = k ?? t?.connectNulls ?? !1, e = d(
|
|
17
|
+
() => t?.data && l && n && A(n) ? G(
|
|
18
|
+
t.data,
|
|
19
|
+
l,
|
|
20
|
+
n,
|
|
21
|
+
p?.data,
|
|
22
|
+
u
|
|
23
|
+
) : null,
|
|
24
|
+
[t, l, n, p, u]
|
|
25
|
+
), m = d(
|
|
26
|
+
() => e ? I(e, a) : null,
|
|
27
|
+
[e, a]
|
|
28
|
+
), h = d(
|
|
29
|
+
() => i && e && s ? M(e, s, a) : null,
|
|
30
|
+
[i, e, s, a]
|
|
31
|
+
);
|
|
32
|
+
return m ? /* @__PURE__ */ c("g", { clipPath: L, children: [
|
|
33
|
+
i && h && r && /* @__PURE__ */ c(j, { children: [
|
|
34
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ c(
|
|
35
|
+
"linearGradient",
|
|
36
|
+
{
|
|
37
|
+
"data-testid": "line-gradient",
|
|
38
|
+
id: f,
|
|
39
|
+
x1: "0",
|
|
40
|
+
y1: "0",
|
|
41
|
+
x2: "0",
|
|
42
|
+
y2: "1",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
|
+
"stop",
|
|
46
|
+
{
|
|
47
|
+
offset: "0%",
|
|
48
|
+
stopColor: r,
|
|
49
|
+
stopOpacity: F.areaGradientOpacity
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: r, stopOpacity: 0 })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ o(
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
"data-testid": "line-area",
|
|
60
|
+
d: h,
|
|
61
|
+
fill: `url(#${f})`,
|
|
62
|
+
stroke: "none"
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ o(
|
|
67
|
+
"path",
|
|
68
|
+
{
|
|
69
|
+
"data-testid": "line-path",
|
|
70
|
+
d: m,
|
|
71
|
+
fill: "none",
|
|
72
|
+
stroke: r,
|
|
73
|
+
strokeWidth: D.line,
|
|
74
|
+
strokeLinecap: "round",
|
|
75
|
+
strokeLinejoin: "round"
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] }) : null;
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
J as Line
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CurveType } from '../utils/types';
|
|
2
|
+
export type { CurveType };
|
|
3
|
+
/**
|
|
4
|
+
* Rendering options shared by `Line` (per-line) and `LineChart` (applied to
|
|
5
|
+
* every line). Owned here so both types stay in sync.
|
|
6
|
+
*/
|
|
7
|
+
export type LineRenderOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to render a filled area under the line.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showArea?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Area fill style.
|
|
15
|
+
* When `'gradient'`, renders a vertical gradient from the stroke color to transparent.
|
|
16
|
+
* @default 'gradient'
|
|
17
|
+
*/
|
|
18
|
+
areaType?: 'gradient';
|
|
19
|
+
};
|
|
20
|
+
export type LineProps = LineRenderOptions & {
|
|
21
|
+
/**
|
|
22
|
+
* The ID of the series to render.
|
|
23
|
+
* Must match a `Series.id` provided to the parent chart.
|
|
24
|
+
*/
|
|
25
|
+
seriesId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Override color for the line stroke.
|
|
28
|
+
* When omitted, falls back to the `stroke` defined on the series.
|
|
29
|
+
*/
|
|
30
|
+
stroke?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Override interpolation used to draw the line between data points.
|
|
33
|
+
* When omitted, falls back to the `curve` defined on the series.
|
|
34
|
+
* @default 'bump'
|
|
35
|
+
*/
|
|
36
|
+
curve?: CurveType;
|
|
37
|
+
/**
|
|
38
|
+
* When true, skips null values and draws a continuous line across gaps.
|
|
39
|
+
* When false, null values create gaps in the line.
|
|
40
|
+
* When omitted, falls back to the `connectNulls` defined on the series.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
connectNulls?: boolean;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Line/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG;IAC1C;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChartScaleFunction, CurveType, DrawingArea, NumericScale } from '../utils/types';
|
|
2
|
+
type Point = [x: number, y: number | null];
|
|
3
|
+
/**
|
|
4
|
+
* Project series data into scaled [x, y] pixel coordinates.
|
|
5
|
+
*
|
|
6
|
+
* When `xData` contains numeric values, those values are fed into the scale
|
|
7
|
+
* instead of the array index so the points honour a numeric X domain.
|
|
8
|
+
*
|
|
9
|
+
* When `xData` is provided, iteration is capped at `xData.length` so a series
|
|
10
|
+
* with more points than the axis has labels does not overflow past the right
|
|
11
|
+
* edge of the chart. The axis is treated as authoritative for the X domain.
|
|
12
|
+
*
|
|
13
|
+
* Null values (and other non-finite numbers) are handled according to `connectNulls`:
|
|
14
|
+
* - `false` (default): kept as `[x, null]` holes so the line/area break into
|
|
15
|
+
* gaps via the generators' `.defined()` check.
|
|
16
|
+
* - `true`: skipped entirely so the line is drawn continuously across gaps.
|
|
17
|
+
*/
|
|
18
|
+
export declare const toScaledPoints: (data: (number | null)[], xScale: ChartScaleFunction, yScale: NumericScale, xData?: readonly (string | number)[], connectNulls?: boolean) => Point[] | null;
|
|
19
|
+
/**
|
|
20
|
+
* Build the SVG `d` attribute for the line stroke.
|
|
21
|
+
*/
|
|
22
|
+
export declare const buildLinePath: (points: Point[], curve?: CurveType) => string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Build the SVG `d` attribute for the filled area beneath the line.
|
|
25
|
+
*/
|
|
26
|
+
export declare const buildAreaPath: (points: Point[], drawingArea: DrawingArea, curve?: CurveType) => string | null;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/Line/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAoB3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EACvB,QAAQ,kBAAkB,EAC1B,QAAQ,YAAY,EACpB,QAAQ,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACpC,sBAAoB,KACnB,KAAK,EAAE,GAAG,IA4BZ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,KAAK,EAAE,EACf,QAAQ,SAAS,KAChB,MAAM,GAAG,IAQX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,KAAK,EAAE,EACf,aAAa,WAAW,EACxB,QAAQ,SAAS,KAChB,MAAM,GAAG,IAWX,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { line as y, curveStepBefore as d, curveStepAfter as C, curveStep as g, curveNatural as F, curveMonotoneX as a, curveLinear as A, curveBumpX as B, area as E } from "d3-shape";
|
|
2
|
+
import { isFiniteNumber as L } from "../utils/numbers.js";
|
|
3
|
+
import { isCategoricalScale as P } from "../utils/scales/scales.js";
|
|
4
|
+
const m = {
|
|
5
|
+
bump: B,
|
|
6
|
+
linear: A,
|
|
7
|
+
monotone: a,
|
|
8
|
+
natural: F,
|
|
9
|
+
step: g,
|
|
10
|
+
stepAfter: C,
|
|
11
|
+
stepBefore: d
|
|
12
|
+
}, h = "bump", v = (e = h) => m[e] ?? m[h], V = (e, t, n, o, r = !1) => {
|
|
13
|
+
const i = [], b = o ? Math.min(e.length, o.length) : e.length;
|
|
14
|
+
let l = 0;
|
|
15
|
+
for (let u = 0; u < b; u++) {
|
|
16
|
+
const c = e[u], s = L(c);
|
|
17
|
+
if (!s && r) continue;
|
|
18
|
+
const p = o && typeof o[u] == "number" ? o[u] : u, f = P(t) ? (t(p) ?? 0) + t.bandwidth() / 2 : t(p);
|
|
19
|
+
if (!s) {
|
|
20
|
+
i.push([f, null]);
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
i.push([f, n(c)]), l++;
|
|
24
|
+
}
|
|
25
|
+
return l >= 2 ? i : null;
|
|
26
|
+
}, I = (e, t) => y().defined((n) => n[1] !== null).x((n) => n[0]).y((n) => n[1]).curve(v(t))(e) ?? null, M = (e, t, n) => {
|
|
27
|
+
const o = t.y + t.height;
|
|
28
|
+
return E().defined((r) => r[1] !== null).x((r) => r[0]).y0(o).y1((r) => r[1]).curve(v(n))(e) ?? null;
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
M as buildAreaPath,
|
|
32
|
+
I as buildLinePath,
|
|
33
|
+
V as toScaledPoints
|
|
34
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LineChartProps } from './types';
|
|
2
|
+
export declare function LineChart({ series: seriesProp, showArea, areaType, connectNulls, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, loading, emptyLabel, enableColorContrast, children, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/LineChart.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA+GjB,wBAAgB,SAAS,CAAC,EACxB,MAAM,EAAE,UAAU,EAClB,QAAgB,EAChB,QAAqB,EACrB,YAAY,EACZ,SAAiB,EACjB,SAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuC,EACvC,KAAK,EACL,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,YAAY,EACZ,OAAe,EACf,UAAgD,EAChD,mBAA2B,EAC3B,QAAQ,GACT,EAAE,cAAc,2CAuFhB"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx as t, jsxs as D, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as d } from "react";
|
|
3
|
+
import { ChartEmptyLabel as R } from "../CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js";
|
|
4
|
+
import { useShimmerAnimation as q } from "../CartesianChart/hooks/useShimmerAnimation.js";
|
|
5
|
+
import { chartConfig as h } from "../config.js";
|
|
6
|
+
import { mergeDefaults as b, computeAxisPadding as z, canRenderLine as J, getChartAriaLabel as K, getChartDisplayStates as Q } from "./utils.js";
|
|
7
|
+
import { CartesianChart as U } from "../CartesianChart/CartesianChart.js";
|
|
8
|
+
import { LineChartEmptyState as V } from "./LineChartEmptyState/LineChartEmptyState.js";
|
|
9
|
+
import { XAxis as X } from "../Axis/XAxis/XAxis.js";
|
|
10
|
+
import { YAxis as Y } from "../Axis/YAxis/YAxis.js";
|
|
11
|
+
import { Line as Z } from "../Line/Line.js";
|
|
12
|
+
import { useTheme as _ } from "../../core/ThemeProvider/ThemeProvider.js";
|
|
13
|
+
import { getContrastSafeColor as $ } from "../../../../libs/design-core/dist/lib/colorContrast/colorContrast.js";
|
|
14
|
+
import { primitiveColorTokens as v } from "../../../../libs/design-core/dist/lib/themes/js/primitives/primitive.colors.js";
|
|
15
|
+
const N = {
|
|
16
|
+
position: "bottom",
|
|
17
|
+
showGrid: !1,
|
|
18
|
+
showLine: !1,
|
|
19
|
+
showTickMark: !1,
|
|
20
|
+
scaleType: "linear",
|
|
21
|
+
nice: !1
|
|
22
|
+
}, tt = {
|
|
23
|
+
position: "start",
|
|
24
|
+
showGrid: !1,
|
|
25
|
+
showLine: !1,
|
|
26
|
+
showTickMark: !1,
|
|
27
|
+
scaleType: "linear",
|
|
28
|
+
nice: !0,
|
|
29
|
+
width: h.axis.defaultWidth
|
|
30
|
+
}, E = ({
|
|
31
|
+
series: e,
|
|
32
|
+
showArea: r,
|
|
33
|
+
areaType: s,
|
|
34
|
+
connectNulls: a,
|
|
35
|
+
stroke: o
|
|
36
|
+
}) => /* @__PURE__ */ t(C, { children: e.map((i) => /* @__PURE__ */ t(
|
|
37
|
+
Z,
|
|
38
|
+
{
|
|
39
|
+
seriesId: i.id,
|
|
40
|
+
stroke: o ?? i.stroke,
|
|
41
|
+
showArea: r,
|
|
42
|
+
areaType: s,
|
|
43
|
+
connectNulls: a
|
|
44
|
+
},
|
|
45
|
+
i.id
|
|
46
|
+
)) }), it = ({
|
|
47
|
+
series: e,
|
|
48
|
+
showArea: r,
|
|
49
|
+
areaType: s,
|
|
50
|
+
connectNulls: a
|
|
51
|
+
}) => {
|
|
52
|
+
const { animationStyle: o, keyframe: i } = q();
|
|
53
|
+
return /* @__PURE__ */ D(C, { children: [
|
|
54
|
+
/* @__PURE__ */ t("style", { children: i }),
|
|
55
|
+
/* @__PURE__ */ t("g", { style: { animation: o }, children: /* @__PURE__ */ t(
|
|
56
|
+
E,
|
|
57
|
+
{
|
|
58
|
+
series: e,
|
|
59
|
+
showArea: r,
|
|
60
|
+
areaType: s,
|
|
61
|
+
connectNulls: a,
|
|
62
|
+
stroke: h.color.mutedLine
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
] });
|
|
66
|
+
}, et = ({
|
|
67
|
+
series: e,
|
|
68
|
+
showArea: r,
|
|
69
|
+
areaType: s,
|
|
70
|
+
connectNulls: a,
|
|
71
|
+
showXAxis: o,
|
|
72
|
+
showYAxis: i,
|
|
73
|
+
xAxisConfig: n,
|
|
74
|
+
yAxisConfig: m,
|
|
75
|
+
isTransitionLoading: p,
|
|
76
|
+
children: g
|
|
77
|
+
}) => /* @__PURE__ */ D(C, { children: [
|
|
78
|
+
o && /* @__PURE__ */ t(X, { ...n }),
|
|
79
|
+
i && /* @__PURE__ */ t(Y, { ...m }),
|
|
80
|
+
p ? /* @__PURE__ */ t(
|
|
81
|
+
it,
|
|
82
|
+
{
|
|
83
|
+
series: e,
|
|
84
|
+
showArea: r,
|
|
85
|
+
areaType: s,
|
|
86
|
+
connectNulls: a
|
|
87
|
+
}
|
|
88
|
+
) : /* @__PURE__ */ t(
|
|
89
|
+
E,
|
|
90
|
+
{
|
|
91
|
+
series: e,
|
|
92
|
+
showArea: r,
|
|
93
|
+
areaType: s,
|
|
94
|
+
connectNulls: a
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
g
|
|
98
|
+
] });
|
|
99
|
+
function ut({
|
|
100
|
+
series: e,
|
|
101
|
+
showArea: r = !1,
|
|
102
|
+
areaType: s = "gradient",
|
|
103
|
+
connectNulls: a,
|
|
104
|
+
showXAxis: o = !1,
|
|
105
|
+
showYAxis: i = !1,
|
|
106
|
+
xAxis: n,
|
|
107
|
+
yAxis: m,
|
|
108
|
+
width: p = "100%",
|
|
109
|
+
height: g = h.root.defaultHeight,
|
|
110
|
+
inset: M,
|
|
111
|
+
enableScrubbing: j,
|
|
112
|
+
onScrubberPositionChange: G,
|
|
113
|
+
animate: W,
|
|
114
|
+
magnetRadius: B,
|
|
115
|
+
loading: L = !1,
|
|
116
|
+
emptyLabel: k = h.emptyState.defaultLabel,
|
|
117
|
+
enableColorContrast: x = !1,
|
|
118
|
+
children: F
|
|
119
|
+
}) {
|
|
120
|
+
const { colorScheme: H } = _(), T = H === "dark" ? v.dark.grey["050"] : v.light.grey["050"], u = d(
|
|
121
|
+
() => e?.map((y) => ({
|
|
122
|
+
...y,
|
|
123
|
+
...y.stroke && x && {
|
|
124
|
+
stroke: $(y.stroke, T)
|
|
125
|
+
}
|
|
126
|
+
})),
|
|
127
|
+
[e, x, T]
|
|
128
|
+
), l = d(
|
|
129
|
+
() => b(N, n),
|
|
130
|
+
[n]
|
|
131
|
+
), c = d(
|
|
132
|
+
() => b(tt, m),
|
|
133
|
+
[m]
|
|
134
|
+
), A = l.position, S = c.position, P = c.width, I = d(
|
|
135
|
+
() => z({
|
|
136
|
+
showXAxis: o,
|
|
137
|
+
showYAxis: i,
|
|
138
|
+
xAxisPosition: A,
|
|
139
|
+
yAxisPosition: S,
|
|
140
|
+
yAxisWidth: P
|
|
141
|
+
}),
|
|
142
|
+
[o, i, A, S, P]
|
|
143
|
+
), w = J(u, l.data), f = Q({ loading: L, hasData: w }), O = K({ loading: L, hasData: w, emptyLabel: k });
|
|
144
|
+
return /* @__PURE__ */ t(
|
|
145
|
+
U,
|
|
146
|
+
{
|
|
147
|
+
series: u ?? [],
|
|
148
|
+
xAxis: l,
|
|
149
|
+
yAxis: c,
|
|
150
|
+
width: p,
|
|
151
|
+
height: g,
|
|
152
|
+
inset: M,
|
|
153
|
+
axisPadding: I,
|
|
154
|
+
enableScrubbing: j,
|
|
155
|
+
onScrubberPositionChange: G,
|
|
156
|
+
animate: W,
|
|
157
|
+
magnetRadius: B,
|
|
158
|
+
ariaLabel: O,
|
|
159
|
+
ariaBusy: L,
|
|
160
|
+
overlay: f.showEmptyOverlay ? /* @__PURE__ */ t(R, { children: k }) : void 0,
|
|
161
|
+
children: f.showPlaceholder ? /* @__PURE__ */ t(V, { loading: f.placeholderLoading }) : /* @__PURE__ */ t(
|
|
162
|
+
et,
|
|
163
|
+
{
|
|
164
|
+
series: u ?? [],
|
|
165
|
+
showArea: r,
|
|
166
|
+
areaType: s,
|
|
167
|
+
connectNulls: a,
|
|
168
|
+
showXAxis: o,
|
|
169
|
+
showYAxis: i,
|
|
170
|
+
xAxisConfig: l,
|
|
171
|
+
yAxisConfig: c,
|
|
172
|
+
isTransitionLoading: f.isTransitionLoading,
|
|
173
|
+
children: F
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
export {
|
|
180
|
+
ut as LineChart
|
|
181
|
+
};
|
package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LineChartEmptyStateProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* SVG placeholder line shown when a LineChart is loading with no data yet (with
|
|
4
|
+
* a shimmer) or has no data to display (static). Uses a fixed line shape scaled
|
|
5
|
+
* into the chart's reserved drawing area, plus static horizontal grid lines, so
|
|
6
|
+
* axes are not needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function LineChartEmptyState({ loading, }: Readonly<LineChartEmptyStateProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=LineChartEmptyState.d.ts.map
|
package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChartEmptyState.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAKxD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAe,GAChB,EAAE,QAAQ,CAAC,wBAAwB,CAAC,kDAkDpC"}
|
package/dist/lib/Components/visualization/LineChart/LineChartEmptyState/LineChartEmptyState.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useShimmerAnimation as p } from "../../CartesianChart/hooks/useShimmerAnimation.js";
|
|
3
|
+
import { chartConfig as f } from "../../config.js";
|
|
4
|
+
import { buildPlaceholderTransform as y } from "./utils.js";
|
|
5
|
+
import { useCartesianChartContext as g } from "../../CartesianChart/context/cartesianChartContext.js";
|
|
6
|
+
import { usePathReveal as u } from "../../CartesianChart/RevealAnimation/context.js";
|
|
7
|
+
const { color: a, strokeWidth: s, emptyState: h } = f;
|
|
8
|
+
function j({
|
|
9
|
+
loading: r = !1
|
|
10
|
+
}) {
|
|
11
|
+
const { drawingArea: t } = g(), { animationStyle: d, keyframe: m } = p(), l = u();
|
|
12
|
+
return t.width <= 0 || t.height <= 0 ? null : /* @__PURE__ */ o(c, { children: [
|
|
13
|
+
r && /* @__PURE__ */ e("style", { children: m }),
|
|
14
|
+
/* @__PURE__ */ o("g", { "data-testid": "chart-empty-state", children: [
|
|
15
|
+
/* @__PURE__ */ e("g", { "data-testid": "chart-empty-state-grid", children: h.gridLineRatios.map((i) => {
|
|
16
|
+
const n = t.y + t.height * i;
|
|
17
|
+
return /* @__PURE__ */ e(
|
|
18
|
+
"line",
|
|
19
|
+
{
|
|
20
|
+
x1: t.x,
|
|
21
|
+
y1: n,
|
|
22
|
+
x2: t.x + t.width,
|
|
23
|
+
y2: n,
|
|
24
|
+
style: {
|
|
25
|
+
stroke: a.gridLine
|
|
26
|
+
},
|
|
27
|
+
strokeWidth: s.hairline
|
|
28
|
+
},
|
|
29
|
+
i
|
|
30
|
+
);
|
|
31
|
+
}) }),
|
|
32
|
+
/* @__PURE__ */ e("g", { clipPath: l, children: /* @__PURE__ */ e("g", { style: r ? { animation: d } : void 0, children: /* @__PURE__ */ e(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
"data-testid": "chart-empty-state-line",
|
|
36
|
+
d: h.placeholderLinePath,
|
|
37
|
+
transform: y(t),
|
|
38
|
+
vectorEffect: "non-scaling-stroke",
|
|
39
|
+
fill: "none",
|
|
40
|
+
stroke: a.mutedLine,
|
|
41
|
+
strokeWidth: s.line,
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round"
|
|
44
|
+
}
|
|
45
|
+
) }) })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
j as LineChartEmptyState
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/LineChart/LineChartEmptyState/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/LineChart/LineChartEmptyState/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DrawingArea } from '../../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Transform that fits `chartConfig.emptyState.placeholderLinePath` into the
|
|
4
|
+
* drawing area. Pair with `vector-effect: non-scaling-stroke` on the path so the
|
|
5
|
+
* stroke keeps a constant width despite the (potentially non-uniform) scale.
|
|
6
|
+
*/
|
|
7
|
+
export declare const buildPlaceholderTransform: (drawingArea: DrawingArea) => string;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/visualization/LineChart/LineChartEmptyState/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,aAAa,WAAW,KAAG,MAOpE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { chartConfig as e } from "../../config.js";
|
|
2
|
+
const h = (t) => {
|
|
3
|
+
const l = t.width / e.emptyState.placeholderViewWidth, o = t.height / e.emptyState.placeholderViewHeight;
|
|
4
|
+
return `translate(${t.x}, ${t.y}) scale(${l}, ${o})`;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
h as buildPlaceholderTransform
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { XAxisProps } from '../Axis/XAxis';
|
|
2
|
+
import { YAxisProps } from '../Axis/YAxis';
|
|
3
|
+
import { CartesianChartProps } from '../CartesianChart/types';
|
|
4
|
+
import { LineRenderOptions } from '../Line/types';
|
|
5
|
+
import { Series } from '../utils/types';
|
|
6
|
+
export type LineChartProps = LineRenderOptions & Pick<CartesianChartProps, 'width' | 'height' | 'inset' | 'animate' | 'children' | 'enableScrubbing' | 'onScrubberPositionChange' | 'magnetRadius'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Data series to render as lines.
|
|
9
|
+
* Each series produces one `<Line>` element.
|
|
10
|
+
*/
|
|
11
|
+
series?: Series[];
|
|
12
|
+
/**
|
|
13
|
+
* Chart-wide override controlling how null values are handled across all lines.
|
|
14
|
+
* When true, skips null values and draws continuous lines across gaps.
|
|
15
|
+
* When false, null values create gaps in the lines.
|
|
16
|
+
* When omitted, each series' own `connectNulls` value is used (defaulting to `false`).
|
|
17
|
+
*/
|
|
18
|
+
connectNulls?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to render an x-axis.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
showXAxis?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to render a y-axis.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
showYAxis?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Combined axis configuration and visual props for the x-axis.
|
|
31
|
+
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
32
|
+
*/
|
|
33
|
+
xAxis?: XAxisProps;
|
|
34
|
+
/**
|
|
35
|
+
* Combined axis configuration and visual props for the y-axis.
|
|
36
|
+
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
37
|
+
*/
|
|
38
|
+
yAxis?: YAxisProps;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the chart is loading. When there is no data, renders an animated
|
|
41
|
+
* shimmer placeholder line (initial loading). When data is present (e.g. a
|
|
42
|
+
* time-range change), the current line is recoloured to a muted grey and
|
|
43
|
+
* shimmers until the new `series` is provided (transition loading).
|
|
44
|
+
*
|
|
45
|
+
* To get the transition behaviour, keep passing the previous `series` while
|
|
46
|
+
* refetching; clearing it falls back to the initial placeholder.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Text shown in the centre of the chart when there is no data and the chart
|
|
52
|
+
* is not loading.
|
|
53
|
+
* @default 'No data'
|
|
54
|
+
*/
|
|
55
|
+
emptyLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* When `true`, each series' `stroke` color is nudged so its HSL lightness
|
|
58
|
+
* differs from the surface background by at least 20 units.
|
|
59
|
+
*
|
|
60
|
+
* Colors that already meet that minimum are left untouched. Only applies to
|
|
61
|
+
* explicit 6-digit hex stroke values; other formats are passed through unchanged.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
enableColorContrast?: boolean;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Series-render fields shared by `LineChart` and its internal line
|
|
68
|
+
* sub-components. Derived from {@link LineChartProps} so the option types stay
|
|
69
|
+
* in sync.
|
|
70
|
+
*/
|
|
71
|
+
type LineSeriesRenderProps = Required<Pick<LineChartProps, 'series' | 'showArea' | 'areaType'>>;
|
|
72
|
+
export type LineChartLinesProps = LineSeriesRenderProps & Pick<LineChartProps, 'connectNulls'> & {
|
|
73
|
+
stroke?: string;
|
|
74
|
+
};
|
|
75
|
+
export type LineChartTransitionLinesProps = Omit<LineChartLinesProps, 'stroke'>;
|
|
76
|
+
export type LineChartContentProps = LineChartLinesProps & Required<Pick<LineChartProps, 'showXAxis' | 'showYAxis'>> & Pick<LineChartProps, 'children'> & {
|
|
77
|
+
xAxisConfig: XAxisProps;
|
|
78
|
+
yAxisConfig: YAxisProps;
|
|
79
|
+
isTransitionLoading: boolean;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/visualization/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAC5C,IAAI,CACF,mBAAmB,EACjB,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,0BAA0B,GAC1B,cAAc,CACjB,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEJ;;;;GAIG;AACH,KAAK,qBAAqB,GAAG,QAAQ,CACnC,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC,CACzD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GACrD,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;AAEhF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GACrD,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC,GACzD,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IACjC,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC"}
|