@coinbase/cds-web-visualization 3.3.2 → 3.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/CHANGELOG.md +50 -2
  2. package/dts/chart/CartesianChart.d.ts +72 -0
  3. package/dts/chart/CartesianChart.d.ts.map +1 -0
  4. package/dts/chart/ChartProvider.d.ts +6 -0
  5. package/dts/chart/ChartProvider.d.ts.map +1 -0
  6. package/dts/chart/Path.d.ts +54 -0
  7. package/dts/chart/Path.d.ts.map +1 -0
  8. package/dts/chart/PeriodSelector.d.ts +57 -0
  9. package/dts/chart/PeriodSelector.d.ts.map +1 -0
  10. package/dts/chart/area/Area.d.ts +78 -0
  11. package/dts/chart/area/Area.d.ts.map +1 -0
  12. package/dts/chart/area/AreaChart.d.ts +79 -0
  13. package/dts/chart/area/AreaChart.d.ts.map +1 -0
  14. package/dts/chart/area/DottedArea.d.ts +45 -0
  15. package/dts/chart/area/DottedArea.d.ts.map +1 -0
  16. package/dts/chart/area/GradientArea.d.ts +39 -0
  17. package/dts/chart/area/GradientArea.d.ts.map +1 -0
  18. package/dts/chart/area/SolidArea.d.ts +23 -0
  19. package/dts/chart/area/SolidArea.d.ts.map +1 -0
  20. package/dts/chart/area/index.d.ts +6 -0
  21. package/dts/chart/area/index.d.ts.map +1 -0
  22. package/dts/chart/axis/Axis.d.ts +255 -0
  23. package/dts/chart/axis/Axis.d.ts.map +1 -0
  24. package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
  25. package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
  26. package/dts/chart/axis/XAxis.d.ts +16 -0
  27. package/dts/chart/axis/XAxis.d.ts.map +1 -0
  28. package/dts/chart/axis/YAxis.d.ts +21 -0
  29. package/dts/chart/axis/YAxis.d.ts.map +1 -0
  30. package/dts/chart/axis/index.d.ts +5 -0
  31. package/dts/chart/axis/index.d.ts.map +1 -0
  32. package/dts/chart/bar/Bar.d.ts +94 -0
  33. package/dts/chart/bar/Bar.d.ts.map +1 -0
  34. package/dts/chart/bar/BarChart.d.ts +62 -0
  35. package/dts/chart/bar/BarChart.d.ts.map +1 -0
  36. package/dts/chart/bar/BarPlot.d.ts +30 -0
  37. package/dts/chart/bar/BarPlot.d.ts.map +1 -0
  38. package/dts/chart/bar/BarStack.d.ts +103 -0
  39. package/dts/chart/bar/BarStack.d.ts.map +1 -0
  40. package/dts/chart/bar/BarStackGroup.d.ts +36 -0
  41. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -0
  42. package/dts/chart/bar/DefaultBar.d.ts +17 -0
  43. package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
  44. package/dts/chart/bar/DefaultBarStack.d.ts +16 -0
  45. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -0
  46. package/dts/chart/bar/index.d.ts +8 -0
  47. package/dts/chart/bar/index.d.ts.map +1 -0
  48. package/dts/chart/gradient/Gradient.d.ts +35 -0
  49. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  50. package/dts/chart/gradient/index.d.ts +2 -0
  51. package/dts/chart/gradient/index.d.ts.map +1 -0
  52. package/dts/chart/index.d.ts +14 -0
  53. package/dts/chart/index.d.ts.map +1 -0
  54. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  55. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  56. package/dts/chart/line/DottedLine.d.ts +26 -0
  57. package/dts/chart/line/DottedLine.d.ts.map +1 -0
  58. package/dts/chart/line/Line.d.ts +122 -0
  59. package/dts/chart/line/Line.d.ts.map +1 -0
  60. package/dts/chart/line/LineChart.d.ts +77 -0
  61. package/dts/chart/line/LineChart.d.ts.map +1 -0
  62. package/dts/chart/line/ReferenceLine.d.ts +178 -0
  63. package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
  64. package/dts/chart/line/SolidLine.d.ts +25 -0
  65. package/dts/chart/line/SolidLine.d.ts.map +1 -0
  66. package/dts/chart/line/index.d.ts +7 -0
  67. package/dts/chart/line/index.d.ts.map +1 -0
  68. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  69. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  70. package/dts/chart/point/Point.d.ts +201 -0
  71. package/dts/chart/point/Point.d.ts.map +1 -0
  72. package/dts/chart/point/index.d.ts +3 -0
  73. package/dts/chart/point/index.d.ts.map +1 -0
  74. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +24 -0
  75. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  76. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  77. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  78. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +10 -0
  79. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  80. package/dts/chart/scrubber/Scrubber.d.ts +290 -0
  81. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
  82. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +70 -0
  83. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  84. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +32 -0
  85. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  86. package/dts/chart/scrubber/ScrubberProvider.d.ts +17 -0
  87. package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -0
  88. package/dts/chart/scrubber/index.d.ts +5 -0
  89. package/dts/chart/scrubber/index.d.ts.map +1 -0
  90. package/dts/chart/text/ChartText.d.ts +117 -0
  91. package/dts/chart/text/ChartText.d.ts.map +1 -0
  92. package/dts/chart/text/ChartTextGroup.d.ts +61 -0
  93. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  94. package/dts/chart/text/index.d.ts +3 -0
  95. package/dts/chart/text/index.d.ts.map +1 -0
  96. package/dts/chart/utils/axis.d.ts +342 -0
  97. package/dts/chart/utils/axis.d.ts.map +1 -0
  98. package/dts/chart/utils/bar.d.ts +20 -0
  99. package/dts/chart/utils/bar.d.ts.map +1 -0
  100. package/dts/chart/utils/chart.d.ts +117 -0
  101. package/dts/chart/utils/chart.d.ts.map +1 -0
  102. package/dts/chart/utils/context.d.ts +101 -0
  103. package/dts/chart/utils/context.d.ts.map +1 -0
  104. package/dts/chart/utils/gradient.d.ts +104 -0
  105. package/dts/chart/utils/gradient.d.ts.map +1 -0
  106. package/dts/chart/utils/index.d.ts +12 -0
  107. package/dts/chart/utils/index.d.ts.map +1 -0
  108. package/dts/chart/utils/interpolate.d.ts +112 -0
  109. package/dts/chart/utils/interpolate.d.ts.map +1 -0
  110. package/dts/chart/utils/path.d.ts +130 -0
  111. package/dts/chart/utils/path.d.ts.map +1 -0
  112. package/dts/chart/utils/point.d.ts +104 -0
  113. package/dts/chart/utils/point.d.ts.map +1 -0
  114. package/dts/chart/utils/scale.d.ts +43 -0
  115. package/dts/chart/utils/scale.d.ts.map +1 -0
  116. package/dts/chart/utils/scrubber.d.ts +39 -0
  117. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  118. package/dts/chart/utils/transition.d.ts +65 -0
  119. package/dts/chart/utils/transition.d.ts.map +1 -0
  120. package/dts/index.d.ts +1 -0
  121. package/dts/index.d.ts.map +1 -1
  122. package/dts/sparkline/Sparkline.d.ts +44 -9
  123. package/dts/sparkline/Sparkline.d.ts.map +1 -1
  124. package/dts/sparkline/SparklineArea.d.ts +4 -0
  125. package/dts/sparkline/SparklineArea.d.ts.map +1 -1
  126. package/dts/sparkline/SparklineAreaPattern.d.ts +5 -0
  127. package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
  128. package/dts/sparkline/SparklineGradient.d.ts +5 -0
  129. package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
  130. package/dts/sparkline/generateSparklineWithId.d.ts +1 -0
  131. package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
  132. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +9 -0
  133. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
  134. package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +3 -0
  135. package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
  136. package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +2 -1
  137. package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
  138. package/esm/chart/CartesianChart.css +1 -0
  139. package/esm/chart/CartesianChart.js +313 -0
  140. package/esm/chart/ChartProvider.js +10 -0
  141. package/esm/chart/Path.js +95 -0
  142. package/esm/chart/PeriodSelector.css +1 -0
  143. package/esm/chart/PeriodSelector.js +112 -0
  144. package/esm/chart/area/Area.js +75 -0
  145. package/esm/chart/area/AreaChart.js +173 -0
  146. package/esm/chart/area/DottedArea.js +87 -0
  147. package/esm/chart/area/GradientArea.js +65 -0
  148. package/esm/chart/area/SolidArea.js +47 -0
  149. package/esm/chart/area/index.js +7 -0
  150. package/esm/chart/axis/Axis.js +25 -0
  151. package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
  152. package/esm/chart/axis/XAxis.css +2 -0
  153. package/esm/chart/axis/XAxis.js +219 -0
  154. package/esm/chart/axis/YAxis.css +2 -0
  155. package/esm/chart/axis/YAxis.js +214 -0
  156. package/esm/chart/axis/index.js +6 -0
  157. package/esm/chart/bar/Bar.js +61 -0
  158. package/esm/chart/bar/BarChart.js +130 -0
  159. package/esm/chart/bar/BarPlot.js +97 -0
  160. package/esm/chart/bar/BarStack.js +561 -0
  161. package/esm/chart/bar/BarStackGroup.js +86 -0
  162. package/esm/chart/bar/DefaultBar.js +61 -0
  163. package/esm/chart/bar/DefaultBarStack.js +58 -0
  164. package/esm/chart/bar/index.js +9 -0
  165. package/esm/chart/gradient/Gradient.js +104 -0
  166. package/esm/chart/gradient/index.js +1 -0
  167. package/esm/chart/index.js +15 -0
  168. package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
  169. package/esm/chart/line/DottedLine.js +59 -0
  170. package/esm/chart/line/Line.js +185 -0
  171. package/esm/chart/line/LineChart.js +132 -0
  172. package/esm/chart/line/ReferenceLine.js +140 -0
  173. package/esm/chart/line/SolidLine.js +55 -0
  174. package/esm/chart/line/index.js +8 -0
  175. package/esm/chart/point/DefaultPointLabel.js +44 -0
  176. package/esm/chart/point/Point.css +2 -0
  177. package/esm/chart/point/Point.js +180 -0
  178. package/esm/chart/point/index.js +2 -0
  179. package/esm/chart/scrubber/DefaultScrubberBeacon.js +155 -0
  180. package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +46 -0
  181. package/esm/chart/scrubber/DefaultScrubberLabel.js +30 -0
  182. package/esm/chart/scrubber/Scrubber.js +189 -0
  183. package/esm/chart/scrubber/ScrubberBeaconGroup.js +166 -0
  184. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +186 -0
  185. package/esm/chart/scrubber/ScrubberProvider.js +228 -0
  186. package/esm/chart/scrubber/index.js +4 -0
  187. package/esm/chart/text/ChartText.js +230 -0
  188. package/esm/chart/text/ChartTextGroup.js +227 -0
  189. package/esm/chart/text/index.js +4 -0
  190. package/esm/chart/utils/axis.js +593 -0
  191. package/esm/chart/utils/bar.js +24 -0
  192. package/esm/chart/utils/chart.js +255 -0
  193. package/esm/chart/utils/context.js +15 -0
  194. package/esm/chart/utils/gradient.js +257 -0
  195. package/esm/chart/utils/index.js +13 -0
  196. package/esm/chart/utils/interpolate.js +644 -0
  197. package/esm/chart/utils/path.js +227 -0
  198. package/esm/chart/utils/point.js +187 -0
  199. package/esm/chart/utils/scale.js +48 -0
  200. package/esm/chart/utils/scrubber.js +132 -0
  201. package/esm/chart/utils/transition.js +111 -0
  202. package/esm/index.js +4 -1
  203. package/esm/sparkline/Sparkline.js +129 -15
  204. package/esm/sparkline/SparklineArea.js +7 -2
  205. package/esm/sparkline/SparklineAreaPattern.js +4 -2
  206. package/esm/sparkline/SparklineGradient.js +16 -58
  207. package/esm/sparkline/generateSparklineWithId.js +3 -2
  208. package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +5 -1
  209. package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +5 -2
  210. package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +1 -1
  211. package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
  212. package/package.json +13 -9
