@mui/x-charts 7.0.0-beta.0 → 7.0.0-beta.2

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 (258) hide show
  1. package/BarChart/BarChart.d.ts +2 -1
  2. package/BarChart/BarChart.js +33 -12
  3. package/BarChart/BarElement.d.ts +20 -13
  4. package/BarChart/BarElement.js +7 -3
  5. package/BarChart/BarPlot.d.ts +11 -6
  6. package/BarChart/BarPlot.js +28 -15
  7. package/BarChart/formatter.js +1 -1
  8. package/CHANGELOG.md +406 -1
  9. package/ChartContainer/ChartContainer.js +6 -4
  10. package/ChartsAxis/ChartsAxis.js +4 -4
  11. package/ChartsLegend/ChartsLegend.d.ts +5 -54
  12. package/ChartsLegend/ChartsLegend.js +2 -307
  13. package/ChartsLegend/DefaultChartsLegend.d.ts +60 -0
  14. package/ChartsLegend/DefaultChartsLegend.js +294 -0
  15. package/ChartsLegend/index.d.ts +1 -0
  16. package/ChartsLegend/index.js +11 -0
  17. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.d.ts +20 -0
  18. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +83 -0
  19. package/ChartsOnAxisClickHandler/index.d.ts +1 -0
  20. package/ChartsOnAxisClickHandler/index.js +16 -0
  21. package/ChartsOnAxisClickHandler/package.json +6 -0
  22. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  23. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  24. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  25. package/ChartsReferenceLine/common.d.ts +2 -1
  26. package/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  27. package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  28. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
  29. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  30. package/ChartsTooltip/utils.d.ts +4 -1
  31. package/ChartsTooltip/utils.js +15 -0
  32. package/ChartsVoronoiHandler/ChartsVoronoiHandler.d.ts +7 -0
  33. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  34. package/ChartsXAxis/ChartsXAxis.js +13 -9
  35. package/ChartsYAxis/ChartsYAxis.js +1 -1
  36. package/LineChart/AnimatedArea.d.ts +1361 -0
  37. package/LineChart/AnimatedArea.js +111 -0
  38. package/LineChart/AnimatedLine.d.ts +1361 -0
  39. package/LineChart/AnimatedLine.js +113 -0
  40. package/LineChart/AreaElement.d.ts +19 -18
  41. package/LineChart/AreaElement.js +17 -34
  42. package/LineChart/AreaPlot.d.ts +12 -7
  43. package/LineChart/AreaPlot.js +91 -58
  44. package/LineChart/LineChart.d.ts +13 -4
  45. package/LineChart/LineChart.js +45 -14
  46. package/LineChart/LineElement.d.ts +19 -18
  47. package/LineChart/LineElement.js +16 -36
  48. package/LineChart/LineHighlightElement.d.ts +3 -2
  49. package/LineChart/LineHighlightElement.js +5 -3
  50. package/LineChart/LinePlot.d.ts +12 -7
  51. package/LineChart/LinePlot.js +89 -56
  52. package/LineChart/MarkElement.d.ts +8 -4
  53. package/LineChart/MarkElement.js +27 -13
  54. package/LineChart/MarkPlot.d.ts +8 -1
  55. package/LineChart/MarkPlot.js +80 -51
  56. package/LineChart/formatter.js +1 -1
  57. package/LineChart/index.d.ts +2 -0
  58. package/LineChart/index.js +22 -0
  59. package/PieChart/PieArc.d.ts +3 -2
  60. package/PieChart/PieArc.js +1 -0
  61. package/PieChart/PieArcLabel.d.ts +3 -2
  62. package/PieChart/PieArcLabel.js +1 -0
  63. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  64. package/PieChart/PieArcLabelPlot.js +2 -2
  65. package/PieChart/PieArcPlot.d.ts +2 -2
  66. package/PieChart/PieArcPlot.js +7 -7
  67. package/PieChart/PieChart.d.ts +1 -1
  68. package/PieChart/PieChart.js +14 -12
  69. package/PieChart/PiePlot.d.ts +1 -1
  70. package/PieChart/PiePlot.js +4 -4
  71. package/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  72. package/ScatterChart/Scatter.d.ts +7 -1
  73. package/ScatterChart/Scatter.js +17 -3
  74. package/ScatterChart/ScatterChart.d.ts +8 -2
  75. package/ScatterChart/ScatterChart.js +21 -10
  76. package/ScatterChart/ScatterPlot.d.ts +1 -1
  77. package/ScatterChart/ScatterPlot.js +10 -2
  78. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  79. package/SparkLineChart/SparkLineChart.js +7 -4
  80. package/context/CartesianContextProvider.js +8 -6
  81. package/context/DrawingProvider.d.ts +6 -1
  82. package/context/DrawingProvider.js +9 -2
  83. package/context/InteractionProvider.d.ts +3 -3
  84. package/esm/BarChart/BarChart.js +33 -12
  85. package/esm/BarChart/BarElement.js +7 -3
  86. package/esm/BarChart/BarPlot.js +27 -15
  87. package/esm/BarChart/formatter.js +1 -1
  88. package/esm/ChartContainer/ChartContainer.js +6 -4
  89. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  90. package/esm/ChartsLegend/ChartsLegend.js +2 -307
  91. package/esm/ChartsLegend/DefaultChartsLegend.js +286 -0
  92. package/esm/ChartsLegend/index.js +1 -0
  93. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +77 -0
  94. package/esm/ChartsOnAxisClickHandler/index.js +1 -0
  95. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  96. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  97. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  98. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  99. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  100. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -5
  101. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  102. package/esm/ChartsTooltip/utils.js +12 -0
  103. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  104. package/esm/ChartsXAxis/ChartsXAxis.js +13 -9
  105. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  106. package/esm/LineChart/AnimatedArea.js +103 -0
  107. package/esm/LineChart/AnimatedLine.js +105 -0
  108. package/esm/LineChart/AreaElement.js +16 -33
  109. package/esm/LineChart/AreaPlot.js +92 -59
  110. package/esm/LineChart/LineChart.js +45 -14
  111. package/esm/LineChart/LineElement.js +16 -35
  112. package/esm/LineChart/LineHighlightElement.js +5 -3
  113. package/esm/LineChart/LinePlot.js +90 -57
  114. package/esm/LineChart/MarkElement.js +27 -13
  115. package/esm/LineChart/MarkPlot.js +80 -51
  116. package/esm/LineChart/formatter.js +1 -1
  117. package/esm/LineChart/index.js +2 -0
  118. package/esm/PieChart/PieArc.js +1 -0
  119. package/esm/PieChart/PieArcLabel.js +1 -0
  120. package/esm/PieChart/PieArcLabelPlot.js +2 -2
  121. package/esm/PieChart/PieArcPlot.js +7 -7
  122. package/esm/PieChart/PieChart.js +14 -12
  123. package/esm/PieChart/PiePlot.js +4 -4
  124. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  125. package/esm/ScatterChart/Scatter.js +17 -3
  126. package/esm/ScatterChart/ScatterChart.js +21 -10
  127. package/esm/ScatterChart/ScatterPlot.js +10 -2
  128. package/esm/SparkLineChart/SparkLineChart.js +7 -4
  129. package/esm/context/CartesianContextProvider.js +8 -6
  130. package/esm/context/DrawingProvider.js +9 -2
  131. package/esm/hooks/useDrawingArea.js +7 -3
  132. package/esm/index.js +1 -0
  133. package/esm/internals/geometry.js +1 -1
  134. package/esm/internals/useAnimatedPath.js +29 -0
  135. package/esm/internals/utils.js +7 -0
  136. package/hooks/useDrawingArea.d.ts +2 -0
  137. package/hooks/useDrawingArea.js +7 -3
  138. package/index.d.ts +1 -0
  139. package/index.js +12 -1
  140. package/internals/defaultizeColor.d.ts +16 -16
  141. package/internals/defaultizeValueFormatter.d.ts +4 -7
  142. package/internals/geometry.js +1 -1
  143. package/internals/stackSeries.d.ts +4 -7
  144. package/internals/useAnimatedPath.d.ts +1 -0
  145. package/internals/useAnimatedPath.js +38 -0
  146. package/internals/utils.d.ts +4 -0
  147. package/internals/utils.js +8 -0
  148. package/legacy/BarChart/BarChart.js +33 -12
  149. package/legacy/BarChart/BarElement.js +6 -2
  150. package/legacy/BarChart/BarPlot.js +28 -14
  151. package/legacy/BarChart/formatter.js +1 -1
  152. package/legacy/ChartContainer/ChartContainer.js +6 -4
  153. package/legacy/ChartsAxis/ChartsAxis.js +4 -4
  154. package/legacy/ChartsLegend/ChartsLegend.js +2 -323
  155. package/legacy/ChartsLegend/DefaultChartsLegend.js +302 -0
  156. package/legacy/ChartsLegend/index.js +1 -0
  157. package/legacy/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
  158. package/legacy/ChartsOnAxisClickHandler/index.js +1 -0
  159. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  160. package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  161. package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  162. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +6 -7
  163. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  164. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -5
  165. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  166. package/legacy/ChartsTooltip/utils.js +12 -0
  167. package/legacy/ChartsVoronoiHandler/ChartsVoronoiHandler.js +88 -44
  168. package/legacy/ChartsXAxis/ChartsXAxis.js +12 -8
  169. package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
  170. package/legacy/LineChart/AnimatedArea.js +102 -0
  171. package/legacy/LineChart/AnimatedLine.js +104 -0
  172. package/legacy/LineChart/AreaElement.js +15 -35
  173. package/legacy/LineChart/AreaPlot.js +102 -66
  174. package/legacy/LineChart/LineChart.js +45 -14
  175. package/legacy/LineChart/LineElement.js +15 -37
  176. package/legacy/LineChart/LineHighlightElement.js +5 -3
  177. package/legacy/LineChart/LinePlot.js +97 -63
  178. package/legacy/LineChart/MarkElement.js +30 -12
  179. package/legacy/LineChart/MarkPlot.js +83 -53
  180. package/legacy/LineChart/formatter.js +1 -1
  181. package/legacy/LineChart/index.js +2 -0
  182. package/legacy/PieChart/PieArc.js +1 -0
  183. package/legacy/PieChart/PieArcLabel.js +1 -0
  184. package/legacy/PieChart/PieArcLabelPlot.js +2 -2
  185. package/legacy/PieChart/PieArcPlot.js +7 -7
  186. package/legacy/PieChart/PieChart.js +14 -12
  187. package/legacy/PieChart/PiePlot.js +4 -4
  188. package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  189. package/legacy/ScatterChart/Scatter.js +19 -3
  190. package/legacy/ScatterChart/ScatterChart.js +21 -10
  191. package/legacy/ScatterChart/ScatterPlot.js +10 -2
  192. package/legacy/SparkLineChart/SparkLineChart.js +8 -5
  193. package/legacy/context/CartesianContextProvider.js +8 -6
  194. package/legacy/context/DrawingProvider.js +11 -2
  195. package/legacy/hooks/useDrawingArea.js +7 -3
  196. package/legacy/index.js +2 -1
  197. package/legacy/internals/geometry.js +1 -1
  198. package/legacy/internals/useAnimatedPath.js +32 -0
  199. package/legacy/internals/utils.js +7 -0
  200. package/models/axis.d.ts +7 -2
  201. package/models/seriesType/common.d.ts +2 -1
  202. package/models/seriesType/config.d.ts +7 -12
  203. package/models/seriesType/line.d.ts +2 -2
  204. package/models/seriesType/pie.d.ts +7 -3
  205. package/models/seriesType/scatter.d.ts +5 -2
  206. package/modern/BarChart/BarChart.js +33 -12
  207. package/modern/BarChart/BarElement.js +7 -3
  208. package/modern/BarChart/BarPlot.js +27 -15
  209. package/modern/BarChart/formatter.js +1 -1
  210. package/modern/ChartContainer/ChartContainer.js +6 -4
  211. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  212. package/modern/ChartsLegend/ChartsLegend.js +2 -307
  213. package/modern/ChartsLegend/DefaultChartsLegend.js +286 -0
  214. package/modern/ChartsLegend/index.js +1 -0
  215. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
  216. package/modern/ChartsOnAxisClickHandler/index.js +1 -0
  217. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  218. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  219. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  220. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  221. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  222. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
  223. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  224. package/modern/ChartsTooltip/utils.js +12 -0
  225. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  226. package/modern/ChartsXAxis/ChartsXAxis.js +13 -9
  227. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  228. package/modern/LineChart/AnimatedArea.js +103 -0
  229. package/modern/LineChart/AnimatedLine.js +105 -0
  230. package/modern/LineChart/AreaElement.js +16 -33
  231. package/modern/LineChart/AreaPlot.js +91 -58
  232. package/modern/LineChart/LineChart.js +45 -14
  233. package/modern/LineChart/LineElement.js +16 -35
  234. package/modern/LineChart/LineHighlightElement.js +5 -3
  235. package/modern/LineChart/LinePlot.js +89 -56
  236. package/modern/LineChart/MarkElement.js +27 -13
  237. package/modern/LineChart/MarkPlot.js +80 -51
  238. package/modern/LineChart/formatter.js +1 -1
  239. package/modern/LineChart/index.js +2 -0
  240. package/modern/PieChart/PieArc.js +1 -0
  241. package/modern/PieChart/PieArcLabel.js +1 -0
  242. package/modern/PieChart/PieArcLabelPlot.js +2 -2
  243. package/modern/PieChart/PieArcPlot.js +7 -7
  244. package/modern/PieChart/PieChart.js +14 -12
  245. package/modern/PieChart/PiePlot.js +4 -4
  246. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  247. package/modern/ScatterChart/Scatter.js +17 -3
  248. package/modern/ScatterChart/ScatterChart.js +21 -10
  249. package/modern/ScatterChart/ScatterPlot.js +10 -2
  250. package/modern/SparkLineChart/SparkLineChart.js +7 -4
  251. package/modern/context/CartesianContextProvider.js +8 -6
  252. package/modern/context/DrawingProvider.js +9 -2
  253. package/modern/hooks/useDrawingArea.js +7 -3
  254. package/modern/index.js +2 -1
  255. package/modern/internals/geometry.js +1 -1
  256. package/modern/internals/useAnimatedPath.js +29 -0
  257. package/modern/internals/utils.js +7 -0
  258. package/package.json +6 -5
