@mui/x-charts-pro 8.5.2 → 8.6.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 (110) hide show
  1. package/CHANGELOG.md +203 -11
  2. package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  3. package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +1 -1
  4. package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +20 -31
  5. package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +1 -8
  6. package/ChartZoomSlider/internals/zoom-utils.d.ts +3 -1
  7. package/ChartZoomSlider/internals/zoom-utils.js +19 -8
  8. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +27 -0
  9. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +77 -0
  10. package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +33 -0
  11. package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +75 -0
  12. package/ChartsToolbarPro/ChartsToolbarPro.d.ts +16 -3
  13. package/ChartsToolbarPro/ChartsToolbarPro.js +118 -8
  14. package/ChartsToolbarPro/index.d.ts +3 -1
  15. package/ChartsToolbarPro/index.js +22 -0
  16. package/ChartsToolbarPro/internals/ChartsMenu.d.ts +14 -0
  17. package/ChartsToolbarPro/internals/ChartsMenu.js +73 -0
  18. package/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +5 -0
  19. package/ChartsToolbarPro/internals/ChartsToolbarDivider.js +47 -0
  20. package/FunnelChart/FunnelPlot.js +56 -40
  21. package/FunnelChart/FunnelSection.js +2 -0
  22. package/FunnelChart/curves/bump.d.ts +3 -3
  23. package/FunnelChart/curves/bump.js +3 -0
  24. package/FunnelChart/curves/curve.types.d.ts +14 -1
  25. package/FunnelChart/curves/getFunnelCurve.d.ts +7 -2
  26. package/FunnelChart/curves/linear.d.ts +3 -3
  27. package/FunnelChart/curves/linear.js +23 -18
  28. package/FunnelChart/curves/pyramid.d.ts +3 -3
  29. package/FunnelChart/curves/pyramid.js +17 -12
  30. package/FunnelChart/curves/step-pyramid.d.ts +5 -5
  31. package/FunnelChart/curves/step-pyramid.js +20 -18
  32. package/FunnelChart/curves/step.d.ts +3 -3
  33. package/FunnelChart/curves/step.js +14 -12
  34. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +18 -1444
  35. package/FunnelChart/labelUtils.d.ts +4 -12
  36. package/FunnelChart/labelUtils.js +43 -44
  37. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  38. package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +1 -1
  39. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +21 -32
  40. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +1 -8
  41. package/esm/ChartZoomSlider/internals/zoom-utils.d.ts +3 -1
  42. package/esm/ChartZoomSlider/internals/zoom-utils.js +19 -9
  43. package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +27 -0
  44. package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +70 -0
  45. package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +33 -0
  46. package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +68 -0
  47. package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +16 -3
  48. package/esm/ChartsToolbarPro/ChartsToolbarPro.js +120 -8
  49. package/esm/ChartsToolbarPro/index.d.ts +3 -1
  50. package/esm/ChartsToolbarPro/index.js +3 -1
  51. package/esm/ChartsToolbarPro/internals/ChartsMenu.d.ts +14 -0
  52. package/esm/ChartsToolbarPro/internals/ChartsMenu.js +67 -0
  53. package/esm/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +5 -0
  54. package/esm/ChartsToolbarPro/internals/ChartsToolbarDivider.js +40 -0
  55. package/esm/FunnelChart/FunnelPlot.js +56 -40
  56. package/esm/FunnelChart/FunnelSection.js +2 -0
  57. package/esm/FunnelChart/curves/bump.d.ts +3 -3
  58. package/esm/FunnelChart/curves/bump.js +3 -0
  59. package/esm/FunnelChart/curves/curve.types.d.ts +14 -1
  60. package/esm/FunnelChart/curves/getFunnelCurve.d.ts +7 -2
  61. package/esm/FunnelChart/curves/linear.d.ts +3 -3
  62. package/esm/FunnelChart/curves/linear.js +23 -18
  63. package/esm/FunnelChart/curves/pyramid.d.ts +3 -3
  64. package/esm/FunnelChart/curves/pyramid.js +17 -12
  65. package/esm/FunnelChart/curves/step-pyramid.d.ts +5 -5
  66. package/esm/FunnelChart/curves/step-pyramid.js +20 -18
  67. package/esm/FunnelChart/curves/step.d.ts +3 -3
  68. package/esm/FunnelChart/curves/step.js +14 -12
  69. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +18 -1444
  70. package/esm/FunnelChart/labelUtils.d.ts +4 -12
  71. package/esm/FunnelChart/labelUtils.js +43 -44
  72. package/esm/index.d.ts +2 -1
  73. package/esm/index.js +1 -1
  74. package/esm/internals/material/components/BaseMenuItem.d.ts +3 -0
  75. package/esm/internals/material/components/BaseMenuItem.js +27 -0
  76. package/esm/internals/material/components/BasePopper.d.ts +3 -0
  77. package/esm/internals/material/components/BasePopper.js +122 -0
  78. package/esm/internals/material/icons.d.ts +2 -1
  79. package/esm/internals/material/icons.js +4 -1
  80. package/esm/internals/material/index.d.ts +1 -0
  81. package/esm/internals/material/index.js +12 -3
  82. package/esm/internals/plugins/useChartProExport/print.js +1 -1
  83. package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +7 -6
  84. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +16 -595
  85. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +2 -2
  86. package/esm/internals/slots/chartBaseSlotProps.d.ts +50 -3
  87. package/esm/internals/slots/chartsBaseSlots.d.ts +5 -1
  88. package/esm/internals/slots/chartsIconSlots.d.ts +5 -0
  89. package/index.d.ts +2 -1
  90. package/index.js +1 -1
  91. package/internals/material/components/BaseMenuItem.d.ts +3 -0
  92. package/internals/material/components/BaseMenuItem.js +35 -0
  93. package/internals/material/components/BasePopper.d.ts +3 -0
  94. package/internals/material/components/BasePopper.js +130 -0
  95. package/internals/material/icons.d.ts +2 -1
  96. package/internals/material/icons.js +5 -2
  97. package/internals/material/index.d.ts +1 -0
  98. package/internals/material/index.js +11 -2
  99. package/internals/plugins/useChartProExport/print.js +1 -1
  100. package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +7 -6
  101. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +16 -595
  102. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +2 -2
  103. package/internals/slots/chartBaseSlotProps.d.ts +50 -3
  104. package/internals/slots/chartsBaseSlots.d.ts +5 -1
  105. package/internals/slots/chartsIconSlots.d.ts +5 -0
  106. package/package.json +5 -5
  107. package/FunnelChart/positionGetter.d.ts +0 -1
  108. package/FunnelChart/positionGetter.js +0 -5
  109. package/esm/FunnelChart/positionGetter.d.ts +0 -1
  110. package/esm/FunnelChart/positionGetter.js +0 -1
