@mui/x-charts 7.11.0 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/BarChart/BarChart.js +0 -2
  2. package/BarChart/BarElement.d.ts +22 -21
  3. package/BarChart/BarElement.js +3 -3
  4. package/BarChart/BarLabel/BarLabel.d.ts +20 -20
  5. package/BarChart/BarLabel/BarLabelItem.d.ts +2 -1
  6. package/BarChart/BarLabel/BarLabelItem.js +2 -2
  7. package/BarChart/BarPlot.js +8 -8
  8. package/BarChart/checkScaleErrors.d.ts +4 -4
  9. package/BarChart/checkScaleErrors.js +11 -11
  10. package/BarChart/extremums.js +4 -1
  11. package/BarChart/formatter.js +3 -3
  12. package/CHANGELOG.md +194 -4
  13. package/ChartContainer/ChartContainer.d.ts +3 -3
  14. package/ChartContainer/ChartContainer.js +3 -5
  15. package/ChartContainer/useChartContainerProps.d.ts +50 -52
  16. package/ChartContainer/useChartContainerProps.js +2 -2
  17. package/ChartContainer/useDefaultizeAxis.d.ts +24 -25
  18. package/ChartContainer/usePluginsMerge.d.ts +1 -1
  19. package/ChartsAxis/ChartsAxis.js +4 -4
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  21. package/ChartsLegend/ChartsLegend.js +6 -6
  22. package/ChartsLegend/DefaultChartsLegend.d.ts +1 -1
  23. package/ChartsLegend/LegendPerItem.js +2 -2
  24. package/ChartsLegend/utils.d.ts +1 -1
  25. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  26. package/ChartsOverlay/ChartsOverlay.d.ts +3 -2
  27. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  28. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  29. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  30. package/ChartsTooltip/ChartsAxisTooltipContent.js +9 -5
  31. package/ChartsTooltip/ChartsItemTooltipContent.js +6 -6
  32. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  33. package/ChartsTooltip/ChartsTooltip.js +10 -10
  34. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  35. package/ChartsXAxis/ChartsXAxis.js +5 -5
  36. package/ChartsYAxis/ChartsYAxis.js +6 -6
  37. package/Gauge/GaugeReferenceArc.js +1 -1
  38. package/Gauge/GaugeValueArc.js +1 -1
  39. package/LineChart/AnimatedArea.d.ts +20 -20
  40. package/LineChart/AnimatedArea.js +1 -1
  41. package/LineChart/AnimatedLine.d.ts +20 -20
  42. package/LineChart/AnimatedLine.js +1 -1
  43. package/LineChart/AreaElement.d.ts +2 -1
  44. package/LineChart/AreaElement.js +2 -2
  45. package/LineChart/AreaPlot.js +11 -7
  46. package/LineChart/LineChart.js +4 -3
  47. package/LineChart/LineElement.d.ts +2 -1
  48. package/LineChart/LineElement.js +2 -2
  49. package/LineChart/LineHighlightPlot.d.ts +2 -1
  50. package/LineChart/LineHighlightPlot.js +9 -5
  51. package/LineChart/LinePlot.js +11 -7
  52. package/LineChart/MarkElement.js +1 -1
  53. package/LineChart/MarkPlot.js +9 -5
  54. package/LineChart/extremums.js +4 -1
  55. package/LineChart/formatter.js +3 -3
  56. package/PieChart/PieArc.js +2 -1
  57. package/PieChart/PieArcLabel.js +1 -1
  58. package/PieChart/PieChart.js +0 -2
  59. package/PieChart/formatter.js +1 -1
  60. package/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  61. package/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  62. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +2 -2
  63. package/ScatterChart/ScatterChart.js +4 -3
  64. package/ScatterChart/ScatterPlot.js +6 -3
  65. package/ScatterChart/extremums.js +8 -2
  66. package/SparkLineChart/SparkLineChart.js +0 -2
  67. package/context/CartesianProvider/CartesianContext.d.ts +1 -1
  68. package/context/CartesianProvider/computeValue.d.ts +1 -1
  69. package/context/CartesianProvider/computeValue.js +1 -1
  70. package/context/CartesianProvider/defaultizeAxis.d.ts +24 -25
  71. package/context/CartesianProvider/getAxisExtremum.d.ts +1 -1
  72. package/context/CartesianProvider/normalizeAxis.js +1 -1
  73. package/context/DrawingProvider.d.ts +2 -1
  74. package/context/DrawingProvider.js +7 -1
  75. package/context/{SeriesContextProvider.d.ts → SeriesProvider/Series.types.d.ts} +4 -8
  76. package/context/SeriesProvider/Series.types.js +5 -0
  77. package/context/SeriesProvider/SeriesContext.d.ts +4 -0
  78. package/context/SeriesProvider/SeriesContext.js +16 -0
  79. package/context/SeriesProvider/SeriesProvider.d.ts +5 -0
  80. package/context/SeriesProvider/SeriesProvider.js +37 -0
  81. package/context/SeriesProvider/index.d.ts +12 -0
  82. package/context/SeriesProvider/index.js +49 -0
  83. package/context/SeriesProvider/processSeries.d.ts +17 -0
  84. package/context/SeriesProvider/processSeries.js +55 -0
  85. package/context/ZAxisContextProvider.d.ts +1 -1
  86. package/context/ZAxisContextProvider.js +1 -1
  87. package/esm/BarChart/BarChart.js +0 -2
  88. package/esm/BarChart/BarElement.js +2 -2
  89. package/esm/BarChart/BarLabel/BarLabelItem.js +1 -1
  90. package/esm/BarChart/BarPlot.js +8 -8
  91. package/esm/BarChart/checkScaleErrors.js +11 -11
  92. package/esm/BarChart/extremums.js +4 -1
  93. package/esm/BarChart/formatter.js +3 -3
  94. package/esm/ChartContainer/ChartContainer.js +3 -5
  95. package/esm/ChartContainer/useChartContainerProps.js +2 -2
  96. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  97. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  98. package/esm/ChartsLegend/ChartsLegend.js +2 -2
  99. package/esm/ChartsLegend/LegendPerItem.js +1 -1
  100. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  101. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  102. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  103. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  104. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  105. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
  106. package/esm/ChartsTooltip/ChartsTooltip.js +3 -3
  107. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  108. package/esm/ChartsXAxis/ChartsXAxis.js +2 -2
  109. package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
  110. package/esm/Gauge/GaugeReferenceArc.js +1 -1
  111. package/esm/Gauge/GaugeValueArc.js +1 -1
  112. package/esm/LineChart/AnimatedArea.js +1 -1
  113. package/esm/LineChart/AnimatedLine.js +1 -1
  114. package/esm/LineChart/AreaElement.js +1 -1
  115. package/esm/LineChart/AreaPlot.js +11 -7
  116. package/esm/LineChart/LineChart.js +4 -3
  117. package/esm/LineChart/LineElement.js +1 -1
  118. package/esm/LineChart/LineHighlightPlot.js +9 -5
  119. package/esm/LineChart/LinePlot.js +11 -7
  120. package/esm/LineChart/MarkElement.js +1 -1
  121. package/esm/LineChart/MarkPlot.js +9 -5
  122. package/esm/LineChart/extremums.js +4 -1
  123. package/esm/LineChart/formatter.js +3 -3
  124. package/esm/PieChart/PieArc.js +2 -1
  125. package/esm/PieChart/PieArcLabel.js +1 -1
  126. package/esm/PieChart/PieChart.js +0 -2
  127. package/esm/PieChart/formatter.js +1 -1
  128. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  129. package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  130. package/esm/ScatterChart/ScatterChart.js +4 -3
  131. package/esm/ScatterChart/ScatterPlot.js +6 -3
  132. package/esm/ScatterChart/extremums.js +8 -2
  133. package/esm/SparkLineChart/SparkLineChart.js +0 -2
  134. package/esm/context/CartesianProvider/computeValue.js +1 -1
  135. package/esm/context/CartesianProvider/normalizeAxis.js +1 -1
  136. package/esm/context/DrawingProvider.js +7 -1
  137. package/esm/context/SeriesProvider/Series.types.js +1 -0
  138. package/esm/context/SeriesProvider/SeriesContext.js +8 -0
  139. package/esm/context/SeriesProvider/SeriesProvider.js +30 -0
  140. package/esm/context/SeriesProvider/index.js +8 -0
  141. package/esm/context/{SeriesContextProvider.js → SeriesProvider/processSeries.js} +10 -35
  142. package/esm/context/ZAxisContextProvider.js +1 -1
  143. package/esm/hooks/useAxisEvents.js +12 -8
  144. package/esm/hooks/useReducedMotion.js +2 -2
  145. package/esm/hooks/useSeries.js +1 -1
  146. package/esm/internals/SlotComponentPropsFromProps.js +1 -0
  147. package/esm/internals/colorScale.js +1 -1
  148. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  149. package/esm/internals/geometry.js +1 -1
  150. package/esm/internals/getCurve.js +1 -1
  151. package/esm/internals/getPercentageValue.js +1 -1
  152. package/esm/internals/getScale.js +1 -1
  153. package/esm/internals/index.js +1 -1
  154. package/esm/internals/stackSeries.js +1 -1
  155. package/esm/internals/useAnimatedPath.js +1 -1
  156. package/esm/internals/warning.js +19 -11
  157. package/hooks/useAxisEvents.js +12 -8
  158. package/hooks/useReducedMotion.js +2 -2
  159. package/hooks/useSeries.d.ts +1 -1
  160. package/hooks/useSeries.js +2 -2
  161. package/hooks/useTicks.d.ts +1 -1
  162. package/index.js +1 -1
  163. package/internals/SlotComponentPropsFromProps.d.ts +1 -0
  164. package/internals/SlotComponentPropsFromProps.js +5 -0
  165. package/internals/colorScale.d.ts +3 -3
  166. package/internals/colorScale.js +1 -1
  167. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  168. package/internals/defaultizeColor.d.ts +8 -1
  169. package/internals/geometry.js +1 -1
  170. package/internals/getCurve.d.ts +1 -1
  171. package/internals/getCurve.js +1 -1
  172. package/internals/getPercentageValue.js +1 -1
  173. package/internals/getScale.js +1 -1
  174. package/internals/index.d.ts +1 -1
  175. package/internals/index.js +4 -4
  176. package/internals/isBandScale.d.ts +1 -1
  177. package/internals/stackSeries.d.ts +1 -1
  178. package/internals/stackSeries.js +1 -1
  179. package/internals/useAnimatedPath.js +1 -1
  180. package/internals/warning.d.ts +2 -1
  181. package/internals/warning.js +21 -12
  182. package/models/axis.d.ts +2 -2
  183. package/models/seriesType/common.d.ts +10 -0
  184. package/models/seriesType/pie.d.ts +1 -1
  185. package/models/seriesType/scatter.d.ts +5 -0
  186. package/models/z-axis.d.ts +1 -1
  187. package/modern/BarChart/BarChart.js +0 -2
  188. package/modern/BarChart/BarElement.js +2 -2
  189. package/modern/BarChart/BarLabel/BarLabelItem.js +1 -1
  190. package/modern/BarChart/BarPlot.js +8 -8
  191. package/modern/BarChart/checkScaleErrors.js +11 -11
  192. package/modern/BarChart/extremums.js +4 -1
  193. package/modern/BarChart/formatter.js +3 -3
  194. package/modern/ChartContainer/ChartContainer.js +3 -5
  195. package/modern/ChartContainer/useChartContainerProps.js +2 -2
  196. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  197. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  198. package/modern/ChartsLegend/ChartsLegend.js +2 -2
  199. package/modern/ChartsLegend/LegendPerItem.js +1 -1
  200. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  201. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  202. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  203. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  204. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  205. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
  206. package/modern/ChartsTooltip/ChartsTooltip.js +3 -3
  207. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  208. package/modern/ChartsXAxis/ChartsXAxis.js +2 -2
  209. package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
  210. package/modern/Gauge/GaugeReferenceArc.js +1 -1
  211. package/modern/Gauge/GaugeValueArc.js +1 -1
  212. package/modern/LineChart/AnimatedArea.js +1 -1
  213. package/modern/LineChart/AnimatedLine.js +1 -1
  214. package/modern/LineChart/AreaElement.js +1 -1
  215. package/modern/LineChart/AreaPlot.js +11 -7
  216. package/modern/LineChart/LineChart.js +4 -3
  217. package/modern/LineChart/LineElement.js +1 -1
  218. package/modern/LineChart/LineHighlightPlot.js +9 -5
  219. package/modern/LineChart/LinePlot.js +11 -7
  220. package/modern/LineChart/MarkElement.js +1 -1
  221. package/modern/LineChart/MarkPlot.js +9 -5
  222. package/modern/LineChart/extremums.js +4 -1
  223. package/modern/LineChart/formatter.js +3 -3
  224. package/modern/PieChart/PieArc.js +2 -1
  225. package/modern/PieChart/PieArcLabel.js +1 -1
  226. package/modern/PieChart/PieChart.js +0 -2
  227. package/modern/PieChart/formatter.js +1 -1
  228. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  229. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  230. package/modern/ScatterChart/ScatterChart.js +4 -3
  231. package/modern/ScatterChart/ScatterPlot.js +6 -3
  232. package/modern/ScatterChart/extremums.js +8 -2
  233. package/modern/SparkLineChart/SparkLineChart.js +0 -2
  234. package/modern/context/CartesianProvider/computeValue.js +1 -1
  235. package/modern/context/CartesianProvider/normalizeAxis.js +1 -1
  236. package/modern/context/DrawingProvider.js +7 -1
  237. package/modern/context/SeriesProvider/Series.types.js +1 -0
  238. package/modern/context/SeriesProvider/SeriesContext.js +8 -0
  239. package/modern/context/SeriesProvider/SeriesProvider.js +30 -0
  240. package/modern/context/SeriesProvider/index.js +8 -0
  241. package/modern/context/{SeriesContextProvider.js → SeriesProvider/processSeries.js} +10 -35
  242. package/modern/context/ZAxisContextProvider.js +1 -1
  243. package/modern/hooks/useAxisEvents.js +12 -8
  244. package/modern/hooks/useReducedMotion.js +2 -2
  245. package/modern/hooks/useSeries.js +1 -1
  246. package/modern/index.js +1 -1
  247. package/modern/internals/SlotComponentPropsFromProps.js +1 -0
  248. package/modern/internals/colorScale.js +1 -1
  249. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  250. package/modern/internals/geometry.js +1 -1
  251. package/modern/internals/getCurve.js +1 -1
  252. package/modern/internals/getPercentageValue.js +1 -1
  253. package/modern/internals/getScale.js +1 -1
  254. package/modern/internals/index.js +1 -1
  255. package/modern/internals/stackSeries.js +1 -1
  256. package/modern/internals/useAnimatedPath.js +1 -1
  257. package/modern/internals/warning.js +19 -11
  258. package/package.json +8 -25
  259. package/context/SeriesContextProvider.js +0 -81
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { stack as d3Stack } from 'd3-shape';
2
+ import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { getStackingGroups } from '../internals/stackSeries';
4
4
  import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
