@mui/x-charts-pro 8.0.0 → 8.1.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 (66) hide show
  1. package/BarChartPro/BarChartPro.js +5 -0
  2. package/BarChartPro/BarChartPro.plugins.d.ts +2 -1
  3. package/BarChartPro/BarChartPro.plugins.js +2 -1
  4. package/CHANGELOG.md +106 -0
  5. package/ChartContainerPro/ChartContainerPro.d.ts +1 -0
  6. package/ChartDataProviderPro/ChartDataProviderPro.js +11 -2
  7. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -0
  8. package/ChartDataProviderPro/useChartDataProviderProProps.js +2 -0
  9. package/FunnelChart/FunnelChart.js +5 -0
  10. package/Heatmap/Heatmap.js +4 -0
  11. package/Heatmap/HeatmapItem.js +1 -1
  12. package/LineChartPro/LineChartPro.js +5 -0
  13. package/LineChartPro/LineChartPro.plugins.d.ts +2 -1
  14. package/LineChartPro/LineChartPro.plugins.js +2 -1
  15. package/ScatterChartPro/ScatterChartPro.js +5 -0
  16. package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
  17. package/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
  18. package/esm/BarChartPro/BarChartPro.js +5 -0
  19. package/esm/BarChartPro/BarChartPro.plugins.d.ts +2 -1
  20. package/esm/BarChartPro/BarChartPro.plugins.js +2 -1
  21. package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -0
  22. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +11 -2
  23. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -0
  24. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +2 -0
  25. package/esm/FunnelChart/FunnelChart.js +5 -0
  26. package/esm/Heatmap/Heatmap.js +4 -0
  27. package/esm/Heatmap/HeatmapItem.js +1 -1
  28. package/esm/LineChartPro/LineChartPro.js +5 -0
  29. package/esm/LineChartPro/LineChartPro.plugins.d.ts +2 -1
  30. package/esm/LineChartPro/LineChartPro.plugins.js +2 -1
  31. package/esm/ScatterChartPro/ScatterChartPro.js +5 -0
  32. package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
  33. package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
  34. package/esm/index.d.ts +1 -0
  35. package/esm/index.js +2 -1
  36. package/esm/internals/plugins/allPlugins.d.ts +5 -4
  37. package/esm/internals/plugins/allPlugins.js +3 -2
  38. package/esm/internals/plugins/useChartProExport/index.d.ts +2 -0
  39. package/esm/internals/plugins/useChartProExport/index.js +2 -0
  40. package/esm/internals/plugins/useChartProExport/print.d.ts +4 -0
  41. package/esm/internals/plugins/useChartProExport/print.js +72 -0
  42. package/esm/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
  43. package/esm/internals/plugins/useChartProExport/useChartProExport.js +45 -0
  44. package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +35 -0
  45. package/esm/internals/plugins/useChartProExport/useChartProExport.types.js +1 -0
  46. package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
  47. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +53 -29
  48. package/esm/locales/index.d.ts +1 -0
  49. package/esm/locales/index.js +1 -0
  50. package/index.d.ts +1 -0
  51. package/index.js +12 -1
  52. package/internals/plugins/allPlugins.d.ts +5 -4
  53. package/internals/plugins/allPlugins.js +3 -2
  54. package/internals/plugins/useChartProExport/index.d.ts +2 -0
  55. package/internals/plugins/useChartProExport/index.js +27 -0
  56. package/internals/plugins/useChartProExport/print.d.ts +4 -0
  57. package/internals/plugins/useChartProExport/print.js +79 -0
  58. package/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
  59. package/internals/plugins/useChartProExport/useChartProExport.js +53 -0
  60. package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +35 -0
  61. package/internals/plugins/useChartProExport/useChartProExport.types.js +5 -0
  62. package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
  63. package/internals/plugins/useChartProZoom/useChartProZoom.js +53 -29
  64. package/locales/index.d.ts +1 -0
  65. package/locales/index.js +16 -0
  66. package/package.json +3 -3
@@ -91,6 +91,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
91
91
  // ----------------------------------------------------------------------
