@coinbase/cds-web-visualization 3.4.0-beta.5 → 3.4.0-beta.7
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 +15 -0
- package/dts/chart/CartesianChart.d.ts +38 -2
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +27 -7
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +0 -4
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +54 -24
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +33 -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 +89 -43
- 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 +1 -1
- 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 +17 -8
- 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 +40 -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.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 +2 -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 +15 -3
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +70 -28
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +26 -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 +201 -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 +24 -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 +207 -66
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +70 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +32 -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/chart.d.ts +27 -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 +24 -1
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +29 -0
- package/dts/chart/utils/point.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 +65 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/esm/chart/CartesianChart.js +140 -85
- package/esm/chart/Path.js +51 -46
- package/esm/chart/PeriodSelector.js +4 -18
- package/esm/chart/area/Area.js +24 -34
- package/esm/chart/area/AreaChart.js +24 -15
- package/esm/chart/area/DottedArea.js +35 -89
- package/esm/chart/area/GradientArea.js +34 -80
- package/esm/chart/area/SolidArea.js +29 -11
- package/esm/chart/axis/Axis.js +4 -25
- package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
- package/esm/chart/axis/XAxis.js +53 -36
- package/esm/chart/axis/YAxis.js +55 -32
- package/esm/chart/axis/index.js +1 -0
- package/esm/chart/bar/Bar.js +3 -1
- package/esm/chart/bar/BarChart.js +15 -32
- package/esm/chart/bar/BarPlot.js +3 -2
- package/esm/chart/bar/BarStack.js +65 -23
- package/esm/chart/bar/BarStackGroup.js +7 -17
- package/esm/chart/bar/DefaultBar.js +4 -7
- package/esm/chart/bar/DefaultBarStack.js +5 -7
- package/esm/chart/gradient/Gradient.js +104 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +2 -1
- package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
- package/esm/chart/line/DottedLine.js +38 -17
- package/esm/chart/line/Line.js +96 -70
- package/esm/chart/line/LineChart.js +18 -6
- package/esm/chart/line/ReferenceLine.js +41 -43
- package/esm/chart/line/SolidLine.js +36 -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} +66 -57
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +155 -0
- package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberBeaconLabel.js} +23 -10
- package/esm/chart/scrubber/DefaultScrubberLabel.js +30 -0
- package/esm/chart/scrubber/Scrubber.js +98 -392
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +166 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +186 -0
- package/esm/chart/scrubber/index.js +3 -1
- package/esm/chart/text/ChartText.js +13 -19
- package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
- package/esm/chart/text/index.js +1 -1
- package/esm/chart/utils/chart.js +29 -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 +32 -9
- package/esm/chart/utils/point.js +69 -0
- package/esm/chart/utils/scrubber.js +132 -0
- package/esm/chart/utils/transition.js +111 -0
- package/package.json +5 -5
- 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
package/dts/chart/axis/Axis.d.ts
CHANGED
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type LineComponent } from '../line';
|
|
3
|
-
import type { ChartTextChildren } from '../text/ChartText';
|
|
3
|
+
import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
|
|
4
4
|
export declare const axisLineStyles =
|
|
5
5
|
'\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n';
|
|
6
6
|
export declare const axisTickMarkStyles =
|
|
7
7
|
'\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n';
|
|
8
|
-
/**
|
|
9
|
-
* Animation variants for grouped axis tick labels - initial mount
|
|
10
|
-
*/
|
|
11
|
-
export declare const axisTickLabelsInitialAnimationVariants: {
|
|
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
|
-
};
|
|
29
8
|
/**
|
|
30
9
|
* Animation variants for axis elements - updates (used for both grid lines and tick labels)
|
|
31
10
|
*/
|
|
@@ -47,12 +26,43 @@ export declare const axisUpdateAnimationVariants: {
|
|
|
47
26
|
};
|
|
48
27
|
};
|
|
49
28
|
};
|
|
29
|
+
export type AxisTickLabelComponentProps = Pick<
|
|
30
|
+
ChartTextProps,
|
|
31
|
+
| 'x'
|
|
32
|
+
| 'y'
|
|
33
|
+
| 'children'
|
|
34
|
+
| 'testID'
|
|
35
|
+
| 'dx'
|
|
36
|
+
| 'dy'
|
|
37
|
+
| 'font'
|
|
38
|
+
| 'fontFamily'
|
|
39
|
+
| 'fontSize'
|
|
40
|
+
| 'fontWeight'
|
|
41
|
+
| 'color'
|
|
42
|
+
| 'elevated'
|
|
43
|
+
| 'inset'
|
|
44
|
+
| 'background'
|
|
45
|
+
| 'borderRadius'
|
|
46
|
+
| 'disableRepositioning'
|
|
47
|
+
| 'bounds'
|
|
48
|
+
| 'styles'
|
|
49
|
+
| 'classNames'
|
|
50
|
+
| 'horizontalAlignment'
|
|
51
|
+
| 'verticalAlignment'
|
|
52
|
+
| 'className'
|
|
53
|
+
| 'style'
|
|
54
|
+
>;
|
|
55
|
+
export type AxisTickLabelComponent = React.FC<AxisTickLabelComponentProps>;
|
|
50
56
|
export type AxisBaseProps = {
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @default DottedLine
|
|
58
|
+
* Label text to display for the axis.
|
|
54
59
|
*/
|
|
55
|
-
|
|
60
|
+
label?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Gap between the tick labels and the axis label.
|
|
63
|
+
* @default 4
|
|
64
|
+
*/
|
|
65
|
+
labelGap?: number;
|
|
56
66
|
/**
|
|
57
67
|
* Minimum gap between tick labels.
|
|
58
68
|
* Labels will be hidden if they are closer than this gap.
|
|
@@ -102,24 +112,6 @@ export type AxisBaseProps = {
|
|
|
102
112
|
* ticks: (index) => index % 12 === 0
|
|
103
113
|
*/
|
|
104
114
|
ticks?: number[] | ((value: number) => boolean);
|
|
105
|
-
/**
|
|
106
|
-
* Formatter function for axis tick values.
|
|
107
|
-
* Tick values will be wrapped in ChartText component.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* // Simple string formatting
|
|
111
|
-
* tickLabelFormatter: (value) => `$${prices[value]}`
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* // ReactNode with conditional styling
|
|
115
|
-
* tickLabelFormatter: (index) => {
|
|
116
|
-
* if (index % 12 === 0) {
|
|
117
|
-
* return <tspan style={{ fontWeight: 'bold' }}>${prices[index]}</tspan>;
|
|
118
|
-
* }
|
|
119
|
-
* return `$${prices[index]}`;
|
|
120
|
-
* }
|
|
121
|
-
*/
|
|
122
|
-
tickLabelFormatter?: (value: any) => ChartTextChildren;
|
|
123
115
|
/**
|
|
124
116
|
* Space between the axis tick mark and labels.
|
|
125
117
|
* If tick marks are not shown, this is the gap between the axis and the chart.
|
|
@@ -158,6 +150,10 @@ export type AxisProps = AxisBaseProps & {
|
|
|
158
150
|
* Custom className for the root element.
|
|
159
151
|
*/
|
|
160
152
|
root?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Custom className for the axis label.
|
|
155
|
+
*/
|
|
156
|
+
label?: string;
|
|
161
157
|
/**
|
|
162
158
|
* Custom className for the tick labels.
|
|
163
159
|
*/
|
|
@@ -187,6 +183,10 @@ export type AxisProps = AxisBaseProps & {
|
|
|
187
183
|
* Custom style for the root element.
|
|
188
184
|
*/
|
|
189
185
|
root?: React.CSSProperties;
|
|
186
|
+
/**
|
|
187
|
+
* Custom style for the axis label.
|
|
188
|
+
*/
|
|
189
|
+
label?: React.CSSProperties;
|
|
190
190
|
/**
|
|
191
191
|
* Custom style for the tick labels.
|
|
192
192
|
*/
|
|
@@ -204,5 +204,51 @@ export type AxisProps = AxisBaseProps & {
|
|
|
204
204
|
*/
|
|
205
205
|
tickMark?: React.CSSProperties;
|
|
206
206
|
};
|
|
207
|
+
/**
|
|
208
|
+
* Component to render the grid lines.
|
|
209
|
+
* @default DottedLine
|
|
210
|
+
*/
|
|
211
|
+
GridLineComponent?: LineComponent;
|
|
212
|
+
/**
|
|
213
|
+
* Component to render the axis line.
|
|
214
|
+
* @default SolidLine
|
|
215
|
+
*/
|
|
216
|
+
LineComponent?: LineComponent;
|
|
217
|
+
/**
|
|
218
|
+
* Component to render the tick marks.
|
|
219
|
+
* @default SolidLine
|
|
220
|
+
*/
|
|
221
|
+
TickMarkLineComponent?: LineComponent;
|
|
222
|
+
/**
|
|
223
|
+
* Formatter function for axis tick values.
|
|
224
|
+
* Tick values will be wrapped in ChartText component.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* // XAxis
|
|
228
|
+
* tickLabelFormatter: (index) => {
|
|
229
|
+
* if (index % 12 === 0) {
|
|
230
|
+
* return <tspan style={{ fontWeight: 'bold' }}>${prices[index]}</tspan>;
|
|
231
|
+
* }
|
|
232
|
+
* return `$${prices[index]}`;
|
|
233
|
+
* }
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* // YAxis
|
|
237
|
+
* tickLabelFormatter: (value) => `$${prices[value]}`
|
|
238
|
+
*/
|
|
239
|
+
tickLabelFormatter?: (value: number) => ChartTextChildren;
|
|
240
|
+
/**
|
|
241
|
+
* Component to render tick labels.
|
|
242
|
+
* Allows for custom styling and formatting that works cross-platform.
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* // Custom tick label component with elevation
|
|
246
|
+
* TickLabelComponent={(props) => (
|
|
247
|
+
* <DefaultAxisTickLabel {...props} elevated color="var(--color-fgPrimary)" />
|
|
248
|
+
* )}
|
|
249
|
+
*
|
|
250
|
+
* @default DefaultAxisTickLabel
|
|
251
|
+
*/
|
|
252
|
+
TickLabelComponent?: AxisTickLabelComponent;
|
|
207
253
|
};
|
|
208
254
|
//# sourceMappingURL=Axis.d.ts.map
|
|
@@ -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;AAE/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/Axis.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AxisTickLabelComponentProps } from './Axis';
|
|
2
|
+
export type DefaultAxisTickLabelProps = AxisTickLabelComponentProps;
|
|
3
|
+
/**
|
|
4
|
+
* DefaultAxisTickLabel is the default label component for axis tick labels.
|
|
5
|
+
* Provides standard styling for both X and Y axis tick labels.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DefaultAxisTickLabel: import('react').NamedExoticComponent<AxisTickLabelComponentProps>;
|
|
8
|
+
//# sourceMappingURL=DefaultAxisTickLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultAxisTickLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/DefaultAxisTickLabel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mEAE/B,CAAC"}
|
|
@@ -7,7 +7,7 @@ export type XAxisBaseProps = AxisBaseProps & {
|
|
|
7
7
|
position?: 'top' | 'bottom';
|
|
8
8
|
/**
|
|
9
9
|
* Height of the axis. This value is inclusive of the padding.
|
|
10
|
-
* @default 32
|
|
10
|
+
* @default 32 when no label is provided, 52 when a label is provided
|
|
11
11
|
*/
|
|
12
12
|
height?: number;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/XAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/XAxis.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAahB,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;AAEpD,eAAO,MAAM,KAAK,kDA0PjB,CAAC"}
|
|
@@ -12,7 +12,7 @@ export type YAxisBaseProps = AxisBaseProps & {
|
|
|
12
12
|
position?: 'left' | 'right';
|
|
13
13
|
/**
|
|
14
14
|
* Width of the axis. This value is inclusive of the padding.
|
|
15
|
-
* @default 44
|
|
15
|
+
* @default 44 when no label is provided, 64 when a label is provided
|
|
16
16
|
*/
|
|
17
17
|
width?: number;
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/YAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/YAxis.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAcvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;AAEpD,eAAO,MAAM,KAAK,kDAmPjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/index.ts"],"names":[],"mappings":"AACA,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dts/chart/bar/Bar.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SVGProps } from 'react';
|
|
3
|
-
|
|
3
|
+
import type { Transition } from 'framer-motion';
|
|
4
|
+
export type BarBaseProps = {
|
|
4
5
|
/**
|
|
5
6
|
* X coordinate of the bar (left edge).
|
|
6
7
|
*/
|
|
@@ -18,7 +19,8 @@ export type BarComponentProps = {
|
|
|
18
19
|
*/
|
|
19
20
|
height: number;
|
|
20
21
|
/**
|
|
21
|
-
* Border radius
|
|
22
|
+
* Border radius for the bar.
|
|
23
|
+
* @default 4
|
|
22
24
|
*/
|
|
23
25
|
borderRadius?: number;
|
|
24
26
|
/**
|
|
@@ -42,10 +44,6 @@ export type BarComponentProps = {
|
|
|
42
44
|
* The y-axis data value for this bar.
|
|
43
45
|
*/
|
|
44
46
|
dataY?: number | [number, number] | null;
|
|
45
|
-
/**
|
|
46
|
-
* The path data for the bar shape.
|
|
47
|
-
*/
|
|
48
|
-
d: SVGProps<SVGPathElement>['d'];
|
|
49
47
|
/**
|
|
50
48
|
* Fill color for the bar.
|
|
51
49
|
*/
|
|
@@ -62,19 +60,24 @@ export type BarComponentProps = {
|
|
|
62
60
|
* Stroke width for the bar outline.
|
|
63
61
|
*/
|
|
64
62
|
strokeWidth?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Component to render the bar.
|
|
65
|
+
*/
|
|
66
|
+
BarComponent?: BarComponent;
|
|
65
67
|
};
|
|
66
|
-
export type
|
|
67
|
-
export type BarProps = Omit<BarComponentProps, 'd'> & {
|
|
68
|
+
export type BarProps = BarBaseProps & {
|
|
68
69
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @default 4
|
|
70
|
+
* Transition configuration for animation.
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
transition?: Transition;
|
|
73
|
+
};
|
|
74
|
+
export type BarComponentProps = Omit<BarProps, 'BarComponent'> & {
|
|
73
75
|
/**
|
|
74
|
-
*
|
|
76
|
+
* The path data for the bar shape.
|
|
75
77
|
*/
|
|
76
|
-
|
|
78
|
+
d: SVGProps<SVGPathElement>['d'];
|
|
77
79
|
};
|
|
80
|
+
export type BarComponent = React.FC<BarComponentProps>;
|
|
78
81
|
/**
|
|
79
82
|
* Simple bar component that renders a single bar at the specified position.
|
|
80
83
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/Bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Bar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/Bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMhD,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG;IAC/D;;OAEG;IACH,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG,sCAkDf,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { type XAxisProps, type YAxisProps } from '../axis';
|
|
2
|
-
import { type CartesianChartProps } from '../CartesianChart';
|
|
2
|
+
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
3
3
|
import { type AxisConfigProps, type Series } from '../utils';
|
|
4
|
-
import { type BarProps } from './Bar';
|
|
5
4
|
import { type BarPlotProps } from './BarPlot';
|
|
6
|
-
export type
|
|
7
|
-
Partial<Pick<BarProps, 'BarComponent' | 'fill' | 'fillOpacity' | 'stroke' | 'strokeWidth'>>;
|
|
8
|
-
export type BarChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
5
|
+
export type BarChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
9
6
|
Pick<
|
|
10
7
|
BarPlotProps,
|
|
11
8
|
| 'barPadding'
|
|
@@ -19,17 +16,17 @@ export type BarChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'serie
|
|
|
19
16
|
| 'stackGap'
|
|
20
17
|
| 'barMinSize'
|
|
21
18
|
| 'stackMinSize'
|
|
19
|
+
| 'transition'
|
|
22
20
|
> & {
|
|
23
21
|
/**
|
|
24
22
|
* Configuration objects that define how to visualize the data.
|
|
25
|
-
* Each series supports Bar component props for individual customization.
|
|
26
23
|
*/
|
|
27
|
-
series?: Array<
|
|
24
|
+
series?: Array<Series>;
|
|
28
25
|
/**
|
|
29
26
|
* Whether to stack the areas on top of each other.
|
|
30
27
|
* When true, each series builds cumulative values on top of the previous series.
|
|
31
28
|
*
|
|
32
|
-
*
|
|
29
|
+
* @note only applies to series data containing singular numbers (e.g., `[10, 20, 30]`).
|
|
33
30
|
* Series with start & end value tuples (e.g., `[[0, 10], [5, 20]]`) will be skipped during stacking
|
|
34
31
|
* and rendered as-is.
|
|
35
32
|
*/
|
|
@@ -42,9 +39,21 @@ export type BarChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'serie
|
|
|
42
39
|
* Whether to show the Y axis.
|
|
43
40
|
*/
|
|
44
41
|
showYAxis?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Configuration for x-axis.
|
|
44
|
+
* Accepts axis config and axis props.
|
|
45
|
+
* To show the axis, set `showXAxis` to true.
|
|
46
|
+
*/
|
|
45
47
|
xAxis?: Partial<AxisConfigProps> & XAxisProps;
|
|
48
|
+
/**
|
|
49
|
+
* Configuration for y-axis.
|
|
50
|
+
* Accepts axis config and axis props.
|
|
51
|
+
* To show the axis, set `showYAxis` to true.
|
|
52
|
+
*/
|
|
46
53
|
yAxis?: Partial<AxisConfigProps> & YAxisProps;
|
|
47
54
|
};
|
|
55
|
+
export type BarChartProps = BarChartBaseProps &
|
|
56
|
+
Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
|
|
48
57
|
export declare const BarChart: import('react').MemoExoticComponent<
|
|
49
58
|
import('react').ForwardRefExoticComponent<
|
|
50
59
|
Omit<BarChartProps, 'ref'> & import('react').RefAttributes<SVGSVGElement>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarChart.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,EACL,KAAK,eAAe,EAIpB,KAAK,MAAM,EACZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GACzF,IAAI,CACF,YAAY,EACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,YAAY,CACf,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;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,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,QAAQ,2JA0HpB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BarStackGroupProps } from './BarStackGroup';
|
|
2
|
-
export type
|
|
2
|
+
export type BarPlotBaseProps = Pick<
|
|
3
3
|
BarStackGroupProps,
|
|
4
4
|
| 'barPadding'
|
|
5
5
|
| 'BarComponent'
|
|
@@ -19,6 +19,7 @@ export type BarPlotProps = Pick<
|
|
|
19
19
|
*/
|
|
20
20
|
seriesIds?: string[];
|
|
21
21
|
};
|
|
22
|
+
export type BarPlotProps = BarPlotBaseProps & Pick<BarStackGroupProps, 'transition'>;
|
|
22
23
|
/**
|
|
23
24
|
* BarPlot component that handles multiple series with proper stacking coordination.
|
|
24
25
|
* Groups series by stack ID + y-axis ID combination and renders BarStackGroup for each group.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarPlot.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarPlot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"BarPlot.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarPlot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,kBAAkB,EAChB,YAAY,GACZ,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,CACtB,GAAG;IACF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,oDAqGnB,CAAC"}
|
|
@@ -1,60 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Rect } from '@coinbase/cds-common';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Transition } from 'framer-motion';
|
|
4
|
+
import type { ChartScaleFunction, Series } from '../utils';
|
|
4
5
|
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<
|
|
6
|
+
export type BarStackBaseProps = Pick<
|
|
51
7
|
BarProps,
|
|
52
8
|
'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
|
|
53
9
|
> & {
|
|
54
10
|
/**
|
|
55
11
|
* Array of series configurations that belong to this stack.
|
|
56
12
|
*/
|
|
57
|
-
series:
|
|
13
|
+
series: Series[];
|
|
58
14
|
/**
|
|
59
15
|
* The category index for this stack.
|
|
60
16
|
*/
|
|
@@ -103,6 +59,42 @@ export type BarStackProps = Pick<
|
|
|
103
59
|
*/
|
|
104
60
|
stackMinSize?: number;
|
|
105
61
|
};
|
|
62
|
+
export type BarStackProps = BarStackBaseProps & {
|
|
63
|
+
/**
|
|
64
|
+
* Transition configuration for animation.
|
|
65
|
+
*/
|
|
66
|
+
transition?: Transition;
|
|
67
|
+
};
|
|
68
|
+
export type BarStackComponentProps = Pick<
|
|
69
|
+
BarStackProps,
|
|
70
|
+
'x' | 'width' | 'categoryIndex' | 'borderRadius' | 'transition'
|
|
71
|
+
> & {
|
|
72
|
+
/**
|
|
73
|
+
* The y position of the stack.
|
|
74
|
+
*/
|
|
75
|
+
y: number;
|
|
76
|
+
/**
|
|
77
|
+
* The height of the stack.
|
|
78
|
+
*/
|
|
79
|
+
height: number;
|
|
80
|
+
/**
|
|
81
|
+
* The bar elements to render within the stack.
|
|
82
|
+
*/
|
|
83
|
+
children: React.ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Whether to round the top corners.
|
|
86
|
+
*/
|
|
87
|
+
roundTop?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether to round the bottom corners.
|
|
90
|
+
*/
|
|
91
|
+
roundBottom?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The y-origin for animations (baseline position).
|
|
94
|
+
*/
|
|
95
|
+
yOrigin?: number;
|
|
96
|
+
};
|
|
97
|
+
export type BarStackComponent = React.FC<BarStackComponentProps>;
|
|
106
98
|
/**
|
|
107
99
|
* BarStack component that renders a single stack of bars at a specific category index.
|
|
108
100
|
* 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;
|
|
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;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAK9D,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,2CA+lBpB,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,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;AAM7C,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,
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,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,6CAyCtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAMA,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,
|
|
1
|
+
{"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAMA,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,4DAgD3B,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,11 @@ 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';
|
|
6
7
|
export * from './line/index';
|
|
7
8
|
export * from './Path';
|
|
8
9
|
export * from './PeriodSelector';
|
|
9
|
-
export * from './
|
|
10
|
+
export * from './point/index';
|
|
10
11
|
export * from './scrubber/index';
|
|
11
12
|
export * from './text/index';
|
|
12
13
|
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,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,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"}
|