@mui/x-charts-pro 9.3.0 → 9.5.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 (132) hide show
  1. package/BarChartPro/BarChartPro.js +33 -3
  2. package/BarChartPro/BarChartPro.mjs +34 -4
  3. package/CHANGELOG.md +296 -0
  4. package/ChartsDataProviderPro/ChartsDataProviderPro.js +2 -2
  5. package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +2 -2
  6. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +1 -0
  7. package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.mjs +1 -0
  8. package/ChartsToolbarPro/ChartsToolbarPro.d.mts +1 -1
  9. package/ChartsToolbarPro/ChartsToolbarPro.d.ts +1 -1
  10. package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.d.mts +1 -1
  11. package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.d.ts +1 -1
  12. package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.js +35 -38
  13. package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.mjs +37 -40
  14. package/ChartsToolbarPro/Toolbar.types.d.mts +3 -2
  15. package/ChartsToolbarPro/Toolbar.types.d.ts +3 -2
  16. package/ChartsToolbarPro/rangeButtonValueToZoom.d.mts +18 -2
  17. package/ChartsToolbarPro/rangeButtonValueToZoom.d.ts +18 -2
  18. package/ChartsToolbarPro/rangeButtonValueToZoom.js +73 -10
  19. package/ChartsToolbarPro/rangeButtonValueToZoom.mjs +72 -10
  20. package/ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.js +9 -2
  21. package/ChartsZoomSlider/internals/chartsAxisZoomSliderThumbClasses.mjs +9 -2
  22. package/ChartsZoomSlider/internals/previews/ScatterPreviewPlot.js +2 -1
  23. package/ChartsZoomSlider/internals/previews/ScatterPreviewPlot.mjs +2 -1
  24. package/FunnelChart/funnel.types.d.mts +1 -1
  25. package/FunnelChart/funnel.types.d.ts +1 -1
  26. package/FunnelChart/funnelPlotSlots.types.d.mts +5 -4
  27. package/FunnelChart/funnelPlotSlots.types.d.ts +5 -4
  28. package/Heatmap/Heatmap.d.mts +3 -2
  29. package/Heatmap/Heatmap.d.ts +3 -2
  30. package/Heatmap/Heatmap.js +32 -2
  31. package/Heatmap/Heatmap.mjs +32 -2
  32. package/Heatmap/HeatmapItem.d.mts +3 -2
  33. package/Heatmap/HeatmapItem.d.ts +3 -2
  34. package/Heatmap/HeatmapItem.js +2 -0
  35. package/Heatmap/HeatmapItem.mjs +2 -0
  36. package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.mts +3 -2
  37. package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +3 -2
  38. package/LineChartPro/LineChartPro.js +33 -3
  39. package/LineChartPro/LineChartPro.mjs +34 -4
  40. package/PieChartPro/PieChartPro.js +1 -1
  41. package/PieChartPro/PieChartPro.mjs +2 -2
  42. package/RadarChartPro/RadarChartPro.js +1 -1
  43. package/RadarChartPro/RadarChartPro.mjs +2 -2
  44. package/ScatterChartPro/ScatterChartPro.d.mts +2 -1
  45. package/ScatterChartPro/ScatterChartPro.d.ts +2 -1
  46. package/ScatterChartPro/ScatterChartPro.js +40 -6
  47. package/ScatterChartPro/ScatterChartPro.mjs +41 -7
  48. package/ScatterChartPro/ScatterChartPro.plugins.d.mts +2 -2
  49. package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -2
  50. package/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
  51. package/ScatterChartPro/ScatterChartPro.plugins.mjs +2 -2
  52. package/index.js +1 -1
  53. package/index.mjs +1 -1
  54. package/internals/plugins/allPlugins.d.mts +5 -5
  55. package/internals/plugins/allPlugins.d.ts +5 -5
  56. package/internals/plugins/allPlugins.js +2 -2
  57. package/internals/plugins/allPlugins.mjs +3 -3
  58. package/internals/plugins/useChartProExport/exportImage.js +8 -2
  59. package/internals/plugins/useChartProExport/exportImage.mjs +8 -2
  60. package/internals/plugins/useChartProExport/print.js +1 -0
  61. package/internals/plugins/useChartProExport/print.mjs +1 -0
  62. package/internals/plugins/useChartProExport/useChartProExport.types.d.mts +6 -0
  63. package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +6 -0
  64. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.mts +36 -4
  65. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +36 -4
  66. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.js +2 -4
  67. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.mjs +1 -3
  68. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.mts +11 -11
  69. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +11 -11
  70. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.mts +0 -1
  71. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +0 -1
  72. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +9 -65
  73. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.mjs +9 -64
  74. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.mts +0 -1
  75. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +0 -1
  76. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +9 -69
  77. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.mjs +9 -68
  78. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.mts +0 -1
  79. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +0 -1
  80. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +9 -39
  81. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.mjs +10 -39
  82. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.mts +0 -1
  83. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +0 -1
  84. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +9 -58
  85. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.mjs +10 -58
  86. package/internals/plugins/useChartProZoom/useChartProZoom.js +77 -14
  87. package/internals/plugins/useChartProZoom/useChartProZoom.mjs +79 -15
  88. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.mts +0 -3
  89. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -3
  90. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -2
  91. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.mjs +0 -1
  92. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.mts +28 -11
  93. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +28 -11
  94. package/internals/plugins/zoomGestures/index.d.mts +5 -0
  95. package/internals/plugins/zoomGestures/index.d.ts +5 -0
  96. package/internals/plugins/zoomGestures/index.js +33 -0
  97. package/internals/plugins/zoomGestures/index.mjs +4 -0
  98. package/internals/plugins/zoomGestures/useDragGesture.d.mts +30 -0
  99. package/internals/plugins/zoomGestures/useDragGesture.d.ts +30 -0
  100. package/internals/plugins/zoomGestures/useDragGesture.js +105 -0
  101. package/internals/plugins/zoomGestures/useDragGesture.mjs +99 -0
  102. package/internals/plugins/zoomGestures/useDragOnPressGesture.d.mts +30 -0
  103. package/internals/plugins/zoomGestures/useDragOnPressGesture.d.ts +30 -0
  104. package/internals/plugins/zoomGestures/useDragOnPressGesture.js +105 -0
  105. package/internals/plugins/zoomGestures/useDragOnPressGesture.mjs +99 -0
  106. package/internals/plugins/zoomGestures/usePinchGesture.d.mts +22 -0
  107. package/internals/plugins/zoomGestures/usePinchGesture.d.ts +22 -0
  108. package/internals/plugins/zoomGestures/usePinchGesture.js +77 -0
  109. package/internals/plugins/zoomGestures/usePinchGesture.mjs +71 -0
  110. package/internals/plugins/zoomGestures/useWheelGesture.d.mts +21 -0
  111. package/internals/plugins/zoomGestures/useWheelGesture.d.ts +21 -0
  112. package/internals/plugins/zoomGestures/useWheelGesture.js +78 -0
  113. package/internals/plugins/zoomGestures/useWheelGesture.mjs +72 -0
  114. package/internals/plugins/zoomGestures/zoomGestures.types.d.mts +29 -0
  115. package/internals/plugins/zoomGestures/zoomGestures.types.d.ts +29 -0
  116. package/internals/plugins/zoomGestures/zoomGestures.types.js +5 -0
  117. package/internals/plugins/zoomGestures/zoomGestures.types.mjs +1 -0
  118. package/internals/slots/chartsBaseSlots.d.mts +6 -5
  119. package/internals/slots/chartsBaseSlots.d.ts +6 -5
  120. package/internals/slots/chartsIconSlots.d.mts +4 -3
  121. package/internals/slots/chartsIconSlots.d.ts +4 -3
  122. package/models/chartsSlotsComponentsPropsPro.d.mts +11 -0
  123. package/models/chartsSlotsComponentsPropsPro.d.ts +11 -0
  124. package/models/chartsSlotsComponentsPropsPro.js +5 -0
  125. package/models/chartsSlotsComponentsPropsPro.mjs +1 -0
  126. package/models/index.d.mts +1 -0
  127. package/models/index.d.ts +1 -0
  128. package/models/index.js +12 -0
  129. package/models/index.mjs +1 -0
  130. package/models/seriesType/heatmap.d.mts +1 -1
  131. package/models/seriesType/heatmap.d.ts +1 -1
  132. package/package.json +5 -5