92
92
  apiRef: _propTypes.default.shape({
93
93
  current: _propTypes.default.shape({
94
+ exportAsPrint: _propTypes.default.func.isRequired,
94
95
  setZoomData: _propTypes.default.func.isRequired
95
96
  })
96
97
  }),
@@ -181,6 +182,10 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
181
182
  * @default false
182
183
  */
183
184
  loading: _propTypes.default.bool,
185
+ /**
186
+ * Localized text for chart components.
187
+ */
188
+ localeText: _propTypes.default.object,
184
189
  /**
185
190
  * The margin between the SVG and the drawing area.
186
191
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type BarChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
4
+ export type BarChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const BAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<BarChartProPluginsSignatures>;
@@ -5,5 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.BAR_CHART_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
+ var _useChartProExport = require("../internals/plugins/useChartProExport");
8
9
  var _useChartProZoom = require("../internals/plugins/useChartProZoom");
9
- const BAR_CHART_PRO_PLUGINS = exports.BAR_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
10
+ const BAR_CHART_PRO_PLUGINS = exports.BAR_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
package/CHANGELOG.md CHANGED
@@ -5,6 +5,112 @@
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.1.0
9
+
10
+ _Apr 24, 2025_
11
+
12
+ We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 Add API to print a chart or export it as PDF: `apiRef.exportAsPrint`.
15
+ - 📚 Documentation improvements
16
+ - 🐞 Bugfixes
17
+
18
+ Special thanks go out to the community members for their valuable contributions:
19
+ @lhilgert9, @ArturAghakaryan, @sai6855.
20
+ Following are all team members who have contributed to this release:
21
+ @alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @JCQuintas, @joserodolfofreitas, @KenanYusuf, @LukasTy, @mapache-salvaje, @oliviertassinari, @romgrk.
22
+
23
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
24
+
25
+ ### Data Grid
26
+
27
+ #### `@mui/x-data-grid@8.1.0`
28
+
29
+ - [DataGrid] Allow row deselection with multiple rows selected (#17473) @arminmeh
30
+ - [DataGrid] Fix column title truncation on touch devices (#17375) @KenanYusuf
31
+ - [DataGrid] Remove internal usage of `material` prop (#17513) @KenanYusuf
32
+ - [DataGrid] Fix apiRef not being passed on onCellClick params (#17335) @sai6855
33
+ - [DataGrid] Add Armenian (hy-AM) locale (#17527) @ArturAghakaryan
34
+
35
+ #### `@mui/x-data-grid-pro@8.1.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
36
+
37
+ Same changes as in `@mui/x-data-grid@8.1.0`, plus:
38
+
39
+ - [DataGridPro] Fix locales.ts export (#17433) @lhilgert9
40
+ - [DataGridPro] Avoid proptypes warnings with header filters in React 17 (#17482) @cherniavskii
41
+ - [DataGridPro] Fix expandable rows detail content height updates (#17394) @arminmeh
42
+
43
+ #### `@mui/x-data-grid-premium@8.1.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
44
+
45
+ Same changes as in `@mui/x-data-grid-pro@8.1.0`.
46
+
47
+ ### Date and Time Pickers
48
+
49
+ #### `@mui/x-date-pickers@8.1.0`
50
+
51
+ - [pickers] Improve `PickersInputBase` owner state typing (#17478) @LukasTy
52
+
53
+ #### `@mui/x-date-pickers-pro@8.1.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
54
+
55
+ Same changes as in `@mui/x-date-pickers@8.1.0`.
56
+
57
+ ### Charts
58
+
59
+ - Add API to print a chart or export it as PDF: `apiRef.exportAsPrint`.
60
+
61
+ #### `@mui/x-charts@8.1.0`
62
+
63
+ - [charts] Add a localization provider (#17325) @alexfauquette
64
+ - [charts] Add codemod for replacing legend's hidden slot prop (#17392) @bernardobelchior
65
+ - [charts] Fix chart visual tests flakiness (#17469) @bernardobelchior
66
+ - [charts] Fix tooltip position (#17440) @alexfauquette
67
+ - [charts] Improve axis tooltip performances (#17398) @alexfauquette
68
+ - [charts] Move radar from under development to preview (#17418) @alexfauquette
69
+ - [charts] Advance time in charts regression tests (#17420) @bernardobelchior
70
+ - [charts] Fix charts visuals flakiness (#17472) @bernardobelchior
71
+ - [charts] Move `rafThrottle` on event handlers instead of setter (#17489) @bernardobelchior
72
+
73
+ #### `@mui/x-charts-pro@8.1.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
74
+
75
+ Same changes as in `@mui/x-charts@8.1.0`, plus:
76
+
77
+ - [charts-pro] Add export as PDF/print functionality (#17285) @bernardobelchior
78
+ - [charts-pro] Fix axis zoom being disabled when not specified in `initialZoom` (#17500) @bernardobelchior
79
+
80
+ ### Tree View
81
+
82
+ #### `@mui/x-tree-view@8.1.0`
83
+
84
+ Internal changes.
85
+
86
+ #### `@mui/x-tree-view-pro@8.1.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
87
+
88
+ Same changes as in `@mui/x-tree-view@8.1.0`.
89
+
90
+ ### Docs
91
+
92
+ - [docs] Fix AI Assistant Panel Trigger demo (#17426) @KenanYusuf
93
+ - [docs] Fix DataGrid's master-detail demo for one expanded detail panel at a time (#17471) @arminmeh
94
+ - [docs] Improve StackOverflow links (#17483) @oliviertassinari
95
+ - [docs] Refine charts demos (#17417) @alexfauquette
96
+ - [docs] Remove ad on paid docs pages (#17373) @oliviertassinari
97
+ - [docs] Serve migration guides in raw markdown format (#17210) @cherniavskii
98
+ - [docs] Fix heading structure (#17495) @oliviertassinari
99
+ - [docs] Revise the Row Grouping doc (#16217) @mapache-salvaje
100
+ - [docs] Fix ellipsis in the demo (#17476) @oliviertassinari
101
+ - [docs] Add docs information for Legend HTML (#17502) @alexfauquette
102
+ - [docs] Refine charts demos (#17417) @alexfauquette
103
+ - [tree view][docs] Copyedit the Tree View Overview page (#17498) @mapache-salvaje
104
+
105
+ ### Core
106
+
107
+ - [core] Bump `@types/node` (#17444) @LukasTy
108
+ - [core] Remove `react-is` dependency (#17470) @LukasTy
109
+ - [core] Remove redundant `overridesResolver` in `styled` components (#17466) @romgrk
110
+ - [core] Update support table (#17425) @joserodolfofreitas
111
+ - [code-infra] Ditch `@babel/node` (#17446) @LukasTy
112
+ - [code-infra] Further remove `clock=fake` from pickers (#17253) @JCQuintas
113
+
8
114
  ## 8.0.0
9
115
 
10
116
  _Apr 17, 2025_
@@ -7,6 +7,7 @@ export type ChartContainerProProps<TSeries extends ChartSeriesType = ChartSeries
7
7
  type ChartContainerProComponent = <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures> & {
8
8
  ref?: React.ForwardedRef<SVGSVGElement>;
9
9
  }) => React.JSX.Element;
10
+ export type ChartProApi = NonNullable<NonNullable<ChartContainerProProps['apiRef']>['current']>;
10
11
  /**
11
12
  * It sets up the data providers as well as the `<svg>` for the chart.
12
13
  *
@@ -12,11 +12,12 @@ var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _Watermark = require("@mui/x-license/Watermark");
14
14
  var _internals = require("@mui/x-charts/internals");
15
+ var _ChartsLocalizationProvider = require("@mui/x-charts/ChartsLocalizationProvider");
15
16
  var _useLicenseVerifier = require("@mui/x-license/useLicenseVerifier");
16
17
  var _allPlugins = require("../internals/plugins/allPlugins");
17
18
  var _useChartDataProviderProProps = require("./useChartDataProviderProProps");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
- const releaseInfo = "MTc0NDg0MDgwMDAwMA==";
20
+ const releaseInfo = "MTc0NTQ0NTYwMDAwMA==";
20
21
  const packageIdentifier = 'x-charts-pro';
21
22
  /**
22
23
  * Orchestrates the data providers for the chart components and hooks.
@@ -48,13 +49,17 @@ const packageIdentifier = 'x-charts-pro';
48
49
  function ChartDataProviderPro(props) {
49
50
  const {
50
51
  children,
52
+ localeText,
51
53
  chartProviderProps
52
54
  } = (0, _useChartDataProviderProProps.useChartDataProviderProProps)((0, _extends2.default)({}, props, {
53
55
  plugins: props.plugins ?? _allPlugins.DEFAULT_PLUGINS
54
56
  }));
55
57
  (0, _useLicenseVerifier.useLicenseVerifier)(packageIdentifier, releaseInfo);
56
58
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartProvider, (0, _extends2.default)({}, chartProviderProps, {
57
- children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
59
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLocalizationProvider.ChartsLocalizationProvider, {
60
+ localeText: localeText,
61
+ children: children
62
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
58
63
  packageName: packageIdentifier,
59
64
  releaseInfo: releaseInfo
60
65
  })]
@@ -86,6 +91,10 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
86
91
  * If you don't provide this prop. It falls back to a randomly generated id.
87
92
  */
