@coinbase/cds-mobile-visualization 3.4.0-beta.1 → 3.4.0-beta.10
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/CHANGELOG.md +54 -0
- package/dts/chart/CartesianChart.d.ts +57 -33
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartContextBridge.d.ts +28 -0
- package/dts/chart/ChartContextBridge.d.ts.map +1 -0
- package/dts/chart/Path.d.ts +77 -34
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +2 -2
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +42 -27
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +51 -10
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts +21 -2
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts +19 -13
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts +17 -2
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +68 -78
- package/dts/chart/axis/Axis.d.ts.map +1 -1
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
- package/dts/chart/axis/XAxis.d.ts +1 -1
- package/dts/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/chart/axis/YAxis.d.ts +2 -2
- package/dts/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/chart/axis/index.d.ts +1 -0
- package/dts/chart/axis/index.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +16 -13
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +36 -20
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarPlot.d.ts +2 -1
- package/dts/chart/bar/BarPlot.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +39 -48
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +1 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBar.d.ts +1 -1
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
- package/dts/chart/gradient/Gradient.d.ts +25 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -0
- package/dts/chart/gradient/index.d.ts +2 -0
- package/dts/chart/gradient/index.d.ts.map +1 -0
- package/dts/chart/index.d.ts +3 -1
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
- package/dts/chart/line/DottedLine.d.ts +13 -5
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +62 -25
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +43 -9
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +68 -20
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts +8 -5
- package/dts/chart/line/SolidLine.d.ts.map +1 -1
- package/dts/chart/line/index.d.ts +1 -1
- package/dts/chart/line/index.d.ts.map +1 -1
- package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
- package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
- package/dts/chart/point/Point.d.ts +120 -0
- package/dts/chart/point/Point.d.ts.map +1 -0
- package/dts/chart/point/index.d.ts +3 -0
- package/dts/chart/point/index.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +8 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +11 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +172 -43
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +44 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +31 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +6 -3
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dts/chart/scrubber/index.d.ts +3 -0
- package/dts/chart/scrubber/index.d.ts.map +1 -1
- package/dts/chart/text/ChartText.d.ts +151 -77
- package/dts/chart/text/ChartText.d.ts.map +1 -1
- package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
- package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
- package/dts/chart/text/index.d.ts +1 -1
- package/dts/chart/text/index.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +34 -7
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +28 -7
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +117 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +3 -0
- package/dts/chart/utils/index.d.ts.map +1 -1
- package/dts/chart/utils/path.d.ts +53 -0
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +60 -1
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +91 -0
- package/dts/chart/utils/scale.d.ts.map +1 -1
- package/dts/chart/utils/scrubber.d.ts +39 -0
- package/dts/chart/utils/scrubber.d.ts.map +1 -0
- package/dts/chart/utils/transition.d.ts +140 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/esm/chart/CartesianChart.js +164 -70
- package/esm/chart/ChartContextBridge.js +148 -0
- package/esm/chart/Path.js +198 -113
- package/esm/chart/PeriodSelector.js +2 -2
- package/esm/chart/__stories__/CartesianChart.stories.js +378 -131
- package/esm/chart/__stories__/Chart.stories.js +2 -4
- package/esm/chart/__stories__/PeriodSelector.stories.js +103 -75
- package/esm/chart/area/Area.js +25 -35
- package/esm/chart/area/AreaChart.js +17 -12
- package/esm/chart/area/DottedArea.js +61 -109
- package/esm/chart/area/GradientArea.js +35 -91
- package/esm/chart/area/SolidArea.js +22 -8
- package/esm/chart/area/__stories__/AreaChart.stories.js +1 -1
- package/esm/chart/axis/Axis.js +2 -0
- package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
- package/esm/chart/axis/XAxis.js +63 -56
- package/esm/chart/axis/YAxis.js +59 -52
- package/esm/chart/axis/__stories__/Axis.stories.js +0 -1
- package/esm/chart/axis/index.js +1 -0
- package/esm/chart/bar/Bar.js +3 -1
- package/esm/chart/bar/BarChart.js +15 -37
- package/esm/chart/bar/BarPlot.js +41 -35
- package/esm/chart/bar/BarStack.js +75 -38
- package/esm/chart/bar/BarStackGroup.js +6 -16
- package/esm/chart/bar/DefaultBar.js +26 -48
- package/esm/chart/bar/DefaultBarStack.js +23 -58
- package/esm/chart/bar/__stories__/BarChart.stories.js +463 -77
- package/esm/chart/gradient/Gradient.js +53 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +3 -1
- package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
- package/esm/chart/line/DottedLine.js +29 -14
- package/esm/chart/line/Line.js +106 -67
- package/esm/chart/line/LineChart.js +20 -14
- package/esm/chart/line/ReferenceLine.js +80 -63
- package/esm/chart/line/SolidLine.js +25 -10
- package/esm/chart/line/__stories__/LineChart.stories.js +2101 -1977
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +83 -28
- package/esm/chart/line/index.js +1 -1
- package/esm/chart/point/DefaultPointLabel.js +39 -0
- package/esm/chart/point/Point.js +188 -0
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +179 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
- package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
- package/esm/chart/scrubber/Scrubber.js +126 -146
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +161 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +185 -0
- package/esm/chart/scrubber/ScrubberProvider.js +46 -54
- package/esm/chart/scrubber/index.js +3 -1
- package/esm/chart/text/ChartText.js +242 -174
- package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +6 -5
- package/esm/chart/text/index.js +1 -1
- package/esm/chart/utils/chart.js +44 -3
- package/esm/chart/utils/gradient.js +305 -0
- package/esm/chart/utils/index.js +3 -0
- package/esm/chart/utils/path.js +76 -8
- package/esm/chart/utils/point.js +116 -5
- package/esm/chart/utils/scale.js +230 -1
- package/esm/chart/utils/scrubber.js +139 -0
- package/esm/chart/utils/transition.js +185 -0
- package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +51 -26
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +17 -9
- package/package.json +15 -9
- package/dts/chart/Point.d.ts +0 -103
- package/dts/chart/Point.d.ts.map +0 -1
- package/dts/chart/line/GradientLine.d.ts +0 -45
- package/dts/chart/line/GradientLine.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -75
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
- package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
- package/esm/chart/Point.js +0 -111
- package/esm/chart/line/GradientLine.js +0 -62
- package/esm/chart/scrubber/ScrubberBeacon.js +0 -199
|
@@ -1,60 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Rect } from '@coinbase/cds-common';
|
|
3
|
-
import type { ChartScaleFunction } from '../utils';
|
|
3
|
+
import type { ChartScaleFunction, Series, Transition } from '../utils';
|
|
4
4
|
import { type BarProps } from './Bar';
|
|
5
|
-
|
|
6
|
-
export type BarStackComponentProps = {
|
|
7
|
-
/**
|
|
8
|
-
* The x position of the stack.
|
|
9
|
-
*/
|
|
10
|
-
x: number;
|
|
11
|
-
/**
|
|
12
|
-
* The y position of the stack.
|
|
13
|
-
*/
|
|
14
|
-
y: number;
|
|
15
|
-
/**
|
|
16
|
-
* The width of the stack.
|
|
17
|
-
*/
|
|
18
|
-
width: number;
|
|
19
|
-
/**
|
|
20
|
-
* The height of the stack.
|
|
21
|
-
*/
|
|
22
|
-
height: number;
|
|
23
|
-
/**
|
|
24
|
-
* The bar elements to render within the stack.
|
|
25
|
-
*/
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* The index of the category this stack belongs to.
|
|
29
|
-
*/
|
|
30
|
-
categoryIndex: number;
|
|
31
|
-
/**
|
|
32
|
-
* Border radius for the bar.
|
|
33
|
-
* @default 4
|
|
34
|
-
*/
|
|
35
|
-
borderRadius?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Whether to round the top corners.
|
|
38
|
-
*/
|
|
39
|
-
roundTop?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to round the bottom corners.
|
|
42
|
-
*/
|
|
43
|
-
roundBottom?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* The y-origin for animations (baseline position).
|
|
46
|
-
*/
|
|
47
|
-
yOrigin?: number;
|
|
48
|
-
};
|
|
49
|
-
export type BarStackComponent = React.FC<BarStackComponentProps>;
|
|
50
|
-
export type BarStackProps = Pick<
|
|
5
|
+
export type BarStackBaseProps = Pick<
|
|
51
6
|
BarProps,
|
|
52
7
|
'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
|
|
53
8
|
> & {
|
|
54
9
|
/**
|
|
55
10
|
* Array of series configurations that belong to this stack.
|
|
56
11
|
*/
|
|
57
|
-
series:
|
|
12
|
+
series: Series[];
|
|
58
13
|
/**
|
|
59
14
|
* The category index for this stack.
|
|
60
15
|
*/
|
|
@@ -103,6 +58,42 @@ export type BarStackProps = Pick<
|
|
|
103
58
|
*/
|
|
104
59
|
stackMinSize?: number;
|
|
105
60
|
};
|
|
61
|
+
export type BarStackProps = BarStackBaseProps & {
|
|
62
|
+
/**
|
|
63
|
+
* Transition configurations for different animation phases.
|
|
64
|
+
*/
|
|
65
|
+
transition?: Transition;
|
|
66
|
+
};
|
|
67
|
+
export type BarStackComponentProps = Pick<
|
|
68
|
+
BarStackProps,
|
|
69
|
+
'x' | 'width' | 'categoryIndex' | 'borderRadius' | 'transition'
|
|
70
|
+
> & {
|
|
71
|
+
/**
|
|
72
|
+
* The y position of the stack.
|
|
73
|
+
*/
|
|
74
|
+
y: number;
|
|
75
|
+
/**
|
|
76
|
+
* The height of the stack.
|
|
77
|
+
*/
|
|
78
|
+
height: number;
|
|
79
|
+
/**
|
|
80
|
+
* The bar elements to render within the stack.
|
|
81
|
+
*/
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to round the top corners.
|
|
85
|
+
*/
|
|
86
|
+
roundTop?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to round the bottom corners.
|
|
89
|
+
*/
|
|
90
|
+
roundBottom?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The y-origin for animations (baseline position).
|
|
93
|
+
*/
|
|
94
|
+
yOrigin?: number;
|
|
95
|
+
};
|
|
96
|
+
export type BarStackComponent = React.FC<BarStackComponentProps>;
|
|
106
97
|
/**
|
|
107
98
|
* BarStack component that renders a single stack of bars at a specific category index.
|
|
108
99
|
* Handles the stacking logic for bars within a single category.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"BarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIvE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAK3C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,QAAQ,EACR,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,CAC3E,GAAG;IACF;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG;IAC9C;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,aAAa,EACb,GAAG,GAAG,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,YAAY,CAChE,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,QAAQ,2CAmlBpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarStackGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStackGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,aAAa,EACX,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,
|
|
1
|
+
{"version":3,"file":"BarStackGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStackGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,aAAa,EACX,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,GACnB,YAAY,CACf,GACC,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,aAAa,0DAoEzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BarComponentProps } from './Bar';
|
|
2
2
|
export type DefaultBarProps = BarComponentProps;
|
|
3
3
|
/**
|
|
4
|
-
* Default bar component that renders a solid bar with animation.
|
|
4
|
+
* Default bar component that renders a solid bar with animation support.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DefaultBar: import('react').NamedExoticComponent<BarComponentProps>;
|
|
7
7
|
//# sourceMappingURL=DefaultBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,UAAU,yDAwEtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,eAAe,8DAoC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GradientDefinition } from '../utils';
|
|
2
|
+
export type GradientBaseProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Gradient definition with stops, axis, and other configuration.
|
|
5
|
+
*/
|
|
6
|
+
gradient: GradientDefinition;
|
|
7
|
+
/**
|
|
8
|
+
* Y-axis ID to use for gradient processing.
|
|
9
|
+
* When provided, the gradient will align with the specified y-axis range.
|
|
10
|
+
* This ensures gradients work correctly when the axis has a custom range configuration.
|
|
11
|
+
*/
|
|
12
|
+
yAxisId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type GradientProps = GradientBaseProps;
|
|
15
|
+
/**
|
|
16
|
+
* Renders a Skia LinearGradient element based on a GradientDefinition.
|
|
17
|
+
* The gradient should be used as a child of a Path component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <Path d={pathString} stroke="red">
|
|
21
|
+
* {gradient && <Gradient gradient={gradient} yAxisId={yAxisId} />}
|
|
22
|
+
* </Path>
|
|
23
|
+
*/
|
|
24
|
+
export declare const Gradient: import('react').NamedExoticComponent<GradientBaseProps>;
|
|
25
|
+
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,yDA8BnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/dts/chart/index.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ export * from './area';
|
|
|
2
2
|
export * from './axis';
|
|
3
3
|
export * from './bar';
|
|
4
4
|
export * from './CartesianChart';
|
|
5
|
+
export * from './ChartContextBridge';
|
|
5
6
|
export * from './ChartProvider';
|
|
7
|
+
export * from './gradient';
|
|
6
8
|
export * from './line';
|
|
7
9
|
export * from './Path';
|
|
8
10
|
export * from './PeriodSelector';
|
|
9
|
-
export * from './
|
|
11
|
+
export * from './point';
|
|
10
12
|
export * from './scrubber';
|
|
11
13
|
export * from './text';
|
|
12
14
|
export * from './utils';
|
package/dts/chart/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReferenceLineLabelComponentProps } from './ReferenceLine';
|
|
2
|
+
export type DefaultReferenceLineLabelProps = ReferenceLineLabelComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultReferenceLineLabel is the default label component for ReferenceLine.
|
|
5
|
+
* Provides standard styling with elevation, inset, and color defaults.
|
|
6
|
+
* When elevated, automatically adds bounds to prevent shadow cutoff at chart edges.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DefaultReferenceLineLabel: import('react').NamedExoticComponent<ReferenceLineLabelComponentProps>;
|
|
9
|
+
//# sourceMappingURL=DefaultReferenceLineLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultReferenceLineLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DefaultReferenceLineLabel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAQ9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,wEAoCrC,CAAC"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
2
1
|
import { type PathProps } from '../Path';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { LineComponentProps } from './Line';
|
|
3
|
+
export type DottedLineProps = Pick<
|
|
4
|
+
PathProps,
|
|
5
|
+
'initialPath' | 'children' | 'strokeCap' | 'strokeJoin' | 'clipRect' | 'clipPath' | 'clipOffset'
|
|
6
|
+
> &
|
|
7
|
+
LineComponentProps & {
|
|
5
8
|
fill?: string;
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Stroke dash array for the dotted pattern.
|
|
11
|
+
* @default [0, 4]
|
|
12
|
+
*/
|
|
13
|
+
dashIntervals?: number[];
|
|
7
14
|
};
|
|
8
15
|
/**
|
|
9
|
-
* A customizable dotted line component
|
|
16
|
+
* A customizable dotted line component.
|
|
17
|
+
* Supports gradient for gradient effects on the dots and smooth data transitions via AnimatedPath.
|
|
10
18
|
*/
|
|
11
19
|
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
12
20
|
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CACjG,GACC,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,uDAqCtB,CAAC"}
|
package/dts/chart/line/Line.d.ts
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type AnimatedProp } from '@shopify/react-native-skia';
|
|
3
3
|
import { type AreaComponent } from '../area/Area';
|
|
4
|
-
import { type
|
|
5
|
-
import { type ChartPathCurveType } from '../utils';
|
|
6
|
-
export type
|
|
7
|
-
d: string;
|
|
8
|
-
stroke: string;
|
|
9
|
-
strokeOpacity?: number;
|
|
10
|
-
strokeWidth?: number;
|
|
11
|
-
testID?: string;
|
|
12
|
-
};
|
|
13
|
-
export type LineComponent = React.FC<LineComponentProps>;
|
|
14
|
-
export type LineProps = SharedProps & {
|
|
4
|
+
import { type PointBaseProps, type PointProps } from '../point';
|
|
5
|
+
import { type ChartPathCurveType, type GradientDefinition, type Transition } from '../utils';
|
|
6
|
+
export type LineBaseProps = {
|
|
15
7
|
/**
|
|
16
8
|
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
17
9
|
*/
|
|
18
10
|
seriesId: string;
|
|
19
11
|
/**
|
|
20
12
|
* The curve interpolation method to use for the line.
|
|
21
|
-
* @default '
|
|
13
|
+
* @default 'bump'
|
|
22
14
|
*/
|
|
23
15
|
curve?: ChartPathCurveType;
|
|
24
16
|
/**
|
|
25
17
|
* The type of line to render.
|
|
26
18
|
* @default 'solid'
|
|
27
19
|
*/
|
|
28
|
-
type?: 'solid' | 'dotted'
|
|
20
|
+
type?: 'solid' | 'dotted';
|
|
29
21
|
/**
|
|
30
|
-
*
|
|
22
|
+
* Whether to show area fill under the line.
|
|
31
23
|
*/
|
|
32
24
|
showArea?: boolean;
|
|
33
25
|
/**
|
|
@@ -49,30 +41,75 @@ export type LineProps = SharedProps & {
|
|
|
49
41
|
* Custom component to render line area fill.
|
|
50
42
|
*/
|
|
51
43
|
AreaComponent?: AreaComponent;
|
|
44
|
+
/**
|
|
45
|
+
* Opacity of the line's stroke.
|
|
46
|
+
* Will also be applied to points and area fill.
|
|
47
|
+
* @default 1
|
|
48
|
+
*/
|
|
49
|
+
opacity?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Controls whether and how to render points at each data point in the series.
|
|
52
|
+
* - `true`: Show all points with default styling
|
|
53
|
+
* - `false` or `undefined`: Hide all points
|
|
54
|
+
* - Function: Called for every entry in the data array to customize individual points
|
|
55
|
+
*
|
|
56
|
+
* @param defaults - The default point props computed by the Line component
|
|
57
|
+
* @returns true for default point, false/null/undefined for no point, or Partial<PointProps> to customize
|
|
58
|
+
*/
|
|
59
|
+
points?:
|
|
60
|
+
| boolean
|
|
61
|
+
| ((defaults: PointBaseProps) => boolean | null | undefined | Partial<PointProps>);
|
|
62
|
+
/**
|
|
63
|
+
* When true, the area is connected across null values.
|
|
64
|
+
*/
|
|
65
|
+
connectNulls?: boolean;
|
|
52
66
|
/**
|
|
53
67
|
* The color of the line.
|
|
54
68
|
* @default color of the series or theme.color.fgPrimary
|
|
55
69
|
*/
|
|
56
70
|
stroke?: string;
|
|
57
71
|
/**
|
|
58
|
-
* Opacity of the line
|
|
72
|
+
* Opacity of the line
|
|
73
|
+
* @note when combined with gradient, both will be applied
|
|
59
74
|
* @default 1
|
|
60
75
|
*/
|
|
61
|
-
|
|
76
|
+
strokeOpacity?: AnimatedProp<number>;
|
|
77
|
+
/**
|
|
78
|
+
* Width of the line
|
|
79
|
+
* @default 2
|
|
80
|
+
*/
|
|
81
|
+
strokeWidth?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Gradient configuration.
|
|
84
|
+
* When provided, creates gradient or threshold-based coloring.
|
|
85
|
+
*/
|
|
86
|
+
gradient?: GradientDefinition;
|
|
62
87
|
/**
|
|
63
88
|
* Whether to animate the line.
|
|
64
|
-
* Overrides the animate
|
|
89
|
+
* Overrides the animate value from the chart context.
|
|
65
90
|
*/
|
|
66
91
|
animate?: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type LineProps = LineBaseProps & {
|
|
67
94
|
/**
|
|
68
|
-
*
|
|
69
|
-
* Called for every entry in the data array.
|
|
70
|
-
*
|
|
71
|
-
* @param params - Contains the data and pixel coordinates of the data point.
|
|
72
|
-
* @returns true for default point, false/null/undefined for no point, or PointConfig for custom point
|
|
95
|
+
* Transition configuration for line animations.
|
|
73
96
|
*/
|
|
74
|
-
|
|
75
|
-
strokeWidth?: number;
|
|
97
|
+
transition?: Transition;
|
|
76
98
|
};
|
|
99
|
+
export type LineComponentProps = Pick<
|
|
100
|
+
LineProps,
|
|
101
|
+
'stroke' | 'strokeOpacity' | 'strokeWidth' | 'gradient' | 'animate' | 'transition'
|
|
102
|
+
> & {
|
|
103
|
+
/**
|
|
104
|
+
* Path of the line
|
|
105
|
+
*/
|
|
106
|
+
d: AnimatedProp<string | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* ID of the y-axis to use.
|
|
109
|
+
* If not provided, defaults to the default y-axis.
|
|
110
|
+
*/
|
|
111
|
+
yAxisId?: string;
|
|
112
|
+
};
|
|
113
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
77
114
|
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
78
115
|
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../src/chart/line/Line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAGL,KAAK,kBAAkB,EAGvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAOlB,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,MAAM,CAAC,EACH,OAAO,GACP,CAAC,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACrF;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CACnF,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCAyMhB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { View } from 'react-native';
|
|
2
2
|
import { type XAxisProps } from '../axis/XAxis';
|
|
3
3
|
import { type YAxisProps } from '../axis/YAxis';
|
|
4
|
-
import { type CartesianChartProps } from '../CartesianChart';
|
|
4
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
5
5
|
import { type AxisConfigProps, type Series } from '../utils';
|
|
6
6
|
import { type LineProps } from './Line';
|
|
7
7
|
export type LineSeries = Series &
|
|
@@ -16,12 +16,15 @@ export type LineSeries = Series &
|
|
|
16
16
|
| 'LineComponent'
|
|
17
17
|
| 'AreaComponent'
|
|
18
18
|
| 'stroke'
|
|
19
|
-
| 'opacity'
|
|
20
|
-
| 'renderPoints'
|
|
21
19
|
| 'strokeWidth'
|
|
20
|
+
| 'strokeOpacity'
|
|
21
|
+
| 'opacity'
|
|
22
|
+
| 'points'
|
|
23
|
+
| 'connectNulls'
|
|
24
|
+
| 'transition'
|
|
22
25
|
>
|
|
23
26
|
>;
|
|
24
|
-
export type
|
|
27
|
+
export type LineChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
25
28
|
Pick<
|
|
26
29
|
LineProps,
|
|
27
30
|
| 'showArea'
|
|
@@ -30,8 +33,12 @@ export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
|
|
|
30
33
|
| 'LineComponent'
|
|
31
34
|
| 'AreaComponent'
|
|
32
35
|
| 'curve'
|
|
33
|
-
| '
|
|
36
|
+
| 'points'
|
|
34
37
|
| 'strokeWidth'
|
|
38
|
+
| 'strokeOpacity'
|
|
39
|
+
| 'connectNulls'
|
|
40
|
+
| 'transition'
|
|
41
|
+
| 'opacity'
|
|
35
42
|
> & {
|
|
36
43
|
/**
|
|
37
44
|
* Configuration objects that define how to visualize the data.
|
|
@@ -46,22 +53,38 @@ export type LineChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
|
|
|
46
53
|
* Whether to show the Y axis.
|
|
47
54
|
*/
|
|
48
55
|
showYAxis?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Configuration for x-axis.
|
|
58
|
+
* Accepts axis config and axis props.
|
|
59
|
+
* To show the axis, set `showXAxis` to true.
|
|
60
|
+
*/
|
|
49
61
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
62
|
+
/**
|
|
63
|
+
* Configuration for y-axis.
|
|
64
|
+
* Accepts axis config and axis props.
|
|
65
|
+
* To show the axis, set `showYAxis` to true.
|
|
66
|
+
*/
|
|
50
67
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
51
68
|
};
|
|
69
|
+
export type LineChartProps = LineChartBaseProps &
|
|
70
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
52
71
|
export declare const LineChart: import('react').MemoExoticComponent<
|
|
53
72
|
import('react').ForwardRefExoticComponent<
|
|
54
|
-
Omit<
|
|
73
|
+
Omit<CartesianChartBaseProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
55
74
|
Pick<
|
|
56
75
|
LineProps,
|
|
57
76
|
| 'type'
|
|
58
|
-
| '
|
|
77
|
+
| 'opacity'
|
|
59
78
|
| 'strokeWidth'
|
|
79
|
+
| 'curve'
|
|
80
|
+
| 'connectNulls'
|
|
81
|
+
| 'transition'
|
|
82
|
+
| 'strokeOpacity'
|
|
60
83
|
| 'AreaComponent'
|
|
61
84
|
| 'showArea'
|
|
62
85
|
| 'areaType'
|
|
63
86
|
| 'LineComponent'
|
|
64
|
-
| '
|
|
87
|
+
| 'points'
|
|
65
88
|
> & {
|
|
66
89
|
/**
|
|
67
90
|
* Configuration objects that define how to visualize the data.
|
|
@@ -76,9 +99,20 @@ export declare const LineChart: import('react').MemoExoticComponent<
|
|
|
76
99
|
* Whether to show the Y axis.
|
|
77
100
|
*/
|
|
78
101
|
showYAxis?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Configuration for x-axis.
|
|
104
|
+
* Accepts axis config and axis props.
|
|
105
|
+
* To show the axis, set `showXAxis` to true.
|
|
106
|
+
*/
|
|
79
107
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
108
|
+
/**
|
|
109
|
+
* Configuration for y-axis.
|
|
110
|
+
* Accepts axis config and axis props.
|
|
111
|
+
* To show the axis, set `showYAxis` to true.
|
|
112
|
+
*/
|
|
80
113
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
81
|
-
} &
|
|
114
|
+
} & Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
|
|
115
|
+
import('react').RefAttributes<View>
|
|
82
116
|
>
|
|
83
117
|
>;
|
|
84
118
|
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/chart/line/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,eAAe,EAAoC,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAC7B,OAAO,CACL,IAAI,CACF,SAAS,EACP,OAAO,GACP,UAAU,GACV,UAAU,GACV,cAAc,GACd,MAAM,GACN,eAAe,GACf,eAAe,GACf,QAAQ,GACR,aAAa,GACb,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,CACf,CACF,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,SAAS,CACZ,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS;IA9BlB;;;OAGG;aACM,KAAK,CAAC,UAAU,CAAC;IAC1B;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,OAAO;IACnB;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;IAC7C;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;mGA6HhD,CAAC"}
|
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnimatedProp } from '@shopify/react-native-skia';
|
|
2
2
|
import type {
|
|
3
3
|
ChartTextChildren,
|
|
4
4
|
ChartTextProps,
|
|
5
5
|
TextHorizontalAlignment,
|
|
6
6
|
TextVerticalAlignment,
|
|
7
7
|
} from '../text/ChartText';
|
|
8
|
+
import type { ChartInset } from '../utils';
|
|
8
9
|
import type { LineComponent } from './Line';
|
|
9
|
-
|
|
10
|
-
* Configuration for ReferenceLine label rendering using ChartText.
|
|
11
|
-
*/
|
|
12
|
-
export type ReferenceLineLabelProps = Pick<
|
|
10
|
+
export type ReferenceLineLabelComponentProps = Pick<
|
|
13
11
|
ChartTextProps,
|
|
14
|
-
| '
|
|
15
|
-
| '
|
|
16
|
-
| '
|
|
17
|
-
| 'fontWeight'
|
|
12
|
+
| 'x'
|
|
13
|
+
| 'y'
|
|
14
|
+
| 'children'
|
|
18
15
|
| 'color'
|
|
19
16
|
| 'inset'
|
|
20
17
|
| 'background'
|
|
21
18
|
| 'borderRadius'
|
|
22
19
|
| 'disableRepositioning'
|
|
23
|
-
| 'bounds'
|
|
24
20
|
| 'horizontalAlignment'
|
|
25
21
|
| 'verticalAlignment'
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
| 'font'
|
|
23
|
+
| 'fontWeight'
|
|
24
|
+
| 'fontFamilies'
|
|
25
|
+
| 'opacity'
|
|
26
|
+
| 'dx'
|
|
27
|
+
| 'dy'
|
|
28
|
+
| 'elevated'
|
|
29
|
+
| 'paragraphAlignment'
|
|
30
|
+
> & {
|
|
31
|
+
/**
|
|
32
|
+
* Bounds inset for label to prevent cutoff at chart edges.
|
|
33
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
34
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when elevated is true, otherwise undefined
|
|
35
|
+
*/
|
|
36
|
+
boundsInset?: number | ChartInset;
|
|
37
|
+
};
|
|
38
|
+
export type ReferenceLineLabelComponent = React.FC<ReferenceLineLabelComponentProps>;
|
|
39
|
+
export type ReferenceLineBaseProps = {
|
|
28
40
|
/**
|
|
29
41
|
* Label content to display near the reference line.
|
|
30
42
|
* Can be a string or ReactNode for rich formatting.
|
|
@@ -43,23 +55,59 @@ type BaseReferenceLineProps = SharedProps & {
|
|
|
43
55
|
* @default DottedLine
|
|
44
56
|
*/
|
|
45
57
|
LineComponent?: LineComponent;
|
|
58
|
+
/**
|
|
59
|
+
* Component to render the label.
|
|
60
|
+
* @default DefaultReferenceLineLabel
|
|
61
|
+
*/
|
|
62
|
+
LabelComponent?: ReferenceLineLabelComponent;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to elevate the label with a shadow.
|
|
65
|
+
* When true, applies elevation and automatically adds bounds to keep label within chart area.
|
|
66
|
+
*/
|
|
67
|
+
labelElevated?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Font style for the label text.
|
|
70
|
+
*/
|
|
71
|
+
labelFont?: ChartTextProps['font'];
|
|
72
|
+
/**
|
|
73
|
+
* Horizontal offset for the label in pixels.
|
|
74
|
+
*/
|
|
75
|
+
labelDx?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Vertical offset for the label in pixels.
|
|
78
|
+
*/
|
|
79
|
+
labelDy?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Horizontal alignment of the label text.
|
|
82
|
+
*/
|
|
83
|
+
labelHorizontalAlignment?: TextHorizontalAlignment;
|
|
84
|
+
/**
|
|
85
|
+
* Vertical alignment of the label text.
|
|
86
|
+
*/
|
|
87
|
+
labelVerticalAlignment?: TextVerticalAlignment;
|
|
88
|
+
/**
|
|
89
|
+
* Bounds inset for the label to prevent cutoff at chart edges.
|
|
90
|
+
* Especially useful when labelElevated is true to prevent shadow clipping.
|
|
91
|
+
* Can be a number (applied to all sides) or a ChartInset object.
|
|
92
|
+
* @default { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
|
|
93
|
+
*/
|
|
94
|
+
labelBoundsInset?: number | ChartInset;
|
|
46
95
|
/**
|
|
47
96
|
* The color of the line.
|
|
48
97
|
* @default theme.color.bgLine
|
|
49
98
|
*/
|
|
50
99
|
stroke?: string;
|
|
51
100
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* Alignment defaults are set based on line orientation and can be overridden here.
|
|
101
|
+
* Opacity applied to both the line and label.
|
|
102
|
+
* @default 1
|
|
55
103
|
*/
|
|
56
|
-
|
|
104
|
+
opacity?: AnimatedProp<number>;
|
|
57
105
|
};
|
|
58
|
-
type HorizontalReferenceLineProps =
|
|
106
|
+
type HorizontalReferenceLineProps = ReferenceLineBaseProps & {
|
|
59
107
|
/**
|
|
60
108
|
* Y-value for horizontal reference line (data value).
|
|
61
109
|
*/
|
|
62
|
-
dataY: number
|
|
110
|
+
dataY: AnimatedProp<number>;
|
|
63
111
|
/**
|
|
64
112
|
* The ID of the y-axis to use for positioning.
|
|
65
113
|
* Defaults to defaultAxisId if not specified.
|
|
@@ -72,11 +120,11 @@ type HorizontalReferenceLineProps = BaseReferenceLineProps & {
|
|
|
72
120
|
labelPosition?: TextHorizontalAlignment;
|
|
73
121
|
dataX?: never;
|
|
74
122
|
};
|
|
75
|
-
type VerticalReferenceLineProps =
|
|
123
|
+
type VerticalReferenceLineProps = ReferenceLineBaseProps & {
|
|
76
124
|
/**
|
|
77
125
|
* X-value for vertical reference line (data index).
|
|
78
126
|
*/
|
|
79
|
-
dataX: number
|
|
127
|
+
dataX: AnimatedProp<number>;
|
|
80
128
|
/**
|
|
81
129
|
* Position of the label along the vertical line.
|
|
82
130
|
* @default 'top'
|