@@ -0,0 +1,22 @@
1
+ import type { KeyboardKey } from '@mui/x-internal-gestures/core';
2
+ import type { ChartPoint, GestureInstance } from "./zoomGestures.types.js";
3
+ export interface UsePinchGestureOptions {
4
+ /** Whether the gesture is active. */
5
+ enabled: boolean;
6
+ /** Keys that must be held for the pinch to trigger the gesture. */
7
+ requiredKeys?: KeyboardKey[];
8
+ /**
9
+ * Called (rAF-throttled) on each pinch update.
10
+ *
11
+ * @param {ChartPoint} point The pinch centroid, in SVG coordinates.
12
+ * @param {number} deltaScale The scale change since the last call.
13
+ * @param {number} direction `> 0` when zooming in, `< 0` when zooming out.
14
+ */
15
+ onPinch: (point: ChartPoint, deltaScale: number, direction: number) => void;
16
+ }
17
+ /**
18
+ * Generic pinch gesture binding.
19
+ *
20
+ * It owns the listener lifecycle, and lets you create your own interactions from the centroid and scale delta it forwards to `onPinch`.
21
+ */
22
+ export declare function usePinchGesture(instance: GestureInstance, options: UsePinchGestureOptions): void;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.usePinchGesture = usePinchGesture;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _internals = require("@mui/x-charts/internals");
11
+ var _rafThrottle = require("@mui/x-internals/rafThrottle");
12
+ /**
13
+ * Generic pinch gesture binding.
14
+ *
15
+ * It owns the listener lifecycle, and lets you create your own interactions from the centroid and scale delta it forwards to `onPinch`.
16
+ */
17
+ function usePinchGesture(instance, options) {
18
+ const {
19
+ enabled,
20
+ requiredKeys,
21
+ onPinch
22
+ } = options;
23
+ const {
24
+ chartsLayerContainerRef
25
+ } = instance;
26
+ const onPinchRef = React.useRef(onPinch);
27
+ React.useEffect(() => {
28
+ onPinchRef.current = onPinch;
29
+ });
30
+ React.useEffect(() => {
31
+ if (!enabled) {
32
+ return;
33
+ }
34
+ instance.updateZoomInteractionListeners('zoomPinch', {
35
+ requiredKeys
36
+ });
37
+ }, [enabled, requiredKeys, instance]);
38
+ React.useEffect(() => {
39
+ const element = chartsLayerContainerRef.current;
40
+ if (element === null || !enabled) {
41
+ return () => {};
42
+ }
43
+ const latest = {
44
+ point: {
45
+ x: 0,
46
+ y: 0
47
+ },
48
+ deltaScale: 0,
49
+ direction: 0,
50
+ valid: false
51
+ };
52
+ const flush = (0, _rafThrottle.rafThrottle)(() => {
53
+ if (latest.valid) {
54
+ onPinchRef.current(latest.point, latest.deltaScale, latest.direction);
55
+ latest.valid = false;
56
+ }
57
+ });
58
+ const handler = instance.addInteractionListener('zoomPinch', event => {
59
+ // A direction of 0 means the pinch gesture is not yet meaningful.
60
+ if (event.detail.direction === 0) {
61
+ return;
62
+ }
63
+ latest.point = (0, _internals.getChartPoint)(element, {
64
+ clientX: event.detail.centroid.x,
65
+ clientY: event.detail.centroid.y
66
+ });
67
+ latest.deltaScale = event.detail.deltaScale;
68
+ latest.direction = event.detail.direction;
69
+ latest.valid = true;
70
+ flush();
71
+ });
72
+ return () => {
73
+ handler.cleanup();
74
+ flush.clear();
75
+ };
76
+ }, [chartsLayerContainerRef, enabled, instance]);
77
+ }
@@ -0,0 +1,71 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { getChartPoint } from '@mui/x-charts/internals';
5
+ import { rafThrottle } from '@mui/x-internals/rafThrottle';
6
+ /**
7
+ * Generic pinch gesture binding.
8
+ *
9
+ * It owns the listener lifecycle, and lets you create your own interactions from the centroid and scale delta it forwards to `onPinch`.
10
+ */
11
+ export function usePinchGesture(instance, options) {
12
+ const {
13
+ enabled,
14
+ requiredKeys,
15
+ onPinch
16
+ } = options;
17
+ const {
18
+ chartsLayerContainerRef
19
+ } = instance;
20
+ const onPinchRef = React.useRef(onPinch);
21
+ React.useEffect(() => {
22
+ onPinchRef.current = onPinch;
23
+ });
24
+ React.useEffect(() => {
25
+ if (!enabled) {
26
+ return;
27
+ }
28
+ instance.updateZoomInteractionListeners('zoomPinch', {
29
+ requiredKeys
30
+ });
31
+ }, [enabled, requiredKeys, instance]);
32
+ React.useEffect(() => {
33
+ const element = chartsLayerContainerRef.current;
34
+ if (element === null || !enabled) {
35
+ return () => {};
36
+ }
37
+ const latest = {
38
+ point: {
39
+ x: 0,
40
+ y: 0
41
+ },
42
+ deltaScale: 0,
43
+ direction: 0,
44
+ valid: false
45
+ };
46
+ const flush = rafThrottle(() => {
47
+ if (latest.valid) {
48
+ onPinchRef.current(latest.point, latest.deltaScale, latest.direction);
49
+ latest.valid = false;
50
+ }
51
+ });
52
+ const handler = instance.addInteractionListener('zoomPinch', event => {
53
+ // A direction of 0 means the pinch gesture is not yet meaningful.
54
+ if (event.detail.direction === 0) {
55
+ return;
56
+ }
57
+ latest.point = getChartPoint(element, {
58
+ clientX: event.detail.centroid.x,
59
+ clientY: event.detail.centroid.y
60
+ });
61
+ latest.deltaScale = event.detail.deltaScale;
62
+ latest.direction = event.detail.direction;
63
+ latest.valid = true;
64
+ flush();
65
+ });
66
+ return () => {
67
+ handler.cleanup();
68
+ flush.clear();
69
+ };
70
+ }, [chartsLayerContainerRef, enabled, instance]);
71
+ }
@@ -0,0 +1,21 @@
1
+ import { type KeyboardKey } from '@mui/x-internal-gestures/core';
2
+ import { type ChartPoint, type GestureInstance } from "./zoomGestures.types.mjs";
3
+ export interface UseWheelGestureOptions {
4
+ /** Whether the gesture is active. */
5
+ enabled: boolean;
6
+ /** Keys that must be held for the wheel to trigger the gesture. */
7
+ requiredKeys?: KeyboardKey[];
8
+ /**
9
+ * Called on each wheel tick inside the drawing area.
10
+ *
11
+ * @param {ChartPoint} point The wheel focal point, in SVG coordinates.
12
+ * @param {WheelEvent} event The `WheelEvent`.
13
+ */
14
+ onWheel: (point: ChartPoint, event: WheelEvent) => void;
15
+ }
16
+ /**
17
+ * Generic wheel gesture binding.
18
+ *
19
+ * It owns the listener lifecycle, and lets you create your own interactions from the focal point and wheel event it forwards to `onWheel`.
20
+ */
21
+ export declare function useWheelGesture(instance: GestureInstance, options: UseWheelGestureOptions): void;
@@ -0,0 +1,21 @@
1
+ import { type KeyboardKey } from '@mui/x-internal-gestures/core';
2
+ import { type ChartPoint, type GestureInstance } from "./zoomGestures.types.js";
3
+ export interface UseWheelGestureOptions {
4
+ /** Whether the gesture is active. */
5
+ enabled: boolean;
6
+ /** Keys that must be held for the wheel to trigger the gesture. */
7
+ requiredKeys?: KeyboardKey[];
8
+ /**
9
+ * Called on each wheel tick inside the drawing area.
10
+ *
11
+ * @param {ChartPoint} point The wheel focal point, in SVG coordinates.
12
+ * @param {WheelEvent} event The `WheelEvent`.
13
+ */
14
+ onWheel: (point: ChartPoint, event: WheelEvent) => void;
15
+ }
16
+ /**
17
+ * Generic wheel gesture binding.
18
+ *
19
+ * It owns the listener lifecycle, and lets you create your own interactions from the focal point and wheel event it forwards to `onWheel`.
20
+ */
21
+ export declare function useWheelGesture(instance: GestureInstance, options: UseWheelGestureOptions): void;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useWheelGesture = useWheelGesture;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _rafThrottle = require("@mui/x-internals/rafThrottle");
11
+ var _internals = require("@mui/x-charts/internals");
12
+ /**
13
+ * Generic wheel gesture binding.
14
+ *
15
+ * It owns the listener lifecycle, and lets you create your own interactions from the focal point and wheel event it forwards to `onWheel`.
16
+ */
17
+ function useWheelGesture(instance, options) {
18
+ const {
19
+ enabled,
20
+ requiredKeys,
21
+ onWheel
22
+ } = options;
23
+ const {
24
+ chartsLayerContainerRef
25
+ } = instance;
26
+ const startedOutsideRef = React.useRef(false);
27
+ const startedOutsideTimeoutRef = React.useRef(null);
28
+ const onWheelRef = React.useRef(onWheel);
29
+ React.useEffect(() => {
30
+ onWheelRef.current = onWheel;
31
+ });
32
+ React.useEffect(() => {
33
+ if (!enabled) {
34
+ return;
35
+ }
36
+ instance.updateZoomInteractionListeners('zoomTurnWheel', {
37
+ requiredKeys
38
+ });
39
+ }, [enabled, requiredKeys, instance]);
40
+ React.useEffect(() => {
41
+ const element = chartsLayerContainerRef.current;
42
+ if (element === null || !enabled) {
43
+ return () => {};
44
+ }
45
+ const rafThrottledOnWheel = (0, _rafThrottle.rafThrottle)(onWheelRef.current);
46
+ const handler = instance.addInteractionListener('zoomTurnWheel', event => {
47
+ const point = (0, _internals.getChartPoint)(element, {
48
+ clientX: event.detail.centroid.x,
49
+ clientY: event.detail.centroid.y
50
+ });
51
+
52
+ // Ignore wheel events that started outside the chart area (e.g. while page-scrolling
53
+ // over the chart). The timeout debounces re-entry caused by the scroll itself.
54
+ if (startedOutsideRef.current || !instance.isPointInside(point.x, point.y)) {
55
+ startedOutsideRef.current = true;
56
+ if (startedOutsideTimeoutRef.current) {
57
+ clearTimeout(startedOutsideTimeoutRef.current);
58
+ }
59
+ startedOutsideTimeoutRef.current = setTimeout(() => {
60
+ startedOutsideRef.current = false;
61
+ startedOutsideTimeoutRef.current = null;
62
+ }, 100);
63
+ return;
64
+ }
65
+ event.detail.srcEvent.preventDefault();
66
+ rafThrottledOnWheel(point, event.detail.srcEvent);
67
+ });
68
+ return () => {
69
+ handler.cleanup();
70
+ if (startedOutsideTimeoutRef.current) {
71
+ clearTimeout(startedOutsideTimeoutRef.current);
72
+ startedOutsideTimeoutRef.current = null;
73
+ }
74
+ startedOutsideRef.current = false;
75
+ rafThrottledOnWheel.clear();
76
+ };
77
+ }, [chartsLayerContainerRef, enabled, instance]);
78
+ }
@@ -0,0 +1,72 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { rafThrottle } from '@mui/x-internals/rafThrottle';
5
+ import { getChartPoint } from '@mui/x-charts/internals';
6
+ /**
7
+ * Generic wheel gesture binding.
8
+ *
9
+ * It owns the listener lifecycle, and lets you create your own interactions from the focal point and wheel event it forwards to `onWheel`.
10
+ */
11
+ export function useWheelGesture(instance, options) {
12
+ const {
13
+ enabled,
14
+ requiredKeys,
15
+ onWheel
16
+ } = options;
17
+ const {
18
+ chartsLayerContainerRef
19
+ } = instance;
20
+ const startedOutsideRef = React.useRef(false);
21
+ const startedOutsideTimeoutRef = React.useRef(null);
22
+ const onWheelRef = React.useRef(onWheel);
23
+ React.useEffect(() => {
24
+ onWheelRef.current = onWheel;
25
+ });
26
+ React.useEffect(() => {
27
+ if (!enabled) {
28
+ return;
29
+ }
30
+ instance.updateZoomInteractionListeners('zoomTurnWheel', {
31
+ requiredKeys
32
+ });
33
+ }, [enabled, requiredKeys, instance]);
34
+ React.useEffect(() => {
35
+ const element = chartsLayerContainerRef.current;
36
+ if (element === null || !enabled) {
37
+ return () => {};
38
+ }
39
+ const rafThrottledOnWheel = rafThrottle(onWheelRef.current);
40
+ const handler = instance.addInteractionListener('zoomTurnWheel', event => {
41
+ const point = getChartPoint(element, {
42
+ clientX: event.detail.centroid.x,
43
+ clientY: event.detail.centroid.y
44
+ });
45
+
46
+ // Ignore wheel events that started outside the chart area (e.g. while page-scrolling
47
+ // over the chart). The timeout debounces re-entry caused by the scroll itself.
48
+ if (startedOutsideRef.current || !instance.isPointInside(point.x, point.y)) {
49
+ startedOutsideRef.current = true;
50
+ if (startedOutsideTimeoutRef.current) {
51
+ clearTimeout(startedOutsideTimeoutRef.current);
52
+ }
53
+ startedOutsideTimeoutRef.current = setTimeout(() => {
54
+ startedOutsideRef.current = false;
55
+ startedOutsideTimeoutRef.current = null;
56
+ }, 100);
57
+ return;
58
+ }
59
+ event.detail.srcEvent.preventDefault();
60
+ rafThrottledOnWheel(point, event.detail.srcEvent);
61
+ });
62
+ return () => {
63
+ handler.cleanup();
64
+ if (startedOutsideTimeoutRef.current) {
65
+ clearTimeout(startedOutsideTimeoutRef.current);
66
+ startedOutsideTimeoutRef.current = null;
67
+ }
68
+ startedOutsideRef.current = false;
69
+ rafThrottledOnWheel.clear();
70
+ };
71
+ }, [chartsLayerContainerRef, enabled, instance]);
72
+ }
@@ -0,0 +1,29 @@
1
+ import type * as React from 'react';
2
+ import type { KeyboardKey, PointerMode } from '@mui/x-internal-gestures/core';
3
+ import type { UseChartInteractionListenerInstance } from '@mui/x-charts/internals';
4
+ /**
5
+ * The minimal slice of a chart instance required to bind zoom/pan gestures.
6
+ */
7
+ export interface GestureInstance {
8
+ chartsLayerContainerRef: React.RefObject<HTMLDivElement | null>;
9
+ addInteractionListener: UseChartInteractionListenerInstance['addInteractionListener'];
10
+ updateZoomInteractionListeners: UseChartInteractionListenerInstance['updateZoomInteractionListeners'];
11
+ isPointInside: (x: number, y: number, targetElement?: Element | EventTarget | null) => boolean;
12
+ }
13
+ /**
14
+ * Pointer and keyboard gating for a pan gesture.
15
+ */
16
+ export interface PanGestureConfig {
17
+ requiredKeys?: KeyboardKey[];
18
+ pointerMode?: PointerMode[];
19
+ mouse?: {
20
+ requiredKeys?: KeyboardKey[];
21
+ };
22
+ touch?: {
23
+ requiredKeys?: KeyboardKey[];
24
+ };
25
+ }
26
+ export interface ChartPoint {
27
+ x: number;
28
+ y: number;
29
+ }
@@ -0,0 +1,29 @@
1
+ import type * as React from 'react';
2
+ import type { KeyboardKey, PointerMode } from '@mui/x-internal-gestures/core';
3
+ import type { UseChartInteractionListenerInstance } from '@mui/x-charts/internals';
4
+ /**
5
+ * The minimal slice of a chart instance required to bind zoom/pan gestures.
6
+ */
7
+ export interface GestureInstance {
8
+ chartsLayerContainerRef: React.RefObject<HTMLDivElement | null>;
9
+ addInteractionListener: UseChartInteractionListenerInstance['addInteractionListener'];
10
+ updateZoomInteractionListeners: UseChartInteractionListenerInstance['updateZoomInteractionListeners'];
11
+ isPointInside: (x: number, y: number, targetElement?: Element | EventTarget | null) => boolean;
12
+ }
13
+ /**
14
+ * Pointer and keyboard gating for a pan gesture.
15
+ */
16
+ export interface PanGestureConfig {
17
+ requiredKeys?: KeyboardKey[];
18
+ pointerMode?: PointerMode[];
19
+ mouse?: {
20
+ requiredKeys?: KeyboardKey[];
21
+ };
22
+ touch?: {
23
+ requiredKeys?: KeyboardKey[];
24
+ };
25
+ }
26
+ export interface ChartPoint {
27
+ x: number;
28
+ y: number;
29
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,10 +1,11 @@
1
1
  import { type ChartsBaseSlots } from '@mui/x-charts/models';
2
2
  import type * as React from 'react';
3
3
  import { type ChartBaseDividerProps, type ChartBaseMenuItemProps, type ChartBaseMenuListProps, type ChartBasePopperProps, type ChartBaseTooltipProps } from "./chartBaseSlotProps.mjs";
4
+ import type { BaseDividerPropsOverrides, BaseMenuItemPropsOverrides, BaseMenuListPropsOverrides, BasePopperPropsOverrides, BaseTooltipPropsOverrides } from "../../models/chartsSlotsComponentsPropsPro.mjs";
4
5
  export interface ChartsBaseSlotsPro extends ChartsBaseSlots {
5
- baseDivider: React.ComponentType<ChartBaseDividerProps>;
6
- baseMenuItem: React.ComponentType<ChartBaseMenuItemProps>;
7
- baseMenuList: React.ComponentType<ChartBaseMenuListProps>;
8
- basePopper: React.ComponentType<ChartBasePopperProps>;
9
- baseTooltip: React.ComponentType<ChartBaseTooltipProps>;
6
+ baseDivider: React.ComponentType<ChartBaseDividerProps & BaseDividerPropsOverrides>;
7
+ baseMenuItem: React.ComponentType<ChartBaseMenuItemProps & BaseMenuItemPropsOverrides>;
8
+ baseMenuList: React.ComponentType<ChartBaseMenuListProps & BaseMenuListPropsOverrides>;
9
+ basePopper: React.ComponentType<ChartBasePopperProps & BasePopperPropsOverrides>;
10
+ baseTooltip: React.ComponentType<ChartBaseTooltipProps & BaseTooltipPropsOverrides>;
10
11
  }
@@ -1,10 +1,11 @@
1
1
  import { type ChartsBaseSlots } from '@mui/x-charts/models';
2
2
  import type * as React from 'react';
3
3
  import { type ChartBaseDividerProps, type ChartBaseMenuItemProps, type ChartBaseMenuListProps, type ChartBasePopperProps, type ChartBaseTooltipProps } from "./chartBaseSlotProps.js";
4
+ import type { BaseDividerPropsOverrides, BaseMenuItemPropsOverrides, BaseMenuListPropsOverrides, BasePopperPropsOverrides, BaseTooltipPropsOverrides } from "../../models/chartsSlotsComponentsPropsPro.js";
4
5
  export interface ChartsBaseSlotsPro extends ChartsBaseSlots {
5
- baseDivider: React.ComponentType<ChartBaseDividerProps>;
6
- baseMenuItem: React.ComponentType<ChartBaseMenuItemProps>;
7
- baseMenuList: React.ComponentType<ChartBaseMenuListProps>;
8
- basePopper: React.ComponentType<ChartBasePopperProps>;
9
- baseTooltip: React.ComponentType<ChartBaseTooltipProps>;
6
+ baseDivider: React.ComponentType<ChartBaseDividerProps & BaseDividerPropsOverrides>;
7
+ baseMenuItem: React.ComponentType<ChartBaseMenuItemProps & BaseMenuItemPropsOverrides>;
8
+ baseMenuList: React.ComponentType<ChartBaseMenuListProps & BaseMenuListPropsOverrides>;
9
+ basePopper: React.ComponentType<ChartBasePopperProps & BasePopperPropsOverrides>;
10
+ baseTooltip: React.ComponentType<ChartBaseTooltipProps & BaseTooltipPropsOverrides>;
10
11
  }
@@ -1,19 +1,20 @@
1
1
  import type * as React from 'react';
2
2
  import { type ChartBaseIconProps, type ChartsIconSlots } from '@mui/x-charts/models';
3
+ import type { ZoomInIconPropsOverrides, ZoomOutIconPropsOverrides, ExportIconPropsOverrides } from "../../models/chartsSlotsComponentsPropsPro.mjs";
3
4
  export interface ChartsIconSlotsPro extends ChartsIconSlots {
4
5
  /**
5
6
  * Icon displayed on the toolbar's zoom in button.
6
7
  * @default ChartsZoomInIcon
7
8
  */
8
- zoomInIcon: React.ComponentType<ChartBaseIconProps>;
9
+ zoomInIcon: React.ComponentType<ChartBaseIconProps & ZoomInIconPropsOverrides>;
9
10
  /**
10
11
  * Icon displayed on the toolbar's zoom out button.
11
12
  * @default ChartsZoomOutIcon
12
13
  */
13
- zoomOutIcon: React.ComponentType<ChartBaseIconProps>;
14
+ zoomOutIcon: React.ComponentType<ChartBaseIconProps & ZoomOutIconPropsOverrides>;
14
15
  /**
15
16
  * Icon displayed on the toolbar's export button.
16
17
  * @default ChartsExportIcon
17
18
  */
18
- exportIcon: React.ComponentType<ChartBaseIconProps>;
19
+ exportIcon: React.ComponentType<ChartBaseIconProps & ExportIconPropsOverrides>;
19
20
  }
@@ -1,19 +1,20 @@
1
1
  import type * as React from 'react';
2
2
  import { type ChartBaseIconProps, type ChartsIconSlots } from '@mui/x-charts/models';
3
+ import type { ZoomInIconPropsOverrides, ZoomOutIconPropsOverrides, ExportIconPropsOverrides } from "../../models/chartsSlotsComponentsPropsPro.js";
3
4
  export interface ChartsIconSlotsPro extends ChartsIconSlots {
4
5
  /**
5
6
  * Icon displayed on the toolbar's zoom in button.
6
7
  * @default ChartsZoomInIcon
7
8
  */
8
- zoomInIcon: React.ComponentType<ChartBaseIconProps>;
9
+ zoomInIcon: React.ComponentType<ChartBaseIconProps & ZoomInIconPropsOverrides>;
9
10
  /**
10
11
  * Icon displayed on the toolbar's zoom out button.
11
12
  * @default ChartsZoomOutIcon
12
13
  */
13
- zoomOutIcon: React.ComponentType<ChartBaseIconProps>;
14
+ zoomOutIcon: React.ComponentType<ChartBaseIconProps & ZoomOutIconPropsOverrides>;
14
15
  /**
15
16
  * Icon displayed on the toolbar's export button.
16
17
  * @default ChartsExportIcon
17
18
  */
18
- exportIcon: React.ComponentType<ChartBaseIconProps>;
19
+ exportIcon: React.ComponentType<ChartBaseIconProps & ExportIconPropsOverrides>;
19
20
  }
@@ -0,0 +1,11 @@
1
+ export interface BaseDividerPropsOverrides {}
2
+ export interface BaseMenuItemPropsOverrides {}
3
+ export interface BaseMenuListPropsOverrides {}
4
+ export interface BasePopperPropsOverrides {}
5
+ export interface BaseTooltipPropsOverrides {}
6
+ export interface ZoomInIconPropsOverrides {}
7
+ export interface ZoomOutIconPropsOverrides {}
8
+ export interface ExportIconPropsOverrides {}
9
+ export interface CellPropsOverrides {}
10
+ export interface FunnelSectionPropsOverrides {}
11
+ export interface FunnelSectionLabelPropsOverrides {}
@@ -0,0 +1,11 @@
1
+ export interface BaseDividerPropsOverrides {}
2
+ export interface BaseMenuItemPropsOverrides {}
3
+ export interface BaseMenuListPropsOverrides {}
4
+ export interface BasePopperPropsOverrides {}
5
+ export interface BaseTooltipPropsOverrides {}
6
+ export interface ZoomInIconPropsOverrides {}
7
+ export interface ZoomOutIconPropsOverrides {}
8
+ export interface ExportIconPropsOverrides {}
9
+ export interface CellPropsOverrides {}
10
+ export interface FunnelSectionPropsOverrides {}
11
+ export interface FunnelSectionLabelPropsOverrides {}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  export * from '@mui/x-charts/models';
2
2
  export type { ZoomData, ZoomFilterMode, ZoomOptions, ZoomSliderOptions, ZoomSliderShowTooltip } from '@mui/x-charts/internals';
3
3
  export * from "./seriesType/index.mjs";
4
+ export * from "./chartsSlotsComponentsPropsPro.mjs";
4
5
  export { defaultOnBeforeExport } from "../internals/plugins/useChartProExport/defaults.mjs";
package/models/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from '@mui/x-charts/models';
2
2
  export type { ZoomData, ZoomFilterMode, ZoomOptions, ZoomSliderOptions, ZoomSliderShowTooltip } from '@mui/x-charts/internals';
3
3
  export * from "./seriesType/index.js";
4
+ export * from "./chartsSlotsComponentsPropsPro.js";
4
5
  export { defaultOnBeforeExport } from "../internals/plugins/useChartProExport/defaults.js";
package/models/index.js CHANGED
@@ -36,4 +36,16 @@ Object.keys(_seriesType).forEach(function (key) {
36
36
  }
37
37
  });