88
93
  id: _propTypes.default.string,
94
+ /**
95
+ * Localized text for chart components.
96
+ */
97
+ localeText: _propTypes.default.object,
89
98
  /**
90
99
  * The margin between the SVG and the drawing area.
91
100
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -3,5 +3,6 @@ import type { ChartDataProviderProProps } from './ChartDataProviderPro';
3
3
  import type { AllPluginSignatures } from '../internals/plugins/allPlugins';
4
4
  export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>) => {
5
5
  children: import("react").ReactNode;
6
+ localeText: Partial<import("@mui/x-charts/locales").ChartsLocaleText> | undefined;
6
7
  chartProviderProps: import("@mui/x-charts/internals").ChartProviderProps<TSeries, TSignatures>;
7
8
  };
@@ -9,10 +9,12 @@ var _internals = require("@mui/x-charts/internals");
9
9
  const useChartDataProviderProProps = props => {
10
10
  const {
11
11
  chartProviderProps,
12
+ localeText,
12
13
  children
13
14
  } = (0, _internals.useChartDataProviderProps)(props);
14
15
  return {
15
16
  children,
17
+ localeText,
16
18
  chartProviderProps
17
19
  };
18
20
  };
@@ -70,6 +70,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
70
70
  // ----------------------------------------------------------------------
71
71
  apiRef: _propTypes.default.shape({
72
72
  current: _propTypes.default.shape({
73
+ exportAsPrint: _propTypes.default.func.isRequired,
73
74
  setZoomData: _propTypes.default.func.isRequired
74
75
  })
75
76
  }),
@@ -218,6 +219,10 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
218
219
  * @default false
219
220
  */