5
5
  let warnedOnce = false;
@@ -31,7 +31,7 @@ const formatter = (params, dataset) => {
31
31
  }
32
32
  });
33
33
  } else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
34
- throw new Error([`MUI X Charts: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
34
+ throw new Error([`MUI X: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
35
35
  }
36
36
  });
37
37
  const completedSeries = {};
@@ -56,7 +56,7 @@ const formatter = (params, dataset) => {
56
56
  if (typeof value !== 'number') {
57
57
  if (process.env.NODE_ENV !== 'production' && !warnedOnce && value !== null) {
58
58
  warnedOnce = true;
59
- console.error([`MUI X charts: your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
59
+ console.error([`MUI X: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
60
60
  }
61
61
  return null;
62
62
  }
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle", "highlightScope"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { arc as d3Arc } from 'd3-shape';
6
+ import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
7
7
  import { animated, to } from '@react-spring/web';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
@@ -73,6 +73,7 @@ function PieArc(props) {
73
73
  innerRadius: iR,
74
74
  outerRadius: oR
75
75
  })),
76
+ visibility: to([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible'),
76
77
  onClick: onClick,
77
78
  cursor: onClick ? 'pointer' : 'unset',
78
79
  ownerState: ownerState,
@@ -4,7 +4,7 @@ const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingA
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { animated, to } from '@react-spring/web';
7
- import { arc as d3Arc } from 'd3-shape';
7
+ import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
9
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
10
10
  import { styled } from '@mui/material/styles';
@@ -284,7 +284,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
284
284
  * An array of [[AxisConfig]] objects.
285
285
  */
286
286
  xAxis: PropTypes.arrayOf(PropTypes.shape({
287
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
288
287
  classes: PropTypes.object,
289
288
  colorMap: PropTypes.oneOfType([PropTypes.shape({
290
289
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -337,7 +336,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
337
336
  * An array of [[AxisConfig]] objects.
338
337
  */
339
338
  yAxis: PropTypes.arrayOf(PropTypes.shape({
340
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
341
339
  classes: PropTypes.object,
342
340
  colorMap: PropTypes.oneOfType([PropTypes.shape({
343
341
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { pie as d3Pie } from 'd3-shape';
2
+ import { pie as d3Pie } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { getLabel } from '../internals/getLabel';
4
4
  const getSortingComparator = (comparator = 'none') => {
5
5
  if (typeof comparator === 'function') {
@@ -96,7 +96,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
96
96
  * An array of [[AxisConfig]] objects.
97
97
  */
98
98
  xAxis: PropTypes.arrayOf(PropTypes.shape({
99
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
100
99
  classes: PropTypes.object,
101
100
  colorMap: PropTypes.oneOfType([PropTypes.shape({
102
101
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -149,7 +148,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
149
148
  * An array of [[AxisConfig]] objects.
150
149
  */
151
150
  yAxis: PropTypes.arrayOf(PropTypes.shape({
152
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
153
151
  classes: PropTypes.object,
154
152
  colorMap: PropTypes.oneOfType([PropTypes.shape({
155
153
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -54,11 +54,11 @@ export const useChartContainerDimensions = (inWidth, inHeight) => {
54
54
  }, [computeSize, inHeight, inWidth]);
55
55
  if (process.env.NODE_ENV !== 'production') {
56
56
  if (displayError.current && inWidth === undefined && width === 0) {
57
- console.error(`MUI X Charts: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`);
57
+ console.error(`MUI X: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`);
58
58
  displayError.current = false;
59
59
  }
60
60
  if (displayError.current && inHeight === undefined && height === 0) {
61
- console.error(`MUI X Charts: ChartContainer does not have \`height\` prop, and its container has no \`height\` defined.`);
61
+ console.error(`MUI X: ChartContainer does not have \`height\` prop, and its container has no \`height\` defined.`);
62
62
  displayError.current = false;
63
63
  }
64
64
  }
@@ -41,7 +41,10 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
41
41
  ref: ref
42
42
  }, chartContainerProps, {
43
43
  children: /*#__PURE__*/_jsxs(ZAxisContextProvider, _extends({}, zAxisProps, {
44
- children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), props.grid && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), children]
44
+ children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), props.grid && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
45
+ "data-drawing-container": true,
46
+ children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
47
+ }), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), children]
45
48
  }))
46
49
  }));
47
50
  });
@@ -218,7 +221,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
218
221
  * An array of [[AxisConfig]] objects.
219
222
  */
220
223
  xAxis: PropTypes.arrayOf(PropTypes.shape({
221
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
222
224
  classes: PropTypes.object,
223
225
  colorMap: PropTypes.oneOfType([PropTypes.shape({
224
226
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -271,7 +273,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
271
273
  * An array of [[AxisConfig]] objects.
272
274
  */
273
275
  yAxis: PropTypes.arrayOf(PropTypes.shape({
274
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
275
276
  classes: PropTypes.object,
276
277
  colorMap: PropTypes.oneOfType([PropTypes.shape({
277
278
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -53,12 +53,15 @@ function ScatterPlot(props) {
53
53
  xAxisKey,
54
54
  yAxisKey,
55
55
  zAxisKey,
56
+ xAxisId,
57
+ yAxisId,
58
+ zAxisId,
56
59
  markerSize,
57
60
  color
58
61
  } = series[seriesId];
59
- const colorGetter = getColor(series[seriesId], xAxis[xAxisKey ?? defaultXAxisId], yAxis[yAxisKey ?? defaultYAxisId], zAxis[zAxisKey ?? defaultZAxisId]);
60
- const xScale = xAxis[xAxisKey ?? defaultXAxisId].scale;
61
- const yScale = yAxis[yAxisKey ?? defaultYAxisId].scale;
62
+ const colorGetter = getColor(series[seriesId], xAxis[xAxisId ?? xAxisKey ?? defaultXAxisId], yAxis[yAxisId ?? yAxisKey ?? defaultYAxisId], zAxis[zAxisId ?? zAxisKey ?? defaultZAxisId]);
63
+ const xScale = xAxis[xAxisId ?? xAxisKey ?? defaultXAxisId].scale;
64
+ const yScale = yAxis[yAxisId ?? yAxisKey ?? defaultYAxisId].scale;
62
65
  return /*#__PURE__*/_jsx(ScatterItems, _extends({
63
66
  xScale: xScale,
64
67
  yScale: yScale,
@@ -13,7 +13,10 @@ export const getExtremumX = params => {
13
13
  axis,
14
14
  isDefaultAxis
15
15
  } = params;
16
- return Object.keys(series).filter(seriesId => series[seriesId].xAxisKey === axis.id || series[seriesId].xAxisKey === undefined && isDefaultAxis).reduce((acc, seriesId) => {
16
+ return Object.keys(series).filter(seriesId => {
17
+ const axisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey;
18
+ return axisId === axis.id || axisId === undefined && isDefaultAxis;
19
+ }).reduce((acc, seriesId) => {
17
20
  const seriesMinMax = series[seriesId].data.reduce((accSeries, {
18
21
  x
19
22
  }) => {
@@ -29,7 +32,10 @@ export const getExtremumY = params => {
29
32
  axis,
30
33
  isDefaultAxis
31
34
  } = params;
32
- return Object.keys(series).filter(seriesId => series[seriesId].yAxisKey === axis.id || series[seriesId].yAxisKey === undefined && isDefaultAxis).reduce((acc, seriesId) => {
35
+ return Object.keys(series).filter(seriesId => {
36
+ const axisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
37
+ return axisId === axis.id || axisId === undefined && isDefaultAxis;
38
+ }).reduce((acc, seriesId) => {
33
39
  const seriesMinMax = series[seriesId].data.reduce((accSeries, {
34
40
  y
35
41
  }) => {
@@ -245,7 +245,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
245
245
  * Notice it is a single [[AxisConfig]] object, not an array of configuration.
246
246
  */
247
247
  xAxis: PropTypes.shape({
248
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
249
248
  classes: PropTypes.object,
250
249
  colorMap: PropTypes.oneOfType([PropTypes.shape({
251
250
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -297,7 +296,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
297
296
  * Notice it is a single [[AxisConfig]] object, not an array of configuration.
298
297
  */
299
298
  yAxis: PropTypes.shape({
300
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
301
299
  classes: PropTypes.object,
302
300
  colorMap: PropTypes.oneOfType([PropTypes.shape({
303
301
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { scaleBand, scalePoint, scaleTime } from 'd3-scale';
2
+ import { scaleBand, scalePoint, scaleTime } from '@mui/x-charts-vendor/d3-scale';
3
3
  import { isBandScaleConfig, isPointScaleConfig } from '../../models/axis';
4
4
  import { getColorScale, getOrdinalColorScale } from '../../internals/colorScale';
5
5
  import { getTickNumber } from '../../hooks/useTicks';
@@ -6,7 +6,7 @@ export const normalizeAxis = (axis, dataset, axisName) => {
6
6
  return axisConfig;
7
7
  }
8
8
  if (dataset === undefined) {
9
- throw Error(`MUI X Charts: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
9
+ throw Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
10
10
  }
11
11
  return _extends({}, axisConfig, {
12
12
  data: dataset.map(d => d[dataKey])
@@ -42,7 +42,13 @@ export function DrawingProvider(props) {
42
42
  const isPointInside = React.useCallback(({
43
43
  x,
44
44
  y
45
- }) => x >= drawingArea.left && x <= drawingArea.left + drawingArea.width && y >= drawingArea.top && y <= drawingArea.top + drawingArea.height, [drawingArea]);
45
+ }, targetElement) => {
46
+ // For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
47
+ if (targetElement && targetElement.closest('[data-drawing-container]')) {
48
+ return true;
49
+ }
50
+ return x >= drawingArea.left && x <= drawingArea.left + drawingArea.width && y >= drawingArea.top && y <= drawingArea.top + drawingArea.height;
51
+ }, [drawingArea]);
46
52
  const value = React.useMemo(() => _extends({
47
53
  chartId: chartId ?? ''
48
54
  }, drawingArea, {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export const SeriesContext = /*#__PURE__*/React.createContext({
3
+ isInitialized: false,
4
+ data: {}
5
+ });
6
+ if (process.env.NODE_ENV !== 'production') {
7
+ SeriesContext.displayName = 'SeriesContext';
8
+ }
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { useTheme } from '@mui/material/styles';
3
+ import { blueberryTwilightPalette } from '../../colorPalettes';
4
+ import { SeriesContext } from './SeriesContext';
5
+ import { preprocessSeries } from './processSeries';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ function SeriesProvider(props) {
8
+ const {
9
+ series,
10
+ dataset,
11
+ colors = blueberryTwilightPalette,
12
+ seriesFormatters,
13
+ children
14
+ } = props;
15
+ const theme = useTheme();
16
+ const formattedSeries = React.useMemo(() => ({
17
+ isInitialized: true,
18
+ data: preprocessSeries({
19
+ series,
20
+ colors: typeof colors === 'function' ? colors(theme.palette.mode) : colors,
21
+ seriesFormatters,
22
+ dataset: dataset
23
+ })
24
+ }), [series, colors, theme.palette.mode, seriesFormatters, dataset]);
25
+ return /*#__PURE__*/_jsx(SeriesContext.Provider, {
26
+ value: formattedSeries,
27
+ children: children
28
+ });
29
+ }
30
+ export { SeriesProvider };
@@ -0,0 +1,8 @@
1
+ import { preprocessSeries } from './processSeries';
2
+ export * from './SeriesProvider';
3
+ export * from './SeriesContext';
4
+ export * from './Series.types';
5
+ const seriesProviderUtils = {
6
+ preprocessSeries
7
+ };
8
+ export { seriesProviderUtils };
@@ -1,25 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { useTheme } from '@mui/material/styles';
4
- import { defaultizeColor } from '../internals/defaultizeColor';
5
- import { blueberryTwilightPalette } from '../colorPalettes';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- export const SeriesContext = /*#__PURE__*/React.createContext({
8
- isInitialized: false,
9
- data: {}
10
- });
11
- if (process.env.NODE_ENV !== 'production') {
12
- SeriesContext.displayName = 'SeriesContext';
13
- }
2
+ import { defaultizeColor } from '../../internals/defaultizeColor';
14
3
  /**
15
4
  * This methods is the interface between what the developer is providing and what components receives
16
5
  * To simplify the components behaviors, it groups series by type, such that LinePlots props are not updated if some line data are modified
17
6
  * It also add defaultized values such as the ids, colors
18
- * @param series The array of series provided by devs
7
+ * @param series The array of series provided by the developer
19
8
  * @param colors The color palette used to defaultize series colors
20
9
  * @returns An object structuring all the series by type.
21
10
  */
22
- const preprocessSeries = (series, colors, seriesFormatters, dataset) => {
11
+ export const preprocessSeries = ({
12
+ series,
13
+ colors,
14
+ seriesFormatters,
15
+ dataset
16
+ }) => {
23
17
  // Group series by type
24
18
  const seriesGroups = {};
25
19
  series.forEach((seriesData, seriesIndex) => {
@@ -34,7 +28,7 @@ const preprocessSeries = (series, colors, seriesFormatters, dataset) => {
34
28
  };
35
29
  }
36
30
  if (seriesGroups[type]?.series[id] !== undefined) {
37
- throw new Error(`MUI X Charts: series' id "${id}" is not unique.`);
31
+ throw new Error(`MUI X: series' id "${id}" is not unique.`);
38
32
  }
39
33
  seriesGroups[type].series[id] = _extends({
40
34
  id
@@ -50,23 +44,4 @@ const preprocessSeries = (series, colors, seriesFormatters, dataset) => {
50
44
  }
51
45
  });
52
46
  return formattedSeries;
53
- };
54
- function SeriesContextProvider(props) {
55
- const {
56
- series,
57
- dataset,
58
- colors = blueberryTwilightPalette,
59
- seriesFormatters,
60
- children
61
- } = props;
62
- const theme = useTheme();
63
- const formattedSeries = React.useMemo(() => ({
64
- isInitialized: true,
65
- data: preprocessSeries(series, typeof colors === 'function' ? colors(theme.palette.mode) : colors, seriesFormatters, dataset)
66
- }), [series, colors, theme.palette.mode, seriesFormatters, dataset]);
67
- return /*#__PURE__*/_jsx(SeriesContext.Provider, {
68
- value: formattedSeries,
69
- children: children
70
- });
71
- }
72
- export { SeriesContextProvider };
47
+ };
@@ -22,7 +22,7 @@ function ZAxisContextProvider(props) {
22
22
  return axisConfig;
23
23
  }
24
24
  if (dataset === undefined) {
25
- throw Error('MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.');
25
+ throw Error('MUI X: z-axis uses `dataKey` but no `dataset` is provided.');
26
26
  }
27
27
  return _extends({}, axisConfig, {
28
28
  data: dataset.map(d => d[dataKey])
@@ -25,6 +25,7 @@ export const useAxisEvents = disableAxisListener => {
25
25
 
26
26
  // Use a ref to avoid rerendering on every mousemove event.
27
27
  const mousePosition = React.useRef({
28
+ isInChart: false,
28
29
  x: -1,
29
30
  y: -1
30
31
  });
@@ -84,6 +85,7 @@ export const useAxisEvents = disableAxisListener => {
84
85
  }
85
86
  const handleOut = () => {
86
87
  mousePosition.current = {
88
+ isInChart: false,
87
89
  x: -1,
88
90
  y: -1
89
91
  };
@@ -94,16 +96,18 @@ export const useAxisEvents = disableAxisListener => {
94
96
  const handleMove = event => {
95
97
  const target = 'targetTouches' in event ? event.targetTouches[0] : event;
96
98
  const svgPoint = getSVGPoint(element, target);
97
- mousePosition.current = {
98
- x: svgPoint.x,
99
- y: svgPoint.y
100
- };
101
- if (!drawingArea.isPointInside(svgPoint)) {
102
- dispatch({
103
- type: 'exitChart'
104
- });
99
+ mousePosition.current.x = svgPoint.x;
100
+ mousePosition.current.y = svgPoint.y;
101
+ if (!drawingArea.isPointInside(svgPoint, event.target)) {
102
+ if (mousePosition.current.isInChart) {
103
+ dispatch({
104
+ type: 'exitChart'
105
+ });
106
+ mousePosition.current.isInChart = false;
107
+ }
105
108
  return;
106
109
  }
110
+ mousePosition.current.isInChart = true;
107
111
  const newStateX = getNewAxisState(xAxis[usedXAxis], svgPoint.x);
108
112
  const newStateY = getNewAxisState(yAxis[usedYAxis], svgPoint.y);
109
113
  dispatch({
@@ -19,10 +19,10 @@ export const useReducedMotion = () => {
19
19
  return () => {};
20
20
  }
21
21
  const mql = window.matchMedia('(prefers-reduced-motion)');
22
- const handleMediaChange = e => {
22
+ const handleMediaChange = event => {
23
23
  Globals.assign({
24
24
  // Modification such the react-spring implementation such that this hook can remove animation but never activate animation.
25
- skipAnimation: e.matches || undefined
25
+ skipAnimation: event.matches || undefined
26
26
  });
27
27
  };
28
28
  handleMediaChange(mql);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SeriesContext } from '../context/SeriesContextProvider';
2
+ import { SeriesContext } from '../context/SeriesProvider';
3
3
 
4
4
  /**
5
5
  * Get access to the internal state of series.
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { scaleOrdinal, scaleThreshold, scaleSequential } from 'd3-scale';
1
+ import { scaleOrdinal, scaleThreshold, scaleSequential } from '@mui/x-charts-vendor/d3-scale';
2
2
  export function getSequentialColorScale(config) {
3
3
  if (config.type === 'piecewise') {
4
4
  return scaleThreshold(config.thresholds, config.colors);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { interpolateDate, interpolateNumber } from 'd3-interpolate';
2
+ import { interpolateDate, interpolateNumber } from '@mui/x-charts-vendor/d3-interpolate';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  const PX_PRECISION = 10;
5
5
  export default function ChartsContinuousGradient(props) {
@@ -14,7 +14,7 @@ export function getMinXTranslation(width, height, angle = 0) {
14
14
  if (process.env.NODE_ENV !== 'production') {
15
15
  if (!warnedOnce && angle > 90 && angle < -90) {
16
16
  warnedOnce = true;
17
- console.warn([`MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° 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'));
17
+ console.warn([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° 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
18
  }
19
19
  }
20
20
  const standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
@@ -1,4 +1,4 @@
1
- import { curveCatmullRom, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from 'd3-shape';
1
+ import { curveCatmullRom, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from '@mui/x-charts-vendor/d3-shape';
2
2
  export default function getCurveFactory(curveType) {
3
3
  switch (curveType) {
4
4
  case 'catmullRom':
@@ -24,5 +24,5 @@ export function getPercentageValue(value, refValue) {
24
24
  return val;
25
25
  }
26
26
  }
27
- throw Error(`MUI X Charts: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
27
+ throw Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
28
28
  }
@@ -1,4 +1,4 @@
1
- import { scaleLog, scalePow, scaleSqrt, scaleTime, scaleUtc, scaleLinear } from 'd3-scale';
1
+ import { scaleLog, scalePow, scaleSqrt, scaleTime, scaleUtc, scaleLinear } from '@mui/x-charts-vendor/d3-scale';
2
2
  export function getScale(scaleType, domain, range) {
3
3
  switch (scaleType) {
4
4
  case 'log':
@@ -27,7 +27,7 @@ export * from '../context/CartesianProvider';
27
27
  export * from '../context/DrawingProvider';
28
28
  export * from '../context/ColorProvider';
29
29
  export * from '../context/InteractionProvider';
30
- export * from '../context/SeriesContextProvider';
30
+ export * from '../context/SeriesProvider';
31
31
  export * from '../context/ZAxisContextProvider';
32
32
  // series configuration
33
33
  export * from '../models/seriesType/config';
@@ -1,4 +1,4 @@
1
- import { stackOrderAppearance as d3StackOrderAppearance, stackOrderAscending as d3StackOrderAscending, stackOrderDescending as d3StackOrderDescending, stackOrderInsideOut as d3StackOrderInsideOut, stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOffsetExpand as d3StackOffsetExpand, stackOffsetDiverging as d3StackOffsetDiverging, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle } from 'd3-shape';
1
+ import { stackOrderAppearance as d3StackOrderAppearance, stackOrderAscending as d3StackOrderAscending, stackOrderDescending as d3StackOrderDescending, stackOrderInsideOut as d3StackOrderInsideOut, stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOffsetExpand as d3StackOffsetExpand, stackOffsetDiverging as d3StackOffsetDiverging, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle } from '@mui/x-charts-vendor/d3-shape';
2
2
  export const StackOrder = {
3
3
  /**
4
4
  * Series order such that the earliest series (according to the maximum value) is at the bottom.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { interpolateString } from 'd3-interpolate';
2
+ import { interpolateString } from '@mui/x-charts-vendor/d3-interpolate';
3
3
  import { useSpring, to } from '@react-spring/web';
4
4
  function usePrevious(value) {
5
5
  const ref = React.useRef(null);
@@ -1,13 +1,21 @@
1
- export function buildWarning(message, gravity = 'warning') {
2
- let alreadyWarned = false;
3
- return (...args) => {
4
- if (!alreadyWarned) {
5
- alreadyWarned = true;
6
- if (gravity === 'error') {
7
- console.error(message(...args));
8
- } else {
9
- console.warn(message(...args));
10
- }
1
+ const warnedOnceCache = new Set();
2
+
3
+ // TODO move to @mui/x-internals
4
+ // TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
5
+ export function warnOnce(message, gravity = 'warning') {
6
+ if (process.env.NODE_ENV === 'production') {
7
+ return;
8
+ }
9
+ const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
10
+ if (!warnedOnceCache.has(cleanMessage)) {
11
+ warnedOnceCache.add(cleanMessage);
12
+ if (gravity === 'error') {
13
+ console.error(cleanMessage);
14
+ } else {
15
+ console.warn(cleanMessage);
11
16
  }
12
- };
17
+ }
18
+ }
19
+ export function clearWarningsCache() {
20
+ warnedOnceCache.clear();
13
21
  }
@@ -33,6 +33,7 @@ const useAxisEvents = disableAxisListener => {
33
33
 
34
34
  // Use a ref to avoid rerendering on every mousemove event.
35
35
  const mousePosition = React.useRef({
36
+ isInChart: false,
36
37
  x: -1,
37
38
  y: -1
38
39
  });
@@ -92,6 +93,7 @@ const useAxisEvents = disableAxisListener => {
92
93
  }
93
94
  const handleOut = () => {
94
95
  mousePosition.current = {
96
+ isInChart: false,
95
97
  x: -1,
96
98
  y: -1
97
99
  };
@@ -102,16 +104,18 @@ const useAxisEvents = disableAxisListener => {
102
104
  const handleMove = event => {
103
105
  const target = 'targetTouches' in event ? event.targetTouches[0] : event;
104
106
  const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, target);
105
- mousePosition.current = {
106
- x: svgPoint.x,
107
- y: svgPoint.y
108
- };
109
- if (!drawingArea.isPointInside(svgPoint)) {
110
- dispatch({
111
- type: 'exitChart'
112
- });
107
+ mousePosition.current.x = svgPoint.x;
108
+ mousePosition.current.y = svgPoint.y;
109
+ if (!drawingArea.isPointInside(svgPoint, event.target)) {
110
+ if (mousePosition.current.isInChart) {
111
+ dispatch({
112
+ type: 'exitChart'
113
+ });
114
+ mousePosition.current.isInChart = false;
115
+ }
113
116
  return;
114
117
  }
118
+ mousePosition.current.isInChart = true;
115
119
  const newStateX = getNewAxisState(xAxis[usedXAxis], svgPoint.x);
116
120
  const newStateY = getNewAxisState(yAxis[usedYAxis], svgPoint.y);
117
121
  dispatch({
@@ -24,10 +24,10 @@ const useReducedMotion = () => {
24
24
  return () => {};
25
25
  }
26
26
  const mql = window.matchMedia('(prefers-reduced-motion)');
27
- const handleMediaChange = e => {
27
+ const handleMediaChange = event => {
28
28
  _web.Globals.assign({
29
29
  // Modification such the react-spring implementation such that this hook can remove animation but never activate animation.
30
- skipAnimation: e.matches || undefined
30
+ skipAnimation: event.matches || undefined
31
31
  });
32
32
  };
33
33
  handleMediaChange(mql);
@@ -1,4 +1,4 @@
1
- import { FormattedSeries } from '../context/SeriesContextProvider';
1
+ import { FormattedSeries } from '../context/SeriesProvider';
2
2
  /**
3
3
  * Get access to the internal state of series.
4
4
  * Structured by type of series:
@@ -9,7 +9,7 @@ exports.usePieSeries = usePieSeries;
9
9
  exports.useScatterSeries = useScatterSeries;
10
10
  exports.useSeries = useSeries;
11
11
  var React = _interopRequireWildcard(require("react"));
12
- var _SeriesContextProvider = require("../context/SeriesContextProvider");
12
+ var _SeriesProvider = require("../context/SeriesProvider");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  /**
@@ -22,7 +22,7 @@ function useSeries() {
22
22
  const {
23
23
  isInitialized,
24
24
  data
25
- } = React.useContext(_SeriesContextProvider.SeriesContext);
25
+ } = React.useContext(_SeriesProvider.SeriesContext);
26
26
  if (!isInitialized) {
27
27
  throw new Error(['MUI X: Could not find the series ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
28
28
  }