@mui/x-charts-pro 8.0.0-beta.2 → 8.0.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 (200) hide show
  1. package/BarChartPro/BarChartPro.js +788 -9
  2. package/CHANGELOG.md +423 -96
  3. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  4. package/ChartDataProviderPro/ChartDataProviderPro.js +27 -22
  5. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  6. package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  7. package/FunnelChart/FunnelChart.js +73 -4
  8. package/FunnelChart/categoryAxis.types.d.ts +3 -2
  9. package/FunnelChart/funnelSectionClasses.d.ts +5 -0
  10. package/FunnelChart/funnelSectionClasses.js +1 -1
  11. package/FunnelChart/index.d.ts +1 -0
  12. package/FunnelChart/index.js +12 -0
  13. package/FunnelChart/useFunnelChartProps.js +3 -3
  14. package/Heatmap/Heatmap.d.ts +1 -1
  15. package/Heatmap/Heatmap.js +4 -3
  16. package/Heatmap/{HeatmapTooltip.js → HeatmapTooltip/HeatmapTooltip.js} +30 -34
  17. package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
  18. package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +26 -0
  19. package/Heatmap/HeatmapTooltip/index.d.ts +1 -0
  20. package/Heatmap/HeatmapTooltip/index.js +16 -0
  21. package/Heatmap/heatmapClasses.d.ts +5 -0
  22. package/Heatmap/heatmapClasses.js +1 -1
  23. package/Heatmap/index.d.ts +1 -1
  24. package/LineChartPro/LineChartPro.js +788 -9
  25. package/ScatterChartPro/ScatterChartPro.js +788 -9
  26. package/esm/BarChartPro/BarChartPro.js +788 -9
  27. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  28. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +28 -23
  29. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  30. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  31. package/esm/FunnelChart/FunnelChart.js +73 -4
  32. package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
  33. package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
  34. package/esm/FunnelChart/funnelSectionClasses.js +1 -1
  35. package/esm/FunnelChart/index.d.ts +1 -0
  36. package/esm/FunnelChart/index.js +1 -0
  37. package/esm/FunnelChart/useFunnelChartProps.js +3 -3
  38. package/esm/Heatmap/Heatmap.d.ts +1 -1
  39. package/esm/Heatmap/Heatmap.js +4 -3
  40. package/{modern/Heatmap → esm/Heatmap/HeatmapTooltip}/HeatmapTooltip.js +30 -34
  41. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
  42. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +22 -0
  43. package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -0
  44. package/esm/Heatmap/HeatmapTooltip/index.js +1 -0
  45. package/esm/Heatmap/heatmapClasses.d.ts +5 -0
  46. package/esm/Heatmap/heatmapClasses.js +1 -1
  47. package/esm/Heatmap/index.d.ts +1 -1
  48. package/esm/Heatmap/index.js +1 -1
  49. package/esm/LineChartPro/LineChartPro.js +788 -9
  50. package/esm/ScatterChartPro/ScatterChartPro.js +788 -9
  51. package/esm/index.js +1 -1
  52. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +28 -35
  53. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  54. package/index.js +1 -1
  55. package/internals/plugins/useChartProZoom/useChartProZoom.js +28 -34
  56. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  57. package/package.json +9 -19
  58. package/esm/Heatmap/HeatmapTooltip.js +0 -288
  59. package/esm/internals/utils/releaseInfo.d.ts +0 -1
  60. package/esm/internals/utils/releaseInfo.js +0 -13
  61. package/internals/utils/releaseInfo.d.ts +0 -1
  62. package/internals/utils/releaseInfo.js +0 -21
  63. package/modern/BarChartPro/BarChartPro.d.ts +0 -18
  64. package/modern/BarChartPro/BarChartPro.js +0 -404
  65. package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
  66. package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
  67. package/modern/BarChartPro/index.d.ts +0 -1
  68. package/modern/BarChartPro/index.js +0 -1
  69. package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
  70. package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
  71. package/modern/ChartContainerPro/index.d.ts +0 -2
  72. package/modern/ChartContainerPro/index.js +0 -2
  73. package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
  74. package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
  75. package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
  76. package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
  77. package/modern/ChartDataProviderPro/index.d.ts +0 -2
  78. package/modern/ChartDataProviderPro/index.js +0 -2
  79. package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
  80. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
  81. package/modern/FunnelChart/FunnelChart.d.ts +0 -37
  82. package/modern/FunnelChart/FunnelChart.js +0 -212
  83. package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
  84. package/modern/FunnelChart/FunnelPlot.js +0 -184
  85. package/modern/FunnelChart/FunnelSection.d.ts +0 -15
  86. package/modern/FunnelChart/FunnelSection.js +0 -56
  87. package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
  88. package/modern/FunnelChart/categoryAxis.types.js +0 -1
  89. package/modern/FunnelChart/funnel.types.d.ts +0 -124
  90. package/modern/FunnelChart/funnel.types.js +0 -1
  91. package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
  92. package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
  93. package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
  94. package/modern/FunnelChart/funnelSectionClasses.js +0 -20
  95. package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
  96. package/modern/FunnelChart/funnelSlots.types.js +0 -1
  97. package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
  98. package/modern/FunnelChart/funnelStepCurve.js +0 -67
  99. package/modern/FunnelChart/index.d.ts +0 -7
  100. package/modern/FunnelChart/index.js +0 -5
  101. package/modern/FunnelChart/labelUtils.d.ts +0 -42
  102. package/modern/FunnelChart/labelUtils.js +0 -166
  103. package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
  104. package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
  105. package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
  106. package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
  107. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  108. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
  109. package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
  110. package/modern/FunnelChart/seriesConfig/index.js +0 -15
  111. package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
  112. package/modern/FunnelChart/seriesConfig/legend.js +0 -25
  113. package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
  114. package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
  115. package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
  116. package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
  117. package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
  118. package/modern/FunnelChart/useFunnelChartProps.js +0 -161
  119. package/modern/Heatmap/Heatmap.d.ts +0 -57
  120. package/modern/Heatmap/Heatmap.js +0 -387
  121. package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
  122. package/modern/Heatmap/Heatmap.plugins.js +0 -2
  123. package/modern/Heatmap/HeatmapItem.d.ts +0 -49
  124. package/modern/Heatmap/HeatmapItem.js +0 -106
  125. package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
  126. package/modern/Heatmap/HeatmapPlot.js +0 -59
  127. package/modern/Heatmap/HeatmapTooltip.d.ts +0 -16
  128. package/modern/Heatmap/heatmapClasses.d.ts +0 -11
  129. package/modern/Heatmap/heatmapClasses.js +0 -14
  130. package/modern/Heatmap/index.d.ts +0 -4
  131. package/modern/Heatmap/index.js +0 -4
  132. package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
  133. package/modern/Heatmap/seriesConfig/extremums.js +0 -8
  134. package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
  135. package/modern/Heatmap/seriesConfig/getColor.js +0 -15
  136. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  137. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
  138. package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
  139. package/modern/Heatmap/seriesConfig/index.js +0 -14
  140. package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
  141. package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
  142. package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
  143. package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
  144. package/modern/LineChartPro/LineChartPro.d.ts +0 -17
  145. package/modern/LineChartPro/LineChartPro.js +0 -401
  146. package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
  147. package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
  148. package/modern/LineChartPro/index.d.ts +0 -1
  149. package/modern/LineChartPro/index.js +0 -1
  150. package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
  151. package/modern/ScatterChartPro/ScatterChartPro.js +0 -395
  152. package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
  153. package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
  154. package/modern/ScatterChartPro/index.d.ts +0 -1
  155. package/modern/ScatterChartPro/index.js +0 -1
  156. package/modern/hooks/index.d.ts +0 -2
  157. package/modern/hooks/index.js +0 -2
  158. package/modern/hooks/useFunnelSeries.d.ts +0 -33
  159. package/modern/hooks/useFunnelSeries.js +0 -42
  160. package/modern/hooks/useHeatmapSeries.d.ts +0 -33
  161. package/modern/hooks/useHeatmapSeries.js +0 -42
  162. package/modern/hooks/zoom/index.d.ts +0 -1
  163. package/modern/hooks/zoom/index.js +0 -1
  164. package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
  165. package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
  166. package/modern/index.d.ts +0 -34
  167. package/modern/index.js +0 -45
  168. package/modern/internals/plugins/allPlugins.d.ts +0 -8
  169. package/modern/internals/plugins/allPlugins.js +0 -6
  170. package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
  171. package/modern/internals/plugins/useChartProZoom/index.js +0 -3
  172. package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
  173. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
  174. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
  175. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
  176. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
  177. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
  178. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
  179. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
  180. package/modern/internals/utils/releaseInfo.d.ts +0 -1
  181. package/modern/internals/utils/releaseInfo.js +0 -13
  182. package/modern/models/index.d.ts +0 -2
  183. package/modern/models/index.js +0 -2
  184. package/modern/models/seriesType/heatmap.d.ts +0 -28
  185. package/modern/models/seriesType/heatmap.js +0 -1
  186. package/modern/models/seriesType/index.d.ts +0 -1
  187. package/modern/models/seriesType/index.js +0 -1
  188. package/modern/package.json +0 -1
  189. package/modern/themeAugmentation/components.d.ts +0 -23
  190. package/modern/themeAugmentation/index.d.ts +0 -4
  191. package/modern/themeAugmentation/index.js +0 -0
  192. package/modern/themeAugmentation/overrides.d.ts +0 -11
  193. package/modern/themeAugmentation/props.d.ts +0 -20
  194. package/modern/typeOverloads/index.d.ts +0 -1
  195. package/modern/typeOverloads/index.js +0 -1
  196. package/modern/typeOverloads/modules.d.ts +0 -33
  197. package/modern/typeOverloads/modules.js +0 -1
  198. package/tsconfig.build.tsbuildinfo +0 -1
  199. /package/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
  200. /package/esm/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v8.0.0-beta.2