220
221
  loading: _propTypes.default.bool,
222
+ /**
223
+ * Localized text for chart components.
224
+ */
225
+ localeText: _propTypes.default.object,
221
226
  /**
222
227
  * The margin between the SVG and the drawing area.
223
228
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -174,6 +174,10 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
174
174
  * @default false
175
175
  */
176
176
  loading: _propTypes.default.bool,
177
+ /**
178
+ * Localized text for chart components.
179
+ */
180
+ localeText: _propTypes.default.object,
177
181
  /**
178
182
  * The margin between the SVG and the drawing area.
179
183
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -21,7 +21,7 @@ const _excluded = ["seriesId", "dataIndex", "color", "value", "slotProps", "slot
21
21
  const HeatmapCell = (0, _styles.styled)('rect', {
22
22
  name: 'MuiHeatmap',
23
23
  slot: 'Cell',
24
- overridesResolver: (_, styles) => styles.arc
24
+ overridesResolver: (_, styles) => styles.arc // FIXME: Inconsistent naming with slot
25
25
  })(({
26
26
  ownerState
27
27
  }) => ({
@@ -96,6 +96,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
96
96
  // ----------------------------------------------------------------------
97
97
  apiRef: _propTypes.default.shape({
98
98
  current: _propTypes.default.shape({
99
+ exportAsPrint: _propTypes.default.func.isRequired,
99
100
  setZoomData: _propTypes.default.func.isRequired
100
101
  })
101
102
  }),
@@ -172,6 +173,10 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
172
173
  * @default false
173
174
  */