@@ -1,5 +1,5 @@
1
- import { FunnelDataPoints, FunnelLabelOptions } from "./funnel.types.js";
2
- import { PositionGetter } from "./positionGetter.js";
1
+ import { FunnelLabelOptions } from "./funnel.types.js";
2
+ import { Point } from "./curves/index.js";
3
3
  /**
4
4
  * It tries to keep the label inside the bounds of the section based on the position.
5
5
  *
@@ -24,19 +24,11 @@ export declare const alignLabel: ({
24
24
  export declare const positionLabel: ({
25
25
  position,
26
26
  offset,
27
- xPosition,
28
- yPosition,
29
27
  isHorizontal,
30
- values,
31
- dataIndex,
32
- baseScaleData
28
+ values
33
29
  }: Omit<FunnelLabelOptions, "textAnchor" | "dominantBaseline"> & {
34
- xPosition: PositionGetter;
35
- yPosition: PositionGetter;
36
30
  isHorizontal: boolean;
37
- values: readonly FunnelDataPoints[];
38
- dataIndex: number;
39
- baseScaleData: readonly number[];
31
+ values: readonly Point[];
40
32
  }) => {
41
33
  x: number;
42
34
  y: number;
@@ -39,17 +39,21 @@ export const alignLabel = ({
39
39
  export const positionLabel = ({
40
40
  position,
41
41
  offset,
42
- xPosition,
43
- yPosition,
44
42
  isHorizontal,
45
- values,
46
- dataIndex,
47
- baseScaleData
43
+ values
48
44
  }) => {
49
45
  const vertical = position?.vertical ?? 'middle';
50
46
  const horizontal = position?.horizontal ?? 'center';
51
47
  let x = 0;
52
48
  let y = 0;
49
+
50
+ // The min/max values are due to the sections possibly being sloped.
51
+ // Importance of values differs from the horizontal and vertical sections.
52
+ // Example (vertical):
53
+ // MaxL MaxT MaxR
54
+ // \ /
55
+ // \ /
56
+ // MinL MaxB MinR
53
57
  let minTop = 0;
54
58
  let maxTop = 0;
55
59
  let minBottom = 0;
@@ -58,56 +62,51 @@ export const positionLabel = ({
58
62
  let maxLeft = 0;
59
63
  let minRight = 0;
60
64
  let maxRight = 0;
61
- let center = 0;
62
- let leftCenter = 0;
63
- let rightCenter = 0;
64
65
  let middle = 0;
65
- let topMiddle = 0;
66
- let bottomMiddle = 0;
66
+ let center = 0;
67
67
  const mv = typeof offset === 'number' ? offset : offset?.y ?? 0;
68
68
  const mh = typeof offset === 'number' ? offset : offset?.x ?? 0;
69
- const stackOffset = values[0].stackOffset;
69
+
70
+ // Min ... Max
71
+ const Ys = values.map(v => v.y).toSorted((a, b) => a - b);
72
+ const Xs = values.map(v => v.x).toSorted((a, b) => a - b);
73
+
74
+ // Visualization of the points in a hierarchical order:
75
+ // MaxT
76
+ // MinT
77
+ // MaxL MinL Cent/Mid MinR MaxR
78
+ // MinB
79
+ // MaxB
70
80
  if (isHorizontal) {
71
- maxTop = yPosition(values[0].y, baseScaleData[dataIndex], stackOffset) - mv;
72
- minTop = yPosition(values[1].y, baseScaleData[dataIndex], stackOffset) - mv;
73
- minBottom = yPosition(values[2].y, baseScaleData[dataIndex], stackOffset) + mv;
74
- maxBottom = yPosition(values[3].y, baseScaleData[dataIndex], stackOffset) + mv;
75
- minRight = 0;
76
- maxRight = xPosition(Math.min(...values.map(v => v.x)), dataIndex, baseScaleData[dataIndex], stackOffset, true) + mh;
77
- minLeft = 0;
78
- maxLeft = xPosition(Math.max(...values.map(v => v.x)), dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
79
- center = maxRight - (maxRight - maxLeft) / 2;
80
- leftCenter = 0;
81
- rightCenter = 0;
82
- middle = yPosition(0, dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
83
- topMiddle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
84
- bottomMiddle = yPosition(values[3].y - (values[3].y - values[2].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) + mv;
81
+ maxTop = Ys.at(0) - mv;
82
+ minTop = Ys.at(1) - mv;
83
+ minBottom = Ys.at(2) + mv;
84
+ maxBottom = (Ys.at(3) ?? Ys.at(2)) + mv;
85
+ maxRight = (Xs.at(3) ?? Xs.at(2)) + mh;
86
+ // We don't need (minRight/minLeft) for horizontal
87
+ maxLeft = Xs.at(0) + mh;
88
+ center = (maxRight + maxLeft) / 2;
89
+ middle = (maxBottom + maxTop) / 2;
85
90
  } else {
86
- minTop = 0;
87
- maxTop = yPosition(Math.max(...values.map(v => v.y)), dataIndex, baseScaleData[dataIndex], stackOffset) - mv;
88
- minBottom = 0;
89
- maxBottom = yPosition(Math.min(...values.map(v => v.y)), dataIndex, baseScaleData[dataIndex], stackOffset, true) - mv;
90
- maxRight = xPosition(values[0].x, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
91
- minRight = xPosition(values[1].x, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
92
- minLeft = xPosition(values[2].x, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
93
- maxLeft = xPosition(values[3].x, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
94
- center = xPosition(0, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
95
- rightCenter = xPosition(values[0].x - (values[0].x - values[1].x) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) + mh;
96
- leftCenter = xPosition(values[3].x - (values[3].x - values[2].x) / 2, dataIndex, baseScaleData[dataIndex], stackOffset) - mh;
97
- middle = yPosition(values[0].y - (values[0].y - values[1].y) / 2, dataIndex, baseScaleData[dataIndex], stackOffset);
98
- middle = maxTop - (maxTop - maxBottom) / 2;
99
- topMiddle = 0;
100
- bottomMiddle = 0;
91
+ maxTop = Ys.at(0) - mv;
92
+ // We don't need (minTop/minBottom) for vertical
93
+ maxBottom = (Ys.at(3) ?? Ys.at(2)) - mv;
94
+ maxRight = (Xs.at(3) ?? Xs.at(2)) + mh;
95
+ minRight = Xs.at(2) + mh;
96
+ minLeft = Xs.at(1) - mh;
97
+ maxLeft = Xs.at(0) - mh;
98
+ center = (maxRight + maxLeft) / 2;
99
+ middle = (maxBottom + maxTop) / 2;
101
100
  }
102
101
  if (isHorizontal) {
103
102
  if (horizontal === 'center') {
104
103
  x = center;
105
104
  if (vertical === 'top') {
106
- y = topMiddle;
105
+ y = (maxTop + minTop) / 2;
107
106
  } else if (vertical === 'middle') {
108
107
  y = middle;
109
108
  } else if (vertical === 'bottom') {
110
- y = bottomMiddle;
109
+ y = (maxBottom + minBottom) / 2;
111
110
  }
112
111
  } else if (horizontal === 'start') {
113
112
  x = maxLeft;
@@ -133,11 +132,11 @@ export const positionLabel = ({
133
132
  if (vertical === 'middle') {
134
133
  y = middle;
135
134
  if (horizontal === 'start') {
136
- x = leftCenter;
135
+ x = (maxLeft + minLeft) / 2;
137
136
  } else if (horizontal === 'center') {
138
137
  x = center;
139
138
  } else if (horizontal === 'end') {
140
- x = rightCenter;
139
+ x = (maxRight + minRight) / 2;
141
140
  }
142
141
  } else if (vertical === 'top') {
143
142
  y = maxTop;
package/esm/index.d.ts CHANGED
@@ -37,4 +37,5 @@ export * from "./PieChartPro/index.js";
37
37
  export * from "./FunnelChart/index.js";
38
38
  export * from "./RadarChartPro/index.js";
39
39
  export * from "./ChartZoomSlider/index.js";
40
- export * from "./ChartsToolbarPro/index.js";
40
+ export * from "./ChartsToolbarPro/index.js";
41
+ export type { ChartImageExportOptions, ChartPrintExportOptions } from "./internals/plugins/useChartProExport/index.js";
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v8.5.2
2
+ * @mui/x-charts-pro v8.6.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ChartBaseMenuItemProps } from "../../slots/chartBaseSlotProps.js";
3
+ export declare function BaseMenuItem(props: ChartBaseMenuItemProps): React.JSX.Element;
@@ -0,0 +1,27 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["inert", "iconStart", "iconEnd", "children"];
4
+ import * as React from 'react';
5
+ import MenuItem from '@mui/material/MenuItem';
6
+ import ListItemIcon from '@mui/material/ListItemIcon';
7
+ import ListItemText from '@mui/material/ListItemText';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export function BaseMenuItem(props) {
10
+ const {
11
+ inert,
12
+ iconStart,
13
+ iconEnd,
14
+ children
15
+ } = props,
16
+ other = _objectWithoutPropertiesLoose(props, _excluded);
17
+ return /*#__PURE__*/_jsxs(MenuItem, _extends({}, other, {
18
+ disableRipple: inert ? true : other.disableRipple,
19
+ children: [iconStart && /*#__PURE__*/_jsx(ListItemIcon, {
20
+ children: iconStart
21
+ }, "1"), /*#__PURE__*/_jsx(ListItemText, {
22
+ children: children
23
+ }, "2"), iconEnd && /*#__PURE__*/_jsx(ListItemIcon, {
24
+ children: iconEnd
25
+ }, "3")]
26
+ }));
27
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { ChartBasePopperProps } from "../../slots/chartBaseSlotProps.js";
3
+ export declare function BasePopper(props: ChartBasePopperProps): React.JSX.Element;
@@ -0,0 +1,122 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["ref", "open", "children", "className", "clickAwayTouchEvent", "clickAwayMouseEvent", "flip", "focusTrap", "onExited", "onClickAway", "onDidShow", "onDidHide", "id", "target", "transition", "placement"];
4
+ import * as React from 'react';
5
+ import Popper from '@mui/material/Popper';
6
+ import MUIFocusTrap from '@mui/material/Unstable_TrapFocus';
7
+ import ClickAwayListener from '@mui/material/ClickAwayListener';
8
+ import Grow from '@mui/material/Grow';
9
+ import Paper from '@mui/material/Paper';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ function clickAwayWrapper(props, content) {
12
+ if (props.onClickAway === undefined) {
13
+ return content;
14
+ }
15
+ return /*#__PURE__*/_jsx(ClickAwayListener, {
16
+ onClickAway: props.onClickAway,
17
+ touchEvent: props.clickAwayTouchEvent,
18
+ mouseEvent: props.clickAwayMouseEvent,
19
+ children: content
20
+ });
21
+ }
22
+ function focusTrapWrapper(props, content) {
23
+ if (props.focusTrap === undefined) {
24
+ return content;
25
+ }
26
+ return /*#__PURE__*/_jsx(MUIFocusTrap, {
27
+ open: true,
28
+ disableEnforceFocus: true,
29
+ disableAutoFocus: true,
30
+ children: /*#__PURE__*/_jsx("div", {
31
+ tabIndex: -1,
32
+ children: content
33
+ })
34
+ });
35
+ }
36
+ function wrappers(props, content) {
37
+ return focusTrapWrapper(props, clickAwayWrapper(props, content));
38
+ }
39
+ const transformOrigin = {
40
+ 'bottom-start': 'top left',
41
+ 'bottom-end': 'top right'
42
+ };
43
+ export function BasePopper(props) {
44
+ const {
45
+ open,
46
+ children,
47
+ className,
48
+ flip,
49
+ onExited,
50
+ onDidShow,
51
+ onDidHide,
52
+ id,
53
+ target,
54
+ transition,
55
+ placement
56
+ } = props,
57
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
58
+ const modifiers = React.useMemo(() => {
59
+ const result = [{
60
+ name: 'preventOverflow',
61
+ options: {
62
+ padding: 8
63
+ }
64
+ }];
65
+ if (flip) {
66
+ result.push({
67
+ name: 'flip',
68
+ enabled: true,
69
+ options: {
70
+ rootBoundary: 'document'
71
+ }
72
+ });
73
+ }
74
+ if (onDidShow || onDidHide) {
75
+ result.push({
76
+ name: 'isPlaced',
77
+ enabled: true,
78
+ phase: 'main',
79
+ fn: () => {
80
+ onDidShow?.();
81
+ },
82
+ effect: () => () => {
83
+ onDidHide?.();
84
+ }
85
+ });
86
+ }
87
+ return result;
88
+ }, [flip, onDidShow, onDidHide]);
89
+ let content;
90
+ if (!transition) {
91
+ content = wrappers(props, children);
92
+ } else {
93
+ const handleExited = popperOnExited => node => {
94
+ if (popperOnExited) {
95
+ popperOnExited();
96
+ }
97
+ if (onExited) {
98
+ onExited(node);
99
+ }
100
+ };
101
+ content = p => wrappers(props, /*#__PURE__*/_jsx(Grow, _extends({}, p.TransitionProps, {
102
+ style: {
103
+ transformOrigin: transformOrigin[p.placement]
104
+ },
105
+ onExited: handleExited(p.TransitionProps?.onExited),
106
+ children: /*#__PURE__*/_jsx(Paper, {
107
+ children: children
108
+ })
109
+ })));
110
+ }
111
+ return /*#__PURE__*/_jsx(Popper, _extends({
112
+ id: id,
113
+ className: className,
114
+ open: open,
115
+ anchorEl: target,
116
+ transition: transition,
117
+ placement: placement,
118
+ modifiers: modifiers
119
+ }, rest, {
120
+ children: content
121
+ }));
122
+ }
@@ -1,3 +1,4 @@
1
1
  import * as React from 'react';