2
+ * @mui/x-charts-pro v8.0.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -2,10 +2,11 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
6
5
  import { useSelector, getSVGPoint, selectorChartDrawingArea, createZoomLookup, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
6
+ import { useEventCallback } from '@mui/material/utils';
7
+ import { rafThrottle } from '@mui/x-internals/rafThrottle';
8
+ import debounce from '@mui/utils/debounce';
7
9
  import { getDiff, getHorizontalCenterRatio, getPinchScaleRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, preventDefault, zoomAtPoint } from "./useChartProZoom.utils.js";
8
-
9
10
  // It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
10
11
  function initializeZoomData(options) {
11
12
  return Object.values(options).map(({
@@ -26,15 +27,15 @@ export const useChartProZoom = ({
26
27
  }) => {
27
28
  const {
28
29
  zoomData: paramsZoomData,
29
- onZoomChange
30
+ onZoomChange: onZoomChangeProp
30
31
  } = params;
31
32
  const drawingArea = useSelector(store, selectorChartDrawingArea);
32
33
  const optionsLookup = useSelector(store, selectorChartZoomOptionsLookup);
33
34
  const isZoomEnabled = Object.keys(optionsLookup).length > 0;
35
+ const onZoomChange = useEventCallback(onZoomChangeProp ?? (() => {}));
34
36
 
35
37
  // Manage controlled state
36
-
37
- useEnhancedEffect(() => {
38
+ React.useEffect(() => {
38
39
  if (paramsZoomData === undefined) {
39
40
  return undefined;
40
41
  }
@@ -63,34 +64,44 @@ export const useChartProZoom = ({
63
64
  };
64
65
  }, [store, paramsZoomData]);
65
66
 
66
- // Add instance methods
67
- const setIsInteracting = React.useCallback(isInteracting => {
68
- store.update(prev => _extends({}, prev, {
69
- zoom: _extends({}, prev.zoom, {
70
- isInteracting
67
+ // This is debounced. We want to run it only once after the interaction ends.
68
+ const removeIsInteracting = React.useMemo(() => debounce(() => store.update(prevState => {
69
+ return _extends({}, prevState, {
70
+ zoom: _extends({}, prevState.zoom, {
71
+ isInteracting: false
71
72
  })
72
- }));
73
- }, [store]);
74
- const setZoomDataCallback = React.useCallback(zoomData => {
73
+ });
74
+ }), 166), [store]);
75
+
76
+ // This is throttled. We want to run it at most once per frame.
77
+ // By joining the two, we ensure that interacting and zooming are in sync.
78
+ const setZoomDataCallback = React.useMemo(() => rafThrottle(zoomData => {
75
79
  store.update(prevState => {
76
80
  const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
77
81
  onZoomChange?.(newZoomData);
78
82
  if (prevState.zoom.isControlled) {
79
83
  return prevState;
80
84
  }
85
+ removeIsInteracting();
81
86
  return _extends({}, prevState, {
82
87
  zoom: _extends({}, prevState.zoom, {
88
+ isInteracting: true,
83
89
  zoomData: newZoomData
84
90
  })
85
91
  });
86
92
  });
87
- }, [onZoomChange, store]);
93
+ }), [onZoomChange, store, removeIsInteracting]);
94
+ React.useEffect(() => {
95
+ return () => {
96
+ setZoomDataCallback.clear();
97
+ removeIsInteracting.clear();
98
+ };
99
+ }, [setZoomDataCallback, removeIsInteracting]);
88
100
 
89
101
  // Add events
90
102
  const panningEventCacheRef = React.useRef([]);
91
103
  const zoomEventCacheRef = React.useRef([]);
92
104
  const eventPrevDiff = React.useRef(0);
93
- const interactionTimeoutRef = React.useRef(undefined);
94
105
 
95
106
  // Add event for chart panning
96
107
  const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
@@ -154,7 +165,6 @@ export const useChartProZoom = ({
154
165
  event.preventDefault();
155
166
  }
156
167
  isDraggingRef.current = true;
157
- setIsInteracting(true);
158
168
  touchStartRef.current = {
159
169
  x: point.x,
160
170
  y: point.y,
@@ -163,7 +173,6 @@ export const useChartProZoom = ({
163
173
  };
164
174
  const handleUp = event => {
165
175
  panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
166
- setIsInteracting(false);
167
176
  isDraggingRef.current = false;
168
177
  touchStartRef.current = null;
169
178
  };
@@ -179,7 +188,7 @@ export const useChartProZoom = ({
179
188
  document.removeEventListener('pointercancel', handleUp);
180
189
  document.removeEventListener('pointerleave', handleUp);
181
190
  };
182
- }, [instance, svgRef, isDraggingRef, setIsInteracting, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
191
+ }, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
183
192
 
184
193
  // Add event for chart zoom in/out
185
194
  React.useEffect(() => {
@@ -196,15 +205,6 @@ export const useChartProZoom = ({
196
205
  return;
197
206
  }
198
207
  event.preventDefault();
199
- if (interactionTimeoutRef.current) {
200
- clearTimeout(interactionTimeoutRef.current);
201
- }
202
- setIsInteracting(true);
203
- // Debounce transition to `isInteractive=false`.
204
- // Useful because wheel events don't have an "end" event.
205
- interactionTimeoutRef.current = window.setTimeout(() => {
206
- setIsInteracting(false);
207
- }, 166);
208
208
  setZoomDataCallback(prevZoomData => {
209
209
  return prevZoomData.map(zoom => {
210
210
  const option = optionsLookup[zoom.axisId];
@@ -230,7 +230,6 @@ export const useChartProZoom = ({
230
230
  };
231
231
  function pointerDownHandler(event) {
232
232
  zoomEventCacheRef.current.push(event);
233
- setIsInteracting(true);
234
233
  }
235
234
  function pointerMoveHandler(event) {
236
235
  if (element === null) {
@@ -281,9 +280,6 @@ export const useChartProZoom = ({
281
280
  if (zoomEventCacheRef.current.length < 2) {
282
281
  eventPrevDiff.current = 0;
283
282
  }
284
- if (event.type === 'pointerup' || event.type === 'pointercancel') {
285
- setIsInteracting(false);
286
- }
287
283
  }
288
284
  element.addEventListener('wheel', wheelHandler);
289
285
  element.addEventListener('pointerdown', pointerDownHandler);
@@ -306,11 +302,8 @@ export const useChartProZoom = ({
306
302
  element.removeEventListener('pointerleave', pointerUpHandler);
307
303
  element.removeEventListener('touchstart', preventDefault);
308
304
  element.removeEventListener('touchmove', preventDefault);
309
- if (interactionTimeoutRef.current) {
310
- clearTimeout(interactionTimeoutRef.current);
311
- }
312
305
  };
313
- }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, setIsInteracting, instance, setZoomDataCallback]);
306
+ }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
314
307
  return {
315
308
  publicAPI: {
316
309
  setZoomData: setZoomDataCallback
@@ -1,7 +1,7 @@
1
1
  import { ChartRootSelector } from '@mui/x-charts/internals';
2
2
  import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
3
  export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
- export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
4
+ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
5
5
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
6
  }) => boolean) & {
7
7
  clearCache: () => void;
@@ -32,7 +32,7 @@ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-cha
32
32
  argsMemoize: typeof import("reselect").weakMapMemoize;
33
33
  memoize: typeof import("reselect").weakMapMemoize;
34
34
  };
35
- export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
35
+ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
36
36
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
37
37
  }) => boolean) & {
38
38
  clearCache: () => void;
@@ -52,7 +52,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
52
52
  resetResultsCount: () => void;
53
53
  };
54
54
  lastResult: () => boolean;
55
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
55
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
56
56
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
57
57
  }) => {
58
58
  [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
@@ -78,7 +78,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
78
78
  [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
79
79
  [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
80
80
  };
81
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
81
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
82
82
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
83
83
  }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
84
84
  clearCache: () => void;
@@ -92,7 +92,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
92
92
  resetResultsCount: () => void;
93
93
  };
94
94
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
95
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
95
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
96
96
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
97
97
  }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
98
98
  clearCache: () => void;
@@ -131,7 +131,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
131
131
  } & {
132
132
  memoize: typeof import("reselect").weakMapMemoize;
133
133
  argsMemoize: typeof import("reselect").weakMapMemoize;
134
- }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
134
+ }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
135
135
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
136
136
  }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
137
137
  clearCache: () => void;
@@ -145,7 +145,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
145
145
  resetResultsCount: () => void;
146
146
  };
147
147
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
148
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
148
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
149
149
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
150
150
  }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
151
151
  clearCache: () => void;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v8.0.0-beta.2
2
+ * @mui/x-charts-pro v8.0.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -9,8 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  exports.useChartProZoom = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
- var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
13
12
  var _internals = require("@mui/x-charts/internals");
13
+ var _utils = require("@mui/material/utils");
14
+ var _rafThrottle = require("@mui/x-internals/rafThrottle");
15
+ var _debounce = _interopRequireDefault(require("@mui/utils/debounce"));
14
16
  var _useChartProZoom = require("./useChartProZoom.utils");
15
17
  // It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
16
18
  function initializeZoomData(options) {
@@ -32,15 +34,15 @@ const useChartProZoom = ({
32
34
  }) => {
33
35
  const {
34
36
  zoomData: paramsZoomData,
35
- onZoomChange
37
+ onZoomChange: onZoomChangeProp
36
38
  } = params;
37
39
  const drawingArea = (0, _internals.useSelector)(store, _internals.selectorChartDrawingArea);
38
40
  const optionsLookup = (0, _internals.useSelector)(store, _internals.selectorChartZoomOptionsLookup);
39
41
  const isZoomEnabled = Object.keys(optionsLookup).length > 0;
42
+ const onZoomChange = (0, _utils.useEventCallback)(onZoomChangeProp ?? (() => {}));
40
43
 
41
44
  // Manage controlled state
42
-
43
- (0, _useEnhancedEffect.default)(() => {
45
+ React.useEffect(() => {
44
46
  if (paramsZoomData === undefined) {
45
47
  return undefined;
46
48
  }
@@ -69,34 +71,44 @@ const useChartProZoom = ({
69
71
  };
70
72
  }, [store, paramsZoomData]);
71
73
 
72
- // Add instance methods
73
- const setIsInteracting = React.useCallback(isInteracting => {
74
- store.update(prev => (0, _extends2.default)({}, prev, {
75
- zoom: (0, _extends2.default)({}, prev.zoom, {
76
- isInteracting
74
+ // This is debounced. We want to run it only once after the interaction ends.
75
+ const removeIsInteracting = React.useMemo(() => (0, _debounce.default)(() => store.update(prevState => {
76
+ return (0, _extends2.default)({}, prevState, {
77
+ zoom: (0, _extends2.default)({}, prevState.zoom, {
78
+ isInteracting: false
77
79
  })
78
- }));
79
- }, [store]);
80
- const setZoomDataCallback = React.useCallback(zoomData => {
80
+ });
81
+ }), 166), [store]);
82
+
83
+ // This is throttled. We want to run it at most once per frame.
84
+ // By joining the two, we ensure that interacting and zooming are in sync.
85
+ const setZoomDataCallback = React.useMemo(() => (0, _rafThrottle.rafThrottle)(zoomData => {
81
86
  store.update(prevState => {
82
87
  const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
83
88
  onZoomChange?.(newZoomData);
84
89
  if (prevState.zoom.isControlled) {
85
90
  return prevState;
86
91
  }
92
+ removeIsInteracting();
87
93
  return (0, _extends2.default)({}, prevState, {
88
94
  zoom: (0, _extends2.default)({}, prevState.zoom, {
95
+ isInteracting: true,
89
96
  zoomData: newZoomData
90
97
  })
91
98
  });
92
99
  });
93
- }, [onZoomChange, store]);
100
+ }), [onZoomChange, store, removeIsInteracting]);
101
+ React.useEffect(() => {
102
+ return () => {
103
+ setZoomDataCallback.clear();
104
+ removeIsInteracting.clear();
105
+ };
106
+ }, [setZoomDataCallback, removeIsInteracting]);
94
107
 
95
108
  // Add events
96
109
  const panningEventCacheRef = React.useRef([]);
97
110
  const zoomEventCacheRef = React.useRef([]);
98
111
  const eventPrevDiff = React.useRef(0);
99
- const interactionTimeoutRef = React.useRef(undefined);
100
112
 
101
113
  // Add event for chart panning
102
114
  const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
@@ -160,7 +172,6 @@ const useChartProZoom = ({
160
172
  event.preventDefault();
161
173
  }
162
174
  isDraggingRef.current = true;
163
- setIsInteracting(true);
164
175
  touchStartRef.current = {
165
176
  x: point.x,
166
177
  y: point.y,
@@ -169,7 +180,6 @@ const useChartProZoom = ({
169
180
  };
170
181
  const handleUp = event => {
171
182
  panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
172
- setIsInteracting(false);
173
183
  isDraggingRef.current = false;
174
184
  touchStartRef.current = null;
175
185
  };
@@ -185,7 +195,7 @@ const useChartProZoom = ({
185
195
  document.removeEventListener('pointercancel', handleUp);
186
196
  document.removeEventListener('pointerleave', handleUp);
187
197
  };
188
- }, [instance, svgRef, isDraggingRef, setIsInteracting, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
198
+ }, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
189
199
 
190
200
  // Add event for chart zoom in/out
191
201
  React.useEffect(() => {
@@ -202,15 +212,6 @@ const useChartProZoom = ({
202
212
  return;
203
213
  }
204
214
  event.preventDefault();
205
- if (interactionTimeoutRef.current) {
206
- clearTimeout(interactionTimeoutRef.current);
207
- }
208
- setIsInteracting(true);
209
- // Debounce transition to `isInteractive=false`.
210
- // Useful because wheel events don't have an "end" event.
211
- interactionTimeoutRef.current = window.setTimeout(() => {
212
- setIsInteracting(false);
213
- }, 166);
214
215
  setZoomDataCallback(prevZoomData => {
215
216
  return prevZoomData.map(zoom => {
216
217
  const option = optionsLookup[zoom.axisId];
@@ -236,7 +237,6 @@ const useChartProZoom = ({
236
237
  };
237
238
  function pointerDownHandler(event) {
238
239
  zoomEventCacheRef.current.push(event);
239
- setIsInteracting(true);
240
240
  }
241
241
  function pointerMoveHandler(event) {
242
242
  if (element === null) {
@@ -287,9 +287,6 @@ const useChartProZoom = ({
287
287
  if (zoomEventCacheRef.current.length < 2) {
288
288
  eventPrevDiff.current = 0;
289
289
  }
290
- if (event.type === 'pointerup' || event.type === 'pointercancel') {
291
- setIsInteracting(false);
292
- }
293
290
  }
294
291
  element.addEventListener('wheel', wheelHandler);
295
292
  element.addEventListener('pointerdown', pointerDownHandler);
@@ -312,11 +309,8 @@ const useChartProZoom = ({
312
309
  element.removeEventListener('pointerleave', pointerUpHandler);
313
310
  element.removeEventListener('touchstart', _useChartProZoom.preventDefault);
314
311
  element.removeEventListener('touchmove', _useChartProZoom.preventDefault);
315
- if (interactionTimeoutRef.current) {
316
- clearTimeout(interactionTimeoutRef.current);
317
- }
318
312
  };
319
- }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, setIsInteracting, instance, setZoomDataCallback]);
313
+ }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
320
314
  return {
321
315
  publicAPI: {
322
316
  setZoomData: setZoomDataCallback
@@ -1,7 +1,7 @@
1
1
  import { ChartRootSelector } from '@mui/x-charts/internals';
2
2
  import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
3
  export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
- export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
4
+ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
5
5
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
6
  }) => boolean) & {
7
7
  clearCache: () => void;
@@ -32,7 +32,7 @@ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-cha
32
32
  argsMemoize: typeof import("reselect").weakMapMemoize;
33
33
  memoize: typeof import("reselect").weakMapMemoize;
34
34
  };
35
- export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
35
+ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
36
36
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
37
37
  }) => boolean) & {
38
38
  clearCache: () => void;
@@ -52,7 +52,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
52
52
  resetResultsCount: () => void;
53
53
  };
54
54
  lastResult: () => boolean;
55
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
55
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
56
56
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
57
57
  }) => {
58
58
  [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
@@ -78,7 +78,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
78
78
  [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
79
79
  [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
80
80
  };
81
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
81
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
82
82
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
83
83
  }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
84
84
  clearCache: () => void;
@@ -92,7 +92,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
92
92
  resetResultsCount: () => void;
93
93
  };
94
94
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
95
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
95
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
96
96
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
97
97
  }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
98
98
  clearCache: () => void;
@@ -131,7 +131,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
131
131
  } & {
132
132
  memoize: typeof import("reselect").weakMapMemoize;
133
133
  argsMemoize: typeof import("reselect").weakMapMemoize;
134
- }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
134
+ }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
135
135
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
136
136
  }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
137
137
  clearCache: () => void;
@@ -145,7 +145,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
145
145
  resetResultsCount: () => void;
146
146
  };
147
147
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
148
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
148
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
149
149
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
150
150
  }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
151
151
  clearCache: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-pro",
3
- "version": "8.0.0-beta.2",
3
+ "version": "8.0.0",
4
4
  "description": "The Pro plan edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -29,22 +29,20 @@
29
29
  "directory": "packages/x-charts-pro"
30
30
  },
31
31
  "dependencies": {
32
- "@babel/runtime": "^7.26.10",
33
- "@mui/utils": "^7.0.0 || ^7.0.0-beta",
34
- "@react-spring/rafz": "^9.7.5",
35
- "@react-spring/web": "^9.7.5",
32
+ "@babel/runtime": "^7.27.0",
33
+ "@mui/utils": "^7.0.2",
36
34
  "clsx": "^2.1.1",
37
35
  "prop-types": "^15.8.1",
38
- "@mui/x-internals": "8.0.0-beta.2",
39
- "@mui/x-charts": "8.0.0-beta.2",
40
- "@mui/x-charts-vendor": "8.0.0-beta.1",
41
- "@mui/x-license": "8.0.0-beta.2"
36
+ "@mui/x-charts-vendor": "8.0.0",
37
+ "@mui/x-license": "8.0.0",
38
+ "@mui/x-charts": "8.0.0",
39
+ "@mui/x-internals": "8.0.0"
42
40
  },
43
41
  "peerDependencies": {
44
42
  "@emotion/react": "^11.9.0",
45
43
  "@emotion/styled": "^11.8.1",
46
- "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
47
- "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta",
44
+ "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
45
+ "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
48
46
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
47
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
50
48
  },
@@ -71,10 +69,6 @@
71
69
  "import": {
72
70
  "types": "./esm/index.d.ts",
73
71
  "default": "./esm/index.js"
74
- },
75
- "mui-modern": {
76
- "types": "./modern/index.d.ts",
77
- "default": "./modern/index.js"
78
72
  }
79
73
  },
80
74
  "./*": {
@@ -85,10 +79,6 @@
85
79
  "import": {
86
80
  "types": "./esm/*/index.d.ts",
87
81
  "default": "./esm/*/index.js"
88
- },
89
- "mui-modern": {
90
- "types": "./modern/*/index.d.ts",
91
- "default": "./modern/*/index.js"
92
82
  }
93
83
  },
94
84
  "./esm": null,