174
175
  loading: _propTypes.default.bool,
176
+ /**
177
+ * Localized text for chart components.
178
+ */
179
+ localeText: _propTypes.default.object,
175
180
  /**
176
181
  * The margin between the SVG and the drawing area.
177
182
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type LineChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
4
+ export type LineChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const LINE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<LineChartProPluginsSignatures>;
@@ -5,5 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.LINE_CHART_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
+ var _useChartProExport = require("../internals/plugins/useChartProExport");
8
9
  var _useChartProZoom = require("../internals/plugins/useChartProZoom");
9
- const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
10
+ const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
@@ -90,6 +90,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
90
90
  // ----------------------------------------------------------------------
91
91
  apiRef: _propTypes.default.shape({
92
92
  current: _propTypes.default.shape({
93
+ exportAsPrint: _propTypes.default.func.isRequired,
93
94
  setZoomData: _propTypes.default.func.isRequired
94
95
  })
95
96
  }),
@@ -167,6 +168,10 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
167
168
  * @default false
168
169
  */
169
170
  loading: _propTypes.default.bool,
171
+ /**
172
+ * Localized text for chart components.
173
+ */
174
+ localeText: _propTypes.default.object,
170
175
  /**
171
176
  * The margin between the SVG and the drawing area.
172
177
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature];
4
+ export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginsSignatures>;
@@ -5,5 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SCATTER_CHART_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
+ var _useChartProExport = require("../internals/plugins/useChartProExport");
8
9
  var _useChartProZoom = require("../internals/plugins/useChartProZoom");
9
- const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartVoronoi, _useChartProZoom.useChartProZoom];
10
+ const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartVoronoi, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
@@ -84,6 +84,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
84
84
  // ----------------------------------------------------------------------
85
85
  apiRef: PropTypes.shape({
86
86
  current: PropTypes.shape({
87
+ exportAsPrint: PropTypes.func.isRequired,
87
88
  setZoomData: PropTypes.func.isRequired
88
89
  })
89
90
  }),
@@ -174,6 +175,10 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
174
175
  * @default false
175
176
  */
176
177
  loading: PropTypes.bool,
