@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
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { SVGContext } from '../context/DrawingProvider';
4
+ import { InteractionContext } from '../context/InteractionProvider';
5
+ import { CartesianContext } from '../context/CartesianContextProvider';
6
+ import { SeriesContext } from '../context/SeriesContextProvider';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ function ChartsOnAxisClickHandler(props) {
9
+ var onAxisClick = props.onAxisClick;
10
+ var svgRef = React.useContext(SVGContext);
11
+ var series = React.useContext(SeriesContext);
12
+ var _React$useContext = React.useContext(InteractionContext),
13
+ axis = _React$useContext.axis;
14
+ var _React$useContext2 = React.useContext(CartesianContext),
15
+ xAxisIds = _React$useContext2.xAxisIds,
16
+ xAxis = _React$useContext2.xAxis,
17
+ yAxisIds = _React$useContext2.yAxisIds,
18
+ yAxis = _React$useContext2.yAxis;
19
+ React.useEffect(function () {
20
+ var element = svgRef.current;
21
+ if (element === null || !onAxisClick) {
22
+ return function () {};
23
+ }
24
+ var handleMouseClick = function handleMouseClick(event) {
25
+ var _USED_AXIS_ID$data;
26
+ event.preventDefault();
27
+ var isXaxis = (axis.x && axis.x.index) !== undefined;
28
+ var USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
29
+ var dataIndex = isXaxis ? axis.x && axis.x.index : axis.y && axis.y.index;
30
+ if (dataIndex == null) {
31
+ return;
32
+ }
33
+ var seriesValues = {};
34
+ Object.keys(series).filter(function (seriesType) {
35
+ return ['bar', 'line'].includes(seriesType);
36
+ }).forEach(function (seriesType) {
37
+ var _series$seriesType;
38
+ (_series$seriesType = series[seriesType]) == null || _series$seriesType.seriesOrder.forEach(function (seriesId) {
39
+ var seriesItem = series[seriesType].series[seriesId];
40
+ var axisKey = isXaxis ? seriesItem.xAxisKey : seriesItem.yAxisKey;
41
+ if (axisKey === undefined || axisKey === USED_AXIS_ID) {
42
+ seriesValues[seriesId] = seriesItem.data[dataIndex];
43
+ }
44
+ });
45
+ });
46
+ var axisValue = (_USED_AXIS_ID$data = (isXaxis ? xAxis : yAxis)[USED_AXIS_ID].data) == null ? void 0 : _USED_AXIS_ID$data[dataIndex];
47
+ onAxisClick(event, {
48
+ dataIndex: dataIndex,
49
+ axisValue: axisValue,
50
+ seriesValues: seriesValues
51
+ });
52
+ };
53
+ element.addEventListener('click', handleMouseClick);
54
+ return function () {
55
+ element.removeEventListener('click', handleMouseClick);
56
+ };
57
+ }, [axis.x, axis.y, onAxisClick, series, svgRef, xAxis, xAxisIds, yAxis, yAxisIds]);
58
+
59
+ // eslint-disable-next-line react/jsx-no-useless-fragment
60
+ return /*#__PURE__*/_jsx(React.Fragment, {});
61
+ }
62
+ process.env.NODE_ENV !== "production" ? ChartsOnAxisClickHandler.propTypes = {
63
+ // ----------------------------- Warning --------------------------------
64
+ // | These PropTypes are generated from the TypeScript type definitions |
65
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
66
+ // ----------------------------------------------------------------------
67
+ /**
68
+ * The function called for onClick events.
69
+ * The second argument contains information about all line/bar elements at the current mouse position.
70
+ * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
71
+ * @param {null | AxisData} data The data about the clicked axis and items associated with it.
72
+ */
73
+ onAxisClick: PropTypes.func
74
+ } : void 0;
75
+ export { ChartsOnAxisClickHandler };
@@ -0,0 +1 @@
1
+ export * from './ChartsOnAxisClickHandler';
@@ -8,7 +8,7 @@ function ChartsReferenceLine(props) {
8
8
  var x = props.x,
9
9
  y = props.y;
10
10
  if (x !== undefined && y !== undefined) {
11
- throw new Error('MUI X Charts: The ChartsReferenceLine can not have both `x` and `y` props set.');
11
+ throw new Error('MUI X Charts: The ChartsReferenceLine cannot have both `x` and `y` props set.');
12
12
  }
13
13
  if (x === undefined && y === undefined) {
14
14
  throw new Error('MUI X Charts: The ChartsReferenceLine should have a value in `x` or `y` prop.');
@@ -27,7 +27,7 @@ process.env.NODE_ENV !== "production" ? ChartsReferenceLine.propTypes = {
27
27
  * The id of the axis used for the reference value.
28
28
  * @default The `id` of the first defined axis.
29
29
  */
30
- axisId: PropTypes.string,
30
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
31
31
  /**
32
32
  * Override or extend the styles applied to the component.
33
33
  */
@@ -70,7 +70,7 @@ function ChartsXReferenceLine(props) {
70
70
  if (process.env.NODE_ENV !== 'production') {
71
71
  if (!warnedOnce) {
72
72
  warnedOnce = true;
73
- console.error("MUI X: the value ".concat(x, " does not exist in the data of x axis with id ").concat(axisId, "."));
73
+ console.error("MUI X Charts: the value ".concat(x, " does not exist in the data of x axis with id ").concat(axisId, "."));
74
74
  }
75
75
  }
76
76
  return null;
@@ -70,7 +70,7 @@ function ChartsYReferenceLine(props) {
70
70
  if (process.env.NODE_ENV !== 'production') {
71
71
  if (!warnedOnce) {
72
72
  warnedOnce = true;
73
- console.error("MUI X: the value ".concat(y, " does not exist in the data of y axis with id ").concat(axisId, "."));
73
+ console.error("MUI X Charts: the value ".concat(y, " does not exist in the data of y axis with id ").concat(axisId, "."));
74
74
  }
75
75
  }
76
76
  return null;
@@ -5,6 +5,7 @@ import { useSlotProps } from '@mui/base/utils';
5
5
  import { SeriesContext } from '../context/SeriesContextProvider';
6
6
  import { CartesianContext } from '../context/CartesianContextProvider';
7
7
  import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
8
+ import { isCartesianSeriesType } from './utils';
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  function ChartsAxisTooltipContent(props) {
10
11
  var content = props.content,
@@ -24,9 +25,7 @@ function ChartsAxisTooltipContent(props) {
24
25
  var USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
25
26
  var relevantSeries = React.useMemo(function () {
26
27
  var rep = [];
27
- Object.keys(series).filter(function (seriesType) {
28
- return ['bar', 'line', 'scatter'].includes(seriesType);
29
- }).forEach(function (seriesType) {
28
+ Object.keys(series).filter(isCartesianSeriesType).forEach(function (seriesType) {
30
29
  series[seriesType].seriesOrder.forEach(function (seriesId) {
31
30
  var item = series[seriesType].series[seriesId];
32
31
  var axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
@@ -65,11 +64,11 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
65
64
  axisData: PropTypes.shape({
66
65
  x: PropTypes.shape({
67
66
  index: PropTypes.number,
68
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
67
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
69
68
  }),
70
69
  y: PropTypes.shape({
71
70
  index: PropTypes.number,
72
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
71
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
73
72
  })
74
73
  }).isRequired,
75
74
  classes: PropTypes.object.isRequired,
@@ -79,11 +78,11 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
79
78
  axisData: PropTypes.shape({
80
79
  x: PropTypes.shape({
81
80
  index: PropTypes.number,
82
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
81
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
83
82
  }),
84
83
  y: PropTypes.shape({
85
84
  index: PropTypes.number,
86
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
85
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
87
86
  })
88
87
  }),
89
88
  axisValue: PropTypes.any,
@@ -37,7 +37,7 @@ process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
37
37
  classes: PropTypes.object,
38
38
  itemData: PropTypes.shape({
39
39
  dataIndex: PropTypes.number,
40
- seriesId: PropTypes.string.isRequired,
40
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
41
41
  type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
42
42
  }),
43
43
  series: PropTypes.object,
@@ -45,7 +45,7 @@ process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
45
45
  }),
46
46
  itemData: PropTypes.shape({
47
47
  dataIndex: PropTypes.number,
48
- seriesId: PropTypes.string.isRequired,
48
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
49
49
  type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
50
50
  }).isRequired,
51
51
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import clsx from 'clsx';
4
4
  import Typography from '@mui/material/Typography';
5
5
  import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from './ChartsTooltipTable';
6
+ import { isCartesianSeries, utcFormatter } from './utils';
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
9
  function DefaultChartsAxisTooltipContent(props) {
@@ -17,7 +18,7 @@ function DefaultChartsAxisTooltipContent(props) {
17
18
  return null;
18
19
  }
19
20
  var axisFormatter = (_axis$valueFormatter = axis.valueFormatter) != null ? _axis$valueFormatter : function (v) {
20
- return v.toLocaleString();
21
+ return axis.scaleType === 'utc' ? utcFormatter(v) : v.toLocaleString();
21
22
  };
22
23
  return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
23
24
  sx: sx,
@@ -34,13 +35,15 @@ function DefaultChartsAxisTooltipContent(props) {
34
35
  })
35
36
  })
36
37
  }), /*#__PURE__*/_jsx("tbody", {
37
- children: series.map(function (_ref) {
38
+ children: series.filter(isCartesianSeries).map(function (_ref) {
39
+ var _data$dataIndex;
38
40
  var color = _ref.color,
39
41
  id = _ref.id,
40
42
  label = _ref.label,
41
43
  valueFormatter = _ref.valueFormatter,
42
44
  data = _ref.data;
43
- var formattedValue = valueFormatter(data[dataIndex]);
45
+ // @ts-ignore
46
+ var formattedValue = valueFormatter((_data$dataIndex = data[dataIndex]) != null ? _data$dataIndex : null);
44
47
  if (formattedValue == null) {
45
48
  return null;
46
49
  }
@@ -87,11 +90,11 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
87
90
  axisData: PropTypes.shape({
88
91
  x: PropTypes.shape({
89
92
  index: PropTypes.number,
90
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
93
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
91
94
  }),
92
95
  y: PropTypes.shape({
93
96
  index: PropTypes.number,
94
- value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired
97
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
95
98
  })
96
99
  }).isRequired,
97
100
  /**
@@ -66,7 +66,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsItemTooltipContent.propType
66
66
  */
67
67
  itemData: PropTypes.shape({
68
68
  dataIndex: PropTypes.number,
69
- seriesId: PropTypes.string.isRequired,
69
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
70
70
  type: PropTypes.oneOf(['bar', 'line', 'pie', 'scatter']).isRequired
71
71
  }).isRequired,
72
72
  /**
@@ -88,4 +88,16 @@ export function getTooltipHasData(trigger, displayedData) {
88
88
  var hasAxisXData = displayedData.x !== null;
89
89
  var hasAxisYData = displayedData.y !== null;
90
90
  return hasAxisXData || hasAxisYData;
91
+ }
92
+ export function isCartesianSeriesType(seriesType) {
93
+ return ['bar', 'line', 'scatter'].includes(seriesType);
94
+ }
95
+ export function isCartesianSeries(series) {
96
+ return isCartesianSeriesType(series.type);
97
+ }
98
+ export function utcFormatter(v) {
99
+ if (v instanceof Date) {
100
+ return v.toUTCString();
101
+ }
102
+ return v.toLocaleString();
91
103
  }
@@ -11,7 +11,8 @@ import { getSVGPoint } from '../internals/utils';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  function ChartsVoronoiHandler(props) {
13
13
  var _React$useContext$sca;
14
- var voronoiMaxRadius = props.voronoiMaxRadius;
14
+ var voronoiMaxRadius = props.voronoiMaxRadius,
15
+ onItemClick = props.onItemClick;
15
16
  var svgRef = React.useContext(SVGContext);
16
17
  var _React$useContext = React.useContext(DrawingContext),
17
18
  width = _React$useContext.width,
@@ -44,6 +45,8 @@ function ChartsVoronoiHandler(props) {
44
45
  };
45
46
  }, [dispatch]);
46
47
  useEnhancedEffect(function () {
48
+ // This effect generate and store the Delaunay object that's used to map coordinate to closest point.
49
+
47
50
  if (seriesOrder === undefined || series === undefined) {
48
51
  // If there is no scatter chart series
49
52
  return;
@@ -77,81 +80,122 @@ function ChartsVoronoiHandler(props) {
77
80
  if (element === null) {
78
81
  return undefined;
79
82
  }
80
- var handleMouseOut = function handleMouseOut() {
81
- dispatch({
82
- type: 'exitChart'
83
- });
84
- };
85
83
 
86
84
  // TODO: A perf optimisation of voronoi could be to use the last point as the intial point for the next search.
87
- var handleMouseMove = function handleMouseMove(event) {
85
+ function getClosestPoint(event) {
88
86
  var _voronoiRef$current$d;
89
87
  // Get mouse coordinate in global SVG space
90
88
  var svgPoint = getSVGPoint(svgRef.current, event);
91
89
  var outsideX = svgPoint.x < left || svgPoint.x > left + width;
92
90
  var outsideY = svgPoint.y < top || svgPoint.y > top + height;
93
91
  if (outsideX || outsideY) {
94
- dispatch({
95
- type: 'exitChart'
96
- });
97
- return;
92
+ return 'outside-chart';
98
93
  }
99
94
  if (!voronoiRef.current.delauney) {
100
- return;
95
+ return 'no-point-found';
101
96
  }
102
97
  var closestPointIndex = (_voronoiRef$current$d = voronoiRef.current.delauney) == null ? void 0 : _voronoiRef$current$d.find(svgPoint.x, svgPoint.y);
103
- if (closestPointIndex !== undefined) {
104
- var seriesId = Object.keys(voronoiRef.current).find(function (id) {
105
- if (id === 'delauney') {
106
- return false;
107
- }
108
- return 2 * closestPointIndex >= voronoiRef.current[id].startIndex && 2 * closestPointIndex < voronoiRef.current[id].endIndex;
109
- });
110
- if (seriesId === undefined) {
111
- return;
98
+ if (closestPointIndex === undefined) {
99
+ return 'no-point-found';
100
+ }
101
+ var seriesId = Object.keys(voronoiRef.current).find(function (id) {
102
+ if (id === 'delauney') {
103
+ return false;
112
104
  }
113
- var dataIndex = (2 * closestPointIndex - voronoiRef.current[seriesId].startIndex) / 2;
114
- if (voronoiMaxRadius !== undefined) {
115
- var pointX = voronoiRef.current.delauney.points[2 * closestPointIndex];
116
- var pointY = voronoiRef.current.delauney.points[2 * closestPointIndex + 1];
117
- var dist2 = Math.pow(pointX - svgPoint.x, 2) + Math.pow(pointY - svgPoint.y, 2);
118
- if (dist2 > Math.pow(voronoiMaxRadius, 2)) {
119
- // The closest point is too far to be considered.
120
- dispatch({
121
- type: 'leaveItem',
122
- data: {
123
- type: 'scatter',
124
- seriesId: seriesId,
125
- dataIndex: dataIndex
126
- }
127
- });
128
- return;
129
- }
105
+ return 2 * closestPointIndex >= voronoiRef.current[id].startIndex && 2 * closestPointIndex < voronoiRef.current[id].endIndex;
106
+ });
107
+ if (seriesId === undefined) {
108
+ return 'no-point-found';
109
+ }
110
+ var dataIndex = (2 * closestPointIndex - voronoiRef.current[seriesId].startIndex) / 2;
111
+ if (voronoiMaxRadius !== undefined) {
112
+ var pointX = voronoiRef.current.delauney.points[2 * closestPointIndex];
113
+ var pointY = voronoiRef.current.delauney.points[2 * closestPointIndex + 1];
114
+ var dist2 = Math.pow(pointX - svgPoint.x, 2) + Math.pow(pointY - svgPoint.y, 2);
115
+ if (dist2 > Math.pow(voronoiMaxRadius, 2)) {
116
+ // The closest point is too far to be considered.
117
+ return 'outside-voronoi-max-radius';
130
118
  }
119
+ }
120
+ return {
121
+ seriesId: seriesId,
122
+ dataIndex: dataIndex
123
+ };
124
+ }
125
+ var handleMouseOut = function handleMouseOut() {
126
+ dispatch({
127
+ type: 'exitChart'
128
+ });
129
+ };
130
+ var handleMouseMove = function handleMouseMove(event) {
131
+ var closestPoint = getClosestPoint(event);
132
+ if (closestPoint === 'outside-chart') {
131
133
  dispatch({
132
- type: 'enterItem',
134
+ type: 'exitChart'
135
+ });
136
+ return;
137
+ }
138
+ if (closestPoint === 'outside-voronoi-max-radius' || closestPoint === 'no-point-found') {
139
+ dispatch({
140
+ type: 'leaveItem',
133
141
  data: {
134
- type: 'scatter',
135
- seriesId: seriesId,
136
- dataIndex: dataIndex
142
+ type: 'scatter'
137
143
  }
138
144
  });
145
+ return;
146
+ }
147
+ var seriesId = closestPoint.seriesId,
148
+ dataIndex = closestPoint.dataIndex;
149
+ dispatch({
150
+ type: 'enterItem',
151
+ data: {
152
+ type: 'scatter',
153
+ seriesId: seriesId,
154
+ dataIndex: dataIndex
155
+ }
156
+ });
157
+ };
158
+ var handleMouseClick = function handleMouseClick(event) {
159
+ if (!onItemClick) {
160
+ return;
139
161
  }
162
+ var closestPoint = getClosestPoint(event);
163
+ if (typeof closestPoint === 'string') {
164
+ // No point fond for any reason
165
+ return;
166
+ }
167
+ var seriesId = closestPoint.seriesId,
168
+ dataIndex = closestPoint.dataIndex;
169
+ onItemClick(event, {
170
+ type: 'scatter',
171
+ seriesId: seriesId,
172
+ dataIndex: dataIndex
173
+ });
140
174
  };
141
175
  element.addEventListener('mouseout', handleMouseOut);
142
176
  element.addEventListener('mousemove', handleMouseMove);
177
+ element.addEventListener('click', handleMouseClick);
143
178
  return function () {
144
179
  element.removeEventListener('mouseout', handleMouseOut);
145
180
  element.removeEventListener('mousemove', handleMouseMove);
181
+ element.removeEventListener('click', handleMouseClick);
146
182
  };
147
- }, [svgRef, dispatch, left, width, top, height, yAxis, xAxis, voronoiMaxRadius]);
148
- return /*#__PURE__*/_jsx("g", {}); // Workaround to fix docs scripts
183
+ }, [svgRef, dispatch, left, width, top, height, yAxis, xAxis, voronoiMaxRadius, onItemClick]);
184
+
185
+ // eslint-disable-next-line react/jsx-no-useless-fragment
186
+ return /*#__PURE__*/_jsx(React.Fragment, {});
149
187
  }
150
188
  process.env.NODE_ENV !== "production" ? ChartsVoronoiHandler.propTypes = {
151
189
  // ----------------------------- Warning --------------------------------
152
190
  // | These PropTypes are generated from the TypeScript type definitions |
153
191
  // | To update them edit the TypeScript types and run "yarn proptypes" |
154
192
  // ----------------------------------------------------------------------
193
+ /**
194
+ * Callback fired when clicking on a scatter item.
195
+ * @param {MouseEvent} event Mouse event catched at the svg level
196
+ * @param {ScatterItemIdentifier} scatterItemIdentifier Identify whihc item got clicked
197
+ */
198
+ onItemClick: PropTypes.func,
155
199
  /**
156
200
  * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
157
201
  * If `undefined`, the radius is assumed to be infinite.
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
- var _excluded = ["scale", "tickNumber"];
4
+ var _excluded = ["scale", "tickNumber", "reverse"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useSlotProps } from '@mui/base/utils';
@@ -34,6 +34,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
34
34
  function addLabelDimension(xTicks, _ref) {
35
35
  var style = _ref.tickLabelStyle,
36
36
  tickLabelInterval = _ref.tickLabelInterval,
37
+ reverse = _ref.reverse,
37
38
  isMounted = _ref.isMounted;
38
39
  var withDimension = xTicks.map(function (tick) {
39
40
  if (!isMounted || tick.formattedValue === undefined) {
@@ -63,8 +64,9 @@ function addLabelDimension(xTicks, _ref) {
63
64
  }
64
65
 
65
66
  // Filter label to avoid overlap
66
- var textStart = 0;
67
- var textEnd = 0;
67
+ var currentTextLimit = 0;
68
+ var previouseTextLimit = 0;
69
+ var direction = reverse ? -1 : 1;
68
70
  return withDimension.map(function (item, labelIndex) {
69
71
  var width = item.width,
70
72
  offset = item.offset,
@@ -74,15 +76,15 @@ function addLabelDimension(xTicks, _ref) {
74
76
  var textPosition = offset + labelOffset;
75
77
  var gapRatio = 1.2; // Ratio applied to the minimal distance to add some margin.
76
78
 
77
- textStart = textPosition - gapRatio * distance / 2;
78
- if (labelIndex > 0 && textStart < textEnd) {
79
+ currentTextLimit = textPosition - direction * (gapRatio * distance) / 2;
80
+ if (labelIndex > 0 && direction * currentTextLimit < direction * previouseTextLimit) {
79
81
  // Except for the first label, we skip all label that overlap with the last accepted.
80
- // Notice that the early return prevents `textEnd` from being updated.
82
+ // Notice that the early return prevents `previouseTextLimit` from being updated.
81
83
  return _extends({}, item, {
82
84
  skipLabel: true
83
85
  });
84
86
  }
85
- textEnd = textPosition + gapRatio * distance / 2;
87
+ previouseTextLimit = textPosition + direction * (gapRatio * distance) / 2;
86
88
  return item;
87
89
  });
88
90
  }
@@ -114,6 +116,7 @@ function ChartsXAxis(inProps) {
114
116
  _React$useContext2$xA = _React$useContext2.xAxis[(_props$axisId = props.axisId) != null ? _props$axisId : xAxisIds[0]],
115
117
  xScale = _React$useContext2$xA.scale,
116
118
  tickNumber = _React$useContext2$xA.tickNumber,
119
+ reverse = _React$useContext2$xA.reverse,
117
120
  settings = _objectWithoutProperties(_React$useContext2$xA, _excluded);
118
121
  var isMounted = useMounted();
119
122
  var defaultizedProps = _extends({}, defaultProps, settings, props);
@@ -169,6 +172,7 @@ function ChartsXAxis(inProps) {
169
172
  var xTicksWithDimension = addLabelDimension(xTicks, {
170
173
  tickLabelStyle: axisTickLabelProps.style,
171
174
  tickLabelInterval: tickLabelInterval,
175
+ reverse: reverse,
172
176
  isMounted: isMounted
173
177
  });
174
178
  var labelRefPoint = {
@@ -231,7 +235,7 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
231
235
  * The id of the axis to render.
232
236
  * If undefined, it will be the first defined axis.
233
237
  */
234
- axisId: PropTypes.string,
238
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
235
239
  /**
236
240
  * Override or extend the styles applied to the component.
237
241
  */
@@ -163,7 +163,7 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
163
163
  * The id of the axis to render.
164
164
  * If undefined, it will be the first defined axis.
165
165
  */
166
- axisId: PropTypes.string,
166
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
167
167
  /**
168
168
  * Override or extend the styles applied to the component.
169
169
  */
@@ -0,0 +1,102 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["d", "skipAnimation", "ownerState"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { styled } from '@mui/material/styles';
7
+ import { color as d3Color } from 'd3-color';
8
+ import { animated, useSpring } from '@react-spring/web';
9
+ import { useAnimatedPath } from '../internals/useAnimatedPath';
10
+ import { DrawingContext } from '../context/DrawingProvider';
11
+ import { cleanId } from '../internals/utils';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ export var AreaElementPath = styled(animated.path, {
15
+ name: 'MuiAreaElement',
16
+ slot: 'Root',
17
+ overridesResolver: function overridesResolver(_, styles) {
18
+ return styles.root;
19
+ }
20
+ })(function (_ref) {
21
+ var ownerState = _ref.ownerState;
22
+ return {
23
+ stroke: 'none',
24
+ fill: ownerState.isHighlighted ? d3Color(ownerState.color).brighter(1).formatHex() : d3Color(ownerState.color).brighter(0.5).formatHex(),
25
+ transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
26
+ opacity: ownerState.isFaded ? 0.3 : 1
27
+ };
28
+ });
29
+ /**
30
+ * Demos:
31
+ *
32
+ * - [Lines](https://mui.com/x/react-charts/lines/)
33
+ * - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
34
+ *
35
+ * API:
36
+ *
37
+ * - [AreaElement API](https://mui.com/x/api/charts/animated-area/)
38
+ */
39
+ function AnimatedArea(props) {
40
+ var d = props.d,
41
+ skipAnimation = props.skipAnimation,
42
+ ownerState = props.ownerState,
43
+ other = _objectWithoutProperties(props, _excluded);
44
+ var _React$useContext = React.useContext(DrawingContext),
45
+ left = _React$useContext.left,
46
+ top = _React$useContext.top,
47
+ right = _React$useContext.right,
48
+ bottom = _React$useContext.bottom,
49
+ width = _React$useContext.width,
50
+ height = _React$useContext.height,
51
+ chartId = _React$useContext.chartId;
52
+ var path = useAnimatedPath(d, skipAnimation);
53
+ var _useSpring = useSpring({
54
+ from: {
55
+ animatedWidth: left
56
+ },
57
+ to: {
58
+ animatedWidth: width + left + right
59
+ },
60
+ reset: false,
61
+ immediate: skipAnimation
62
+ }),
63
+ animatedWidth = _useSpring.animatedWidth;
64
+ var clipId = cleanId("".concat(chartId, "-").concat(ownerState.id, "-area-clip"));
65
+ return /*#__PURE__*/_jsxs(React.Fragment, {
66
+ children: [/*#__PURE__*/_jsx("clipPath", {
67
+ id: clipId,
68
+ children: /*#__PURE__*/_jsx(animated.rect, {
69
+ x: 0,
70
+ y: 0,
71
+ width: animatedWidth,
72
+ height: top + height + bottom
73
+ })
74
+ }), /*#__PURE__*/_jsx("g", {
75
+ clipPath: "url(#".concat(clipId, ")"),
76
+ children: /*#__PURE__*/_jsx(AreaElementPath, _extends({}, other, {
77
+ ownerState: ownerState,
78
+ d: path
79
+ }))
80
+ })]
81
+ });
82
+ }
83
+ process.env.NODE_ENV !== "production" ? AnimatedArea.propTypes = {
84
+ // ----------------------------- Warning --------------------------------
85
+ // | These PropTypes are generated from the TypeScript type definitions |
86
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
87
+ // ----------------------------------------------------------------------
88
+ d: PropTypes.string.isRequired,
89
+ ownerState: PropTypes.shape({
90
+ classes: PropTypes.object,
91
+ color: PropTypes.string.isRequired,
92
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
93
+ isFaded: PropTypes.bool.isRequired,
94
+ isHighlighted: PropTypes.bool.isRequired
95
+ }).isRequired,
96
+ /**
97
+ * If `true`, animations are skipped.
98
+ * @default false
99
+ */
100
+ skipAnimation: PropTypes.bool
101
+ } : void 0;
102
+ export { AnimatedArea };