@coinbase/cds-web-visualization 3.4.0-beta.2 → 3.4.0-beta.20
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 +115 -0
- package/dts/chart/CartesianChart.d.ts +56 -3
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartProvider.d.ts +3 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +64 -7
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +5 -15
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +50 -25
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +46 -6
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts +21 -44
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts +21 -12
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts +16 -1
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +109 -63
- 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 +50 -12
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +20 -8
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarPlot.d.ts +3 -1
- package/dts/chart/bar/BarPlot.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +41 -46
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +2 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +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 +35 -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/legend/DefaultLegendEntry.d.ts +21 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +7 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +169 -0
- package/dts/chart/legend/Legend.d.ts.map +1 -0
- package/dts/chart/legend/index.d.ts +4 -0
- package/dts/chart/legend/index.d.ts.map +1 -0
- 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 +15 -3
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +84 -28
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +28 -8
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +91 -44
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts +14 -3
- 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 +217 -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 +41 -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 +10 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +287 -70
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +80 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +47 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- 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 +46 -43
- 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/axis.d.ts +25 -1
- package/dts/chart/utils/axis.d.ts.map +1 -1
- package/dts/chart/utils/bar.d.ts +34 -0
- package/dts/chart/utils/bar.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +45 -7
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +6 -0
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +104 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +4 -0
- package/dts/chart/utils/index.d.ts.map +1 -1
- package/dts/chart/utils/interpolate.d.ts +112 -0
- package/dts/chart/utils/interpolate.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +30 -1
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +40 -7
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +11 -0
- package/dts/chart/utils/scale.d.ts.map +1 -1
- package/dts/chart/utils/scrubber.d.ts +40 -0
- package/dts/chart/utils/scrubber.d.ts.map +1 -0
- package/dts/chart/utils/transition.d.ts +101 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +170 -83
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +59 -54
- package/esm/chart/PeriodSelector.js +36 -32
- package/esm/chart/area/Area.js +26 -34
- package/esm/chart/area/AreaChart.js +29 -15
- package/esm/chart/area/DottedArea.js +39 -89
- package/esm/chart/area/GradientArea.js +37 -80
- package/esm/chart/area/SolidArea.js +32 -11
- package/esm/chart/axis/Axis.js +4 -39
- package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
- package/esm/chart/axis/XAxis.js +184 -63
- package/esm/chart/axis/YAxis.js +190 -57
- package/esm/chart/axis/index.js +1 -0
- package/esm/chart/bar/Bar.js +7 -1
- package/esm/chart/bar/BarChart.js +17 -32
- package/esm/chart/bar/BarPlot.js +5 -2
- package/esm/chart/bar/BarStack.js +74 -22
- package/esm/chart/bar/BarStackGroup.js +8 -18
- package/esm/chart/bar/DefaultBar.js +23 -28
- package/esm/chart/bar/DefaultBarStack.js +24 -20
- package/esm/chart/gradient/Gradient.js +104 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +3 -1
- package/esm/chart/legend/DefaultLegendEntry.css +1 -0
- package/esm/chart/legend/DefaultLegendEntry.js +50 -0
- package/esm/chart/legend/DefaultLegendShape.css +5 -0
- package/esm/chart/legend/DefaultLegendShape.js +47 -0
- package/esm/chart/legend/Legend.js +76 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
- package/esm/chart/line/DottedLine.js +41 -17
- package/esm/chart/line/Line.js +87 -75
- package/esm/chart/line/LineChart.js +24 -8
- package/esm/chart/line/ReferenceLine.js +41 -43
- package/esm/chart/line/SolidLine.js +39 -15
- package/esm/chart/line/index.js +1 -1
- package/esm/chart/{line/GradientLine.js → point/DefaultPointLabel.js} +31 -45
- package/esm/chart/point/Point.css +2 -0
- package/esm/chart/{Point.js → point/Point.js} +87 -62
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +154 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +57 -0
- package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberLabel.js} +15 -18
- package/esm/chart/scrubber/Scrubber.js +97 -392
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +174 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +201 -0
- package/esm/chart/scrubber/index.js +3 -1
- package/esm/chart/text/ChartText.js +15 -20
- package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
- package/esm/chart/text/index.js +1 -1
- package/esm/chart/utils/axis.js +47 -31
- package/esm/chart/utils/bar.js +48 -0
- package/esm/chart/utils/chart.js +42 -3
- package/esm/chart/utils/gradient.js +257 -0
- package/esm/chart/utils/index.js +4 -0
- package/esm/chart/utils/interpolate.js +644 -0
- package/esm/chart/utils/path.js +41 -9
- package/esm/chart/utils/point.js +99 -12
- package/esm/chart/utils/scale.js +13 -2
- package/esm/chart/utils/scrubber.js +137 -0
- package/esm/chart/utils/transition.js +133 -0
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
- package/package.json +12 -11
- package/dts/chart/Point.d.ts +0 -153
- package/dts/chart/Point.d.ts.map +0 -1
- package/dts/chart/line/GradientLine.d.ts +0 -42
- package/dts/chart/line/GradientLine.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -93
- package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +0 -7
- package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts.map +0 -1
- package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
- package/esm/chart/Point.css +0 -2
- package/esm/chart/scrubber/ScrubberBeacon.js +0 -195
|
@@ -1,54 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Rect } from '@coinbase/cds-common';
|
|
3
|
-
import type { ChartScaleFunction } from '../utils';
|
|
4
|
-
import { type BarProps } from './Bar';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
3
|
+
import type { ChartScaleFunction, Series } from '../utils';
|
|
4
|
+
import { type BarBaseProps, type BarComponent, type BarProps } from './Bar';
|
|
5
|
+
/**
|
|
6
|
+
* Extended series type that includes bar-specific properties.
|
|
7
|
+
*/
|
|
8
|
+
export type BarSeries = Series & {
|
|
44
9
|
/**
|
|
45
|
-
*
|
|
10
|
+
* Custom component to render bars for this series.
|
|
46
11
|
*/
|
|
47
|
-
|
|
12
|
+
BarComponent?: BarComponent;
|
|
48
13
|
};
|
|
49
|
-
export type
|
|
50
|
-
|
|
51
|
-
BarProps,
|
|
14
|
+
export type BarStackBaseProps = Pick<
|
|
15
|
+
BarBaseProps,
|
|
52
16
|
'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
|
|
53
17
|
> & {
|
|
54
18
|
/**
|
|
@@ -103,6 +67,37 @@ export type BarStackProps = Pick<
|
|
|
103
67
|
*/
|
|
104
68
|
stackMinSize?: number;
|
|
105
69
|
};
|
|
70
|
+
export type BarStackProps = BarStackBaseProps & Pick<BarProps, 'transitions' | 'transition'>;
|
|
71
|
+
export type BarStackComponentProps = Pick<
|
|
72
|
+
BarStackProps,
|
|
73
|
+
'x' | 'width' | 'categoryIndex' | 'borderRadius' | 'transitions' | 'transition'
|
|
74
|
+
> & {
|
|
75
|
+
/**
|
|
76
|
+
* The y position of the stack.
|
|
77
|
+
*/
|
|
78
|
+
y: number;
|
|
79
|
+
/**
|
|
80
|
+
* The height of the stack.
|
|
81
|
+
*/
|
|
82
|
+
height: number;
|
|
83
|
+
/**
|
|
84
|
+
* The bar elements to render within the stack.
|
|
85
|
+
*/
|
|
86
|
+
children: React.ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to round the top corners.
|
|
89
|
+
*/
|
|
90
|
+
roundTop?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether to round the bottom corners.
|
|
93
|
+
*/
|
|
94
|
+
roundBottom?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The y-origin for animations (baseline position).
|
|
97
|
+
*/
|
|
98
|
+
yOrigin?: number;
|
|
99
|
+
};
|
|
100
|
+
export type BarStackComponent = React.FC<BarStackComponentProps>;
|
|
106
101
|
/**
|
|
107
102
|
* BarStack component that renders a single stack of bars at a specific category index.
|
|
108
103
|
* 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;AAGjD,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;AAGjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKjF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC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AAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,QAAQ,2CAmmBpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarStackGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStackGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,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":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,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,aAAa,GACb,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,0DAqEzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAY7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,6CA4EtB,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":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,GAAG;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,4DAyE3B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Transition } from 'framer-motion';
|
|
2
|
+
import type { GradientDefinition } from '../utils';
|
|
3
|
+
export type GradientBaseProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Gradient definition with stops, axis, and other configuration.
|
|
6
|
+
*/
|
|
7
|
+
gradient: GradientDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Y-axis ID to use for gradient processing.
|
|
10
|
+
* When provided, the gradient will align with the specified y-axis range.
|
|
11
|
+
* This ensures gradients work correctly when the axis has a custom range configuration.
|
|
12
|
+
*/
|
|
13
|
+
yAxisId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type GradientProps = GradientBaseProps & {
|
|
16
|
+
/**
|
|
17
|
+
* Unique ID for the gradient definition.
|
|
18
|
+
* Will be used in `url(#${id})` references.
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to animate gradient changes.
|
|
23
|
+
*/
|
|
24
|
+
animate?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Transition configuration for animation.
|
|
27
|
+
*/
|
|
28
|
+
transition?: Transition;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Renders an SVG linearGradient element based on a GradientDefinition.
|
|
32
|
+
* The gradient can be referenced via `fill="url(#${id})"` or `stroke="url(#${id})"`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Gradient: import('react').NamedExoticComponent<GradientProps>;
|
|
35
|
+
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/Gradient.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG7D,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,GAAG;IAC9C;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,qDAgGpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/gradient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dts/chart/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export * from './axis/index';
|
|
|
3
3
|
export * from './bar/index';
|
|
4
4
|
export * from './CartesianChart';
|
|
5
5
|
export * from './ChartProvider';
|
|
6
|
+
export * from './gradient/index';
|
|
7
|
+
export * from './legend/index';
|
|
6
8
|
export * from './line/index';
|
|
7
9
|
export * from './Path';
|
|
8
10
|
export * from './PeriodSelector';
|
|
9
|
-
export * from './
|
|
11
|
+
export * from './point/index';
|
|
10
12
|
export * from './scrubber/index';
|
|
11
13
|
export * from './text/index';
|
|
12
14
|
export * from './utils/index';
|
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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HStackDefaultElement, type HStackProps } from '@coinbase/cds-web/layout';
|
|
2
|
+
import type { LegendEntryProps } from './Legend';
|
|
3
|
+
export type DefaultLegendEntryProps = LegendEntryProps &
|
|
4
|
+
Omit<HStackProps<HStackDefaultElement>, 'children' | 'color'>;
|
|
5
|
+
export declare const DefaultLegendEntry: import('react').MemoExoticComponent<
|
|
6
|
+
({
|
|
7
|
+
seriesId,
|
|
8
|
+
label,
|
|
9
|
+
color,
|
|
10
|
+
shape,
|
|
11
|
+
ShapeComponent,
|
|
12
|
+
gap,
|
|
13
|
+
className,
|
|
14
|
+
classNames,
|
|
15
|
+
style,
|
|
16
|
+
styles,
|
|
17
|
+
testID,
|
|
18
|
+
...props
|
|
19
|
+
}: DefaultLegendEntryProps) => import('react/jsx-runtime').JSX.Element
|
|
20
|
+
>;
|
|
21
|
+
//# sourceMappingURL=DefaultLegendEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultLegendEntry.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/DefaultLegendEntry.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAMjD,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,uJAc1B,uBAAuB,6CAyB3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BoxProps } from '@coinbase/cds-web/layout';
|
|
3
|
+
import type { LegendShapeProps } from './Legend';
|
|
4
|
+
export type DefaultLegendShapeProps = LegendShapeProps &
|
|
5
|
+
Omit<BoxProps<'div'>, 'children' | 'color'>;
|
|
6
|
+
export declare const DefaultLegendShape: React.NamedExoticComponent<DefaultLegendShapeProps>;
|
|
7
|
+
//# sourceMappingURL=DefaultLegendShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultLegendShape.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/DefaultLegendShape.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2CjD,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,kBAAkB,qDAY9B,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { type BoxBaseProps, type BoxDefaultElement, type BoxProps } from '@coinbase/cds-web/layout';
|
|
2
|
+
import type { LegendShape } from '../utils';
|
|
3
|
+
export type LegendShapeProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Color of the legend shape.
|
|
6
|
+
* @default 'var(--color-fgPrimary)'
|
|
7
|
+
*/
|
|
8
|
+
color?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Shape to display. Can be a preset shape or a custom ReactNode.
|
|
11
|
+
* @default 'circle'
|
|
12
|
+
*/
|
|
13
|
+
shape?: LegendShape;
|
|
14
|
+
/**
|
|
15
|
+
* Custom class name for the shape element.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom styles for the shape element.
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
export type LegendShapeComponent = React.FC<LegendShapeProps>;
|
|
24
|
+
export type LegendEntryProps = {
|
|
25
|
+
/**
|
|
26
|
+
* Id of the series.
|
|
27
|
+
*/
|
|
28
|
+
seriesId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Label of the series.
|
|
31
|
+
* If a ReactNode is provided, it replaces the default Text component.
|
|
32
|
+
*/
|
|
33
|
+
label: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Color of the series.
|
|
36
|
+
* @default 'var(--color-fgPrimary)'
|
|
37
|
+
*/
|
|
38
|
+
color?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Shape of the series.
|
|
41
|
+
*/
|
|
42
|
+
shape?: LegendShape;
|
|
43
|
+
/**
|
|
44
|
+
* Custom component to render the legend shape.
|
|
45
|
+
* @default DefaultLegendShape
|
|
46
|
+
*/
|
|
47
|
+
ShapeComponent?: LegendShapeComponent;
|
|
48
|
+
/**
|
|
49
|
+
* Custom class name for the root element.
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Custom class names for the component parts.
|
|
54
|
+
*/
|
|
55
|
+
classNames?: {
|
|
56
|
+
/**
|
|
57
|
+
* Custom class name for the root element.
|
|
58
|
+
*/
|
|
59
|
+
root?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Custom class name for the shape element.
|
|
62
|
+
*/
|
|
63
|
+
shape?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Custom class name for the label element.
|
|
66
|
+
* @note not applied when label is a ReactNode.
|
|
67
|
+
*/
|
|
68
|
+
label?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Custom styles for the root element.
|
|
72
|
+
*/
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
/**
|
|
75
|
+
* Custom styles for the component parts.
|
|
76
|
+
*/
|
|
77
|
+
styles?: {
|
|
78
|
+
/**
|
|
79
|
+
* Custom styles for the root element.
|
|
80
|
+
*/
|
|
81
|
+
root?: React.CSSProperties;
|
|
82
|
+
/**
|
|
83
|
+
* Custom styles for the shape element.
|
|
84
|
+
*/
|
|
85
|
+
shape?: React.CSSProperties;
|
|
86
|
+
/**
|
|
87
|
+
* Custom styles for the label element.
|
|
88
|
+
* @note not applied when label is a ReactNode.
|
|
89
|
+
*/
|
|
90
|
+
label?: React.CSSProperties;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export type LegendEntryComponent = React.FC<LegendEntryProps>;
|
|
94
|
+
export type LegendBaseProps = Omit<BoxBaseProps, 'children'> & {
|
|
95
|
+
/**
|
|
96
|
+
* Array of series IDs to display in the legend.
|
|
97
|
+
* By default, all series will be displayed.
|
|
98
|
+
*/
|
|
99
|
+
seriesIds?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Custom component to render each legend entry.
|
|
102
|
+
* @default DefaultLegendEntry
|
|
103
|
+
*/
|
|
104
|
+
EntryComponent?: LegendEntryComponent;
|
|
105
|
+
/**
|
|
106
|
+
* Custom component to render the legend shape within each entry.
|
|
107
|
+
* Only used when EntryComponent is not provided or is DefaultLegendEntry.
|
|
108
|
+
* @default DefaultLegendShape
|
|
109
|
+
*/
|
|
110
|
+
ShapeComponent?: LegendShapeComponent;
|
|
111
|
+
/**
|
|
112
|
+
* Accessibility label for the legend group.
|
|
113
|
+
* @default 'Legend'
|
|
114
|
+
*/
|
|
115
|
+
accessibilityLabel?: string;
|
|
116
|
+
};
|
|
117
|
+
export type LegendProps = Omit<BoxProps<BoxDefaultElement>, 'children'> &
|
|
118
|
+
LegendBaseProps & {
|
|
119
|
+
/**
|
|
120
|
+
* Custom class names for the component parts.
|
|
121
|
+
*/
|
|
122
|
+
classNames?: {
|
|
123
|
+
/**
|
|
124
|
+
* Custom class name for the root element.
|
|
125
|
+
*/
|
|
126
|
+
root?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Custom class name for each entry element.
|
|
129
|
+
*/
|
|
130
|
+
entry?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Custom class name for the shape element within each entry.
|
|
133
|
+
*/
|
|
134
|
+
entryShape?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Custom class name for the label element within each entry.
|
|
137
|
+
* @note not applied when label is a ReactNode.
|
|
138
|
+
*/
|
|
139
|
+
entryLabel?: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Custom styles for the component parts.
|
|
143
|
+
*/
|
|
144
|
+
styles?: {
|
|
145
|
+
/**
|
|
146
|
+
* Custom styles for the root element.
|
|
147
|
+
*/
|
|
148
|
+
root?: React.CSSProperties;
|
|
149
|
+
/**
|
|
150
|
+
* Custom styles for each entry element.
|
|
151
|
+
*/
|
|
152
|
+
entry?: React.CSSProperties;
|
|
153
|
+
/**
|
|
154
|
+
* Custom styles for the shape element within each entry.
|
|
155
|
+
*/
|
|
156
|
+
entryShape?: React.CSSProperties;
|
|
157
|
+
/**
|
|
158
|
+
* Custom styles for the label element within each entry.
|
|
159
|
+
* @note not applied when label is a ReactNode.
|
|
160
|
+
*/
|
|
161
|
+
entryLabel?: React.CSSProperties;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export declare const Legend: import('react').MemoExoticComponent<
|
|
165
|
+
import('react').ForwardRefExoticComponent<
|
|
166
|
+
Omit<LegendProps, 'ref'> & import('react').RefAttributes<HTMLDivElement>
|
|
167
|
+
>
|
|
168
|
+
>;
|
|
169
|
+
//# sourceMappingURL=Legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/Legend.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,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AAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG;IAC7D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC;;;;OAIG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GACrE,eAAe,GAAG;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB;;;WAGG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B;;WAEG;QACH,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACjC;;;WAGG;QACH,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAClC,CAAC;CACH,CAAC;AAEJ,eAAO,MAAM,MAAM,0JAsElB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,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":"AAMA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAQ9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,wEAyDrC,CAAC"}
|
|
@@ -3,12 +3,24 @@ import type { SharedProps } from '@coinbase/cds-common/types';
|
|
|
3
3
|
import { type PathProps } from '../Path';
|
|
4
4
|
import type { LineComponentProps } from './Line';
|
|
5
5
|
export type DottedLineProps = SharedProps &
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Pick<
|
|
7
|
+
PathProps,
|
|
8
|
+
| 'className'
|
|
9
|
+
| 'clipOffset'
|
|
10
|
+
| 'clipRect'
|
|
11
|
+
| 'strokeLinecap'
|
|
12
|
+
| 'strokeLinejoin'
|
|
13
|
+
| 'strokeDasharray'
|
|
14
|
+
| 'strokeDashoffset'
|
|
15
|
+
| 'style'
|
|
16
|
+
| 'vectorEffect'
|
|
17
|
+
> &
|
|
18
|
+
LineComponentProps & {
|
|
8
19
|
fill?: SVGProps<SVGPathElement>['fill'];
|
|
9
20
|
};
|
|
10
21
|
/**
|
|
11
|
-
* A customizable dotted line component
|
|
22
|
+
* A customizable dotted line component.
|
|
23
|
+
* Supports gradient for gradient effects on the dots.
|
|
12
24
|
*/
|
|
13
25
|
export declare const DottedLine: import('react').NamedExoticComponent<DottedLineProps>;
|
|
14
26
|
//# sourceMappingURL=DottedLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"DottedLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/DottedLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,WAAW,GACvC,IAAI,CACF,SAAS,EACP,WAAW,GACX,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,GACP,cAAc,CACjB,GACD,kBAAkB,GAAG;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,UAAU,uDAoDtB,CAAC"}
|
package/dts/chart/line/Line.d.ts
CHANGED
|
@@ -2,39 +2,26 @@ import React from 'react';
|
|
|
2
2
|
import type { SVGProps } from 'react';
|
|
3
3
|
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
4
4
|
import { type AreaComponent } from '../area/Area';
|
|
5
|
-
import
|
|
6
|
-
import { type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
stroke: string;
|
|
10
|
-
strokeOpacity?: number;
|
|
11
|
-
strokeWidth?: number;
|
|
12
|
-
testID?: string;
|
|
13
|
-
animate?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type LineComponent = React.FC<LineComponentProps>;
|
|
16
|
-
export type LineProps = SharedProps & {
|
|
5
|
+
import type { PathProps } from '../Path';
|
|
6
|
+
import { type PointBaseProps, type PointProps } from '../point';
|
|
7
|
+
import { type ChartPathCurveType, type GradientDefinition } from '../utils';
|
|
8
|
+
export type LineBaseProps = SharedProps & {
|
|
17
9
|
/**
|
|
18
10
|
* The ID of the series to render. Will be used to find the data from the chart context.
|
|
19
11
|
*/
|
|
20
12
|
seriesId: string;
|
|
21
13
|
/**
|
|
22
14
|
* The curve interpolation method to use for the line.
|
|
23
|
-
* @default '
|
|
15
|
+
* @default 'bump'
|
|
24
16
|
*/
|
|
25
17
|
curve?: ChartPathCurveType;
|
|
26
18
|
/**
|
|
27
19
|
* The type of line to render.
|
|
28
20
|
* @default 'solid'
|
|
29
21
|
*/
|
|
30
|
-
type?: 'solid' | 'dotted'
|
|
31
|
-
/**
|
|
32
|
-
* Handler for when a dot is clicked.
|
|
33
|
-
* Automatically makes dots appear pressable when provided.
|
|
34
|
-
*/
|
|
35
|
-
onPointClick?: PointConfig['onClick'];
|
|
22
|
+
type?: 'solid' | 'dotted';
|
|
36
23
|
/**
|
|
37
|
-
*
|
|
24
|
+
* Whether to show area fill under the line.
|
|
38
25
|
*/
|
|
39
26
|
showArea?: boolean;
|
|
40
27
|
/**
|
|
@@ -56,25 +43,94 @@ export type LineProps = SharedProps & {
|
|
|
56
43
|
* Custom component to render line area fill.
|
|
57
44
|
*/
|
|
58
45
|
AreaComponent?: AreaComponent;
|
|
46
|
+
/**
|
|
47
|
+
* Opacity of the line's stroke.
|
|
48
|
+
* Will also be applied to points and area fill.
|
|
49
|
+
* @default 1
|
|
50
|
+
*/
|
|
51
|
+
opacity?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Controls whether and how to render points at each data point in the series.
|
|
54
|
+
* - `true`: Show all points with default styling
|
|
55
|
+
* - `false` or `undefined`: Hide all points
|
|
56
|
+
* - Function: Called for every entry in the data array to customize individual points
|
|
57
|
+
*
|
|
58
|
+
* @param defaults - The default point props computed by the Line component
|
|
59
|
+
* @returns true for default point, false/null/undefined for no point, or Partial<PointProps> to customize
|
|
60
|
+
*/
|
|
61
|
+
points?:
|
|
62
|
+
| boolean
|
|
63
|
+
| ((defaults: PointBaseProps) => boolean | null | undefined | Partial<PointProps>);
|
|
64
|
+
/**
|
|
65
|
+
* When true, the area is connected across null values.
|
|
66
|
+
*/
|
|
67
|
+
connectNulls?: boolean;
|
|
59
68
|
/**
|
|
60
69
|
* The color of the line.
|
|
61
70
|
* @default color of the series or 'var(--color-fgPrimary)'
|
|
62
71
|
*/
|
|
63
72
|
stroke?: string;
|
|
64
73
|
/**
|
|
65
|
-
* Opacity of the line
|
|
74
|
+
* Opacity of the line
|
|
75
|
+
* @note when combined with gradient, both will be applied
|
|
66
76
|
* @default 1
|
|
67
77
|
*/
|
|
68
|
-
|
|
78
|
+
strokeOpacity?: number;
|
|
69
79
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @param params - Contains the data and pixel coordinates of the data point.
|
|
74
|
-
* @returns true for default point, false/null/undefined for no point, or PointConfig for custom point
|
|
80
|
+
* Width of the line
|
|
81
|
+
* @default 2
|
|
75
82
|
*/
|
|
76
|
-
renderPoints?: (params: RenderPointsParams) => boolean | null | undefined | PointConfig;
|
|
77
83
|
strokeWidth?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Gradient configuration.
|
|
86
|
+
* When provided, creates gradient or threshold-based coloring.
|
|
87
|
+
*/
|
|
88
|
+
gradient?: GradientDefinition;
|
|
89
|
+
/**
|
|
90
|
+
* Whether to animate the line.
|
|
91
|
+
* Overrides the animate value from the chart context.
|
|
92
|
+
*/
|
|
93
|
+
animate?: boolean;
|
|
78
94
|
};
|
|
95
|
+
export type LineProps = LineBaseProps &
|
|
96
|
+
Pick<PathProps, 'transitions' | 'transition'> & {
|
|
97
|
+
/**
|
|
98
|
+
* Handler for when a point is clicked.
|
|
99
|
+
* Passed through to Point components rendered via points.
|
|
100
|
+
*/
|
|
101
|
+
onPointClick?: PointProps['onClick'];
|
|
102
|
+
/**
|
|
103
|
+
* Custom style for the line.
|
|
104
|
+
*/
|
|
105
|
+
style?: React.CSSProperties;
|
|
106
|
+
/**
|
|
107
|
+
* Custom className for the line.
|
|
108
|
+
*/
|
|
109
|
+
className?: string;
|
|
110
|
+
};
|
|
111
|
+
export type LineComponentProps = Pick<
|
|
112
|
+
LineProps,
|
|
113
|
+
| 'stroke'
|
|
114
|
+
| 'strokeOpacity'
|
|
115
|
+
| 'strokeWidth'
|
|
116
|
+
| 'gradient'
|
|
117
|
+
| 'animate'
|
|
118
|
+
| 'transitions'
|
|
119
|
+
| 'transition'
|
|
120
|
+
| 'style'
|
|
121
|
+
| 'className'
|
|
122
|
+
> &
|
|
123
|
+
Pick<PathProps, 'clipRect' | 'strokeLinecap'> & {
|
|
124
|
+
/**
|
|
125
|
+
* Path of the line.
|
|
126
|
+
*/
|
|
127
|
+
d: SVGProps<SVGPathElement>['d'];
|
|
128
|
+
/**
|
|
129
|
+
* ID of the y-axis to use.
|
|
130
|
+
* If not provided, defaults to the default y-axis.
|
|
131
|
+
*/
|
|
132
|
+
yAxisId?: string;
|
|
133
|
+
};
|
|
134
|
+
export type LineComponent = React.FC<LineComponentProps>;
|
|
79
135
|
export declare const Line: React.NamedExoticComponent<LineProps>;
|
|
80
136
|
//# 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,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE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