@ledgerhq/lumen-ui-rnative-visualization 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/lib/Components/Axis/XAxis/XAxis.js +4 -3
- package/dist/module/lib/Components/Axis/XAxis/XAxis.js.map +1 -1
- package/dist/module/lib/Components/Axis/XAxis/XAxis.test.js +14 -0
- package/dist/module/lib/Components/Axis/XAxis/XAxis.test.js.map +1 -1
- package/dist/module/lib/Components/Axis/YAxis/YAxis.js +4 -3
- package/dist/module/lib/Components/Axis/YAxis/YAxis.js.map +1 -1
- package/dist/module/lib/Components/Axis/YAxis/YAxis.test.js +14 -0
- package/dist/module/lib/Components/Axis/YAxis/YAxis.test.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js +30 -23
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +61 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/index.js +4 -0
- package/dist/module/lib/Components/CartesianChart/ChartEmptyLabel/index.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.js → RevealAnimation/RevealAnimationProvider.js} +13 -13
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.test.js → RevealAnimation/RevealAnimationProvider.test.js} +51 -12
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.test.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/context.js +35 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/context.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/index.js +5 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/index.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/types.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/utils.js +64 -0
- package/dist/module/lib/Components/CartesianChart/RevealAnimation/utils.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/hooks/useShimmerAnimation.js +37 -0
- package/dist/module/lib/Components/CartesianChart/hooks/useShimmerAnimation.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/utils.js +1 -1
- package/dist/module/lib/Components/CartesianChart/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/Line.js +18 -11
- package/dist/module/lib/Components/Line/Line.js.map +1 -1
- package/dist/module/lib/Components/Line/constants.js +5 -0
- package/dist/module/lib/Components/Line/constants.js.map +1 -0
- package/dist/module/lib/Components/Line/types.js +2 -0
- package/dist/module/lib/Components/Line/utils.js +38 -11
- package/dist/module/lib/Components/Line/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.test.js +49 -3
- package/dist/module/lib/Components/Line/utils.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.js +131 -27
- package/dist/module/lib/Components/LineChart/LineChart.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.test.js +147 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js +72 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.js +47 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/index.js +4 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/index.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/types.js +4 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/types.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.js +22 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.test.js +21 -0
- package/dist/module/lib/Components/LineChart/LineChartEmptyState/utils.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/utils.js +83 -0
- package/dist/module/lib/Components/LineChart/utils.js.map +1 -0
- package/dist/module/lib/Components/LineChart/utils.test.js +174 -0
- package/dist/module/lib/Components/LineChart/utils.test.js.map +1 -0
- package/dist/module/lib/Components/Point/Point.js +6 -4
- package/dist/module/lib/Components/Point/Point.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/ReferenceLine.js +4 -4
- package/dist/module/lib/Components/ReferenceLine/ReferenceLine.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/constants.js +2 -2
- package/dist/module/lib/Components/ReferenceLine/constants.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/utils.js +2 -1
- package/dist/module/lib/Components/ReferenceLine/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js +2 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/Scrubber.js +2 -2
- package/dist/module/lib/Components/Scrubber/Scrubber.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js +10 -2
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.test.js +79 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.test.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/utils.js +3 -2
- package/dist/module/lib/Components/Scrubber/utils.js.map +1 -1
- package/dist/module/lib/utils/numbers.js +16 -0
- package/dist/module/lib/utils/numbers.js.map +1 -0
- package/dist/module/lib/utils/ticks/ticks.js +0 -16
- package/dist/module/lib/utils/ticks/ticks.js.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts +6 -0
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/XAxis/XAxis.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/YAxis/YAxis.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/CartesianChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +18 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/CartesianChart/ChartEmptyLabel/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/context.d.ts +22 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.d.ts +15 -2
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/utils.d.ts +33 -0
- package/dist/typescript/src/lib/Components/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useShimmerAnimation.d.ts +13 -0
- package/dist/typescript/src/lib/Components/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts +12 -0
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/Line.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Line/Line.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/constants.d.ts +3 -0
- package/dist/typescript/src/lib/Components/Line/constants.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Line/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Line/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/types.d.ts +15 -0
- package/dist/typescript/src/lib/Components/Line/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/utils.d.ts +11 -6
- package/dist/typescript/src/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/utils.d.ts +14 -0
- package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts +41 -1
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/utils.d.ts +43 -0
- package/dist/typescript/src/lib/Components/LineChart/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/ReferenceLine.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/constants.d.ts +2 -2
- package/dist/typescript/src/lib/Components/ReferenceLine/constants.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/Scrubber.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/numbers.d.ts +13 -0
- package/dist/typescript/src/lib/utils/numbers.d.ts.map +1 -0
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts +1 -11
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/types.d.ts +27 -2
- package/dist/typescript/src/lib/utils/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Components/Axis/Axis.types.ts +6 -0
- package/src/lib/Components/Axis/XAxis/XAxis.test.tsx +12 -0
- package/src/lib/Components/Axis/XAxis/XAxis.tsx +29 -32
- package/src/lib/Components/Axis/YAxis/YAxis.test.tsx +12 -0
- package/src/lib/Components/Axis/YAxis/YAxis.tsx +29 -32
- package/src/lib/Components/CartesianChart/CartesianChart.tsx +30 -24
- package/src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.tsx +68 -0
- package/src/lib/Components/CartesianChart/ChartEmptyLabel/index.ts +1 -0
- package/src/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.test.tsx → RevealAnimation/RevealAnimationProvider.test.tsx} +60 -17
- package/src/lib/Components/CartesianChart/{RevealClip/RevealClipDefs.tsx → RevealAnimation/RevealAnimationProvider.tsx} +11 -11
- package/src/lib/Components/CartesianChart/RevealAnimation/context.ts +39 -0
- package/src/lib/Components/CartesianChart/RevealAnimation/index.ts +2 -0
- package/src/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.ts +16 -2
- package/src/lib/Components/CartesianChart/RevealAnimation/utils.ts +87 -0
- package/src/lib/Components/CartesianChart/hooks/useShimmerAnimation.ts +52 -0
- package/src/lib/Components/CartesianChart/types.ts +12 -0
- package/src/lib/Components/CartesianChart/utils.ts +2 -1
- package/src/lib/Components/Line/Line.tsx +26 -14
- package/src/lib/Components/Line/constants.ts +2 -0
- package/src/lib/Components/Line/index.ts +1 -1
- package/src/lib/Components/Line/types.ts +17 -0
- package/src/lib/Components/Line/utils.test.ts +77 -3
- package/src/lib/Components/Line/utils.ts +63 -12
- package/src/lib/Components/LineChart/LineChart.test.tsx +135 -0
- package/src/lib/Components/LineChart/LineChart.tsx +157 -38
- package/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.test.tsx +39 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.tsx +72 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/index.ts +2 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/types.ts +3 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/utils.test.ts +22 -0
- package/src/lib/Components/LineChart/LineChartEmptyState/utils.ts +24 -0
- package/src/lib/Components/LineChart/types.ts +49 -1
- package/src/lib/Components/LineChart/utils.test.ts +196 -0
- package/src/lib/Components/LineChart/utils.ts +107 -0
- package/src/lib/Components/Point/Point.tsx +7 -4
- package/src/lib/Components/ReferenceLine/ReferenceLine.tsx +8 -4
- package/src/lib/Components/ReferenceLine/constants.ts +2 -2
- package/src/lib/Components/ReferenceLine/utils.ts +2 -1
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts +2 -1
- package/src/lib/Components/Scrubber/Scrubber.tsx +13 -2
- package/src/lib/Components/Scrubber/ScrubberProvider.test.tsx +83 -1
- package/src/lib/Components/Scrubber/ScrubberProvider.tsx +17 -2
- package/src/lib/Components/Scrubber/utils.ts +3 -5
- package/src/lib/utils/index.ts +1 -0
- package/src/lib/utils/numbers.ts +15 -0
- package/src/lib/utils/ticks/ticks.ts +1 -23
- package/src/lib/utils/types.ts +35 -2
- package/dist/module/lib/Components/CartesianChart/RevealClip/RevealClipDefs.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/RevealClipDefs.test.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/context.js +0 -8
- package/dist/module/lib/Components/CartesianChart/RevealClip/context.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/index.js +0 -5
- package/dist/module/lib/Components/CartesianChart/RevealClip/index.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/types.js.map +0 -1
- package/dist/module/lib/Components/CartesianChart/RevealClip/utils.js +0 -32
- package/dist/module/lib/Components/CartesianChart/RevealClip/utils.js.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts +0 -3
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/context.d.ts +0 -7
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/context.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/index.d.ts +0 -3
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/index.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/types.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/utils.d.ts +0 -17
- package/dist/typescript/src/lib/Components/CartesianChart/RevealClip/utils.d.ts.map +0 -1
- package/src/lib/Components/CartesianChart/RevealClip/context.ts +0 -13
- package/src/lib/Components/CartesianChart/RevealClip/index.ts +0 -2
- package/src/lib/Components/CartesianChart/RevealClip/utils.ts +0 -51
- /package/dist/module/lib/Components/CartesianChart/{RevealClip → RevealAnimation}/types.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { CurveType } from '../../utils/types';
|
|
2
|
+
export type { CurveType };
|
|
1
3
|
export type LineProps = {
|
|
2
4
|
/**
|
|
3
5
|
* The ID of the series to render.
|
|
@@ -20,5 +22,18 @@ export type LineProps = {
|
|
|
20
22
|
* @default 'gradient'
|
|
21
23
|
*/
|
|
22
24
|
areaType?: 'gradient';
|
|
25
|
+
/**
|
|
26
|
+
* Override interpolation used to draw the line between data points.
|
|
27
|
+
* When omitted, falls back to the `curve` defined on the series.
|
|
28
|
+
* @default 'bump'
|
|
29
|
+
*/
|
|
30
|
+
curve?: CurveType;
|
|
31
|
+
/**
|
|
32
|
+
* When true, skips null values and draws a continuous line across gaps.
|
|
33
|
+
* When false, null values create gaps in the line.
|
|
34
|
+
* When omitted, falls back to the `connectNulls` defined on the series.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
connectNulls?: boolean;
|
|
23
38
|
};
|
|
24
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ChartScaleFunction, DrawingArea, NumericScale } from '../../utils/types';
|
|
2
|
-
type Point = [x: number, y: number];
|
|
1
|
+
import type { ChartScaleFunction, CurveType, DrawingArea, NumericScale } from '../../utils/types';
|
|
2
|
+
type Point = [x: number, y: number | null];
|
|
3
3
|
/**
|
|
4
|
-
* Project series data into scaled [x, y] pixel coordinates
|
|
4
|
+
* Project series data into scaled [x, y] pixel coordinates.
|
|
5
5
|
*
|
|
6
6
|
* When `xData` contains numeric values, those values are fed into the scale
|
|
7
7
|
* instead of the array index so the points honour a numeric X domain.
|
|
@@ -9,15 +9,20 @@ type Point = [x: number, y: number];
|
|
|
9
9
|
* When `xData` is provided, iteration is capped at `xData.length` so a series
|
|
10
10
|
* with more points than the axis has labels does not overflow past the right
|
|
11
11
|
* edge of the chart. The axis is treated as authoritative for the X domain.
|
|
12
|
+
*
|
|
13
|
+
* Non-finite values (e.g. `null`) 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.
|
|
12
17
|
*/
|
|
13
|
-
export declare const toScaledPoints: (data: (number | null)[], xScale: ChartScaleFunction, yScale: NumericScale, xData?: readonly (string | number)[]) => Point[] | null;
|
|
18
|
+
export declare const toScaledPoints: (data: (number | null)[], xScale: ChartScaleFunction, yScale: NumericScale, xData?: readonly (string | number)[], connectNulls?: boolean) => Point[] | null;
|
|
14
19
|
/**
|
|
15
20
|
* Build the SVG `d` attribute for the line stroke.
|
|
16
21
|
*/
|
|
17
|
-
export declare const buildLinePath: (points: Point[]) => string | null;
|
|
22
|
+
export declare const buildLinePath: (points: Point[], curve?: CurveType) => string | null;
|
|
18
23
|
/**
|
|
19
24
|
* Build the SVG `d` attribute for the filled area beneath the line.
|
|
20
25
|
*/
|
|
21
|
-
export declare const buildAreaPath: (points: Point[], drawingArea: DrawingArea) => string | null;
|
|
26
|
+
export declare const buildAreaPath: (points: Point[], drawingArea: DrawingArea, curve?: CurveType) => string | null;
|
|
22
27
|
export {};
|
|
23
28
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LineChartProps } from './types';
|
|
2
|
-
export declare const LineChart: ({ series, showArea, areaType, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, children, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const LineChart: ({ series, showArea, areaType, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, children, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, loading, emptyLabel, connectNulls, }: Readonly<LineChartProps>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA0FjB,eAAO,MAAM,SAAS,GAAI,0MAmBvB,QAAQ,CAAC,cAAc,CAAC,4CAgF1B,CAAC"}
|
package/dist/typescript/src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChartEmptyState.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AASxD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAe,GAChB,EAAE,QAAQ,CAAC,wBAAwB,CAAC,kDA8CpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/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/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,14 @@
|
|
|
1
|
+
import type { DrawingArea } from '../../../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* Fixed placeholder line shape, authored against a {@link PLACEHOLDER_VIEW_WIDTH}
|
|
4
|
+
* x {@link PLACEHOLDER_VIEW_HEIGHT} viewBox. Reused for every empty/loading
|
|
5
|
+
* state so the placeholder always reads the same.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PLACEHOLDER_LINE_PATH = "M1.00 128.27 C4.02 127.46 13.09 125.96 19.13 123.47 C25.19 120.97 31.23 116.53 37.28 113.31 C43.33 110.10 49.38 106.15 55.42 104.20 C61.48 102.24 67.52 102.53 73.57 101.61 C79.61 100.69 85.65 99.89 91.71 98.70 C97.75 97.51 103.80 95.67 109.84 94.47 C115.90 93.27 121.94 91.71 127.99 91.49 C134.03 91.26 140.09 91.53 146.13 93.16 C152.19 94.79 158.23 98.37 164.27 101.25 C170.32 104.13 176.36 108.16 182.42 110.45 C188.46 112.74 194.51 114.41 200.55 115.00 C206.61 115.60 212.65 114.56 218.70 114.03 C224.75 113.50 230.80 112.56 236.84 111.86 C242.88 111.17 248.94 110.27 254.98 109.87 C261.03 109.48 267.07 109.14 273.13 109.49 C279.17 109.82 285.22 110.90 291.26 111.90 C297.32 112.90 303.36 114.47 309.41 115.50 C315.46 116.54 321.50 118.12 327.55 118.11 C333.59 118.10 339.65 118.08 345.69 115.45 C351.74 112.81 357.78 107.02 363.84 102.29 C369.88 97.54 375.93 90.87 381.97 87.01 C388.03 83.16 394.07 79.81 400.11 79.12 C406.17 78.43 412.21 80.79 418.26 82.88 C424.30 84.99 430.36 88.88 436.40 91.74 C442.45 94.59 448.49 98.24 454.55 100.02 C460.59 101.80 466.64 102.08 472.68 102.44 C478.72 102.81 484.78 102.31 490.82 102.21 C496.87 102.11 502.92 101.95 508.97 101.84 C515.01 101.74 521.07 101.47 527.11 101.58 C533.16 101.68 539.20 101.57 545.26 102.48 C551.30 103.39 557.34 105.37 563.39 107.02 C569.43 108.68 575.49 111.02 581.53 112.40 C587.59 113.79 593.63 114.62 599.68 115.30 C605.72 115.98 611.78 115.81 617.82 116.48 C623.87 117.16 629.91 118.39 635.95 119.32 C642.01 120.25 648.05 121.51 654.10 122.04 C660.15 122.57 666.20 123.89 672.24 122.47 C678.30 121.07 684.34 117.39 690.39 113.54 C696.43 109.69 702.49 103.53 708.53 99.38 C714.57 95.23 722.31 90.65 726.66 88.61";
|
|
8
|
+
/**
|
|
9
|
+
* Transform that fits {@link PLACEHOLDER_LINE_PATH} into the drawing area. Pair
|
|
10
|
+
* with `vector-effect: non-scaling-stroke` on the path so the stroke keeps a
|
|
11
|
+
* constant width despite the (potentially non-uniform) scale.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buildPlaceholderTransform: (drawingArea: DrawingArea) => string;
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/LineChart/LineChartEmptyState/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,ypDACsnD,CAAC;AAKzpD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,aAAa,WAAW,KAAG,MAKpE,CAAC"}
|
|
@@ -46,7 +46,7 @@ export type LineChartProps = {
|
|
|
46
46
|
width?: number;
|
|
47
47
|
/**
|
|
48
48
|
* Height of the chart in pixels.
|
|
49
|
-
* @default
|
|
49
|
+
* @default 228
|
|
50
50
|
*/
|
|
51
51
|
height?: number;
|
|
52
52
|
/**
|
|
@@ -81,5 +81,45 @@ export type LineChartProps = {
|
|
|
81
81
|
* @default 6
|
|
82
82
|
*/
|
|
83
83
|
magnetRadius?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the chart is loading. When there is no data, renders an animated
|
|
86
|
+
* shimmer placeholder line (initial loading). When data is present (e.g. a
|
|
87
|
+
* time-range change), the current line is recoloured to a muted grey and
|
|
88
|
+
* shimmers until the new `series` is provided (transition loading).
|
|
89
|
+
*
|
|
90
|
+
* To get the transition behaviour, keep passing the previous `series` while
|
|
91
|
+
* refetching; clearing it falls back to the initial placeholder.
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
loading?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Text shown in the centre of the chart when there is no data and the chart
|
|
97
|
+
* is not loading.
|
|
98
|
+
* @default 'No data'
|
|
99
|
+
*/
|
|
100
|
+
emptyLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Chart-wide override controlling how null values are handled across all lines.
|
|
103
|
+
* When true, skips null values and draws continuous lines across gaps.
|
|
104
|
+
* When false, null values create gaps in the lines.
|
|
105
|
+
* When omitted, each series' own `connectNulls` value is used (defaulting to `false`).
|
|
106
|
+
*/
|
|
107
|
+
connectNulls?: boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Series-render fields shared by `LineChart` and its internal line
|
|
111
|
+
* sub-components. Derived from {@link LineChartProps} so the option types stay
|
|
112
|
+
* in sync.
|
|
113
|
+
*/
|
|
114
|
+
type LineSeriesRenderProps = Required<Pick<LineChartProps, 'series' | 'showArea' | 'areaType'>>;
|
|
115
|
+
export type LineChartLinesProps = LineSeriesRenderProps & Pick<LineChartProps, 'connectNulls'> & {
|
|
116
|
+
stroke?: string;
|
|
117
|
+
};
|
|
118
|
+
export type LineChartTransitionLinesProps = Omit<LineChartLinesProps, 'stroke'>;
|
|
119
|
+
export type LineChartContentProps = LineChartLinesProps & Required<Pick<LineChartProps, 'showXAxis' | 'showYAxis'>> & Pick<LineChartProps, 'children'> & {
|
|
120
|
+
xAxisConfig: XAxisProps;
|
|
121
|
+
yAxisConfig: YAxisProps;
|
|
122
|
+
isTransitionLoading: boolean;
|
|
84
123
|
};
|
|
124
|
+
export {};
|
|
85
125
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;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;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;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;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChartInset, Series } from '../../utils/types';
|
|
2
|
+
import type { XAxisProps } from '../Axis/XAxis';
|
|
3
|
+
import type { YAxisProps } from '../Axis/YAxis';
|
|
4
|
+
type ComputeAxisPaddingParams = {
|
|
5
|
+
showXAxis: boolean;
|
|
6
|
+
showYAxis: boolean;
|
|
7
|
+
xAxisPosition: XAxisProps['position'];
|
|
8
|
+
yAxisPosition: YAxisProps['position'];
|
|
9
|
+
yAxisWidth: YAxisProps['width'];
|
|
10
|
+
};
|
|
11
|
+
type ChartDisplayStateParams = {
|
|
12
|
+
loading: boolean;
|
|
13
|
+
hasData: boolean;
|
|
14
|
+
emptyLabel: string;
|
|
15
|
+
};
|
|
16
|
+
type ChartStatus = 'initial-loading' | 'empty' | 'transition-loading' | 'ready';
|
|
17
|
+
type ChartDisplayState = {
|
|
18
|
+
status: ChartStatus;
|
|
19
|
+
ariaLabel: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Reserves space on the relevant sides of the drawing area for visible axes.
|
|
23
|
+
* Returns `undefined` when no axis is shown so the chart keeps its full area.
|
|
24
|
+
*/
|
|
25
|
+
export declare const computeAxisPadding: ({ showXAxis, showYAxis, xAxisPosition, yAxisPosition, yAxisWidth, }: ComputeAxisPaddingParams) => Partial<ChartInset> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Derives the chart's {@link ChartStatus} from its loading flag and whether it
|
|
28
|
+
* has drawable data, along with the matching accessibility label.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getChartDisplayState: ({ loading, hasData, emptyLabel, }: ChartDisplayStateParams) => ChartDisplayState;
|
|
31
|
+
/**
|
|
32
|
+
* Whether any series has at least {@link MIN_DRAWABLE_POINTS} finite points,
|
|
33
|
+
* i.e. enough to actually draw a line. Drives the empty / loading / data states
|
|
34
|
+
* of the chart.
|
|
35
|
+
*
|
|
36
|
+
* When `xData` (the x-axis domain) is provided, only the first `xData.length`
|
|
37
|
+
* points of each series are considered — mirroring the cap in `toScaledPoints`
|
|
38
|
+
* (Line/utils.ts) — so a series longer than the axis cannot report drawable
|
|
39
|
+
* points that would never be plotted.
|
|
40
|
+
*/
|
|
41
|
+
export declare const canRenderLine: (series: Series[] | undefined, xData?: readonly (string | number)[]) => boolean;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQhD,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACtC,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACtC,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,WAAW,GAAG,iBAAiB,GAAG,OAAO,GAAG,oBAAoB,GAAG,OAAO,CAAC;AAEhF,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,qEAMhC,wBAAwB,KAAG,OAAO,CAAC,UAAU,CAAC,GAAG,SAanD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,mCAIlC,uBAAuB,KAAG,iBAa5B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EAAE,GAAG,SAAS,EAC5B,QAAQ,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KACnC,OAWF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAW3D,wBAAgB,UAAU,CAAC,EACzB,UAAqB,EACrB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAa3B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAqB,EACrB,SAAiB,EACjB,cAAqB,EACrB,IAAmB,EACnB,OAAO,EACP,QAAgB,GACjB,EAAE,QAAQ,CAAC,UAAU,CAAC,kDA0DtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/ReferenceLine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/ReferenceLine.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQlD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAW,EACX,OAAW,EACX,wBAAwB,EACxB,sBAAsB,EACtB,aAAqB,EACrB,MAAM,EACN,SAAoB,EACpB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,kBAAkB,CAAC,kDA6H9B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const REFERENCE_LINE_STROKE_WIDTH = 2;
|
|
2
|
+
export declare const REFERENCE_LINE_DASH_ARRAY = "0.1 6";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,yBAAyB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7D,KAAK,gBAAgB,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAQF,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,cAAc,CAAC;CACpC,CAAC;AAuBF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,gBAAgB,CAAC,kBAAkB,CAAC,EAC9C,UAAU,MAAM,KACf,MAAuC,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,EACb,MAAM,GAAG,GAAG,GAAG,EACf,aAAa,WAAW,KACvB,OAKF,CAAC;AAqBF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,sDAM1B,kBAAkB,KAAG,MAAM,GAAG,SAehC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,wFAQ/C,WAAW,KAAG,gBAKf,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,wFAQ7C,WAAW,KAAG,gBAKf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAUrE,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,IAAI,cAAc,GAAG,IAAI,KACxB,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,OAAO,EACjB,UAAU,MAAM,KACf,MAUF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,cAAc,MAAM,EACpB,aAAa,WAAW,KACvB,MAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,UAAU,OAAO,KAChB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,UAAU,OAAO,KAChB,MAGF,CAAC;AAaF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,oBAAoB,EAAE,EAC7B,UAAU,OAAO,EACjB,UAAU,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EAC1C,WAAW,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,EAC/C,WAAW,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,KAC9C;IAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAahD,CAAC;AAsBF;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAAE,EAC7B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACjC,2BAA2B,CAoC7B;AAED,KAAK,SAAS,GAAG,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM;IAAE,OAAO,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAA;CAAE,EAC5C,QAAQ,MAAM,KACb,SAAS,EAUX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/Scrubber.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAgB,EAChB,WAAmB,EACnB,WAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/Scrubber.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAgB,EAChB,WAAmB,EACnB,WAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,aAAa,CAAC,kDAqKzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAUrD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,MAAM,EACN,eAAe,EACf,wBAAwB,EACxB,YAAgB,EAChB,KAAK,GACN,EAAE,QAAQ,CAAC,qBAAqB,CAAC,2CAwKjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAQ,MAAM,EACd,OAAO,kBAAkB,EACzB,YAAY,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,EAC9C,YAAY,MAAM,KACjB,MAgCF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,EACjB,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,EACzC,WAAW,0BAA0B,CAAC,WAAW,CAAC,KACjD,MAAM,GAAG,SASX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,EACjB,WAAW,0BAA0B,CAAC,WAAW,CAAC,EAClD,aAAa,aAAa,KACzB,MAAM,GAAG,SAMX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,wCAGhC;IACD,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACzD,KAAG,WAAW,EAad,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,eAAe,SAAS,WAAW,EAAE,EACrC,QAAQ,MAAM,KACb,MAsBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,yDAKhC;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB,KAAG,MAWH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CartesianChartContextValue, CategoricalScale, ChartInset, ChartScaleFunction, DrawingArea, NumericScale, Series, } from './types';
|
|
1
|
+
export type { CartesianChartContextValue, CategoricalScale, ChartInset, ChartScaleFunction, CurveType, DrawingArea, NumericScale, Series, } from './types';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,MAAM,GACP,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,GACP,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard for a finite number. Narrows out `null`, `undefined`, `NaN` and
|
|
3
|
+
* `Infinity`, i.e. any value that cannot be projected to a valid coordinate or
|
|
4
|
+
* counted as a drawable data point.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isFiniteNumber: (value: unknown) => value is number;
|
|
7
|
+
/**
|
|
8
|
+
* Constrains `value` to the inclusive `[min, max]` range. For a degenerate
|
|
9
|
+
* range where `min > max` (e.g. an index range `[0, length - 1]` for empty
|
|
10
|
+
* data), `min` takes precedence and is returned — matching `lodash.clamp`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
13
|
+
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MACjC,CAAC;AAEzB;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAC3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseAxisProps } from '../../Components/Axis';
|
|
2
|
-
import type { ChartScaleFunction
|
|
2
|
+
import type { ChartScaleFunction } from '../types';
|
|
3
3
|
export declare const APPROXIMATE_TICK_COUNT = 5;
|
|
4
4
|
export type TickData = {
|
|
5
5
|
position: number;
|
|
@@ -32,14 +32,4 @@ export declare const getTickLabel: (tick: number, axisData: BaseAxisProps["data"
|
|
|
32
32
|
* Builds the complete tick data array from a scale and axis configuration.
|
|
33
33
|
*/
|
|
34
34
|
export declare const buildTicksData: (scale: ChartScaleFunction, axisConfig?: BaseAxisProps, explicitTicks?: number[], formatter?: (value: number | string) => string) => TickData[];
|
|
35
|
-
/**
|
|
36
|
-
* Excludes the X grid line at the Y-axis origin (left edge)
|
|
37
|
-
* to prevent overlap with the Y-axis solid line.
|
|
38
|
-
*/
|
|
39
|
-
export declare const isTickOnXAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Excludes the Y grid line at the X-axis origin (bottom edge)
|
|
42
|
-
* to prevent overlap with the X-axis solid line.
|
|
43
|
-
*/
|
|
44
|
-
export declare const isTickOnYAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
|
|
45
35
|
//# sourceMappingURL=ticks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,kBAAkB,EACzB,gBAAgB,MAAM,EAAE,EACxB,WAAW,aAAa,CAAC,MAAM,CAAC,KAC/B,MAAM,EAUR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,kBAAkB,EACzB,MAAM,MAAM,KACX,MAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,UAAU,aAAa,CAAC,MAAM,CAAC,EAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,EACzB,aAAa,aAAa,EAC1B,gBAAgB,MAAM,EAAE,EACxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,QAAQ,EASV,CAAC"}
|
|
@@ -15,6 +15,18 @@ export type DrawingArea = {
|
|
|
15
15
|
width: number;
|
|
16
16
|
height: number;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Interpolation used to draw a line (and its area) between data points.
|
|
20
|
+
* Each value maps to a [d3-shape](https://d3js.org/d3-shape/curve) curve:
|
|
21
|
+
* - `'bump'` — smooth cubic curve with horizontal tangents (`curveBumpX`).
|
|
22
|
+
* - `'natural'` — natural cubic spline through every point (`curveNatural`).
|
|
23
|
+
* - `'monotone'` — smooth curve that preserves monotonicity (`curveMonotoneX`).
|
|
24
|
+
* - `'linear'` — straight segments between points (`curveLinear`).
|
|
25
|
+
* - `'step'` — stepped, piecewise-constant line (`curveStep`).
|
|
26
|
+
* - `'stepAfter'` — stepped line where changes occur after the x-coordinate (`curveStepAfter`).
|
|
27
|
+
* - `'stepBefore'` — stepped line where changes occur before the x-coordinate (`curveStepBefore`).
|
|
28
|
+
*/
|
|
29
|
+
export type CurveType = 'bump' | 'natural' | 'monotone' | 'linear' | 'step' | 'stepAfter' | 'stepBefore';
|
|
18
30
|
export type Series = {
|
|
19
31
|
/**
|
|
20
32
|
* Unique identifier for the series.
|
|
@@ -29,9 +41,22 @@ export type Series = {
|
|
|
29
41
|
*/
|
|
30
42
|
label?: string;
|
|
31
43
|
/**
|
|
32
|
-
*
|
|
44
|
+
* Color applied to the series line/mark.
|
|
45
|
+
* @default border-muted
|
|
46
|
+
*/
|
|
47
|
+
stroke?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Interpolation used to draw the line between data points.
|
|
50
|
+
* @default 'bump'
|
|
51
|
+
*/
|
|
52
|
+
curve?: CurveType;
|
|
53
|
+
/**
|
|
54
|
+
* When true, skips null values and draws a continuous line across gaps.
|
|
55
|
+
* When false (default), null values create gaps in the line.
|
|
56
|
+
* Overridden by the chart-level `connectNulls` prop when that is set.
|
|
57
|
+
* @default false
|
|
33
58
|
*/
|
|
34
|
-
|
|
59
|
+
connectNulls?: boolean;
|
|
35
60
|
};
|
|
36
61
|
export type NumericScale = ScaleLinear<number, number> | ScaleLogarithmic<number, number>;
|
|
37
62
|
export type CategoricalScale = ScaleBand<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,SAAS,GACT,UAAU,GACV,QAAQ,GACR,MAAM,GACN,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative-visualization",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@types/react": "^19.0.0",
|
|
47
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
48
|
-
"@ledgerhq/lumen-ui-rnative": "0.1.
|
|
47
|
+
"@ledgerhq/lumen-design-core": "0.1.17",
|
|
48
|
+
"@ledgerhq/lumen-ui-rnative": "0.1.42",
|
|
49
49
|
"react": "^19.0.0",
|
|
50
50
|
"react-native": "~0.79.7",
|
|
51
51
|
"react-native-svg": "^15.0.0",
|
|
@@ -24,6 +24,12 @@ export type BaseAxisProps = {
|
|
|
24
24
|
* @default false
|
|
25
25
|
*/
|
|
26
26
|
showTickMark?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to render the text labels at each tick position.
|
|
29
|
+
* When false, tick marks, grid lines, and the baseline still render.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
showLabels?: boolean;
|
|
27
33
|
/**
|
|
28
34
|
* Explicit tick positions along the axis.
|
|
29
35
|
* When omitted, ticks are computed automatically from the scale.
|
|
@@ -75,6 +75,18 @@ describe('XAxis', () => {
|
|
|
75
75
|
getByText('4');
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
it('hides tick labels when showLabels is false but keeps tick marks', () => {
|
|
79
|
+
const { queryByText, toJSON } = renderXAxis({
|
|
80
|
+
ticks: [0, 2, 4],
|
|
81
|
+
showTickMark: true,
|
|
82
|
+
showLabels: false,
|
|
83
|
+
});
|
|
84
|
+
expect(queryByText('0')).toBeNull();
|
|
85
|
+
expect(queryByText('2')).toBeNull();
|
|
86
|
+
expect(queryByText('4')).toBeNull();
|
|
87
|
+
expect(toJSON()).toBeTruthy();
|
|
88
|
+
});
|
|
89
|
+
|
|
78
90
|
it('does not render axis when width is 0', () => {
|
|
79
91
|
const { queryByText } = render(
|
|
80
92
|
<ThemeProvider themes={ledgerLiveThemes} colorScheme='light'>
|
|
@@ -2,10 +2,7 @@ import { useTheme } from '@ledgerhq/lumen-ui-rnative';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { G, Line as SvgLine, Text as SvgText } from 'react-native-svg';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
buildTicksData,
|
|
7
|
-
isTickOnXAxisDomainEdge,
|
|
8
|
-
} from '../../../utils/ticks/ticks';
|
|
5
|
+
import { buildTicksData } from '../../../utils/ticks/ticks';
|
|
9
6
|
import { useCartesianChartContext } from '../../CartesianChart/context';
|
|
10
7
|
|
|
11
8
|
import type { XAxisProps } from './types';
|
|
@@ -21,6 +18,7 @@ export const XAxis = ({
|
|
|
21
18
|
showGrid = false,
|
|
22
19
|
showLine = false,
|
|
23
20
|
showTickMark = false,
|
|
21
|
+
showLabels = true,
|
|
24
22
|
ticks: ticksProp,
|
|
25
23
|
tickLabelFormatter,
|
|
26
24
|
}: XAxisProps) => {
|
|
@@ -57,20 +55,18 @@ export const XAxis = ({
|
|
|
57
55
|
return (
|
|
58
56
|
<G>
|
|
59
57
|
{showGrid &&
|
|
60
|
-
ticksData
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
58
|
+
ticksData.map((tick, i) => (
|
|
59
|
+
<SvgLine
|
|
60
|
+
key={`grid-${tick.value}-${i}`}
|
|
61
|
+
x1={tick.position}
|
|
62
|
+
y1={drawingArea.y}
|
|
63
|
+
x2={tick.position}
|
|
64
|
+
y2={drawingArea.y + drawingArea.height}
|
|
65
|
+
stroke={gridStroke}
|
|
66
|
+
strokeWidth={STROKE_WIDTH}
|
|
67
|
+
strokeDasharray={gridLineStyle === 'dashed' ? '3 3' : undefined}
|
|
68
|
+
/>
|
|
69
|
+
))}
|
|
74
70
|
|
|
75
71
|
{showLine && (
|
|
76
72
|
<SvgLine
|
|
@@ -97,20 +93,21 @@ export const XAxis = ({
|
|
|
97
93
|
/>
|
|
98
94
|
))}
|
|
99
95
|
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
{showLabels &&
|
|
97
|
+
ticksData.map((tick, i) => (
|
|
98
|
+
<SvgText
|
|
99
|
+
key={`label-${tick.value}-${i}`}
|
|
100
|
+
x={tick.position}
|
|
101
|
+
y={labelY}
|
|
102
|
+
dy={labelDy}
|
|
103
|
+
textAnchor='middle'
|
|
104
|
+
fill={textFill}
|
|
105
|
+
fontSize={fontSize}
|
|
106
|
+
fontFamily={theme.fontFamilies.sans}
|
|
107
|
+
>
|
|
108
|
+
{tick.label}
|
|
109
|
+
</SvgText>
|
|
110
|
+
))}
|
|
114
111
|
</G>
|
|
115
112
|
);
|
|
116
113
|
};
|
|
@@ -75,6 +75,18 @@ describe('YAxis', () => {
|
|
|
75
75
|
getByText('50');
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
it('hides tick labels when showLabels is false but keeps tick marks', () => {
|
|
79
|
+
const { queryByText, toJSON } = renderYAxis({
|
|
80
|
+
ticks: [10, 30, 50],
|
|
81
|
+
showTickMark: true,
|
|
82
|
+
showLabels: false,
|
|
83
|
+
});
|
|
84
|
+
expect(queryByText('10')).toBeNull();
|
|
85
|
+
expect(queryByText('30')).toBeNull();
|
|
86
|
+
expect(queryByText('50')).toBeNull();
|
|
87
|
+
expect(toJSON()).toBeTruthy();
|
|
88
|
+
});
|
|
89
|
+
|
|
78
90
|
it('does not render axis when height is 0', () => {
|
|
79
91
|
const { queryByText } = render(
|
|
80
92
|
<ThemeProvider themes={ledgerLiveThemes} colorScheme='light'>
|