@mui/x-charts 8.4.0 → 8.5.1

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 (194) hide show
  1. package/BarChart/BarChart.d.ts +9 -2
  2. package/BarChart/BarChart.js +7 -1
  3. package/BarChart/BarLabel/BarLabel.d.ts +1 -1
  4. package/BarChart/seriesConfig/seriesProcessor.js +1 -1
  5. package/BarChart/useBarChartProps.js +1 -1
  6. package/CHANGELOG.md +215 -0
  7. package/ChartContainer/ChartContainer.d.ts +21 -2
  8. package/ChartContainer/ChartContainer.js +16 -0
  9. package/ChartContainer/useChartContainerProps.js +7 -3
  10. package/ChartDataProvider/ChartDataProvider.d.ts +11 -1
  11. package/ChartDataProvider/ChartDataProvider.js +19 -2
  12. package/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
  13. package/ChartDataProvider/useChartDataProviderProps.js +7 -3
  14. package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +1 -1
  15. package/ChartsGrid/styledComponents.d.ts +2 -2
  16. package/ChartsReferenceLine/common.d.ts +1 -1
  17. package/ChartsTooltip/ChartsTooltip.js +1 -1
  18. package/ChartsTooltip/ChartsTooltipContainer.js +21 -16
  19. package/ChartsTooltip/ChartsTooltipTable.d.ts +4 -4
  20. package/ChartsTooltip/utils.d.ts +6 -0
  21. package/ChartsTooltip/utils.js +19 -1
  22. package/LineChart/LineChart.d.ts +9 -2
  23. package/LineChart/LineChart.js +7 -1
  24. package/LineChart/useLineChartProps.js +1 -1
  25. package/PieChart/PieChart.d.ts +10 -3
  26. package/PieChart/PieChart.js +12 -11
  27. package/RadarChart/RadarChart.d.ts +21 -3
  28. package/RadarChart/RadarChart.js +16 -2
  29. package/RadarChart/RadarChart.plugins.d.ts +5 -0
  30. package/RadarChart/RadarChart.plugins.js +10 -0
  31. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
  32. package/RadarChart/RadarDataProvider/RadarDataProvider.js +6 -116
  33. package/RadarChart/index.d.ts +2 -0
  34. package/RadarChart/index.js +15 -1
  35. package/RadarChart/useRadarChartProps.d.ts +2 -1
  36. package/RadarChart/useRadarChartProps.js +3 -1
  37. package/ScatterChart/ScatterChart.d.ts +9 -2
  38. package/ScatterChart/ScatterChart.js +7 -1
  39. package/ScatterChart/useScatterChartProps.js +4 -2
  40. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  41. package/Toolbar/Toolbar.d.ts +11 -4
  42. package/Toolbar/Toolbar.js +38 -7
  43. package/Toolbar/Toolbar.types.d.ts +15 -0
  44. package/Toolbar/Toolbar.types.js +5 -0
  45. package/Toolbar/ToolbarButton.d.ts +8 -2
  46. package/Toolbar/ToolbarButton.js +39 -7
  47. package/Toolbar/chartToolbarClasses.d.ts +6 -0
  48. package/Toolbar/chartToolbarClasses.js +9 -0
  49. package/Toolbar/index.d.ts +3 -1
  50. package/Toolbar/index.js +22 -0
  51. package/context/ChartsSlotsContext.d.ts +20 -0
  52. package/context/ChartsSlotsContext.js +44 -0
  53. package/context/index.d.ts +2 -1
  54. package/context/index.js +11 -0
  55. package/context/useChartApiContext.d.ts +10 -0
  56. package/context/useChartApiContext.js +27 -0
  57. package/esm/BarChart/BarChart.d.ts +9 -2
  58. package/esm/BarChart/BarChart.js +7 -1
  59. package/esm/BarChart/BarLabel/BarLabel.d.ts +1 -1
  60. package/esm/BarChart/seriesConfig/seriesProcessor.js +1 -1
  61. package/esm/BarChart/useBarChartProps.js +1 -1
  62. package/esm/ChartContainer/ChartContainer.d.ts +21 -2
  63. package/esm/ChartContainer/ChartContainer.js +16 -0
  64. package/esm/ChartContainer/useChartContainerProps.js +7 -3
  65. package/esm/ChartDataProvider/ChartDataProvider.d.ts +11 -1
  66. package/esm/ChartDataProvider/ChartDataProvider.js +19 -2
  67. package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
  68. package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -3
  69. package/esm/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +1 -1
  70. package/esm/ChartsGrid/styledComponents.d.ts +2 -2
  71. package/esm/ChartsReferenceLine/common.d.ts +1 -1
  72. package/esm/ChartsTooltip/ChartsTooltip.js +1 -1
  73. package/esm/ChartsTooltip/ChartsTooltipContainer.js +22 -17
  74. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +4 -4
  75. package/esm/ChartsTooltip/utils.d.ts +6 -0
  76. package/esm/ChartsTooltip/utils.js +16 -1
  77. package/esm/LineChart/LineChart.d.ts +9 -2
  78. package/esm/LineChart/LineChart.js +7 -1
  79. package/esm/LineChart/useLineChartProps.js +1 -1
  80. package/esm/PieChart/PieChart.d.ts +10 -3
  81. package/esm/PieChart/PieChart.js +12 -11
  82. package/esm/RadarChart/RadarChart.d.ts +21 -3
  83. package/esm/RadarChart/RadarChart.js +16 -2
  84. package/esm/RadarChart/RadarChart.plugins.d.ts +5 -0
  85. package/esm/RadarChart/RadarChart.plugins.js +4 -0
  86. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
  87. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.js +5 -115
  88. package/esm/RadarChart/index.d.ts +2 -0
  89. package/esm/RadarChart/index.js +2 -0
  90. package/esm/RadarChart/useRadarChartProps.d.ts +2 -1
  91. package/esm/RadarChart/useRadarChartProps.js +3 -1
  92. package/esm/ScatterChart/ScatterChart.d.ts +9 -2
  93. package/esm/ScatterChart/ScatterChart.js +7 -1
  94. package/esm/ScatterChart/useScatterChartProps.js +4 -2
  95. package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
  96. package/esm/Toolbar/Toolbar.d.ts +11 -4
  97. package/esm/Toolbar/Toolbar.js +36 -6
  98. package/esm/Toolbar/Toolbar.types.d.ts +15 -0
  99. package/esm/Toolbar/Toolbar.types.js +1 -0
  100. package/esm/Toolbar/ToolbarButton.d.ts +8 -2
  101. package/esm/Toolbar/ToolbarButton.js +39 -6
  102. package/esm/Toolbar/chartToolbarClasses.d.ts +6 -0
  103. package/esm/Toolbar/chartToolbarClasses.js +2 -0
  104. package/esm/Toolbar/index.d.ts +3 -1
  105. package/esm/Toolbar/index.js +3 -1
  106. package/esm/context/ChartsSlotsContext.d.ts +20 -0
  107. package/esm/context/ChartsSlotsContext.js +35 -0
  108. package/esm/context/index.d.ts +2 -1
  109. package/esm/context/index.js +1 -0
  110. package/esm/context/useChartApiContext.d.ts +10 -0
  111. package/esm/context/useChartApiContext.js +21 -0
  112. package/esm/hooks/index.d.ts +1 -0
  113. package/esm/hooks/index.js +1 -0
  114. package/esm/index.js +1 -1
  115. package/esm/internals/components/AxisSharedComponents.d.ts +1 -1
  116. package/esm/internals/components/ChartsWrapper/ChartsWrapper.d.ts +5 -0
  117. package/esm/internals/components/ChartsWrapper/ChartsWrapper.js +22 -3
  118. package/esm/internals/constants.d.ts +10 -1
  119. package/esm/internals/constants.js +10 -1
  120. package/esm/internals/dateHelpers.d.ts +15 -0
  121. package/esm/internals/dateHelpers.js +20 -0
  122. package/esm/internals/domUtils.d.ts +1 -2
  123. package/esm/internals/domUtils.js +8 -19
  124. package/esm/internals/index.d.ts +6 -1
  125. package/esm/internals/index.js +6 -1
  126. package/esm/internals/invertScale.d.ts +2 -0
  127. package/esm/internals/invertScale.js +8 -0
  128. package/esm/internals/material/index.d.ts +2 -0
  129. package/esm/internals/material/index.js +2 -0
  130. package/esm/internals/plugins/allPlugins.d.ts +1 -0
  131. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +2 -8
  132. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
  133. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -3
  134. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
  135. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3000 -0
  136. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -1
  137. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +9 -0
  138. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
  139. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
  140. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -8
  141. package/esm/locales/index.d.ts +3 -1
  142. package/esm/locales/index.js +2 -0
  143. package/esm/locales/ptBR.d.ts +16 -0
  144. package/esm/locales/ptBR.js +9 -0
  145. package/esm/locales/ptPT.d.ts +16 -0
  146. package/esm/locales/ptPT.js +9 -0
  147. package/esm/models/axis.d.ts +2 -1
  148. package/esm/models/index.d.ts +2 -2
  149. package/esm/models/index.js +1 -0
  150. package/esm/models/seriesType/bar.d.ts +2 -2
  151. package/esm/models/slots/chartsBaseSlotProps.d.ts +7 -0
  152. package/esm/models/slots/chartsBaseSlots.d.ts +2 -1
  153. package/hooks/index.d.ts +1 -0
  154. package/hooks/index.js +12 -0
  155. package/index.js +1 -1
  156. package/internals/components/AxisSharedComponents.d.ts +1 -1
  157. package/internals/components/ChartsWrapper/ChartsWrapper.d.ts +5 -0
  158. package/internals/components/ChartsWrapper/ChartsWrapper.js +22 -3
  159. package/internals/constants.d.ts +10 -1
  160. package/internals/constants.js +11 -2
  161. package/internals/dateHelpers.d.ts +15 -0
  162. package/internals/dateHelpers.js +28 -0
  163. package/internals/domUtils.d.ts +1 -2
  164. package/internals/domUtils.js +8 -20
  165. package/internals/index.d.ts +6 -1
  166. package/internals/index.js +68 -8
  167. package/internals/invertScale.d.ts +2 -0
  168. package/internals/invertScale.js +14 -0
  169. package/internals/material/index.d.ts +2 -0
  170. package/internals/material/index.js +2 -0
  171. package/internals/plugins/allPlugins.d.ts +1 -0
  172. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -11
  173. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
  174. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -3
  175. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
  176. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3000 -0
  177. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +10 -2
  178. package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +9 -0
  179. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
  180. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
  181. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +5 -11
  182. package/locales/index.d.ts +3 -1
  183. package/locales/index.js +22 -0
  184. package/locales/ptBR.d.ts +16 -0
  185. package/locales/ptBR.js +15 -0
  186. package/locales/ptPT.d.ts +16 -0
  187. package/locales/ptPT.js +15 -0
  188. package/models/axis.d.ts +2 -1
  189. package/models/index.d.ts +2 -2
  190. package/models/index.js +11 -0
  191. package/models/seriesType/bar.d.ts +2 -2
  192. package/models/slots/chartsBaseSlotProps.d.ts +7 -0
  193. package/models/slots/chartsBaseSlots.d.ts +2 -1
  194. package/package.json +5 -5
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { MakeOptional } from '@mui/x-internals/types';
3
+ import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
4
+ import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
3
5
  import { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from "./BarPlot.js";
4
6
  import { ChartContainerProps } from "../ChartContainer/index.js";
5
7
  import { ChartsAxisProps } from "../ChartsAxis/index.js";
@@ -11,8 +13,8 @@ import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
11
13
  import { ChartsGridProps } from "../ChartsGrid/index.js";
12
14
  import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
13
15
  import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
14
- export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots {}
15
- export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps {}
16
+ export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
17
+ export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
16
18
  export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
17
19
  /**
18
20
  * The series to display in the bar chart.
@@ -50,6 +52,11 @@ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartP
50
52
  * @default 'vertical'
51
53
  */
52
54
  layout?: BarSeriesType['layout'];
55
+ /**
56
+ * If true, shows the default chart toolbar.
57
+ * @default false
58
+ */
59
+ showToolbar?: boolean;
53
60
  }