2
2
  export declare const ChartsZoomInIcon: (props: import("@mui/x-charts").ChartBaseIconProps) => React.ReactNode;
3
- export declare const ChartsZoomOutIcon: (props: import("@mui/x-charts").ChartBaseIconProps) => React.ReactNode;
3
+ export declare const ChartsZoomOutIcon: (props: import("@mui/x-charts").ChartBaseIconProps) => React.ReactNode;
4
+ export declare const ChartsExportIcon: (props: import("@mui/x-charts").ChartBaseIconProps) => React.ReactNode;
@@ -10,4 +10,7 @@ export const ChartsZoomInIcon = createSvgIcon(/*#__PURE__*/_jsxs(React.Fragment,
10
10
  }), 'ZoomIn');
11
11
  export const ChartsZoomOutIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
12
12
  d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14M7 9h5v1H7z"
13
- }), 'ZoomOut');
13
+ }), 'ZoomOut');
14
+ export const ChartsExportIcon = createSvgIcon(/*#__PURE__*/_jsx("path", {
15
+ d: "M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"
16
+ }), 'Export');
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { ChartsBaseSlotsPro } from "../slots/chartsBaseSlots.js";
2
3
  import { ChartsIconSlotsPro } from "../slots/chartsIconSlots.js";
3
4
  export type ChartsSlotsPro = ChartsBaseSlotsPro & ChartsIconSlotsPro;
