@coinbase/cds-web-visualization 3.4.0-beta.9 → 3.4.0
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 +126 -0
- package/dts/chart/CartesianChart.d.ts +40 -4
- 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 +51 -12
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +25 -4
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +13 -11
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +18 -5
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +29 -29
- package/dts/chart/axis/Axis.d.ts.map +1 -1
- package/dts/chart/axis/XAxis.d.ts +6 -0
- package/dts/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/chart/axis/YAxis.d.ts +2 -1
- package/dts/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +51 -51
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +29 -6
- 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 +58 -20
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +2 -1
- 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 +7 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -1
- package/dts/chart/index.d.ts +1 -0
- 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/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +45 -24
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +5 -3
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +9 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts.map +1 -1
- package/dts/chart/point/Point.d.ts +26 -2
- package/dts/chart/point/Point.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +34 -17
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +2 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -1
- package/dts/chart/scrubber/Scrubber.d.ts +148 -46
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +10 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +25 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dts/chart/text/ChartText.d.ts.map +1 -1
- package/dts/chart/utils/axis.d.ts +48 -9
- package/dts/chart/utils/axis.d.ts.map +1 -1
- package/dts/chart/utils/bar.d.ts +188 -0
- package/dts/chart/utils/bar.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +32 -0
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +20 -4
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +3 -1
- package/dts/chart/utils/gradient.d.ts.map +1 -1
- package/dts/chart/utils/path.d.ts +26 -0
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +18 -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 +2 -1
- package/dts/chart/utils/scrubber.d.ts.map +1 -1
- package/dts/chart/utils/transition.d.ts +50 -14
- package/dts/chart/utils/transition.d.ts.map +1 -1
- package/dts/sparkline/Sparkline.d.ts +2 -1
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +2 -1
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +2 -1
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +2 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +154 -90
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +35 -19
- package/esm/chart/PeriodSelector.js +33 -15
- package/esm/chart/area/Area.js +21 -9
- package/esm/chart/area/AreaChart.js +28 -25
- package/esm/chart/area/DottedArea.js +18 -9
- package/esm/chart/area/GradientArea.js +16 -8
- package/esm/chart/area/SolidArea.js +8 -3
- package/esm/chart/axis/Axis.js +3 -17
- package/esm/chart/axis/XAxis.js +153 -50
- package/esm/chart/axis/YAxis.js +146 -36
- package/esm/chart/bar/Bar.js +16 -8
- package/esm/chart/bar/BarChart.js +38 -33
- package/esm/chart/bar/BarPlot.js +20 -25
- package/esm/chart/bar/BarStack.js +109 -505
- package/esm/chart/bar/BarStackGroup.js +36 -27
- package/esm/chart/bar/DefaultBar.js +34 -26
- package/esm/chart/bar/DefaultBarStack.js +31 -18
- package/esm/chart/gradient/Gradient.js +3 -2
- package/esm/chart/index.js +1 -0
- 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/DottedLine.js +7 -2
- package/esm/chart/line/Line.js +41 -42
- package/esm/chart/line/LineChart.js +18 -13
- package/esm/chart/line/ReferenceLine.js +6 -2
- package/esm/chart/line/SolidLine.js +8 -3
- package/esm/chart/point/Point.js +41 -24
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +64 -65
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +25 -14
- package/esm/chart/scrubber/DefaultScrubberLabel.js +26 -8
- package/esm/chart/scrubber/Scrubber.js +54 -43
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +60 -35
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +31 -8
- package/esm/chart/scrubber/ScrubberProvider.js +44 -39
- package/esm/chart/text/ChartText.js +3 -2
- package/esm/chart/utils/axis.js +90 -43
- package/esm/chart/utils/bar.js +863 -0
- package/esm/chart/utils/chart.js +34 -7
- package/esm/chart/utils/context.js +7 -0
- package/esm/chart/utils/gradient.js +6 -4
- package/esm/chart/utils/path.js +88 -61
- package/esm/chart/utils/point.js +57 -30
- package/esm/chart/utils/scale.js +13 -2
- package/esm/chart/utils/scrubber.js +9 -4
- package/esm/chart/utils/transition.js +68 -41
- package/esm/sparkline/Sparkline.js +2 -1
- package/esm/sparkline/SparklineArea.js +2 -1
- package/esm/sparkline/SparklineGradient.js +2 -1
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +2 -1
- 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 +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,132 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 3.4.0 (4/1/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Remove usage of Array.prototype.at(). [[#575](https://github.com/coinbase/cds/pull/575)]
|
|
16
|
+
|
|
17
|
+
## 3.4.0-beta.27 (4/1/2026 PST)
|
|
18
|
+
|
|
19
|
+
This is an artificial version bump with no new change.
|
|
20
|
+
|
|
21
|
+
## 3.4.0-beta.26 (3/31/2026 PST)
|
|
22
|
+
|
|
23
|
+
This is an artificial version bump with no new change.
|
|
24
|
+
|
|
25
|
+
## 3.4.0-beta.25 (3/24/2026 PST)
|
|
26
|
+
|
|
27
|
+
#### 🐞 Fixes
|
|
28
|
+
|
|
29
|
+
- Fix bar enter and update animation. [[#540](https://github.com/coinbase/cds/pull/540)]
|
|
30
|
+
|
|
31
|
+
#### 📘 Misc
|
|
32
|
+
|
|
33
|
+
- Chore: Updated numerous deprecation annotation messages.
|
|
34
|
+
|
|
35
|
+
## 3.4.0-beta.24 (3/12/2026 PST)
|
|
36
|
+
|
|
37
|
+
This is an artificial version bump with no new change.
|
|
38
|
+
|
|
39
|
+
## 3.4.0-beta.23 (3/10/2026 PST)
|
|
40
|
+
|
|
41
|
+
#### 🚀 Updates
|
|
42
|
+
|
|
43
|
+
- Add layout prop on CartesianChart. [[#483](https://github.com/coinbase/cds/pull/483)]
|
|
44
|
+
|
|
45
|
+
## 3.4.0-beta.22 (3/4/2026 PST)
|
|
46
|
+
|
|
47
|
+
#### 🚀 Updates
|
|
48
|
+
|
|
49
|
+
- Improve PeriodSelector types. [[#464](https://github.com/coinbase/cds/pull/464)]
|
|
50
|
+
- Skip null path transitions. [[#464](https://github.com/coinbase/cds/pull/464)]
|
|
51
|
+
|
|
52
|
+
## 3.4.0-beta.21 (3/2/2026 PST)
|
|
53
|
+
|
|
54
|
+
#### 🚀 Updates
|
|
55
|
+
|
|
56
|
+
- Fix styles props on Scrubber. [[#463](https://github.com/coinbase/cds/pull/463)]
|
|
57
|
+
- Fix text elevation background. [[#463](https://github.com/coinbase/cds/pull/463)]
|
|
58
|
+
|
|
59
|
+
## 3.4.0-beta.20 (2/27/2026 PST)
|
|
60
|
+
|
|
61
|
+
#### 🚀 Updates
|
|
62
|
+
|
|
63
|
+
- Add classnames and styles props to PeriodSelector. [[#438](https://github.com/coinbase/cds/pull/438/)]
|
|
64
|
+
|
|
65
|
+
#### 📘 Misc
|
|
66
|
+
|
|
67
|
+
- Clarify framer-motion is a peerDependency. [[#437](https://github.com/coinbase/cds/pull/437)]
|
|
68
|
+
- Update oudated doc links. [[#440](https://github.com/coinbase/cds/pull/440)]
|
|
69
|
+
|
|
70
|
+
## 3.4.0-beta.19 (2/20/2026 PST)
|
|
71
|
+
|
|
72
|
+
#### 🚀 Updates
|
|
73
|
+
|
|
74
|
+
- Support custom enter transitions [[#400](https://github.com/coinbase/cds/pull/400/)]
|
|
75
|
+
|
|
76
|
+
#### 📘 Misc
|
|
77
|
+
|
|
78
|
+
- Update jsdocs for styles props. [[#384](https://github.com/coinbase/cds/pull/384)]
|
|
79
|
+
|
|
80
|
+
## 3.4.0-beta.18 (2/8/2026 PST)
|
|
81
|
+
|
|
82
|
+
This is an artificial version bump with no new change.
|
|
83
|
+
|
|
84
|
+
## 3.4.0-beta.17 (2/4/2026 PST)
|
|
85
|
+
|
|
86
|
+
#### 🚀 Updates
|
|
87
|
+
|
|
88
|
+
- Add support preferred side for scrubber beacon label group. [[#366](https://github.com/coinbase/cds/pull/366)]
|
|
89
|
+
|
|
90
|
+
## 3.4.0-beta.16 (1/29/2026 PST)
|
|
91
|
+
|
|
92
|
+
#### 🚀 Updates
|
|
93
|
+
|
|
94
|
+
- Export `CartesianChartContext`. [[#340](https://github.com/coinbase/cds/pull/340)]
|
|
95
|
+
|
|
96
|
+
## 3.4.0-beta.15 (1/27/2026 PST)
|
|
97
|
+
|
|
98
|
+
#### 🐞 Fixes
|
|
99
|
+
|
|
100
|
+
- Fix padding on PeriodSelector. [[#330](https://github.com/coinbase/cds/pull/330)]
|
|
101
|
+
|
|
102
|
+
## 3.4.0-beta.14 (1/22/2026 PST)
|
|
103
|
+
|
|
104
|
+
#### 🚀 Updates
|
|
105
|
+
|
|
106
|
+
- Add chart Legend component. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
107
|
+
- Add support for hideBeaconLabels in Scrubber. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
108
|
+
- Add support for custom bar components. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
109
|
+
|
|
110
|
+
## 3.4.0-beta.13 (1/20/2026 PST)
|
|
111
|
+
|
|
112
|
+
#### 🚀 Updates
|
|
113
|
+
|
|
114
|
+
- Feat: support styling default scrubber beacon. [[#315](https://github.com/coinbase/cds/pull/315)]
|
|
115
|
+
|
|
116
|
+
#### 📘 Misc
|
|
117
|
+
|
|
118
|
+
- Internal: code connect file lint fixes. [[#311](https://github.com/coinbase/cds/pull/311)]
|
|
119
|
+
- Internal: update figma code connect config and some mapping files. [[#304](https://github.com/coinbase/cds/pull/304)]
|
|
120
|
+
|
|
121
|
+
## 3.4.0-beta.12 (1/8/2026 PST)
|
|
122
|
+
|
|
123
|
+
This is an artificial version bump with no new change.
|
|
124
|
+
|
|
125
|
+
## 3.4.0-beta.11 (1/7/2026 PST)
|
|
126
|
+
|
|
127
|
+
#### 🐞 Fixes
|
|
128
|
+
|
|
129
|
+
- Allow customization of axis tick mark and grid line alignment in band scale. [[#291](https://github.com/coinbase/cds/pull/291)]
|
|
130
|
+
|
|
131
|
+
## 3.4.0-beta.10 (1/6/2026 PST)
|
|
132
|
+
|
|
133
|
+
#### 🐞 Fixes
|
|
134
|
+
|
|
135
|
+
- Fix axis clip line issues when multiple axes are present on one side. [[#285](https://github.com/coinbase/cds/pull/285)]
|
|
136
|
+
|
|
11
137
|
## 3.4.0-beta.9 (12/18/2025 PST)
|
|
12
138
|
|
|
13
139
|
This is an artificial version bump with no new change.
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BoxBaseProps, type BoxProps } from '@coinbase/cds-web/layout';
|
|
3
3
|
import { type ScrubberProviderProps } from './scrubber/ScrubberProvider';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
type CartesianAxisConfigProps,
|
|
6
|
+
type CartesianChartLayout,
|
|
7
|
+
type ChartInset,
|
|
8
|
+
type LegendPosition,
|
|
9
|
+
type Series,
|
|
10
|
+
} from './utils';
|
|
5
11
|
export type CartesianChartBaseProps = BoxBaseProps &
|
|
6
12
|
Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
|
|
7
13
|
/**
|
|
@@ -9,23 +15,53 @@ export type CartesianChartBaseProps = BoxBaseProps &
|
|
|
9
15
|
* Each series contains its own data array.
|
|
10
16
|
*/
|
|
11
17
|
series?: Array<Series>;
|
|
18
|
+
/**
|
|
19
|
+
* Chart layout - describes the direction bars/areas grow.
|
|
20
|
+
* - 'vertical' (default): Bars grow vertically. X is category axis, Y is value axis.
|
|
21
|
+
* - 'horizontal': Bars grow horizontally. Y is category axis, X is value axis.
|
|
22
|
+
* @default 'vertical'
|
|
23
|
+
*/
|
|
24
|
+
layout?: CartesianChartLayout;
|
|
12
25
|
/**
|
|
13
26
|
* Whether to animate the chart.
|
|
14
27
|
* @default true
|
|
15
28
|
*/
|
|
16
29
|
animate?: boolean;
|
|
17
30
|
/**
|
|
18
|
-
* Configuration for x-axis.
|
|
31
|
+
* Configuration for x-axis(es). Can be a single config or array of configs.
|
|
32
|
+
*
|
|
33
|
+
* @note Multiple x-axis configs are only supported when `layout="horizontal"`.
|
|
19
34
|
*/
|
|
20
|
-
xAxis?: Partial<
|
|
35
|
+
xAxis?: Partial<CartesianAxisConfigProps> | Partial<CartesianAxisConfigProps>[];
|
|
21
36
|
/**
|
|
22
37
|
* Configuration for y-axis(es). Can be a single config or array of configs.
|
|
38
|
+
*
|
|
39
|
+
* @note `layout="horizontal"` supports only one y-axis config.
|
|
23
40
|
*/
|
|
24
|
-
yAxis?:
|
|
41
|
+
yAxis?:
|
|
42
|
+
| Partial<Omit<CartesianAxisConfigProps, 'data'>>
|
|
43
|
+
| Partial<Omit<CartesianAxisConfigProps, 'data'>>[];
|
|
25
44
|
/**
|
|
26
45
|
* Inset around the entire chart (outside the axes).
|
|
27
46
|
*/
|
|
28
47
|
inset?: number | Partial<ChartInset>;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to show the legend or a custom legend element.
|
|
50
|
+
* - `true` renders the default Legend component
|
|
51
|
+
* - A React element renders that element as the legend
|
|
52
|
+
* - `false` or omitted hides the legend
|
|
53
|
+
*/
|
|
54
|
+
legend?: boolean | React.ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Position of the legend relative to the chart.
|
|
57
|
+
* @default 'bottom'
|
|
58
|
+
*/
|
|
59
|
+
legendPosition?: LegendPosition;
|
|
60
|
+
/**
|
|
61
|
+
* Accessibility label for the legend group.
|
|
62
|
+
* @default 'Legend'
|
|
63
|
+
*/
|
|
64
|
+
legendAccessibilityLabel?: string;
|
|
29
65
|
};
|
|
30
66
|
export type CartesianChartProps = Omit<BoxProps<'div'>, 'title'> &
|
|
31
67
|
CartesianChartBaseProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGjF,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGjF,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAG3F,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAWf,KAAK,cAAc,EACnB,KAAK,MAAM,EAEZ,MAAM,SAAS,CAAC;AAYjB,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAChD,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,0BAA0B,CAAC,GAAG;IAC5E;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAChF;;;;OAIG;IACH,KAAK,CAAC,EACF,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,GAC/C,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEJ,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAC9D,uBAAuB,GAAG;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;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;KAC7B,CAAC;CACH,CAAC;AAEJ,eAAO,MAAM,cAAc,mIAib1B,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { CartesianChartContextValue } from './utils/context';
|
|
2
|
+
export declare const CartesianChartContext: import('react').Context<
|
|
3
|
+
CartesianChartContextValue | undefined
|
|
4
|
+
>;
|
|
2
5
|
export declare const useCartesianChartContext: () => CartesianChartContextValue;
|
|
3
6
|
export declare const CartesianChartProvider: import('react').Provider<
|
|
4
7
|
CartesianChartContextValue | undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAElE,eAAO,MAAM,qBAAqB,iEAEjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,0BAQ3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,kEAAiC,CAAC"}
|
package/dts/chart/Path.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { Rect, SharedProps } from '@coinbase/cds-common/types';
|
|
|
3
3
|
import { type Transition } from 'framer-motion';
|
|
4
4
|
/**
|
|
5
5
|
* Duration in seconds for path enter transition.
|
|
6
|
+
* @deprecated Use `transitions.enter` on the Path component instead. This will be removed in a future major release.
|
|
7
|
+
* @deprecationExpectedRemoval v4
|
|
6
8
|
*/
|
|
7
9
|
export declare const pathEnterTransitionDuration = 0.5;
|
|
8
10
|
export type PathBaseProps = SharedProps & {
|
|
@@ -10,6 +12,20 @@ export type PathBaseProps = SharedProps & {
|
|
|
10
12
|
* Whether to animate this path. Overrides the animate prop on the Chart component.
|
|
11
13
|
*/
|
|
12
14
|
animate?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Initial path for enter animation.
|
|
17
|
+
* When provided, the first animation will go from initialPath to d.
|
|
18
|
+
* If not provided, defaults to d (no path enter animation).
|
|
19
|
+
*/
|
|
20
|
+
initialPath?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Fill color for the path.
|
|
23
|
+
*/
|
|
24
|
+
fill?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Opacity for the path fill.
|
|
27
|
+
*/
|
|
28
|
+
fillOpacity?: number;
|
|
13
29
|
};
|
|
14
30
|
export type PathProps = PathBaseProps &
|
|
15
31
|
Omit<
|
|
@@ -27,6 +43,41 @@ export type PathProps = PathBaseProps &
|
|
|
27
43
|
| 'onDragEndCapture'
|
|
28
44
|
| 'onDragStartCapture'
|
|
29
45
|
> & {
|
|
46
|
+
/**
|
|
47
|
+
* Transition configuration for enter and update animations.
|
|
48
|
+
* @note Disable an animation by passing in null.
|
|
49
|
+
*
|
|
50
|
+
* @default transitions = {{
|
|
51
|
+
* enter: { type: 'tween', duration: 0.5 },
|
|
52
|
+
* update: { type: 'spring', stiffness: 900, damping: 120, mass: 4 }
|
|
53
|
+
* }}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Custom enter and update transitions
|
|
57
|
+
* transitions={{ enter: { type: 'tween', duration: 0.3 }, update: { type: 'spring', damping: 20 } }}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Disable enter animation
|
|
61
|
+
* transitions={{ enter: null }}
|
|
62
|
+
*/
|
|
63
|
+
transitions?: {
|
|
64
|
+
/**
|
|
65
|
+
* Transition for the initial enter/reveal animation.
|
|
66
|
+
* Set to `null` to disable.
|
|
67
|
+
*/
|
|
68
|
+
enter?: Transition | null;
|
|
69
|
+
/**
|
|
70
|
+
* Transition for subsequent data update animations.
|
|
71
|
+
* Set to `null` to disable.
|
|
72
|
+
*/
|
|
73
|
+
update?: Transition | null;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Transition for updates.
|
|
77
|
+
* @deprecated Use `transitions.update` instead. This will be removed in a future major release.
|
|
78
|
+
* @deprecationExpectedRemoval v4
|
|
79
|
+
*/
|
|
80
|
+
transition?: Transition;
|
|
30
81
|
/**
|
|
31
82
|
* Offset added to the clip rect boundaries.
|
|
32
83
|
*/
|
|
@@ -37,18 +88,6 @@ export type PathProps = PathBaseProps &
|
|
|
37
88
|
* @default drawingArea of chart + clipOffset
|
|
38
89
|
*/
|
|
39
90
|
clipRect?: Rect | null;
|
|
40
|
-
/**
|
|
41
|
-
* Transition configuration for path.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Timing based animation
|
|
45
|
-
* transition={{ type: 'tween', duration: 0.2, ease: 'easeOut' }}
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* // Spring animation
|
|
49
|
-
* transition={{ type: 'spring', damping: 20, stiffness: 300 }}
|
|
50
|
-
*/
|
|
51
|
-
transition?: Transition;
|
|
52
91
|
};
|
|
53
92
|
export declare const Path: import('react').NamedExoticComponent<PathProps>;
|
|
54
93
|
//# sourceMappingURL=Path.d.ts.map
|
package/dts/chart/Path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAM7D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GACnC,IAAI,CACF,QAAQ,CAAC,cAAc,CAAC,EACtB,kBAAkB,GAClB,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,6BAA6B,GAC7B,QAAQ,GACR,WAAW,GACX,aAAa,GACb,eAAe,GACf,kBAAkB,GAClB,oBAAoB,CACvB,GAAG;IACF;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,EAAE;QACZ;;;WAGG;QACH,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB,CAAC;AAcJ,eAAO,MAAM,IAAI,iDA8FhB,CAAC"}
|
|
@@ -9,6 +9,7 @@ export declare const PeriodSelectorActiveIndicator: React.MemoExoticComponent<
|
|
|
9
9
|
position,
|
|
10
10
|
borderRadius,
|
|
11
11
|
style,
|
|
12
|
+
...props
|
|
12
13
|
}: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | null
|
|
13
14
|
>;
|
|
14
15
|
export declare const liveTabLabelDefaultElement = 'span';
|
|
@@ -42,15 +43,35 @@ export declare const PeriodSelector: React.MemoExoticComponent<
|
|
|
42
43
|
React.ForwardRefExoticComponent<
|
|
43
44
|
Partial<
|
|
44
45
|
Pick<
|
|
45
|
-
import('@coinbase/cds-web/tabs').
|
|
46
|
+
import('@coinbase/cds-web/tabs').TabsBaseProps<string>,
|
|
46
47
|
'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
47
48
|
>
|
|
48
49
|
> &
|
|
49
50
|
Omit<
|
|
50
|
-
import('@coinbase/cds-web/tabs').
|
|
51
|
-
'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
51
|
+
import('@coinbase/cds-web/tabs').TabsBaseProps<string>,
|
|
52
|
+
'classNames' | 'styles' | 'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
52
53
|
> &
|
|
53
|
-
|
|
54
|
+
Partial<
|
|
55
|
+
Pick<
|
|
56
|
+
import('@coinbase/cds-web/tabs').TabsProps<string>,
|
|
57
|
+
'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
58
|
+
>
|
|
59
|
+
> &
|
|
60
|
+
Omit<
|
|
61
|
+
import('@coinbase/cds-web/tabs').TabsProps<string>,
|
|
62
|
+
'classNames' | 'styles' | 'TabComponent' | 'TabsActiveIndicatorComponent'
|
|
63
|
+
> & {
|
|
64
|
+
styles?: {
|
|
65
|
+
root?: React.CSSProperties;
|
|
66
|
+
tab?: React.CSSProperties;
|
|
67
|
+
activeIndicator?: React.CSSProperties;
|
|
68
|
+
};
|
|
69
|
+
classNames?: {
|
|
70
|
+
root?: string;
|
|
71
|
+
tab?: string;
|
|
72
|
+
activeIndicator?: string;
|
|
73
|
+
};
|
|
74
|
+
} & React.RefAttributes<HTMLElement>
|
|
54
75
|
>
|
|
55
76
|
>;
|
|
56
77
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAE9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAOxE,eAAO,MAAM,6BAA6B,qGAQrC,wBAAwB,oDA0B5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,SAAS,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC;AAE3E,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,WAAW,SAAS,KAAK,CAAC,WAAW,IAAI,WAAW,CAAC,KAAK,CACtF,WAAW,EACX,qBAAqB,CACtB,CAAC;AAYF,KAAK,qBAAqB,GAAG,CAAC,CAAC,WAAW,SAAS,KAAK,CAAC,WAAW,GAAG,0BAA0B,EAC/F,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAClC,WAAW,CAAC,WAAW,CAAC,GAC3B,WAAW,CAAC,UAAU,CAAC;AAEzB,eAAO,MAAM,YAAY,EAAE,qBAiC1B,CAAC;AASF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,cAAc;;YAxHL,CAAC;WAGd,CAAC;uBAIN,CAAJ;;;YAKK,CAAC;WAGK,CAAC;uBAEsB,CAAC;;sCA+IlC,CAAC"}
|
package/dts/chart/area/Area.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SVGProps } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PathBaseProps, PathProps } from '../Path';
|
|
4
4
|
import { type ChartPathCurveType, type GradientDefinition } from '../utils';
|
|
5
5
|
export type AreaBaseProps = {
|
|
6
6
|
/**
|
|
@@ -30,13 +30,13 @@ export type AreaBaseProps = {
|
|
|
30
30
|
* The color of the area.
|
|
31
31
|
* @default color of the series or 'var(--color-fgPrimary)'
|
|
32
32
|
*/
|
|
33
|
-
fill?:
|
|
33
|
+
fill?: PathBaseProps['fill'];
|
|
34
34
|
/**
|
|
35
35
|
* Opacity of the area
|
|
36
36
|
* @note when combined with gradient, both will be applied
|
|
37
37
|
* @default 1
|
|
38
38
|
*/
|
|
39
|
-
fillOpacity?:
|
|
39
|
+
fillOpacity?: PathBaseProps['fillOpacity'];
|
|
40
40
|
/**
|
|
41
41
|
* Baseline value for the gradient.
|
|
42
42
|
* When set, overrides the default baseline.
|
|
@@ -51,25 +51,27 @@ export type AreaBaseProps = {
|
|
|
51
51
|
* Whether to animate the area.
|
|
52
52
|
* Overrides the animate value from the chart context.
|
|
53
53
|
*/
|
|
54
|
-
animate?:
|
|
55
|
-
};
|
|
56
|
-
export type AreaProps = AreaBaseProps & {
|
|
57
|
-
/**
|
|
58
|
-
* Transition configuration for path animations.
|
|
59
|
-
*/
|
|
60
|
-
transition?: Transition;
|
|
54
|
+
animate?: PathBaseProps['animate'];
|
|
61
55
|
};
|
|
56
|
+
export type AreaProps = AreaBaseProps & Pick<PathProps, 'transitions' | 'transition'>;
|
|
62
57
|
export type AreaComponentProps = Pick<
|
|
63
58
|
AreaProps,
|
|
64
|
-
'fill' | 'fillOpacity' | 'baseline' | 'gradient' | 'animate' | 'transition'
|
|
59
|
+
'fill' | 'fillOpacity' | 'baseline' | 'gradient' | 'animate' | 'transitions' | 'transition'
|
|
65
60
|
> & {
|
|
66
61
|
/**
|
|
67
62
|
* Path of the area
|
|
68
63
|
*/
|
|
69
64
|
d: SVGProps<SVGPathElement>['d'];
|
|
65
|
+
/**
|
|
66
|
+
* ID of the x-axis to use.
|
|
67
|
+
* If not provided, defaults to the default x-axis.
|
|
68
|
+
* @note Only used for axis selection when layout is 'horizontal'. Vertical layout uses a single x-axis.
|
|
69
|
+
*/
|
|
70
|
+
xAxisId?: string;
|
|
70
71
|
/**
|
|
71
72
|
* ID of the y-axis to use.
|
|
72
73
|
* If not provided, defaults to the default y-axis.
|
|
74
|
+
* @note Only used for axis selection when layout is 'vertical'. Horizontal layout supports a single y-axis.
|
|
73
75
|
*/
|
|
74
76
|
yAxisId?: string;
|
|
75
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Area.d.ts","sourceRoot":"","sources":["../../../src/chart/area/Area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Area.d.ts","sourceRoot":"","sources":["../../../src/chart/area/Area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,KAAK,kBAAkB,EAAe,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMzF,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,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,CAC5F,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCA+FhB,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { type XAxisProps, type YAxisProps } from '../axis';
|
|
2
2
|
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
3
3
|
import { type LineProps } from '../line/Line';
|
|
4
|
-
import { type
|
|
4
|
+
import { type CartesianAxisConfigProps, type Series } from '../utils';
|
|
5
5
|
import { type AreaProps } from './Area';
|
|
6
6
|
export type AreaSeries = Series &
|
|
7
7
|
Partial<
|
|
8
8
|
Pick<
|
|
9
9
|
AreaProps,
|
|
10
|
-
|
|
10
|
+
| 'AreaComponent'
|
|
11
|
+
| 'curve'
|
|
12
|
+
| 'fillOpacity'
|
|
13
|
+
| 'type'
|
|
14
|
+
| 'fill'
|
|
15
|
+
| 'connectNulls'
|
|
16
|
+
| 'transitions'
|
|
17
|
+
| 'transition'
|
|
11
18
|
>
|
|
12
19
|
> &
|
|
13
20
|
Partial<Pick<LineProps, 'LineComponent' | 'strokeWidth' | 'stroke' | 'opacity'>> & {
|
|
@@ -21,7 +28,13 @@ export type AreaSeries = Series &
|
|
|
21
28
|
export type AreaChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
22
29
|
Pick<
|
|
23
30
|
AreaProps,
|
|
24
|
-
|
|
31
|
+
| 'AreaComponent'
|
|
32
|
+
| 'curve'
|
|
33
|
+
| 'fillOpacity'
|
|
34
|
+
| 'type'
|
|
35
|
+
| 'connectNulls'
|
|
36
|
+
| 'transitions'
|
|
37
|
+
| 'transition'
|
|
25
38
|
> &
|
|
26
39
|
Pick<LineProps, 'LineComponent' | 'strokeWidth'> & {
|
|
27
40
|
/**
|
|
@@ -61,13 +74,13 @@ export type AreaChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis'
|
|
|
61
74
|
* Accepts axis config and axis props.
|
|
62
75
|
* To show the axis, set `showXAxis` to true.
|
|
63
76
|
*/
|
|
64
|
-
xAxis?: Partial<
|
|
77
|
+
xAxis?: Partial<CartesianAxisConfigProps> & XAxisProps;
|
|
65
78
|
/**
|
|
66
79
|
* Configuration for y-axis.
|
|
67
80
|
* Accepts axis config and axis props.
|
|
68
81
|
* To show the axis, set `showYAxis` to true.
|
|
69
82
|
*/
|
|
70
|
-
yAxis?: Partial<
|
|
83
|
+
yAxis?: Partial<CartesianAxisConfigProps> & YAxisProps;
|
|
71
84
|
};
|
|
72
85
|
export type AreaChartProps = AreaChartBaseProps &
|
|
73
86
|
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.d.ts","sourceRoot":"","sources":["../../../src/chart/area/AreaChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"AreaChart.d.ts","sourceRoot":"","sources":["../../../src/chart/area/AreaChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,wBAAwB,EAAkB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtF,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAC7B,OAAO,CACL,IAAI,CACF,SAAS,EACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,MAAM,GACN,MAAM,GACN,cAAc,GACd,aAAa,GACb,YAAY,CACf,CACF,GACD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC,GAAG;IACjF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,MAAM,GACN,cAAc,GACd,aAAa,GACb,YAAY,CACf,GACD,IAAI,CAAC,SAAS,EAAE,eAAe,GAAG,aAAa,CAAC,GAAG;IACjD;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,UAAU,CAAC;IACvD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,UAAU,CAAC;CACxD,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS,4JAgLrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DottedArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/DottedArea.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,GAAG;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"DottedArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/DottedArea.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,GAAG;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,UAAU,uDAsFtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradientArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/GradientArea.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,GAAG;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"GradientArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/GradientArea.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,GAAG;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,yDA+DxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/SolidArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"SolidArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/SolidArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,SAAS,EACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,YAAY,GACZ,UAAU,CACb,GACC,kBAAkB,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,SAAS,sDAyCrB,CAAC"}
|
package/dts/chart/axis/Axis.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { SharedProps } from '@coinbase/cds-common/types';
|
|
3
|
+
import type { Transition } from 'framer-motion';
|
|
2
4
|
import { type LineComponent } from '../line';
|
|
3
5
|
import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
|
|
6
|
+
import { type AxisBandPlacement } from '../utils';
|
|
4
7
|
export declare const axisLineStyles =
|
|
5
8
|
'\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n';
|
|
6
9
|
export declare const axisTickMarkStyles =
|
|
@@ -8,24 +11,7 @@ export declare const axisTickMarkStyles =
|
|
|
8
11
|
/**
|
|
9
12
|
* Animation variants for axis elements - updates (used for both grid lines and tick labels)
|
|
10
13
|
*/
|
|
11
|
-
export declare const
|
|
12
|
-
initial: {
|
|
13
|
-
opacity: number;
|
|
14
|
-
};
|
|
15
|
-
animate: {
|
|
16
|
-
opacity: number;
|
|
17
|
-
transition: {
|
|
18
|
-
duration: number;
|
|
19
|
-
delay: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
exit: {
|
|
23
|
-
opacity: number;
|
|
24
|
-
transition: {
|
|
25
|
-
duration: number;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
14
|
+
export declare const axisUpdateAnimationTransition: Transition;
|
|
29
15
|
export type AxisTickLabelComponentProps = Pick<
|
|
30
16
|
ChartTextProps,
|
|
31
17
|
| 'x'
|
|
@@ -53,7 +39,21 @@ export type AxisTickLabelComponentProps = Pick<
|
|
|
53
39
|
| 'style'
|
|
54
40
|
>;
|
|
55
41
|
export type AxisTickLabelComponent = React.FC<AxisTickLabelComponentProps>;
|
|
56
|
-
export type AxisBaseProps = {
|
|
42
|
+
export type AxisBaseProps = SharedProps & {
|
|
43
|
+
/**
|
|
44
|
+
* Placement of grid lines relative to each band.
|
|
45
|
+
* Options: 'start', 'middle', 'end', 'edges'
|
|
46
|
+
* @note This property only applies to band scales.
|
|
47
|
+
* @default 'edges'
|
|
48
|
+
*/
|
|
49
|
+
bandGridLinePlacement?: AxisBandPlacement;
|
|
50
|
+
/**
|
|
51
|
+
* Placement of tick marks relative to each band.
|
|
52
|
+
* Options: 'start', 'middle', 'end', 'edges'
|
|
53
|
+
* @note This property only applies to band scales.
|
|
54
|
+
* @default 'middle'
|
|
55
|
+
*/
|
|
56
|
+
bandTickMarkPlacement?: AxisBandPlacement;
|
|
57
57
|
/**
|
|
58
58
|
* Label text to display for the axis.
|
|
59
59
|
*/
|
|
@@ -74,7 +74,9 @@ export type AxisBaseProps = {
|
|
|
74
74
|
* This value is passed into d3 and may not be respected.
|
|
75
75
|
* @note This property is overridden when `ticks` is provided.
|
|
76
76
|
* @note this property overrides the `tickInterval` property.
|
|
77
|
-
* @default 5
|
|
77
|
+
* @default 5 for value axes by layout:
|
|
78
|
+
* - X axis when chart layout is horizontal
|
|
79
|
+
* - Y axis when chart layout is vertical
|
|
78
80
|
*/
|
|
79
81
|
requestedTickCount?: number;
|
|
80
82
|
/**
|
|
@@ -223,18 +225,16 @@ export type AxisProps = AxisBaseProps & {
|
|
|
223
225
|
* Formatter function for axis tick values.
|
|
224
226
|
* Tick values will be wrapped in ChartText component.
|
|
225
227
|
*
|
|
228
|
+
* For band scales with string data, the value will be the string label (e.g., "Jan", "Feb").
|
|
229
|
+
* For numeric scales, the value will be the number.
|
|
230
|
+
*
|
|
226
231
|
* @example
|
|
227
|
-
* // XAxis
|
|
228
|
-
* tickLabelFormatter: (
|
|
229
|
-
* if (index % 12 === 0) {
|
|
230
|
-
* return <tspan style={{ fontWeight: 'bold' }}>${prices[index]}</tspan>;
|
|
231
|
-
* }
|
|
232
|
-
* return `$${prices[index]}`;
|
|
233
|
-
* }
|
|
232
|
+
* // XAxis with categorical data
|
|
233
|
+
* tickLabelFormatter: (value) => String(value).toUpperCase()
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
|
-
* // YAxis
|
|
237
|
-
* tickLabelFormatter: (value) => `$${
|
|
236
|
+
* // YAxis with numeric data
|
|
237
|
+
* tickLabelFormatter: (value) => `$${value}`
|
|
238
238
|
*/
|
|
239
239
|
tickLabelFormatter?: (value: number) => ChartTextChildren;
|
|
240
240
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/Axis.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/Axis.tsx"],"names":[],"mappings":"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"}
|