54
61
  /**
55
62
  * Demos:
@@ -59,9 +59,10 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
59
59
  chartsSurfaceProps
60
60
  } = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
61
61
  const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
62
+ const Toolbar = props.slots?.toolbar;
62
63
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
63
64
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
64
- children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
65
+ children: [props.showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
65
66
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
66
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
67
68
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
@@ -196,6 +197,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
196
197
  * An array of [[BarSeriesType]] objects.
197
198
  */
198
199
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
200
+ /**
201
+ * If true, shows the default chart toolbar.
202
+ * @default false
203
+ */
204
+ showToolbar: _propTypes.default.bool,
199
205
  /**
200
206
  * If `true`, animations are skipped.
201
207
  * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BarLabelOwnerState } from "./BarLabel.types.js";
3
- export declare const BarLabelComponent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
3
+ export declare const BarLabelComponent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
4
4
  export type BarLabelProps = Omit<React.SVGProps<SVGTextElement>, 'ref' | 'id' | 'x' | 'y' | 'width' | 'height'> & BarLabelOwnerState & {
5
5
  /**
6
6
  * The x-coordinate of the stack this bar label belongs to.
@@ -63,7 +63,7 @@ const seriesProcessor = (params, dataset) => {
63
63
  (0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
64
64
  }
65
65
  }
66
- return 0;
66
+ return null;
67
67
  }
68
68
  return value;
69
69
  }) : series[id].data,
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
13
13
  var _useId = _interopRequireDefault(require("@mui/utils/useId"));
14
14
  var _constants = require("../constants");
15
15
  var _BarChart = require("./BarChart.plugins");
16
- const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
16
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend", "showToolbar"];
17
17
  /**
18
18
  * A helper function that extracts BarChartProps from the input props
19
19
  * and returns an object with props for the children components of BarChart.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,221 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.5.1
9
+
10
+ <!-- generated comparing v8.5.0..master -->
11
+
12
+ _Jun 5, 2025_
13
+
14
+ We'd like to extend a big thank you to the 9 contributors who made this release possible. Here are some highlights ✨:
15
+
16
+ - 📊 Allow exporting pie charts
17
+ - 📚 Documentation improvements
18
+ - 🌎 Improve Portuguese (ptPT) translations on the Data Grid
19
+ - 🌎 Improve Portuguese (ptPT, ptBR) translations on Charts
20
+ - 🌎 Improve Arabic (ar-SD) locale
21
+ - 🐞 Bugfixes
22
+
23
+ Special thanks go out to the community members for their valuable contributions: @moosekebab, @TiagoPortfolio.
24
+ The following are all team members who have contributed to this release:
25
+ @alexfauquette, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen, @arminmeh.
26
+
27
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
28
+
29
+ ### Data Grid
30
+
31
+ #### `@mui/x-data-grid@8.5.1`
32
+
33
+ - [DataGrid] Fix `registerPipeProcessor()` for Node v20 (#18241) @arminmeh
34
+ - [DataGrid] Fix background color in column header filler cells (#18188) @KenanYusuf
35
+ - [DataGrid] Keep pipe pre-processors execution order when callback reference changes (#17558) @arminmeh
36
+ - [DataGrid] Use `useComponentRenderer` from x-internals (#18203) @bernardobelchior
37
+ - [l10n] Improve Arabic (ar-SD) locale (#17959) @moosekebab
38
+ - [l10n] Improve Portuguese from Portugal (pt-PT) locale (#18064) @TiagoPortfolio
39
+
40
+ #### `@mui/x-data-grid-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-data-grid@8.5.1`, plus:
43
+
44
+ - [DataGridPro] Skip rendering detail panels of the rows turned into skeleton rows with lazy loading (#17958) @arminmeh
45
+
46
+ #### `@mui/x-data-grid-premium@8.5.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
47
+
48
+ Same changes as in `@mui/x-data-grid-pro@8.5.1`.
49
+
50
+ ### Date and Time Pickers
51
+
52
+ #### `@mui/x-date-pickers@8.5.1`
53
+
54
+ - [pickers] Fix `transformOrigin` resolving based on popper `placement` (#18206) @LukasTy
55
+
56
+ #### `@mui/x-date-pickers-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
57
+
58
+ Same changes as in `@mui/x-date-pickers@8.5.1`.
59
+
60
+ ### Charts
61
+
62
+ #### `@mui/x-charts@8.5.1`
63
+
64
+ - [charts] Allow skipping tooltip render (#18050) @alexfauquette
65
+ - [charts] Fix act warnings in toolbar tests (#18212) @JCQuintas
66
+ - [charts] Fix prop typo in `extendVertically` (#18211) @JCQuintas
67
+ - [charts] Fix responsive height for ChartsWrapper (#18183) @alexfauquette
68
+ - [charts] Improve charts toolbar accessibility (#18056) @bernardobelchior
69
+ - [charts] Let line series propagate null from the dataset (#18223) @alexfauquette
70
+ - [l10n] Add Portuguese locales for charts (pt-PT, pt-BR) (#18069) @bernardobelchior
71
+
72
+ #### `@mui/x-charts-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
73
+
74
+ Same changes as in `@mui/x-charts@8.5.1`, plus:
75
+
76
+ - [charts-pro] Add `linear-sharp` curve as alternative to square edge (#17966) @JCQuintas
77
+ - [charts-pro] Add correct classes to `FunnelSectionLabel` (#18061) @JCQuintas
78
+ - [charts-pro] Allow exporting a pie chart (#18063) @bernardobelchior
79
+ - [charts-pro] Fix initial render for zoom slider selection (#18208) @bernardobelchior
80
+ - [charts-pro] Fix props being passed to DOM in FunnelChart (#18192) @JCQuintas
81
+ - [charts-pro] Show axis value in zoom slider tooltip (#18054) @bernardobelchior
82
+ - [charts-pro] Render the toolbar in the heatmap chart (#18247) @bernardobelchior
83
+
84
+ ### Tree View
85
+
86
+ #### `@mui/x-tree-view@8.5.1`
87
+
88
+ Internal changes.
89
+
90
+ #### `@mui/x-tree-view-pro@8.5.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
91
+
92
+ Same changes as in `@mui/x-tree-view@8.5.1`.
93
+
94
+ ### Docs
95
+
96
+ - [docs] Update `valueFormatter` signature in migration guide (#18226) @michelengelen
97
+
98
+ ### Core
99
+
100
+ - chore(deps): bump @next/eslint-plugin-next to 15.3.3 (#18155) @renovate[bot]
101
+ - chore(deps): bump @types/lodash to ^4.17.17 (#17990) @renovate[bot]
102
+ - chore(deps): bump babel (#18157) @renovate[bot]
103
+ - chore(deps): bump eslint to ^9.28.0 (#17352) @renovate[bot]
104
+ - chore(deps): bump material ui (#17802) @renovate[bot]
105
+ - chore(deps): bump next to ^15.3.3 (#18159) @renovate[bot]
106
+ - chore(deps): bump ossf/scorecard-action action to v2.4.2 (#18160) @renovate[bot]
107
+ - chore(deps): bump react-router to ^7.6.1 (#18162) @renovate[bot]
108
+ - chore(deps): bump yargs to ^18.0.0 (#18169) @renovate[bot]
109
+ - [code-infra] Different approach to console testing for `processRowUpdate` (#18213) @JCQuintas
110
+ - [code-infra] Fix act warnings in DataGrid/toolbar (#18207) @JCQuintas
111
+ - [code-infra] Remove `istanbul` references (#18194) @JCQuintas
112
+ - [code-infra] Remove codesandbox:ci (#18179) @JCQuintas
113
+ - [code-infra] Replace `mocha` with `vitest` on e2e and regression tests (#18071) @JCQuintas
114
+ - [code-infra] Upgrade @mui/internal-test-utils (#18191) @JCQuintas
115
+ - [code-infra] Use vitest for `no-direct-state-access` tests (#18209) @JCQuintas
116
+ - [infra] Improve test setup (#18228) @LukasTy
117
+ - [infra] Update bug and feature request templates to standardize label types (#18198) @michelengelen
118
+ - [infra] Use `playwright` docker image (#18186) @LukasTy
119
+
120
+ ## 8.5.0
121
+
122
+ _May 29, 2025_
123
+
124
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
125
+
126
+ - 📊 Add support for exporting `RadarChartPro`, `FunnelChart` and `Heatmap` as image and PDF.
127
+ - 📊 `RadarChart` is now stable.
128
+
129
+ Special thanks go out to the community members for their valuable contributions:
130
+ @xBlizZer, @sai6855, @alisasanib.
131
+ Following are all team members who have contributed to this release:
132
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @oliviertassinari.
133
+
134
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
135
+
136
+ ### Data Grid
137
+
138
+ #### `@mui/x-data-grid@8.5.0`
139
+
140
+ - [DataGrid] Avoid ResizeObserver loop error (#17984) @cherniavskii
141
+ - [DataGrid] Fix column management `toggleColumn` event type (#18023) @KenanYusuf
142
+ - [DataGrid] Remove unnecessary `any` type (#17979) @sai6855
143
+
144
+ #### `@mui/x-data-grid-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
145
+
146
+ Same changes as in `@mui/x-data-grid@8.5.0`, plus:
147
+
148
+ - [DataGridPro] Allow multi sorting without modifier key (#17925) @cherniavskii
149
+ - [DataGridPro] Row reordering icon improvements (#17947) @KenanYusuf
150
+ - [DataGridPro] Fix pinned columns order in column management (#17950) @alisasanib
151
+
152
+ #### `@mui/x-data-grid-premium@8.5.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
153
+
154
+ Same changes as in `@mui/x-data-grid-pro@8.5.0`, plus:
155
+
156
+ - [DataGridPremium] Export `GridApiPremium` type (#18037) @arminmeh
157
+
158
+ ### Date and Time Pickers
159
+
160
+ #### `@mui/x-date-pickers@8.5.0`
161
+
162
+ Internal changes.
163
+
164
+ #### `@mui/x-date-pickers-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
165
+
166
+ Same changes as in `@mui/x-date-pickers@8.5.0`, plus:
167
+
168
+ - [DateRangePicker] Allow to override the format in the field (#17972) @flaviendelangle
169
+
170
+ ### Charts
171
+
172
+ #### `@mui/x-charts@8.5.0`
173
+
174
+ - [charts] Add `render` prop to charts toolbar components (#17649) @bernardobelchior
175
+ - [charts] Add configurable slots to toolbar (#17712) @bernardobelchior
176
+ - [charts] Export `useFunnelSeries` and `useRadarSeries` (#18034) @JCQuintas
177
+ - [charts] Expose `ChartApi` through context (#18004) @bernardobelchior
178
+ - [charts] Mark Radar chart as stable (#17946) @alexfauquette
179
+ - [charts] Only update store if interaction item is different (#17851) @bernardobelchior
180
+ - [charts] Reuse shared date utils (#18014) @JCQuintas
181
+ - [charts] Use Map for string cache instead of object (#17982) @bernardobelchior
182
+ - [charts] Fix Population pyramid demo (#17987) @oliviertassinari
183
+
184
+ #### `@mui/x-charts-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
185
+
186
+ Same changes as in `@mui/x-charts@8.5.0`, plus:
187
+
188
+ - [charts-pro] Add range selection to zoom slider (#17949) @bernardobelchior
189
+ - [charts-pro] Allow configuring zoom slider tooltip (#18030) @bernardobelchior
190
+ - [charts-pro] Allow exporting a funnel chart (#17957) @bernardobelchior
191
+ - [charts-pro] Allow exporting a heatmap chart (#17916) @bernardobelchior
192
+ - [charts-pro] Allow exporting a radar chart (#17968) @bernardobelchior
193
+ - [charts-pro] Always show both zoom slider tooltips (#18027) @bernardobelchior
194
+ - [charts-pro] Show zoom slider tooltip when selecting range (#18028) @bernardobelchior
195
+ - [charts-pro] Split `ChartAxisZoomSlider` into smaller files (#18011) @bernardobelchior
196
+ - [charts-pro] Update zoom slider range selection cursor (#17977) @bernardobelchior
197
+ - [charts-pro] Add support for Heatmap legend (#17943) @alexfauquette
198
+
199
+ ### Tree View
200
+
201
+ #### `@mui/x-tree-view@8.5.0`
202
+
203
+ Internal changes.
204
+
205
+ #### `@mui/x-tree-view-pro@8.5.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
206
+
207
+ Same changes as in `@mui/x-tree-view@8.5.0`.
208
+
209
+ ### Docs
210
+
211
+ - [docs] Fix derived column pivoting demo crash (#17944) @arminmeh
212
+ - [docs] Fix light/dark mode blink on pickers overview (#18002) @alexfauquette
213
+ - [docs] Fix scatter shape demo causing horizontal overflow (#17974) @bernardobelchior
214
+
215
+ ### Core
216
+
217
+ - [code-infra] Add bundle size monitor (#17754) @Janpot
218
+ - [code-infra] Enable `babel-plugin-display-name` in vitest (#17903) @JCQuintas
219
+ - [infra] Remove last deprecated `ponyfillGlobal` usage (#18003) @LukasTy
220
+ - [infra] Use `babel-plugin-display-name` from npm (#18040) @LukasTy
221
+ - [x-telemetry] Remove deprecated `ponyfillGlobal` (#17986) @xBlizZer
222
+
8
223
  ## 8.4.0
9
224
 
10
225
  _May 21, 2025_
@@ -1,11 +1,30 @@
1
1
  import * as React from 'react';
2
+ import { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
3
+ import { BarChartPluginsSignatures } from "../BarChart/BarChart.plugins.js";
4
+ import { ScatterChartPluginsSignatures } from "../ScatterChart/ScatterChart.plugins.js";
5
+ import { LineChartPluginsSignatures } from "../LineChart/LineChart.plugins.js";
2
6
  import { ChartSeriesType } from "../models/seriesType/config.js";
3
7
  import { ChartDataProviderProps } from "../ChartDataProvider/index.js";
4
8
  import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
5
- import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
9
+ import { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
6
10
  import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
11
+ import { ChartPublicAPI } from "../internals/plugins/models/index.js";
7
12
  export type ChartContainerProps<SeriesType extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<SeriesType>> = Omit<ChartDataProviderProps<SeriesType, TSignatures>, 'children'> & ChartsSurfaceProps;
8
- export type ChartApi = NonNullable<NonNullable<ChartContainerProps['apiRef']>['current']>;
13
+ type PluginsPerSeriesType = {
14
+ line: LineChartPluginsSignatures;
15
+ scatter: ScatterChartPluginsSignatures;
16
+ bar: BarChartPluginsSignatures;
17
+ pie: PieChartPluginSignatures;
18
+ composition: DefaultPluginSignatures;
19
+ };
20
+ /**
21
+ * The API of the chart `apiRef` object.
22
+ * The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
23
+ * @example ChartApi<'bar'>
24
+ * If the chart is being created using composition, the `composition` value can be used.
25
+ * @example ChartApi<'composition'>
26
+ */
27
+ export type ChartApi<TSeries extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (TSeries extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[TSeries] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>;
9
28
  /**
10
29
  * It sets up the data providers as well as the `<svg>` for the chart.
11
30
  *
@@ -14,6 +14,14 @@ var _ChartDataProvider = require("../ChartDataProvider");
14
14
  var _useChartContainerProps = require("./useChartContainerProps");
15
15
  var _ChartsSurface = require("../ChartsSurface");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
+ /**
18
+ * The API of the chart `apiRef` object.
19
+ * The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
20
+ * @example ChartApi<'bar'>
21
+ * If the chart is being created using composition, the `composition` value can be used.
22
+ * @example ChartApi<'composition'>
23
+ */
24
+
17
25
  /**
18
26
  * It sets up the data providers as well as the `<svg>` for the chart.
19
27
  *
@@ -593,6 +601,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
593
601
  * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
594
602
  */
595
603
  skipAnimation: _propTypes.default.bool,
604
+ /**
605
+ * The props for the slots.
606
+ */
607
+ slotProps: _propTypes.default.object,
608
+ /**
609
+ * Slots to customize charts' components.
610
+ */
611
+ slots: _propTypes.default.object,
596
612
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
597
613
  theme: _propTypes.default.oneOf(['dark', 'light']),
598
614
  title: _propTypes.default.string,
@@ -9,7 +9,7 @@ exports.useChartContainerProps = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _allPlugins = require("../internals/plugins/allPlugins");
12
- const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText"];
12
+ const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps"];
13
13
  const useChartContainerProps = (props, ref) => {
14
14
  const _ref = props,
15
15
  {
@@ -38,7 +38,9 @@ const useChartContainerProps = (props, ref) => {
38
38
  skipAnimation,
39
39
  seriesConfig,
40
40
  plugins,
41
- localeText
41
+ localeText,
42
+ slots,
43
+ slotProps
42
44
  } = _ref,
43
45
  other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
44
46
  const chartsSurfaceProps = (0, _extends2.default)({
@@ -69,7 +71,9 @@ const useChartContainerProps = (props, ref) => {
69
71
  height,
70
72
  localeText,
71
73
  seriesConfig,
72
- plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS
74
+ plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS,
75
+ slots,
76
+ slotProps
73
77
  };
74
78
  return {
75
79
  chartDataProviderProps,
@@ -1,10 +1,20 @@
1
1
  import * as React from 'react';
2
+ import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
2
3
  import { ChartProviderProps } from "../context/ChartProvider/index.js";
3
4
  import { ChartSeriesType } from "../models/seriesType/config.js";
4
5
  import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
5
6
  import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
6
7
  import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
7
- export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps;
8
+ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps & {
9
+ /**
10
+ * Slots to customize charts' components.
11
+ */
12
+ slots?: Partial<ChartsSlots>;
13
+ /**
14
+ * The props for the slots.
15
+ */
16
+ slotProps?: Partial<ChartsSlotProps>;
17
+ };
8
18
  /**
9
19
  * Orchestrates the data providers for the chart components and hooks.
10
20
  *
@@ -10,6 +10,8 @@ exports.ChartDataProvider = ChartDataProvider;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _material = require("../internals/material");
14
+ var _ChartsSlotsContext = require("../context/ChartsSlotsContext");
13
15
  var _useChartDataProviderProps = require("./useChartDataProviderProps");
14
16
  var _ChartProvider = require("../context/ChartProvider");
15
17
  var _ChartsLocalizationProvider = require("../ChartsLocalizationProvider");
@@ -45,12 +47,19 @@ function ChartDataProvider(props) {
45
47
  const {
46
48
  children,
47
49
  localeText,
48
- chartProviderProps
50
+ chartProviderProps,
51
+ slots,
52
+ slotProps
49
53
  } = (0, _useChartDataProviderProps.useChartDataProviderProps)(props);
50
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartProvider.ChartProvider, (0, _extends2.default)({}, chartProviderProps, {
51
55
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLocalizationProvider.ChartsLocalizationProvider, {
52
56
  localeText: localeText,
53
- children: children
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSlotsContext.ChartsSlotsProvider, {
58
+ slots: slots,
59
+ slotProps: slotProps,
60
+ defaultSlots: _material.defaultSlotsMaterial,
61
+ children: children
62
+ })
54
63
  })
55
64
  }));
56
65
  }
@@ -107,6 +116,14 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
107
116
  * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
108
117
  */
109
118
  skipAnimation: _propTypes.default.bool,
119
+ /**
120
+ * The props for the slots.
121
+ */
122
+ slotProps: _propTypes.default.object,
123
+ /**
124
+ * Slots to customize charts' components.
125
+ */
126
+ slots: _propTypes.default.object,
110
127
  theme: _propTypes.default.oneOf(['dark', 'light']),
111
128
  /**
112
129
  * The width of the chart in px. If not defined, it takes the width of the parent element.
@@ -8,4 +8,6 @@ export declare const useChartDataProviderProps: <TSeries extends ChartSeriesType
8
8
  children: import("react").ReactNode;
9
9
  localeText: Partial<import("../locales/index.js").ChartsLocaleText> | undefined;
10
10
  chartProviderProps: ChartProviderProps<TSeries, TSignatures>;
11
+ slots: Partial<import("../internals/index.js").ChartsSlots> | undefined;
12
+ slotProps: Partial<import("../internals/index.js").ChartsSlotProps> | undefined;
11
13
  };
@@ -10,13 +10,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _styles = require("@mui/material/styles");
12
12
  var _allPlugins = require("../internals/plugins/allPlugins");
13
- const _excluded = ["children", "localeText", "plugins", "seriesConfig"];
13
+ const _excluded = ["children", "localeText", "plugins", "seriesConfig", "slots", "slotProps"];
14
14
  const useChartDataProviderProps = props => {
15
15
  const {
16
16
  children,
17
17
  localeText,
18
18
  plugins = _allPlugins.DEFAULT_PLUGINS,
19
- seriesConfig
19
+ seriesConfig,
20
+ slots,
21
+ slotProps
20
22
  } = props,
21
23
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
22
24
  const theme = (0, _styles.useTheme)();
@@ -30,7 +32,9 @@ const useChartDataProviderProps = props => {
30
32
  return {
31
33
  children,
32
34
  localeText,
33
- chartProviderProps
35
+ chartProviderProps,
36
+ slots,
37
+ slotProps
34
38
  };
35
39
  };
36
40
  exports.useChartDataProviderProps = useChartDataProviderProps;
@@ -1,5 +1,5 @@
1
1
  import { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.js";
2
- export declare const ChartsAxisHighlightPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
2
+ export declare const ChartsAxisHighlightPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
3
3
  ownerState: {
4
4
  axisHighlight: ChartsAxisHighlightType;
5
5
  };
@@ -1,2 +1,2 @@
1
- export declare const GridRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").SVGProps<SVGGElement>, keyof import("react").SVGProps<SVGGElement>>, {}>;
2
- export declare const GridLine: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").SVGLineElementAttributes<SVGLineElement>, keyof import("react").SVGLineElementAttributes<SVGLineElement>>, {}>;
1
+ export declare const GridRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").SVGProps<SVGGElement>, keyof import("react").SVGProps<SVGGElement>>, {}>;
2
+ export declare const GridLine: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").SVGLineElementAttributes<SVGLineElement>, keyof import("react").SVGLineElementAttributes<SVGLineElement>>, {}>;
@@ -38,4 +38,4 @@ export type CommonChartsReferenceLineProps = {
38
38
  */
39
39
  classes?: Partial<ChartsReferenceLineClasses>;
40
40
  };
41
- export declare const ReferenceLineRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").SVGProps<SVGGElement>, {}>;
41
+ export declare const ReferenceLineRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").SVGProps<SVGGElement>, {}>;
@@ -32,7 +32,7 @@ function ChartsTooltip(props) {
32
32
  } = props;
33
33
  const classes = (0, _chartsTooltipClasses.useUtilityClasses)(propClasses);
34
34
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipContainer.ChartsTooltipContainer, (0, _extends2.default)({}, props, {
35
- classes: classes,
35
+ classes: propClasses,
36
36
  children: trigger === 'axis' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisTooltipContent.ChartsAxisTooltipContent, {
37
37
  classes: classes
38
38
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsItemTooltipContent.ChartsItemTooltipContent, {
@@ -18,6 +18,7 @@ var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
18
18
  var _NoSsr = _interopRequireDefault(require("@mui/material/NoSsr"));
19
19
  var _useSvgRef = require("../hooks/useSvgRef");
20
20
  var _utils = require("./utils");
21
+ var _chartsTooltipClasses = require("./chartsTooltipClasses");
21
22
  var _useSelector = require("../internals/store/useSelector");
22
23
  var _useStore = require("../internals/store/useStore");
23
24
  var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
@@ -53,12 +54,14 @@ function ChartsTooltipContainer(inProps) {
53
54
  });
54
55
  const {
55
56
  trigger = 'axis',
56
- classes,
57
+ classes: propClasses,
57
58
  children
58
59
  } = props,
59
60
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
61
+ const classes = (0, _chartsTooltipClasses.useUtilityClasses)(propClasses);
60
62
  const svgRef = (0, _useSvgRef.useSvgRef)();
61
63
  const pointerType = (0, _utils.usePointerType)();
64
+ const isFineMainPointer = (0, _utils.useIsFineMainPointer)();
62
65
  const popperRef = React.useRef(null);
63
66
  const positionRef = (0, _useLazyRef.default)(() => ({
64
67
  x: 0,
@@ -67,14 +70,12 @@ function ChartsTooltipContainer(inProps) {
67
70
  const axisSystem = (0, _useAxisSystem.useAxisSystem)();
68
71
  const store = (0, _useStore.useStore)();
69
72
  const isOpen = (0, _useSelector.useSelector)(store, trigger === 'axis' ? axisSystem === 'polar' && _useChartPolarInteraction.selectorChartsInteractionPolarAxisTooltip || axisSystem === 'cartesian' && _useChartCartesianAxis.selectorChartsInteractionAxisTooltip || noAxis : _useChartInteraction.selectorChartsInteractionItemIsDefined);
70
- const popperOpen = pointerType !== null && isOpen; // tooltipHasData;
71
-
72
73
  React.useEffect(() => {
73
74
  const element = svgRef.current;
74
75
  if (element === null) {
75
76
  return () => {};
76
77
  }
77
- const handleMove = event => {
78
+ const handlePointerEvent = event => {
78
79
  // eslint-disable-next-line react-compiler/react-compiler
79
80
  positionRef.current = {
80
81
  x: event.clientX,
@@ -82,9 +83,11 @@ function ChartsTooltipContainer(inProps) {
82
83
  };
83
84
  popperRef.current?.update();
84
85
  };
85
- element.addEventListener('pointermove', handleMove);
86
+ element.addEventListener('pointerdown', handlePointerEvent);
87
+ element.addEventListener('pointermove', handlePointerEvent);
86
88
  return () => {
87
- element.removeEventListener('pointermove', handleMove);
89
+ element.removeEventListener('pointerdown', handlePointerEvent);
90
+ element.removeEventListener('pointermove', handlePointerEvent);
88
91
  };
89
92
  }, [svgRef, positionRef]);
90
93
  const anchorEl = React.useMemo(() => ({
@@ -100,32 +103,34 @@ function ChartsTooltipContainer(inProps) {
100
103
  toJSON: () => ''
101
104
  })
102
105
  }), [positionRef]);
106
+ const isMouse = pointerType?.pointerType === 'mouse' || isFineMainPointer;
107
+ const isTouch = pointerType?.pointerType === 'touch' || !isFineMainPointer;
103
108
  const modifiers = React.useMemo(() => [{
104
109
  name: 'offset',
105
110
  options: {
106
111
  offset: () => {
107
- if (pointerType?.pointerType !== 'touch') {
108
- // The popper offset: [skidding, distance]
109
- return [0, 8];
112
+ if (isTouch) {
113
+ return [0, 64];
110
114
  }
111
- return [0, 64];
115
+ // The popper offset: [skidding, distance]
116
+ return [0, 8];
112
117
  }
113
118
  }
114
- }, ...(pointerType?.pointerType === 'mouse' ? [] // Keep default behavior
115
- : [{
119
+ }, ...(!isMouse ? [{
116
120
  name: 'flip',
117
121
  options: {
118
122
  fallbackPlacements: ['top-end', 'top-start', 'bottom-end', 'bottom']
119
123
  }
120
- }])], [pointerType]);
124
+ }] : []) // Keep default behavior
125
+ ], [isMouse, isTouch]);
121
126
  if (trigger === 'none') {
122
127
  return null;
123
128
  }
124
129
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoSsr.default, {
125
- children: popperOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsTooltipRoot, (0, _extends2.default)({
130
+ children: isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsTooltipRoot, (0, _extends2.default)({
126
131
  className: classes?.root,
127
- open: popperOpen,
128
- placement: pointerType?.pointerType === 'mouse' ? 'right-start' : 'top',
132
+ open: isOpen,
133
+ placement: isMouse ? 'right-start' : 'top',
129
134
  popperRef: popperRef,
130
135
  anchorEl: anchorEl,
131
136
  modifiers: modifiers