@@ -66,7 +66,7 @@ function PieChart(props) {
66
66
  children = props.children,
67
67
  slots = props.slots,
68
68
  slotProps = props.slotProps,
69
- onClick = props.onClick;
69
+ onItemClick = props.onItemClick;
70
70
  var margin = _extends({}, defaultMargin, marginProps);
71
71
  return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
72
72
  series: series.map(function (s) {
@@ -100,7 +100,7 @@ function PieChart(props) {
100
100
  }), /*#__PURE__*/_jsx(PiePlot, {
101
101
  slots: slots,
102
102
  slotProps: slotProps,
103
- onClick: onClick,
103
+ onItemClick: onItemClick,
104
104
  skipAnimation: skipAnimation
105
105
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
106
106
  slots: slots,
@@ -123,7 +123,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
123
123
  * @default null
124
124
  */
125
125
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
126
- axisId: PropTypes.string,
126
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
127
127
  classes: PropTypes.object,
128
128
  disableLine: PropTypes.bool,
129
129
  disableTicks: PropTypes.bool,
@@ -173,7 +173,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
173
173
  * @default null
174
174
  */
175
175
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
176
- axisId: PropTypes.string,
176
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
177
177
  classes: PropTypes.object,
178
178
  disableLine: PropTypes.bool,
179
179
  disableTicks: PropTypes.bool,
@@ -220,14 +220,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
220
220
  right: PropTypes.number,
221
221
  top: PropTypes.number
222
222
  }),
223
- onClick: PropTypes.func,
223
+ onItemClick: PropTypes.func,
224
224
  /**
225
225
  * Indicate which axis to display the right of the charts.
226
226
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
227
227
  * @default null
228
228
  */
229
229
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
230
- axisId: PropTypes.string,
230
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
231
231
  classes: PropTypes.object,
232
232
  disableLine: PropTypes.bool,
233
233
  disableTicks: PropTypes.bool,
@@ -250,7 +250,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
250
250
  }), PropTypes.string]),