@@ -1,12 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import Tooltip from '@mui/material/Tooltip';
3
+ import MenuList from '@mui/material/MenuList';
4
+ import Divider from '@mui/material/Divider';
3
5
  import { defaultSlotsMaterial as communityDefaultSlotsMaterial } from '@mui/x-charts/internals';
4
- import { ChartsZoomInIcon, ChartsZoomOutIcon } from "./icons.js";
6
+ import { BaseMenuItem } from "./components/BaseMenuItem.js";
7
+ import { BasePopper } from "./components/BasePopper.js";
8
+ import { ChartsExportIcon, ChartsZoomInIcon, ChartsZoomOutIcon } from "./icons.js";
5
9
  const baseSlots = {
6
- baseTooltip: Tooltip
10
+ baseTooltip: Tooltip,
11
+ basePopper: BasePopper,
12
+ baseMenuList: MenuList,
13
+ baseMenuItem: BaseMenuItem,
14
+ baseDivider: Divider
7
15
  };
8
16
  const iconSlots = {
9
17
  zoomInIcon: ChartsZoomInIcon,
10
- zoomOutIcon: ChartsZoomOutIcon
18
+ zoomOutIcon: ChartsZoomOutIcon,
19
+ exportIcon: ChartsExportIcon
11
20
  };