38
38
  });
39
+ var _chartsSlotsComponentsPropsPro = require("./chartsSlotsComponentsPropsPro");
40
+ Object.keys(_chartsSlotsComponentsPropsPro).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
43
+ if (key in exports && exports[key] === _chartsSlotsComponentsPropsPro[key]) return;
44
+ Object.defineProperty(exports, key, {
45
+ enumerable: true,
46
+ get: function () {
47
+ return _chartsSlotsComponentsPropsPro[key];
48
+ }
49
+ });
50
+ });
39
51
  var _defaults = require("../internals/plugins/useChartProExport/defaults");
package/models/index.mjs CHANGED
@@ -3,4 +3,5 @@ export * from '@mui/x-charts/models';
3
3
  // End of re-export-block
4
4
 
5
5
  export * from "./seriesType/index.mjs";
6
+ export * from "./chartsSlotsComponentsPropsPro.mjs";
6
7
  export { defaultOnBeforeExport } from "../internals/plugins/useChartProExport/defaults.mjs";
@@ -1,7 +1,7 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import { type CommonDefaultizedProps, type CommonSeriesType, type CartesianSeriesType, type DatasetElementType } from '@mui/x-charts/internals';
3
3
  export type HeatmapValueType = readonly [number, number, number];
4
- export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType, 'heatmap'>, 'color' | 'colorGetter' | 'valueFormatter'>, CartesianSeriesType {
4
+ export interface HeatmapSeriesType extends Omit<CommonSeriesType<'heatmap'>, 'color' | 'colorGetter' | 'valueFormatter'>, CartesianSeriesType {
5
5
  type: 'heatmap';
6
6
  /**
7
7
  * Data associated to each cell in the heatmap.
@@ -1,7 +1,7 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import { type CommonDefaultizedProps, type CommonSeriesType, type CartesianSeriesType, type DatasetElementType } from '@mui/x-charts/internals';
3
3
  export type HeatmapValueType = readonly [number, number, number];
4
- export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType, 'heatmap'>, 'color' | 'colorGetter' | 'valueFormatter'>, CartesianSeriesType {
4
+ export interface HeatmapSeriesType extends Omit<CommonSeriesType<'heatmap'>, 'color' | 'colorGetter' | 'valueFormatter'>, CartesianSeriesType {
5
5
  type: 'heatmap';
6
6
  /**
7
7
  * Data associated to each cell in the heatmap.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-pro",
3
- "version": "9.3.0",
3
+ "version": "9.5.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The Pro plan edition of the MUI X Charts components.",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -27,15 +27,15 @@
27
27
  "directory": "packages/x-charts-pro"
28
28
  },
29
29
  "dependencies": {
30
- "@babel/runtime": "^7.29.2",
30
+ "@babel/runtime": "^7.29.7",
31
31
  "@mui/utils": "9.0.1",
32
32
  "clsx": "^2.1.1",
33
33
  "prop-types": "^15.8.1",
34
- "@mui/x-charts-vendor": "^9.0.0",
34
+ "@mui/x-charts": "^9.5.0",
35
+ "@mui/x-charts-vendor": "^9.4.0",
35
36
  "@mui/x-internals": "^9.1.0",
36
37
  "@mui/x-internal-gestures": "^9.3.0",
37
- "@mui/x-charts": "^9.3.0",
38
- "@mui/x-license": "^9.2.0"
38
+ "@mui/x-license": "^9.4.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@emotion/react": "^11.9.0",