@@ -0,0 +1,255 @@
1
+ import type React from 'react';
2
+ import type { SharedProps } from '@coinbase/cds-common/types';
3
+ import { type LineComponent } from '../line';
4
+ import type { ChartTextChildren, ChartTextProps } from '../text/ChartText';
5
+ export declare const axisLineStyles =
6
+ '\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n';
7
+ export declare const axisTickMarkStyles =
8
+ '\n stroke: var(--color-fg);\n stroke-linecap: square;\n stroke-width: 1px;\n';
9
+ /**
10
+ * Animation variants for axis elements - updates (used for both grid lines and tick labels)
11
+ */
12
+ export declare const axisUpdateAnimationVariants: {
13
+ initial: {
14
+ opacity: number;
15
+ };
16
+ animate: {
17
+ opacity: number;
18
+ transition: {
19
+ duration: number;
20
+ delay: number;
21
+ };
22
+ };
23
+ exit: {
24
+ opacity: number;
25
+ transition: {
26
+ duration: number;
27
+ };
28
+ };
29
+ };
30
+ export type AxisTickLabelComponentProps = Pick<
31
+ ChartTextProps,
32
+ | 'x'
33
+ | 'y'
34
+ | 'children'
35
+ | 'testID'
36
+ | 'dx'
37
+ | 'dy'
38
+ | 'font'
39
+ | 'fontFamily'
40
+ | 'fontSize'
41
+ | 'fontWeight'
42
+ | 'color'
43
+ | 'elevated'
44
+ | 'inset'
45
+ | 'background'
46
+ | 'borderRadius'
47
+ | 'disableRepositioning'
48
+ | 'bounds'
49
+ | 'styles'
50
+ | 'classNames'
51
+ | 'horizontalAlignment'
52
+ | 'verticalAlignment'
53
+ | 'className'
54
+ | 'style'
55
+ >;
56
+ export type AxisTickLabelComponent = React.FC<AxisTickLabelComponentProps>;
57
+ export type AxisBaseProps = SharedProps & {
58
+ /**
59
+ * Label text to display for the axis.
60
+ */
61
+ label?: string;
62
+ /**
63
+ * Gap between the tick labels and the axis label.
64
+ * @default 4
65
+ */
66
+ labelGap?: number;
67
+ /**
68
+ * Minimum gap between tick labels.
69
+ * Labels will be hidden if they are closer than this gap.
70
+ * @default 4
71
+ */
72
+ minTickLabelGap?: number;
73
+ /**
74
+ * Requested number of ticks to display.
75
+ * This value is passed into d3 and may not be respected.
76
+ * @note This property is overridden when `ticks` is provided.
77
+ * @note this property overrides the `tickInterval` property.
78
+ * @default 5 (for y-axis)
79
+ */
80
+ requestedTickCount?: number;
81
+ /**
82
+ * Whether to show grid lines at each tick position.
83
+ */
84
+ showGrid?: boolean;
85
+ /**
86
+ * Whether to show the axis line.
87
+ */
88
+ showLine?: boolean;
89
+ /**
90
+ * Whether to show tick marks on the axis.
91
+ */
92
+ showTickMarks?: boolean;
93
+ /**
94
+ * Size of the tick marks.
95
+ * @default 4
96
+ */
97
+ tickMarkSize?: number;
98
+ /**
99
+ * Custom tick configuration for the axis.
100
+ * When provided, this overrides the `requestedTickCount` property.
101
+ *
102
+ * - **Array**: Uses these exact values for tick positioning and labels.
103
+ * - **Function**: Filters based on the predicate function.
104
+ * - For **x-axis**: Checks every data index (0, 1, 2, ..., dataLength-1)
105
+ * - For **y-axis**: Filters d3-generated tick values
106
+ *
107
+ * @example
108
+ * // Exact tick values
109
+ * ticks: [0, 25, 50, 75, 100]
110
+ *
111
+ * @example
112
+ * // Show every 12th data point on x-axis
113
+ * ticks: (index) => index % 12 === 0
114
+ */
115
+ ticks?: number[] | ((value: number) => boolean);
116
+ /**
117
+ * Space between the axis tick mark and labels.
118
+ * If tick marks are not shown, this is the gap between the axis and the chart.
119
+ * @default 2 for x-axis, 8 for y-axis
120
+ */
121
+ tickMarkLabelGap?: number;
122
+ /**
123
+ * Interval at which to show ticks.
124
+ * When provided, calculates tick count based on available space.
125
+ * @note this property is overridden by the `requestedTickCount` and `ticks` properties.
126
+ * @default 32 (for x-axis)
127
+ */
128
+ tickInterval?: number;
129
+ /**
130
+ * Minimum step size for tick generation.
131
+ * Prevents the step from being smaller than this value.
132
+ * @default 1
133
+ */
134
+ tickMinStep?: number;
135
+ /**
136
+ * Maximum step size for tick generation.
137
+ * Prevents the step from being larger than this value.
138
+ */
139
+ tickMaxStep?: number;
140
+ };
141
+ export type AxisProps = AxisBaseProps & {
142
+ /**
143
+ * Custom className for the axis.
144
+ */
145
+ className?: string;
146
+ /**
147
+ * Custom classNames for the axis.
148
+ */
149
+ classNames?: {
150
+ /**
151
+ * Custom className for the root element.
152
+ */
153
+ root?: string;
154
+ /**
155
+ * Custom className for the axis label.
156
+ */
157
+ label?: string;
158
+ /**
159
+ * Custom className for the tick labels.
160
+ */
161
+ tickLabel?: string;
162
+ /**
163
+ * Custom className for the grid lines.
164
+ */
165
+ gridLine?: string;
166
+ /**
167
+ * Custom className for the axis line.
168
+ */
169
+ line?: string;
170
+ /**
171
+ * Custom className for the tick marks.
172
+ */
173
+ tickMark?: string;
174
+ };
175
+ /**
176
+ * Custom style for the axis.
177
+ */
178
+ style?: React.CSSProperties;
179
+ /**
180
+ * Custom styles for the axis.
181
+ */
182
+ styles?: {
183
+ /**
184
+ * Custom style for the root element.
185
+ */
186
+ root?: React.CSSProperties;
187
+ /**
188
+ * Custom style for the axis label.
189
+ */
190
+ label?: React.CSSProperties;
191
+ /**
192
+ * Custom style for the tick labels.
193
+ */
194
+ tickLabel?: React.CSSProperties;
195
+ /**
196
+ * Custom style for the grid lines.
197
+ */
198
+ gridLine?: React.CSSProperties;
199
+ /**
200
+ * Custom style for the axis line.
201
+ */
202
+ line?: React.CSSProperties;
203
+ /**
204
+ * Custom style for the tick marks.
205
+ */
206
+ tickMark?: React.CSSProperties;
207
+ };
208
+ /**
209
+ * Component to render the grid lines.
210
+ * @default DottedLine
211
+ */
212
+ GridLineComponent?: LineComponent;
213
+ /**
214
+ * Component to render the axis line.
215
+ * @default SolidLine
216
+ */
217
+ LineComponent?: LineComponent;
218
+ /**
219
+ * Component to render the tick marks.
220
+ * @default SolidLine
221
+ */
222
+ TickMarkLineComponent?: LineComponent;
223
+ /**
224
+ * Formatter function for axis tick values.
225
+ * Tick values will be wrapped in ChartText component.
226
+ *
227
+ * @example
228
+ * // XAxis
229
+ * tickLabelFormatter: (index) => {
230
+ * if (index % 12 === 0) {
231
+ * return <tspan style={{ fontWeight: 'bold' }}>${prices[index]}</tspan>;
232
+ * }
233
+ * return `$${prices[index]}`;
234
+ * }
235
+ *
236
+ * @example
237
+ * // YAxis
238
+ * tickLabelFormatter: (value) => `$${prices[value]}`
239
+ */
240
+ tickLabelFormatter?: (value: number) => ChartTextChildren;
241
+ /**
242
+ * Component to render tick labels.
243
+ * Allows for custom styling and formatting that works cross-platform.
244
+ *
245
+ * @example
246
+ * // Custom tick label component with elevation
247
+ * TickLabelComponent={(props) => (
248
+ * <DefaultAxisTickLabel {...props} elevated color="var(--color-fgPrimary)" />
249
+ * )}
250
+ *
251
+ * @default DefaultAxisTickLabel
252
+ */
253
+ TickLabelComponent?: AxisTickLabelComponent;
254
+ };
255
+ //# sourceMappingURL=Axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../../src/chart/axis/Axis.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG3E,eAAO,MAAM,cAAc,oFAI1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,oFAI9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;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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"}
@@ -0,0 +1,16 @@
1
+ import { type AxisBaseProps, type AxisProps } from './Axis';
2
+ export type XAxisBaseProps = AxisBaseProps & {
3
+ /**
4
+ * The position of the axis relative to the chart's drawing area.
5
+ * @default 'bottom'
6
+ */
7
+ position?: 'top' | 'bottom';
8
+ /**
9
+ * Height of the axis. This value is inclusive of the padding.
10
+ * @default 32 when no label is provided, 52 when a label is provided
11
+ */
12
+ height?: number;
13
+ };
14
+ export type XAxisProps = AxisProps & XAxisBaseProps;
15
+ export declare const XAxis: import('react').NamedExoticComponent<XAxisProps>;
16
+ //# sourceMappingURL=XAxis.d.ts.map
@@ -0,0 +1 @@
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,kDAgQjB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { AxisBaseProps, AxisProps } from './Axis';
2
+ export type YAxisBaseProps = AxisBaseProps & {
3
+ /**
4
+ * The ID of the axis to render.
5
+ * Defaults to defaultAxisId if not specified.
6
+ */
7
+ axisId?: string;
8
+ /**
9
+ * The position of the axis relative to the chart's drawing area.
10
+ * @default 'right'
11
+ */
12
+ position?: 'left' | 'right';
13
+ /**
14
+ * Width of the axis. This value is inclusive of the padding.
15
+ * @default 44 when no label is provided, 64 when a label is provided
16
+ */
17
+ width?: number;
18
+ };
19
+ export type YAxisProps = AxisProps & YAxisBaseProps;
20
+ export declare const YAxis: import('react').NamedExoticComponent<YAxisProps>;
21
+ //# sourceMappingURL=YAxis.d.ts.map
@@ -0,0 +1 @@
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,kDA0PjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './Axis';
2
+ export * from './DefaultAxisTickLabel';
3
+ export * from './XAxis';
4
+ export * from './YAxis';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import type { SVGProps } from 'react';
3
+ import type { Transition } from 'framer-motion';
4
+ export type BarBaseProps = {
5
+ /**
6
+ * X coordinate of the bar (left edge).
7
+ */
8
+ x: number;
9
+ /**
10
+ * Y coordinate of the bar (top edge).
11
+ */
12
+ y: number;
13
+ /**
14
+ * Width of the bar.
15
+ */
16
+ width: number;
17
+ /**
18
+ * Height of the bar.
19
+ */
20
+ height: number;
21
+ /**
22
+ * Border radius for the bar.
23
+ * @default 4
24
+ */
25
+ borderRadius?: number;
26
+ /**
27
+ * Whether to round the top of the bar.
28
+ */
29
+ roundTop?: boolean;
30
+ /**
31
+ * Whether to round the bottom of the bar.
32
+ */
33
+ roundBottom?: boolean;
34
+ /**
35
+ * Y coordinate of the baseline/origin for animations.
36
+ * Used to calculate initial animation state.
37
+ */
38
+ originY?: number;
39
+ /**
40
+ * The x-axis data value for this bar.
41
+ */
42
+ dataX?: number | string;
43
+ /**
44
+ * The y-axis data value for this bar.
45
+ */
46
+ dataY?: number | [number, number] | null;
47
+ /**
48
+ * Fill color for the bar.
49
+ */
50
+ fill?: string;
51
+ /**
52
+ * Fill opacity for the bar.
53
+ */
54
+ fillOpacity?: number;
55
+ /**
56
+ * Stroke color for the bar outline.
57
+ */
58
+ stroke?: string;
59
+ /**
60
+ * Stroke width for the bar outline.
61
+ */
62
+ strokeWidth?: number;
63
+ /**
64
+ * Component to render the bar.
65
+ */
66
+ BarComponent?: BarComponent;
67
+ };
68
+ export type BarProps = BarBaseProps & {
69
+ /**
70
+ * Transition configuration for animation.
71
+ */
72
+ transition?: Transition;
73
+ };
74
+ export type BarComponentProps = Omit<BarProps, 'BarComponent'> & {
75
+ /**
76
+ * The path data for the bar shape.
77
+ */
78
+ d: SVGProps<SVGPathElement>['d'];
79
+ };
80
+ export type BarComponent = React.FC<BarComponentProps>;
81
+ /**
82
+ * Simple bar component that renders a single bar at the specified position.
83
+ *
84
+ * This component is intentionally kept simple - it just renders a bar at the given
85
+ * x, y, width, height coordinates. Complex positioning logic (like handling stacks,
86
+ * groups, gaps, etc.) should be handled by parent components like BarChart or BarStack.
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * <Bar x={10} y={20} width={50} height={100} fill="blue" />
91
+ * ```
92
+ */
93
+ export declare const Bar: React.NamedExoticComponent<BarProps>;
94
+ //# sourceMappingURL=Bar.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,62 @@
1
+ import { type XAxisProps, type YAxisProps } from '../axis';
2
+ import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
3
+ import { type AxisConfigProps, type Series } from '../utils';
4
+ import { type BarPlotProps } from './BarPlot';
5
+ export type BarChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
6
+ Pick<
7
+ BarPlotProps,
8
+ | 'barPadding'
9
+ | 'BarComponent'
10
+ | 'fillOpacity'
11
+ | 'stroke'
12
+ | 'strokeWidth'
13
+ | 'borderRadius'
14
+ | 'BarStackComponent'
15
+ | 'roundBaseline'
16
+ | 'stackGap'
17
+ | 'barMinSize'
18
+ | 'stackMinSize'
19
+ | 'transition'
20
+ > & {
21
+ /**
22
+ * Configuration objects that define how to visualize the data.
23
+ */
24
+ series?: Array<Series>;
25
+ /**
26
+ * Whether to stack the areas on top of each other.
27
+ * When true, each series builds cumulative values on top of the previous series.
28
+ *
29
+ * @note only applies to series data containing singular numbers (e.g., `[10, 20, 30]`).
30
+ * Series with start & end value tuples (e.g., `[[0, 10], [5, 20]]`) will be skipped during stacking
31
+ * and rendered as-is.
32
+ */
33
+ stacked?: boolean;
34
+ /**
35
+ * Whether to show the X axis.
36
+ */
37
+ showXAxis?: boolean;
38
+ /**
39
+ * Whether to show the Y axis.
40
+ */
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
+ */
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
+ */
53
+ yAxis?: Partial<AxisConfigProps> & YAxisProps;
54
+ };
55
+ export type BarChartProps = BarChartBaseProps &
56
+ Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
57
+ export declare const BarChart: import('react').MemoExoticComponent<
58
+ import('react').ForwardRefExoticComponent<
59
+ Omit<BarChartProps, 'ref'> & import('react').RefAttributes<SVGSVGElement>
60
+ >
61
+ >;
62
+ //# sourceMappingURL=BarChart.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,30 @@
1
+ import type { BarStackGroupProps } from './BarStackGroup';
2
+ export type BarPlotBaseProps = Pick<
3
+ BarStackGroupProps,
4
+ | 'barPadding'
5
+ | 'BarComponent'
6
+ | 'fillOpacity'
7
+ | 'stroke'
8
+ | 'strokeWidth'
9
+ | 'borderRadius'
10
+ | 'roundBaseline'
11
+ | 'stackGap'
12
+ | 'barMinSize'
13
+ | 'stackMinSize'
14
+ | 'BarStackComponent'
15
+ > & {
16
+ /**
17
+ * Array of series IDs to render.
18
+ * If not provided, renders all series in the chart.
19
+ */
20
+ seriesIds?: string[];
21
+ };
22
+ export type BarPlotProps = BarPlotBaseProps & Pick<BarStackGroupProps, 'transition'>;
23
+ /**
24
+ * BarPlot component that handles multiple series with proper stacking coordination.
25
+ * Groups series by stack ID + y-axis ID combination and renders BarStackGroup for each group.
26
+ * This allows series with different y-axes to be rendered side by side while preventing
27
+ * cross-axis stacking (e.g., comparing $1M vs $1B companies on different scales).
28
+ */
29
+ export declare const BarPlot: import('react').NamedExoticComponent<BarPlotProps>;
30
+ //# sourceMappingURL=BarPlot.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,103 @@
1
+ import React from 'react';
2
+ import type { Rect } from '@coinbase/cds-common';
3
+ import type { Transition } from 'framer-motion';
4
+ import type { ChartScaleFunction, Series } from '../utils';
5
+ import { type BarProps } from './Bar';
6
+ export type BarStackBaseProps = Pick<
7
+ BarProps,
8
+ 'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
9
+ > & {
10
+ /**
11
+ * Array of series configurations that belong to this stack.
12
+ */
13
+ series: Series[];
14
+ /**
15
+ * The category index for this stack.
16
+ */
17
+ categoryIndex: number;
18
+ /**
19
+ * X position for this stack.
20
+ */
21
+ x: number;
22
+ /**
23
+ * Width of this stack.
24
+ */
25
+ width: number;
26
+ /**
27
+ * Y scale function.
28
+ */
29
+ yScale: ChartScaleFunction;
30
+ /**
31
+ * Chart rect for bounds.
32
+ */
33
+ rect: Rect;
34
+ /**
35
+ * Y axis ID to use.
36
+ * If not provided, will use the yAxisId from the first series.
37
+ */
38
+ yAxisId?: string;
39
+ /**
40
+ * Custom component to render the stack container.
41
+ * Can be used to add clip paths, outlines, or other custom styling.
42
+ * @default DefaultBarStack
43
+ */
44
+ BarStackComponent?: BarStackComponent;
45
+ /**
46
+ * Whether to round the baseline of a bar (where the value is 0).
47
+ */
48
+ roundBaseline?: boolean;
49
+ /**
50
+ * Gap between bars in the stack.
51
+ */
52
+ stackGap?: number;
53
+ /**
54
+ * Minimum size for individual bars in the stack.
55
+ */
56
+ barMinSize?: number;
57
+ /**
58
+ * Minimum size for the entire stack.
59
+ */
60
+ stackMinSize?: number;
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>;
98
+ /**
99
+ * BarStack component that renders a single stack of bars at a specific category index.
100
+ * Handles the stacking logic for bars within a single category.
101
+ */
102
+ export declare const BarStack: React.NamedExoticComponent<BarStackProps>;
103
+ //# sourceMappingURL=BarStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarStack.d.ts","sourceRoot":"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AChE,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"}
@@ -0,0 +1,36 @@
1
+ import type { BarStackProps } from './BarStack';
2
+ export type BarStackGroupProps = Pick<
3
+ BarStackProps,
4
+ | 'BarComponent'
5
+ | 'fillOpacity'
6
+ | 'stroke'
7
+ | 'strokeWidth'
8
+ | 'borderRadius'
9
+ | 'roundBaseline'
10
+ | 'stackGap'
11
+ | 'barMinSize'
12
+ | 'stackMinSize'
13
+ | 'BarStackComponent'
14
+ | 'transition'
15
+ > &
16
+ Pick<BarStackProps, 'series' | 'yAxisId'> & {
17
+ /**
18
+ * Index of this stack within the category (0-based).
19
+ */
20
+ stackIndex: number;
21
+ /**
22
+ * Total number of stacks per category.
23
+ */
24
+ totalStacks: number;
25
+ /**
26
+ * Padding between bar groups (0-1).
27
+ * @default 0.1
28
+ */
29
+ barPadding?: number;
30
+ };
31
+ /**
32
+ * BarStackGroup component that renders a group of stacks across all categories.
33
+ * Delegates the actual stacking logic to BarStack for each category.
34
+ */
35
+ export declare const BarStackGroup: import('react').NamedExoticComponent<BarStackGroupProps>;
36
+ //# sourceMappingURL=BarStackGroup.d.ts.map
@@ -0,0 +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,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"}