12
21
  export const defaultSlotsMaterial = _extends({}, communityDefaultSlotsMaterial, baseSlots, iconSlots);
@@ -15,7 +15,6 @@ export function printChart(element, {
15
15
  const rootCandidate = element.getRootNode();
16
16
  const root = rootCandidate.constructor.name === 'ShadowRoot' ? rootCandidate : doc;
17
17
  await Promise.all(loadStyleSheets(printDoc, root));
18
- printWindow.contentWindow.print();
19
18
  const mediaQueryList = printWindow.contentWindow.matchMedia('print');
20
19
  mediaQueryList.addEventListener('change', mql => {
21
20
  const isAfterPrint = mql.matches === false;
@@ -23,6 +22,7 @@ export function printChart(element, {
23
22
  doc.body.removeChild(printWindow);
24
23
  }
25
24
  });
25
+ printWindow.contentWindow.print();
26
26
  };
27
27
  doc.body.appendChild(printWindow);
28
28
  }
@@ -7,29 +7,30 @@ export interface UseChartProExportState {
7
7
  /**
8
8
  * The options to apply on the Print export.
9
9
  * @demos
10
- * - [Print export](/x/react-charts/export/#print-export-as-pdf)
10
+ * - [Print export](https://mui.com/x/react-charts/export/#print-export-as-pdf)
11
11
  */
12
12
  export interface ChartPrintExportOptions {
13
13
  /**
14
- * The value to be used as the print window title.
15
- * @default The title of the page.
14
+ * The name of the file without the extension.
15
+ * @default The title of the document the chart belongs to
16
16
  */
17
17
  fileName?: string;
18
18
  }
19
19
  /**
20
20
  * The options to apply on the image export.
21
21
  * @demos
22
- * - [Image export](/x/react-charts/export/#export-as-image)
22
+ * - [Image export](https://mui.com/x/react-charts/export/#export-as-image)
23
23
  */
24
24
  export interface ChartImageExportOptions {
25
25
  /**
26
- * The value to be used as the print window title.
27
- * @default The title of the page.
26
+ * The name of the file without the extension.
27
+ * @default The title of the document the chart belongs to
28
28
  */
29
29
  fileName?: string;
30
30
  /**
31
31
  * The format of the image to be exported.
32
32
  * Browsers are required to support 'image/png'. Some browsers also support 'image/jpeg' and 'image/webp'.
33
+ * If the provided `type` is not supported by the browser, it will default to 'image/png'.
33
34
  * @default 'image/png'
34
35
  */
35
36
  type?: 'image/png' | string;