178
+ /**
179
+ * Localized text for chart components.
180
+ */
181
+ localeText: PropTypes.object,
177
182
  /**
178
183
  * The margin between the SVG and the drawing area.
179
184
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type BarChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
4
+ export type BarChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const BAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<BarChartProPluginsSignatures>;
@@ -1,3 +1,4 @@
1
1
  import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
2
+ import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
3
- export const BAR_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
4
+ export const BAR_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];
@@ -7,6 +7,7 @@ export type ChartContainerProProps<TSeries extends ChartSeriesType = ChartSeries
7
7
  type ChartContainerProComponent = <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures> & {
8
8
  ref?: React.ForwardedRef<SVGSVGElement>;
9
9
  }) => React.JSX.Element;
10
+ export type ChartProApi = NonNullable<NonNullable<ChartContainerProProps['apiRef']>['current']>;
10
11
  /**
11
12
  * It sets up the data providers as well as the `<svg>` for the chart.
12
13
  *
@@ -5,11 +5,12 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { Watermark } from '@mui/x-license/Watermark';
7
7
  import { ChartProvider } from '@mui/x-charts/internals';
8
+ import { ChartsLocalizationProvider } from '@mui/x-charts/ChartsLocalizationProvider';
8
9
  import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
9
10
  import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
10
11
  import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- const releaseInfo = "MTc0NDg0MDgwMDAwMA==";
13
+ const releaseInfo = "MTc0NTQ0NTYwMDAwMA==";
13
14
  const packageIdentifier = 'x-charts-pro';
14
15
  /**
15
16
  * Orchestrates the data providers for the chart components and hooks.
@@ -41,13 +42,17 @@ const packageIdentifier = 'x-charts-pro';
41
42
  function ChartDataProviderPro(props) {
42
43
  const {
43
44
  children,
45
+ localeText,
44
46
  chartProviderProps
45
47
  } = useChartDataProviderProProps(_extends({}, props, {
46
48
  plugins: props.plugins ?? DEFAULT_PLUGINS
47
49
  }));
48
50
  useLicenseVerifier(packageIdentifier, releaseInfo);
49
51
  return /*#__PURE__*/_jsxs(ChartProvider, _extends({}, chartProviderProps, {
50
- children: [children, /*#__PURE__*/_jsx(Watermark, {
52
+ children: [/*#__PURE__*/_jsx(ChartsLocalizationProvider, {
53
+ localeText: localeText,
54
+ children: children
55
+ }), /*#__PURE__*/_jsx(Watermark, {
51
56
  packageName: packageIdentifier,
52
57
  releaseInfo: releaseInfo
53
58
  })]
@@ -79,6 +84,10 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
79
84
  * If you don't provide this prop. It falls back to a randomly generated id.
80
85
  */
81
86
  id: PropTypes.string,
87
+ /**
88
+ * Localized text for chart components.
89
+ */
90
+ localeText: PropTypes.object,
82
91
  /**
83
92
  * The margin between the SVG and the drawing area.
84
93
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -3,5 +3,6 @@ import type { ChartDataProviderProProps } from './ChartDataProviderPro';
3
3
  import type { AllPluginSignatures } from '../internals/plugins/allPlugins';
4
4
  export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>) => {
5
5
  children: import("react").ReactNode;
6
+ localeText: Partial<import("@mui/x-charts/locales").ChartsLocaleText> | undefined;
6
7
  chartProviderProps: import("@mui/x-charts/internals").ChartProviderProps<TSeries, TSignatures>;
7
8
  };
@@ -4,10 +4,12 @@ import { useChartDataProviderProps } from '@mui/x-charts/internals';
4
4
  export const useChartDataProviderProProps = props => {
5
5
  const {
6
6
  chartProviderProps,
7
+ localeText,
7
8
  children
8
9
  } = useChartDataProviderProps(props);
9
10
  return {
10
11
  children,
12
+ localeText,
11
13
  chartProviderProps
12
14
  };
13
15
  };
@@ -63,6 +63,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
63
63
  // ----------------------------------------------------------------------
64
64
  apiRef: PropTypes.shape({
65
65
  current: PropTypes.shape({
66
+ exportAsPrint: PropTypes.func.isRequired,
66
67
  setZoomData: PropTypes.func.isRequired
67
68
  })
68
69
  }),
@@ -211,6 +212,10 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
211
212
  * @default false
212
213
  */
213
214
  loading: PropTypes.bool,
215
+ /**
216
+ * Localized text for chart components.
217
+ */
218
+ localeText: PropTypes.object,
214
219
  /**
215
220
  * The margin between the SVG and the drawing area.
216
221
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -167,6 +167,10 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
167
167
  * @default false
168
168
  */
169
169
  loading: PropTypes.bool,
170
+ /**
171
+ * Localized text for chart components.
172
+ */
173
+ localeText: PropTypes.object,
170
174
  /**
171
175
  * The margin between the SVG and the drawing area.
172
176
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  const HeatmapCell = styled('rect', {
14
14
  name: 'MuiHeatmap',
15
15
  slot: 'Cell',
16
- overridesResolver: (_, styles) => styles.arc
16
+ overridesResolver: (_, styles) => styles.arc // FIXME: Inconsistent naming with slot
17
17
  })(({
18
18
  ownerState
19
19
  }) => ({
@@ -89,6 +89,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
89
89
  // ----------------------------------------------------------------------
90
90
  apiRef: PropTypes.shape({
91
91
  current: PropTypes.shape({
92
+ exportAsPrint: PropTypes.func.isRequired,
92
93
  setZoomData: PropTypes.func.isRequired
93
94
  })
94
95
  }),
@@ -165,6 +166,10 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
165
166
  * @default false
166
167
  */
167
168
  loading: PropTypes.bool,
169
+ /**
170
+ * Localized text for chart components.
171
+ */
172
+ localeText: PropTypes.object,
168
173
  /**
169
174
  * The margin between the SVG and the drawing area.
170
175
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type LineChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
4
+ export type LineChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const LINE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<LineChartProPluginsSignatures>;
@@ -1,3 +1,4 @@
1
1
  import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
2
+ import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
3
- export const LINE_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
4
+ export const LINE_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];
@@ -83,6 +83,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
83
83
  // ----------------------------------------------------------------------
84
84
  apiRef: PropTypes.shape({
85
85
  current: PropTypes.shape({
86
+ exportAsPrint: PropTypes.func.isRequired,
86
87
  setZoomData: PropTypes.func.isRequired
87
88
  })
88
89
  }),
@@ -160,6 +161,10 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
160
161
  * @default false
161
162
  */
162
163
  loading: PropTypes.bool,
164
+ /**
165
+ * Localized text for chart components.
166
+ */
167
+ localeText: PropTypes.object,
163
168
  /**
164
169
  * The margin between the SVG and the drawing area.
165
170
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -1,4 +1,5 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
3
- export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature];
4
+ export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginsSignatures>;
@@ -1,3 +1,4 @@
1
1
  import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi } from '@mui/x-charts/internals';
2
+ import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
2
3
  import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
3
- export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi, useChartProZoom];
4
+ export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi, useChartProZoom, useChartProExport];
package/esm/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from '@mui/x-charts/ChartsGrid';
13
13
  export * from '@mui/x-charts/ChartsText';
14
14
  export * from '@mui/x-charts/ChartsTooltip';
15
15
  export * from '@mui/x-charts/ChartsLegend';
16
+ export * from '@mui/x-charts/ChartsLocalizationProvider';
16
17
  export * from '@mui/x-charts/ChartsAxisHighlight';
17
18
  export * from '@mui/x-charts/BarChart';
18
19
  export * from '@mui/x-charts/LineChart';
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v8.0.0
2
+ * @mui/x-charts-pro v8.1.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -22,6 +22,7 @@ export * from '@mui/x-charts/ChartsGrid';
22
22
  export * from '@mui/x-charts/ChartsText';
23
23
  export * from '@mui/x-charts/ChartsTooltip';
24
24
  export * from '@mui/x-charts/ChartsLegend';
25
+ export * from '@mui/x-charts/ChartsLocalizationProvider';
25
26
  export * from '@mui/x-charts/ChartsAxisHighlight';
26
27
  export * from '@mui/x-charts/BarChart';
27
28
  export * from '@mui/x-charts/LineChart';
@@ -1,8 +1,9 @@
1
1
  import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
2
+ import { UseChartProExportSignature } from "./useChartProExport/index.js";
2
3
  import { UseChartProZoomSignature } from "./useChartProZoom/index.js";
3
- export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
4
+ export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
5
  export type AllPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<TSeries>>;
5
- export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
6
- export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
6
+ export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
7
+ export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
7
8
  export type DefaultPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<DefaultPluginSignatures<TSeries>>;
8
- export declare const DEFAULT_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
9
+ export declare const DEFAULT_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
@@ -1,6 +1,7 @@
1
1
  // This file should be removed after creating all plugins in favor of a file per chart type.
2
2
 
3
3
  import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis } from '@mui/x-charts/internals';
4
+ import { useChartProExport } from "./useChartProExport/index.js";
4
5
  import { useChartProZoom } from "./useChartProZoom/index.js";
5
- export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom];
6
- export const DEFAULT_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
6
+ export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];
7
+ export const DEFAULT_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];