@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.
- package/BarChartPro/BarChartPro.js +788 -9
- package/CHANGELOG.md +423 -96
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +27 -22
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
- package/FunnelChart/FunnelChart.js +73 -4
- package/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/FunnelChart/funnelSectionClasses.js +1 -1
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/useFunnelChartProps.js +3 -3
- package/Heatmap/Heatmap.d.ts +1 -1
- package/Heatmap/Heatmap.js +4 -3
- package/Heatmap/{HeatmapTooltip.js → HeatmapTooltip/HeatmapTooltip.js} +30 -34
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +26 -0
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -0
- package/Heatmap/HeatmapTooltip/index.js +16 -0
- package/Heatmap/heatmapClasses.d.ts +5 -0
- package/Heatmap/heatmapClasses.js +1 -1
- package/Heatmap/index.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +788 -9
- package/ScatterChartPro/ScatterChartPro.js +788 -9
- package/esm/BarChartPro/BarChartPro.js +788 -9
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +28 -23
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
- package/esm/FunnelChart/FunnelChart.js +73 -4
- package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/esm/FunnelChart/funnelSectionClasses.js +1 -1
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.js +3 -3
- package/esm/Heatmap/Heatmap.d.ts +1 -1
- package/esm/Heatmap/Heatmap.js +4 -3
- package/{modern/Heatmap → esm/Heatmap/HeatmapTooltip}/HeatmapTooltip.js +30 -34
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +22 -0
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -0
- package/esm/Heatmap/HeatmapTooltip/index.js +1 -0
- package/esm/Heatmap/heatmapClasses.d.ts +5 -0
- package/esm/Heatmap/heatmapClasses.js +1 -1
- package/esm/Heatmap/index.d.ts +1 -1
- package/esm/Heatmap/index.js +1 -1
- package/esm/LineChartPro/LineChartPro.js +788 -9
- package/esm/ScatterChartPro/ScatterChartPro.js +788 -9
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +28 -35
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/index.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +28 -34
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/package.json +9 -19
- package/esm/Heatmap/HeatmapTooltip.js +0 -288
- package/esm/internals/utils/releaseInfo.d.ts +0 -1
- package/esm/internals/utils/releaseInfo.js +0 -13
- package/internals/utils/releaseInfo.d.ts +0 -1
- package/internals/utils/releaseInfo.js +0 -21
- package/modern/BarChartPro/BarChartPro.d.ts +0 -18
- package/modern/BarChartPro/BarChartPro.js +0 -404
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
- package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
- package/modern/BarChartPro/index.d.ts +0 -1
- package/modern/BarChartPro/index.js +0 -1
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
- package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
- package/modern/ChartContainerPro/index.d.ts +0 -2
- package/modern/ChartContainerPro/index.js +0 -2
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
- package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
- package/modern/ChartDataProviderPro/index.d.ts +0 -2
- package/modern/ChartDataProviderPro/index.js +0 -2
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
- package/modern/FunnelChart/FunnelChart.d.ts +0 -37
- package/modern/FunnelChart/FunnelChart.js +0 -212
- package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
- package/modern/FunnelChart/FunnelPlot.js +0 -184
- package/modern/FunnelChart/FunnelSection.d.ts +0 -15
- package/modern/FunnelChart/FunnelSection.js +0 -56
- package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
- package/modern/FunnelChart/categoryAxis.types.js +0 -1
- package/modern/FunnelChart/funnel.types.d.ts +0 -124
- package/modern/FunnelChart/funnel.types.js +0 -1
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
- package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
- package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
- package/modern/FunnelChart/funnelSectionClasses.js +0 -20
- package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
- package/modern/FunnelChart/funnelSlots.types.js +0 -1
- package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
- package/modern/FunnelChart/funnelStepCurve.js +0 -67
- package/modern/FunnelChart/index.d.ts +0 -7
- package/modern/FunnelChart/index.js +0 -5
- package/modern/FunnelChart/labelUtils.d.ts +0 -42
- package/modern/FunnelChart/labelUtils.js +0 -166
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
- package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
- package/modern/FunnelChart/seriesConfig/index.js +0 -15
- package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/legend.js +0 -25
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
- package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
- package/modern/FunnelChart/useFunnelChartProps.js +0 -161
- package/modern/Heatmap/Heatmap.d.ts +0 -57
- package/modern/Heatmap/Heatmap.js +0 -387
- package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
- package/modern/Heatmap/Heatmap.plugins.js +0 -2
- package/modern/Heatmap/HeatmapItem.d.ts +0 -49
- package/modern/Heatmap/HeatmapItem.js +0 -106
- package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
- package/modern/Heatmap/HeatmapPlot.js +0 -59
- package/modern/Heatmap/HeatmapTooltip.d.ts +0 -16
- package/modern/Heatmap/heatmapClasses.d.ts +0 -11
- package/modern/Heatmap/heatmapClasses.js +0 -14
- package/modern/Heatmap/index.d.ts +0 -4
- package/modern/Heatmap/index.js +0 -4
- package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/extremums.js +0 -8
- package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getColor.js +0 -15
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
- package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/index.js +0 -14
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
- package/modern/LineChartPro/LineChartPro.d.ts +0 -17
- package/modern/LineChartPro/LineChartPro.js +0 -401
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
- package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
- package/modern/LineChartPro/index.d.ts +0 -1
- package/modern/LineChartPro/index.js +0 -1
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
- package/modern/ScatterChartPro/ScatterChartPro.js +0 -395
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
- package/modern/ScatterChartPro/index.d.ts +0 -1
- package/modern/ScatterChartPro/index.js +0 -1
- package/modern/hooks/index.d.ts +0 -2
- package/modern/hooks/index.js +0 -2
- package/modern/hooks/useFunnelSeries.d.ts +0 -33
- package/modern/hooks/useFunnelSeries.js +0 -42
- package/modern/hooks/useHeatmapSeries.d.ts +0 -33
- package/modern/hooks/useHeatmapSeries.js +0 -42
- package/modern/hooks/zoom/index.d.ts +0 -1
- package/modern/hooks/zoom/index.js +0 -1
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
- package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
- package/modern/index.d.ts +0 -34
- package/modern/index.js +0 -45
- package/modern/internals/plugins/allPlugins.d.ts +0 -8
- package/modern/internals/plugins/allPlugins.js +0 -6
- package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/index.js +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
- package/modern/internals/utils/releaseInfo.d.ts +0 -1
- package/modern/internals/utils/releaseInfo.js +0 -13
- package/modern/models/index.d.ts +0 -2
- package/modern/models/index.js +0 -2
- package/modern/models/seriesType/heatmap.d.ts +0 -28
- package/modern/models/seriesType/heatmap.js +0 -1
- package/modern/models/seriesType/index.d.ts +0 -1
- package/modern/models/seriesType/index.js +0 -1
- package/modern/package.json +0 -1
- package/modern/themeAugmentation/components.d.ts +0 -23
- package/modern/themeAugmentation/index.d.ts +0 -4
- package/modern/themeAugmentation/index.js +0 -0
- package/modern/themeAugmentation/overrides.d.ts +0 -11
- package/modern/themeAugmentation/props.d.ts +0 -20
- package/modern/typeOverloads/index.d.ts +0 -1
- package/modern/typeOverloads/index.js +0 -1
- package/modern/typeOverloads/modules.d.ts +0 -33
- package/modern/typeOverloads/modules.js +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- /package/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
- /package/esm/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
package/esm/index.js
CHANGED
|
@@ -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
|
-
//
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
zoom: _extends({},
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
@@ -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
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
zoom: (0, _extends2.default)({},
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
|
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.
|
|
33
|
-
"@mui/utils": "^7.0.
|
|
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-
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-charts
|
|
41
|
-
"@mui/x-
|
|
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
|
|
47
|
-
"@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0
|
|
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,
|