251
251
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
252
252
  /**
253
- * If `true`, animations are skiped.
253
+ * If `true`, animations are skipped.
254
254
  * @default false
255
255
  */
256
256
  skipAnimation: PropTypes.bool,
@@ -276,7 +276,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
276
276
  * @default null
277
277
  */
278
278
  topAxis: PropTypes.oneOfType([PropTypes.shape({
279
- axisId: PropTypes.string,
279
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
280
280
  classes: PropTypes.object,
281
281
  disableLine: PropTypes.bool,
282
282
  disableTicks: PropTypes.bool,
@@ -313,7 +313,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
313
313
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
314
314
  */
315
315
  xAxis: PropTypes.arrayOf(PropTypes.shape({
316
- axisId: PropTypes.string,
316
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
317
317
  classes: PropTypes.object,
318
318
  data: PropTypes.array,
319
319
  dataKey: PropTypes.string,
@@ -321,13 +321,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
321
321
  disableTicks: PropTypes.bool,
322
322
  fill: PropTypes.string,
323
323
  hideTooltip: PropTypes.bool,
324
- id: PropTypes.string,
324
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
325
325
  label: PropTypes.string,
326
326
  labelFontSize: PropTypes.number,
327
327
  labelStyle: PropTypes.object,
328
328
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
329
329
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
330
330
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
331
+ reverse: PropTypes.bool,
331
332
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
332
333
  slotProps: PropTypes.object,
333
334
  slots: PropTypes.object,
@@ -347,7 +348,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
347
348
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
348
349
  */
349
350
  yAxis: PropTypes.arrayOf(PropTypes.shape({
350
- axisId: PropTypes.string,
351
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
351
352
  classes: PropTypes.object,
352
353
  data: PropTypes.array,
353
354
  dataKey: PropTypes.string,
@@ -355,13 +356,14 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
355
356
  disableTicks: PropTypes.bool,
356
357
  fill: PropTypes.string,
357
358
  hideTooltip: PropTypes.bool,
358
- id: PropTypes.string,
359
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
359
360
  label: PropTypes.string,
360
361
  labelFontSize: PropTypes.number,
361
362
  labelStyle: PropTypes.object,
362
363
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
363
364
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
364
365
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
366
+ reverse: PropTypes.bool,
365
367
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
366
368
  slotProps: PropTypes.object,
367
369
  slots: PropTypes.object,
@@ -21,7 +21,7 @@ function PiePlot(props) {
21
21
  var skipAnimation = props.skipAnimation,
22
22
  slots = props.slots,
23
23
  slotProps = props.slotProps,
24
- onClick = props.onClick;
24
+ onItemClick = props.onItemClick;
25
25
  var seriesData = React.useContext(SeriesContext).pie;
26
26
  var _React$useContext = React.useContext(DrawingContext),
27
27
  left = _React$useContext.left,
@@ -64,7 +64,7 @@ function PiePlot(props) {
64
64
  highlightScope: highlightScope,
65
65
  highlighted: highlighted,
66
66
  faded: faded,
67
- onClick: onClick,
67
+ onItemClick: onItemClick,
68
68
  slots: slots,
69
69
  slotProps: slotProps
70
70
  })
@@ -117,9 +117,9 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
117
117
  * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
118
118
  * @param {DefaultizedPieValueType} item The pie item.
119
119
  */
120
- onClick: PropTypes.func,
120
+ onItemClick: PropTypes.func,
121
121
  /**
122
- * If `true`, animations are skiped.
122
+ * If `true`, animations are skipped.
123
123
  * @default false
124
124
  */
125
125
  skipAnimation: PropTypes.bool,
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
186
186
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
187
187
  */
188
188
  xAxis: PropTypes.arrayOf(PropTypes.shape({
189
- axisId: PropTypes.string,
189
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
190
190
  classes: PropTypes.object,
191
191
  data: PropTypes.array,
192
192
  dataKey: PropTypes.string,
@@ -194,13 +194,14 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
194
194
  disableTicks: PropTypes.bool,
195
195
  fill: PropTypes.string,
196
196
  hideTooltip: PropTypes.bool,
197
- id: PropTypes.string,
197
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
198
198
  label: PropTypes.string,
199
199
  labelFontSize: PropTypes.number,
200
200
  labelStyle: PropTypes.object,
201
201
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
202
202
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
203
203
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
204
+ reverse: PropTypes.bool,
204
205
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
205
206
  slotProps: PropTypes.object,
206
207
  slots: PropTypes.object,
@@ -220,7 +221,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
220
221
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
221
222
  */
222
223
  yAxis: PropTypes.arrayOf(PropTypes.shape({
223
- axisId: PropTypes.string,
224
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
224
225
  classes: PropTypes.object,
225
226
  data: PropTypes.array,
226
227
  dataKey: PropTypes.string,
@@ -228,13 +229,14 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
228
229
  disableTicks: PropTypes.bool,
229
230
  fill: PropTypes.string,
230
231
  hideTooltip: PropTypes.bool,
231
- id: PropTypes.string,
232
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
232
233
  label: PropTypes.string,
233
234
  labelFontSize: PropTypes.number,
234
235
  labelStyle: PropTypes.object,
235
236
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
236
237
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
237
238
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
239
+ reverse: PropTypes.bool,
238
240
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
239
241
  slotProps: PropTypes.object,
240
242
  slots: PropTypes.object,
@@ -21,7 +21,8 @@ function Scatter(props) {
21
21
  xScale = props.xScale,
22
22
  yScale = props.yScale,
23
23
  color = props.color,
24
- markerSize = props.markerSize;
24
+ markerSize = props.markerSize,
25
+ onItemClick = props.onItemClick;
25
26
  var highlightScope = React.useMemo(function () {
26
27
  return _extends({
27
28
  highlighted: 'item',
@@ -61,7 +62,8 @@ function Scatter(props) {
61
62
  isHighlighted: isHighlighted,
62
63
  isFaded: !isHighlighted && getIsFaded(item, pointCtx, highlightScope),
63
64
  interactionProps: getInteractionItemProps(pointCtx),
64
- id: scatterPoint.id
65
+ id: scatterPoint.id,
66
+ dataIndex: i
65
67
  });
66
68
  }
67
69
  }
@@ -75,7 +77,15 @@ function Scatter(props) {
75
77
  r: (dataPoint.isHighlighted ? 1.2 : 1) * markerSize,
76
78
  transform: "translate(".concat(dataPoint.x, ", ").concat(dataPoint.y, ")"),
77
79
  fill: color,
78
- opacity: dataPoint.isFaded && 0.3 || 1
80
+ opacity: dataPoint.isFaded && 0.3 || 1,
81
+ onClick: onItemClick && function (event) {
82
+ return onItemClick(event, {
83
+ type: 'scatter',
84
+ seriesId: series.id,
85
+ dataIndex: dataPoint.dataIndex
86
+ });
87
+ },
88
+ cursor: onItemClick ? 'pointer' : 'unset'
79
89
  }, dataPoint.interactionProps), dataPoint.id);
80
90
  })
81
91
  });
@@ -87,6 +97,12 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
87
97
  // ----------------------------------------------------------------------
88
98
  color: PropTypes.string.isRequired,
89
99
  markerSize: PropTypes.number.isRequired,
100
+ /**
101
+ * Callback fired when clicking on a scatter item.
102
+ * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
103
+ * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
104
+ */
105
+ onItemClick: PropTypes.func,
90
106
  series: PropTypes.object.isRequired,
91
107
  xScale: PropTypes.func.isRequired,
92
108
  yScale: PropTypes.func.isRequired
@@ -38,6 +38,7 @@ var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, re
38
38
  leftAxis = props.leftAxis,
39
39
  rightAxis = props.rightAxis,
40
40
  bottomAxis = props.bottomAxis,
41
+ onItemClick = props.onItemClick,
41
42
  children = props.children,
42
43
  slots = props.slots,
43
44
  slotProps = props.slotProps;
@@ -56,7 +57,8 @@ var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, re
56
57
  yAxis: yAxis,
57
58
  sx: sx,
58
59
  children: [!disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, {
59
- voronoiMaxRadius: voronoiMaxRadius
60
+ voronoiMaxRadius: voronoiMaxRadius,
61
+ onItemClick: onItemClick
60
62
  }), /*#__PURE__*/_jsx(ChartsAxis, {
61
63
  topAxis: topAxis,
62
64
  leftAxis: leftAxis,
@@ -66,7 +68,8 @@ var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, re
66
68
  slotProps: slotProps
67
69
  }), /*#__PURE__*/_jsx(ScatterPlot, {
68
70
  slots: slots,
69
- slotProps: slotProps
71
+ slotProps: slotProps,
72
+ onItemClick: disableVoronoi ? onItemClick : undefined
70
73
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
71
74
  slots: slots,
72
75
  slotProps: slotProps
@@ -93,7 +96,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
93
96
  * @default xAxisIds[0] The id of the first provided axis
94
97
  */
95
98
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
96
- axisId: PropTypes.string,
99
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
97
100
  classes: PropTypes.object,
98
101
  disableLine: PropTypes.bool,
99
102
  disableTicks: PropTypes.bool,
@@ -148,7 +151,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
148
151
  * @default yAxisIds[0] The id of the first provided axis
149
152
  */
150
153
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
151
- axisId: PropTypes.string,
154
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
152
155
  classes: PropTypes.object,
153
156
  disableLine: PropTypes.bool,
154
157
  disableTicks: PropTypes.bool,
@@ -195,13 +198,19 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
195
198
  right: PropTypes.number,
196
199
  top: PropTypes.number
197
200
  }),
201
+ /**
202
+ * Callback fired when clicking on a scatter item.
203
+ * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element if using Voronoi cells. Or the Mouse event from the scatter element, when `disableVoronoi=true`.
204
+ * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
205
+ */
206
+ onItemClick: PropTypes.func,
198
207
  /**
199
208
  * Indicate which axis to display the right of the charts.
200
209
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
201
210
  * @default null
202
211
  */
203
212
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
204
- axisId: PropTypes.string,
213
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
205
214
  classes: PropTypes.object,
206
215
  disableLine: PropTypes.bool,
207
216
  disableTicks: PropTypes.bool,
@@ -249,7 +258,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
249
258
  * @default null
250
259
  */
251
260
  topAxis: PropTypes.oneOfType([PropTypes.shape({
252
- axisId: PropTypes.string,
261
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
253
262
  classes: PropTypes.object,
254
263
  disableLine: PropTypes.bool,
255
264
  disableTicks: PropTypes.bool,
@@ -292,7 +301,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
292
301
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
293
302
  */
294
303
  xAxis: PropTypes.arrayOf(PropTypes.shape({
295
- axisId: PropTypes.string,
304
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
296
305
  classes: PropTypes.object,
297
306
  data: PropTypes.array,
298
307
  dataKey: PropTypes.string,
@@ -300,13 +309,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
300
309
  disableTicks: PropTypes.bool,
301
310
  fill: PropTypes.string,
302
311
  hideTooltip: PropTypes.bool,
303
- id: PropTypes.string,
312
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
304
313
  label: PropTypes.string,
305
314
  labelFontSize: PropTypes.number,
306
315
  labelStyle: PropTypes.object,
307
316
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
308
317
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
309
318
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
319
+ reverse: PropTypes.bool,
310
320
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
311
321
  slotProps: PropTypes.object,
312
322
  slots: PropTypes.object,
@@ -326,7 +336,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
326
336
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
327
337
  */
328
338
  yAxis: PropTypes.arrayOf(PropTypes.shape({
329
- axisId: PropTypes.string,
339
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
330
340
  classes: PropTypes.object,
331
341
  data: PropTypes.array,
332
342
  dataKey: PropTypes.string,
@@ -334,13 +344,14 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
334
344
  disableTicks: PropTypes.bool,
335
345
  fill: PropTypes.string,
336
346
  hideTooltip: PropTypes.bool,
337
- id: PropTypes.string,
347
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
338
348
  label: PropTypes.string,
339
349
  labelFontSize: PropTypes.number,
340
350
  labelStyle: PropTypes.object,
341
351
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
342
352
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
343
353
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
354
+ reverse: PropTypes.bool,
344
355
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
345
356
  slotProps: PropTypes.object,
346
357
  slots: PropTypes.object,
@@ -18,7 +18,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  function ScatterPlot(props) {
19
19
  var _slots$scatter;
20
20
  var slots = props.slots,
21
- slotProps = props.slotProps;
21
+ slotProps = props.slotProps,
22
+ onItemClick = props.onItemClick;
22
23
  var seriesData = React.useContext(SeriesContext).scatter;
23
24
  var axisData = React.useContext(CartesianContext);
24
25
  if (seriesData === undefined) {
@@ -48,7 +49,8 @@ function ScatterPlot(props) {
48
49
  yScale: yScale,
49
50
  color: color,
50
51
  markerSize: markerSize != null ? markerSize : 4,
51
- series: series[seriesId]
52
+ series: series[seriesId],
53
+ onItemClick: onItemClick
52
54
  }, slotProps == null ? void 0 : slotProps.scatter), id);
53
55
  })
54
56
  });
@@ -58,6 +60,12 @@ process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
58
60
  // | These PropTypes are generated from the TypeScript type definitions |
59
61
  // | To update them edit the TypeScript types and run "yarn proptypes" |
60
62
  // ----------------------------------------------------------------------
63
+ /**
64
+ * Callback fired when clicking on a scatter item.
65
+ * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
66
+ * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
67
+ */
68
+ onItemClick: PropTypes.func,
61
69
  /**
62
70
  * The props used for each component slot.
63
71
  * @default {}
@@ -44,8 +44,8 @@ var SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(props
44
44
  _props$plotType = props.plotType,
45
45
  plotType = _props$plotType === void 0 ? 'line' : _props$plotType,
46
46
  _props$valueFormatter = props.valueFormatter,
47
- valueFormatter = _props$valueFormatter === void 0 ? function (v) {
48
- return v === null ? '' : v.toString();
47
+ valueFormatter = _props$valueFormatter === void 0 ? function (value) {
48
+ return value === null ? '' : value.toString();
49
49
  } : _props$valueFormatter,
50
50
  area = props.area,
51
51
  _props$curve = props.curve,
@@ -92,9 +92,11 @@ var SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(props
92
92
  }
93
93
  }), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
94
94
  children: [/*#__PURE__*/_jsx(AreaPlot, {
95
+ skipAnimation: true,
95
96
  slots: slots,
96
97
  slotProps: slotProps
97
98
  }), /*#__PURE__*/_jsx(LinePlot, {
99
+ skipAnimation: true,
98
100
  slots: slots,
99
101
  slotProps: slotProps
100
102
  }), /*#__PURE__*/_jsx(LineHighlightPlot, {
@@ -211,7 +213,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
211
213
  * Formatter used by the tooltip.
212
214
  * @param {number} value The value to format.
213
215
  * @returns {string} the formatted value.
214
- * @default (v: number | null) => (v === null ? '' : v.toString())
216
+ * @default (value: number | null) => (value === null ? '' : value.toString())
215
217
  */
216
218
  valueFormatter: PropTypes.func,
217
219
  viewBox: PropTypes.shape({
@@ -230,7 +232,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
230
232
  * Notice it is a single configuration object, not an array of configuration.
231
233
  */
232
234
  xAxis: PropTypes.shape({
233
- axisId: PropTypes.string,
235
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
234
236
  classes: PropTypes.object,
235
237
  data: PropTypes.array,
236
238
  dataKey: PropTypes.string,
@@ -238,13 +240,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
238
240
  disableTicks: PropTypes.bool,
239
241
  fill: PropTypes.string,
240
242
  hideTooltip: PropTypes.bool,
241
- id: PropTypes.string,
243
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
242
244
  label: PropTypes.string,
243
245
  labelFontSize: PropTypes.number,
244
246
  labelStyle: PropTypes.object,
245
247
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
246
248
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
247
249
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
250
+ reverse: PropTypes.bool,
248
251
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
249
252
  slotProps: PropTypes.object,
250
253
  slots: PropTypes.object,
@@ -129,7 +129,7 @@ function CartesianContextProvider(props) {
129
129
  _getAxisExtremum2 = _slicedToArray(_getAxisExtremum, 2),
130
130
  minData = _getAxisExtremum2[0],
131
131
  maxData = _getAxisExtremum2[1];
132
- var range = [drawingArea.left, drawingArea.left + drawingArea.width];
132
+ var range = axis.reverse ? [drawingArea.left + drawingArea.width, drawingArea.left] : [drawingArea.left, drawingArea.left + drawingArea.width];
133
133
  if (isBandScaleConfig(axis)) {
134
134
  var _axis$categoryGapRati, _axis$barGapRatio;
135
135
  var categoryGapRatio = (_axis$categoryGapRati = axis.categoryGapRatio) != null ? _axis$categoryGapRati : DEFAULT_CATEGORY_GAP_RATIO;
@@ -186,7 +186,7 @@ function CartesianContextProvider(props) {
186
186
  _getAxisExtremum4 = _slicedToArray(_getAxisExtremum3, 2),
187
187
  minData = _getAxisExtremum4[0],
188
188
  maxData = _getAxisExtremum4[1];
189
- var range = [drawingArea.top + drawingArea.height, drawingArea.top];
189
+ var range = axis.reverse ? [drawingArea.top, drawingArea.top + drawingArea.height] : [drawingArea.top + drawingArea.height, drawingArea.top];
190
190
  if (isBandScaleConfig(axis)) {
191
191
  var _axis$categoryGapRati2;
192
192
  var categoryGapRatio = (_axis$categoryGapRati2 = axis.categoryGapRatio) != null ? _axis$categoryGapRati2 : DEFAULT_CATEGORY_GAP_RATIO;
@@ -258,7 +258,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
258
258
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
259
259
  */
260
260
  xAxis: PropTypes.arrayOf(PropTypes.shape({
261
- axisId: PropTypes.string,
261
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
262
262
  classes: PropTypes.object,
263
263
  data: PropTypes.array,
264
264
  dataKey: PropTypes.string,
@@ -266,13 +266,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
266
266
  disableTicks: PropTypes.bool,
267
267
  fill: PropTypes.string,
268
268
  hideTooltip: PropTypes.bool,
269
- id: PropTypes.string,
269
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
270
270
  label: PropTypes.string,
271
271
  labelFontSize: PropTypes.number,
272
272
  labelStyle: PropTypes.object,
273
273
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
274
274
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
275
275
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
276
+ reverse: PropTypes.bool,
276
277
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
277
278
  slotProps: PropTypes.object,
278
279
  slots: PropTypes.object,
@@ -292,7 +293,7 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
292
293
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
293
294
  */
294
295
  yAxis: PropTypes.arrayOf(PropTypes.shape({
295
- axisId: PropTypes.string,
296
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
296
297
  classes: PropTypes.object,
297
298
  data: PropTypes.array,
298
299
  dataKey: PropTypes.string,
@@ -300,13 +301,14 @@ process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
300
301
  disableTicks: PropTypes.bool,
301
302
  fill: PropTypes.string,
302
303
  hideTooltip: PropTypes.bool,
303
- id: PropTypes.string,
304
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
304
305
  label: PropTypes.string,
305
306
  labelFontSize: PropTypes.number,
306
307
  labelStyle: PropTypes.object,
307
308
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
308
309
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
309
310
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
311
+ reverse: PropTypes.bool,
310
312
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
311
313
  slotProps: PropTypes.object,
312
314
  slots: PropTypes.object,
@@ -1,5 +1,7 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import * as React from 'react';
2
3
  import PropTypes from 'prop-types';
4
+ import useId from '@mui/utils/useId';
3
5
  import useChartDimensions from '../hooks/useChartDimensions';
4
6
 
5
7
  /**
@@ -12,7 +14,8 @@ export var DrawingContext = /*#__PURE__*/React.createContext({
12
14
  bottom: 0,
13
15
  right: 0,
14
16
  height: 300,
15
- width: 400
17
+ width: 400,
18
+ chartId: ''
16
19
  });
17
20
  export var SVGContext = /*#__PURE__*/React.createContext({
18
21
  current: null
@@ -30,10 +33,16 @@ function DrawingProvider(props) {
30
33
  svgRef = props.svgRef,
31
34
  children = props.children;
32
35
  var drawingArea = useChartDimensions(width, height, margin);
36
+ var chartId = useId();
37
+ var value = React.useMemo(function () {
38
+ return _extends({
39
+ chartId: chartId != null ? chartId : ''
40
+ }, drawingArea);
41
+ }, [chartId, drawingArea]);
33
42
  return /*#__PURE__*/_jsx(SVGContext.Provider, {
34
43
  value: svgRef,
35
44
  children: /*#__PURE__*/_jsx(DrawingContext.Provider, {
36
- value: drawingArea,
45
+ value: value,
37
46
  children: children
38
47
  })
39
48
  });
@@ -5,13 +5,17 @@ export function useDrawingArea() {
5
5
  left = _React$useContext.left,
6
6
  top = _React$useContext.top,
7
7
  width = _React$useContext.width,
8
- height = _React$useContext.height;
8
+ height = _React$useContext.height,
9
+ bottom = _React$useContext.bottom,
10
+ right = _React$useContext.right;
9
11
  return React.useMemo(function () {
10
12
  return {
11
13
  left: left,
12
14
  top: top,
13
15
  width: width,
14
- height: height
16
+ height: height,
17
+ bottom: bottom,
18
+ right: right
15
19
  };
16
- }, [height, left, top, width]);
20
+ }, [height, left, top, width, bottom, right]);
17
21
  }
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-beta.0
2
+ * @mui/x-charts v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -20,6 +20,7 @@ export * from './ChartsTooltip';
20
20
  export * from './ChartsLegend';
21
21
  export * from './ChartsAxisHighlight';
22
22
  export * from './ChartsVoronoiHandler';
23
+ export * from './ChartsOnAxisClickHandler';
23
24
  export * from './BarChart';
24
25
  export * from './LineChart';
25
26
  export * from './PieChart';
@@ -15,7 +15,7 @@ export function getMinXTranslation(width, height) {
15
15
  if (process.env.NODE_ENV !== 'production') {
16
16
  if (!warnedOnce && angle > 90 && angle < -90) {
17
17
  warnedOnce = true;
18
- console.warn(["MUI X: It seems you applied an angle larger than 90\xB0 or smaller than -90\xB0 to an axis text.", "This could cause some text overlapping.", "If you encounter a use case where it's needed, please open an issue."].join('\n'));
18
+ console.warn(["MUI X Charts: It seems you applied an angle larger than 90\xB0 or smaller than -90\xB0 to an axis text.", "This could cause some text overlapping.", "If you encounter a use case where it's needed, please open an issue."].join('\n'));
19
19
  }
20
20
  }
21
21
  var standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import { interpolateString } from 'd3-interpolate';
3
+ import { useSpring, to } from '@react-spring/web';
4
+ function usePrevious(value) {
5
+ var ref = React.useRef(null);
6
+ React.useEffect(function () {
7
+ ref.current = value;
8
+ }, [value]);
9
+ return ref.current;
10
+ }
11
+
12
+ // Taken from Nivo
13
+ export var useAnimatedPath = function useAnimatedPath(path, skipAnimation) {
14
+ var previousPath = usePrevious(path);
15
+ var interpolator = React.useMemo(function () {
16
+ return previousPath ? interpolateString(previousPath, path) : function () {
17
+ return path;
18
+ };
19
+ }, [previousPath, path]);
20
+ var _useSpring = useSpring({
21
+ from: {
22
+ value: 0
23
+ },
24
+ to: {
25
+ value: 1
26
+ },
27
+ reset: true,
28
+ immediate: skipAnimation
29
+ }),
30
+ value = _useSpring.value;
31
+ return to([value], interpolator);
32
+ };
@@ -42,4 +42,11 @@ export function getPercentageValue(value, refValue) {
42
42
  }
43
43
  }
44
44
  throw Error("MUI-Charts: Received an unknown value \"".concat(value, "\". It should be a number, or a string with a percentage value."));
45
+ }
46
+
47
+ /**
48
+ * Remove spaces to have viable ids
49
+ */
50
+ export function cleanId(id) {
51
+ return id.replace(' ', '_');
45
52
  }