@mui/x-charts-pro 8.0.0-alpha.12 → 8.0.0-alpha.13
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 +25 -30
- package/CHANGELOG.md +299 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/ChartContainerPro/ChartContainerPro.js +1 -1
- package/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/Heatmap/Heatmap.d.ts +5 -4
- package/Heatmap/Heatmap.js +37 -52
- package/LineChartPro/LineChartPro.js +25 -30
- package/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/BarChartPro/BarChartPro.js +25 -30
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/esm/ChartContainerPro/ChartContainerPro.js +1 -1
- package/esm/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/esm/Heatmap/Heatmap.d.ts +5 -4
- package/esm/Heatmap/Heatmap.js +37 -52
- package/esm/LineChartPro/LineChartPro.js +25 -30
- package/esm/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/esm/internals/utils/releaseInfo.js +1 -1
- package/esm/models/seriesType/heatmap.d.ts +2 -2
- package/index.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/internals/utils/releaseInfo.js +1 -1
- package/models/seriesType/heatmap.d.ts +2 -2
- package/modern/BarChartPro/BarChartPro.js +25 -30
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/modern/ChartContainerPro/ChartContainerPro.js +1 -1
- package/modern/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/modern/Heatmap/Heatmap.d.ts +5 -4
- package/modern/Heatmap/Heatmap.js +37 -52
- package/modern/LineChartPro/LineChartPro.js +25 -30
- package/modern/ScatterChartPro/ScatterChartPro.js +25 -30
- package/modern/index.js +1 -1
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/seriesType/heatmap.d.ts +2 -2
- package/package.json +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
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';
|
|
5
6
|
import { useSelector, getSVGPoint, selectorChartDrawingArea, createZoomLookup, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
6
7
|
import { getDiff, getHorizontalCenterRatio, getPinchScaleRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, preventDefault, zoomAtPoint } from "./useChartProZoom.utils.js";
|
|
7
8
|
|
|
@@ -23,15 +24,46 @@ export const useChartProZoom = ({
|
|
|
23
24
|
svgRef,
|
|
24
25
|
params
|
|
25
26
|
}) => {
|
|
27
|
+
const {
|
|
28
|
+
zoomData: paramsZoomData,
|
|
29
|
+
onZoomChange
|
|
30
|
+
} = params;
|
|
26
31
|
const drawingArea = useSelector(store, selectorChartDrawingArea);
|
|
27
32
|
const optionsLookup = useSelector(store, selectorChartZoomOptionsLookup);
|
|
28
33
|
const isZoomEnabled = Object.keys(optionsLookup).length > 0;
|
|
29
34
|
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
// Manage controlled state
|
|
36
|
+
|
|
37
|
+
useEnhancedEffect(() => {
|
|
38
|
+
if (paramsZoomData === undefined) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
store.update(prevState => {
|
|
42
|
+
if (process.env.NODE_ENV !== 'production' && !prevState.zoom.isControlled) {
|
|
43
|
+
console.error([`MUI X: A chart component is changing the \`zoomData\` from uncontrolled to controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', 'Decide between using a controlled or uncontrolled for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
44
|
+
}
|
|
45
|
+
return _extends({}, prevState, {
|
|
46
|
+
zoom: _extends({}, prevState.zoom, {
|
|
47
|
+
isInteracting: true,
|
|
48
|
+
zoomData: paramsZoomData
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const timeout = setTimeout(() => {
|
|
53
|
+
store.update(prevState => {
|
|
54
|
+
return _extends({}, prevState, {
|
|
55
|
+
zoom: _extends({}, prevState.zoom, {
|
|
56
|
+
isInteracting: false
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}, 166);
|
|
61
|
+
return () => {
|
|
62
|
+
clearTimeout(timeout);
|
|
63
|
+
};
|
|
64
|
+
}, [store, paramsZoomData]);
|
|
65
|
+
|
|
66
|
+
// Add instance methods
|
|
35
67
|
const setIsInteracting = React.useCallback(isInteracting => {
|
|
36
68
|
store.update(prev => _extends({}, prev, {
|
|
37
69
|
zoom: _extends({}, prev.zoom, {
|
|
@@ -41,15 +73,24 @@ export const useChartProZoom = ({
|
|
|
41
73
|
}, [store]);
|
|
42
74
|
const setZoomDataCallback = React.useCallback(zoomData => {
|
|
43
75
|
store.update(prevState => {
|
|
44
|
-
const newZoomData = typeof zoomData === 'function' ? zoomData(prevState.zoom.zoomData) : zoomData;
|
|
45
|
-
|
|
76
|
+
const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
|
|
77
|
+
onZoomChange?.(newZoomData);
|
|
78
|
+
if (prevState.zoom.isControlled) {
|
|
79
|
+
return prevState;
|
|
80
|
+
}
|
|
46
81
|
return _extends({}, prevState, {
|
|
47
82
|
zoom: _extends({}, prevState.zoom, {
|
|
48
83
|
zoomData: newZoomData
|
|
49
84
|
})
|
|
50
85
|
});
|
|
51
86
|
});
|
|
52
|
-
}, [
|
|
87
|
+
}, [onZoomChange, store]);
|
|
88
|
+
|
|
89
|
+
// Add events
|
|
90
|
+
const panningEventCacheRef = React.useRef([]);
|
|
91
|
+
const zoomEventCacheRef = React.useRef([]);
|
|
92
|
+
const eventPrevDiff = React.useRef(0);
|
|
93
|
+
const interactionTimeoutRef = React.useRef(undefined);
|
|
53
94
|
|
|
54
95
|
// Add event for chart panning
|
|
55
96
|
const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
|
|
@@ -281,7 +322,8 @@ export const useChartProZoom = ({
|
|
|
281
322
|
};
|
|
282
323
|
useChartProZoom.params = {
|
|
283
324
|
initialZoom: true,
|
|
284
|
-
onZoomChange: true
|
|
325
|
+
onZoomChange: true,
|
|
326
|
+
zoomData: true
|
|
285
327
|
};
|
|
286
328
|
useChartProZoom.getDefaultizedParams = ({
|
|
287
329
|
params
|
|
@@ -289,11 +331,20 @@ useChartProZoom.getDefaultizedParams = ({
|
|
|
289
331
|
return _extends({}, params);
|
|
290
332
|
};
|
|
291
333
|
useChartProZoom.getInitialState = params => {
|
|
292
|
-
const
|
|
334
|
+
const {
|
|
335
|
+
initialZoom,
|
|
336
|
+
zoomData,
|
|
337
|
+
defaultizedXAxis,
|
|
338
|
+
defaultizedYAxis
|
|
339
|
+
} = params;
|
|
340
|
+
const optionsLookup = _extends({}, createZoomLookup('x')(defaultizedXAxis), createZoomLookup('y')(defaultizedYAxis));
|
|
293
341
|
return {
|
|
294
342
|
zoom: {
|
|
295
|
-
zoomData:
|
|
296
|
-
|
|
343
|
+
zoomData:
|
|
344
|
+
// eslint-disable-next-line no-nested-ternary
|
|
345
|
+
zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : initializeZoomData(optionsLookup),
|
|
346
|
+
isInteracting: false,
|
|
347
|
+
isControlled: zoomData !== undefined
|
|
297
348
|
}
|
|
298
349
|
};
|
|
299
350
|
};
|
|
@@ -10,11 +10,13 @@ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-cha
|
|
|
10
10
|
} & {
|
|
11
11
|
resultFunc: (resultFuncArgs_0: {
|
|
12
12
|
isInteracting: boolean;
|
|
13
|
-
zoomData: import("@mui/x-charts/internals").ZoomData[];
|
|
13
|
+
zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
|
|
14
|
+
isControlled: boolean;
|
|
14
15
|
}) => boolean;
|
|
15
16
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
16
17
|
isInteracting: boolean;
|
|
17
|
-
zoomData: import("@mui/x-charts/internals").ZoomData[];
|
|
18
|
+
zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
|
|
19
|
+
isControlled: boolean;
|
|
18
20
|
}) => boolean) & {
|
|
19
21
|
clearCache: () => void;
|
|
20
22
|
resultsCount: () => number;
|
|
@@ -30,7 +32,7 @@ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-cha
|
|
|
30
32
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
31
33
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
32
34
|
};
|
|
33
|
-
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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
34
36
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
35
37
|
}) => boolean) & {
|
|
36
38
|
clearCache: () => void;
|
|
@@ -50,7 +52,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
50
52
|
resetResultsCount: () => void;
|
|
51
53
|
};
|
|
52
54
|
lastResult: () => boolean;
|
|
53
|
-
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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
54
56
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
55
57
|
}) => {
|
|
56
58
|
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
@@ -76,23 +78,23 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
76
78
|
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
77
79
|
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
78
80
|
};
|
|
79
|
-
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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
80
82
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
81
83
|
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
82
84
|
clearCache: () => void;
|
|
83
85
|
resultsCount: () => number;
|
|
84
86
|
resetResultsCount: () => void;
|
|
85
87
|
} & {
|
|
86
|
-
resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
87
|
-
memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
88
|
+
resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
89
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
88
90
|
clearCache: () => void;
|
|
89
91
|
resultsCount: () => number;
|
|
90
92
|
resetResultsCount: () => void;
|
|
91
93
|
};
|
|
92
94
|
lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
93
|
-
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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
94
96
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
95
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
|
|
97
|
+
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
|
|
96
98
|
clearCache: () => void;
|
|
97
99
|
resultsCount: () => number;
|
|
98
100
|
resetResultsCount: () => void;
|
|
@@ -100,20 +102,20 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
100
102
|
resultFunc: (resultFuncArgs_0: {
|
|
101
103
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
102
104
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
103
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
105
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
|
|
104
106
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
105
107
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
106
108
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
107
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
|
|
109
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
|
|
108
110
|
clearCache: () => void;
|
|
109
111
|
resultsCount: () => number;
|
|
110
112
|
resetResultsCount: () => void;
|
|
111
113
|
};
|
|
112
|
-
lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
113
|
-
dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
|
|
114
|
+
lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
|
|
115
|
+
dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
|
|
114
116
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
115
117
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
116
|
-
}];
|
|
118
|
+
} | undefined];
|
|
117
119
|
recomputations: () => number;
|
|
118
120
|
resetRecomputations: () => void;
|
|
119
121
|
dependencyRecomputations: () => number;
|
|
@@ -129,23 +131,23 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
129
131
|
} & {
|
|
130
132
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
131
133
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
132
|
-
}, ((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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
133
135
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
134
136
|
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
135
137
|
clearCache: () => void;
|
|
136
138
|
resultsCount: () => number;
|
|
137
139
|
resetResultsCount: () => void;
|
|
138
140
|
} & {
|
|
139
|
-
resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
140
|
-
memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
141
|
+
resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
142
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
141
143
|
clearCache: () => void;
|
|
142
144
|
resultsCount: () => number;
|
|
143
145
|
resetResultsCount: () => void;
|
|
144
146
|
};
|
|
145
147
|
lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
146
|
-
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").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> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
147
149
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
148
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
|
|
150
|
+
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
|
|
149
151
|
clearCache: () => void;
|
|
150
152
|
resultsCount: () => number;
|
|
151
153
|
resetResultsCount: () => void;
|
|
@@ -153,20 +155,20 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
153
155
|
resultFunc: (resultFuncArgs_0: {
|
|
154
156
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
155
157
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
156
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
158
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
|
|
157
159
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
158
160
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
159
161
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
160
|
-
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
|
|
162
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
|
|
161
163
|
clearCache: () => void;
|
|
162
164
|
resultsCount: () => number;
|
|
163
165
|
resetResultsCount: () => void;
|
|
164
166
|
};
|
|
165
|
-
lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
166
|
-
dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
|
|
167
|
+
lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
|
|
168
|
+
dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
|
|
167
169
|
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
168
170
|
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
169
|
-
}];
|
|
171
|
+
} | undefined];
|
|
170
172
|
recomputations: () => number;
|
|
171
173
|
resetRecomputations: () => void;
|
|
172
174
|
dependencyRecomputations: () => number;
|
|
@@ -2,14 +2,19 @@ import { UseChartSeriesSignature, ChartPluginSignature, UseChartCartesianAxisSig
|
|
|
2
2
|
export interface UseChartProZoomParameters {
|
|
3
3
|
/**
|
|
4
4
|
* The list of zoom data related to each axis.
|
|
5
|
+
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
5
6
|
*/
|
|
6
|
-
initialZoom?: ZoomData[];
|
|
7
|
+
initialZoom?: readonly ZoomData[];
|
|
7
8
|
/**
|
|
8
9
|
* Callback fired when the zoom has changed.
|
|
9
10
|
*
|
|
10
11
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
11
12
|
*/
|
|
12
|
-
onZoomChange?: (zoomData: ZoomData[]
|
|
13
|
+
onZoomChange?: (zoomData: ZoomData[]) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The list of zoom data related to each axis.
|
|
16
|
+
*/
|
|
17
|
+
zoomData?: readonly ZoomData[];
|
|
13
18
|
}
|
|
14
19
|
export type UseChartProZoomDefaultizedParameters = UseChartProZoomParameters & UseChartCartesianAxisDefaultizedParameters;
|
|
15
20
|
export interface UseChartProZoomState {
|
|
@@ -22,7 +27,11 @@ export interface UseChartProZoomState {
|
|
|
22
27
|
/**
|
|
23
28
|
* Mapping of axis id to the zoom data.
|
|
24
29
|
*/
|
|
25
|
-
zoomData: ZoomData[];
|
|
30
|
+
zoomData: readonly ZoomData[];
|
|
31
|
+
/**
|
|
32
|
+
* Internal information to know if the user control the state or not.
|
|
33
|
+
*/
|
|
34
|
+
isControlled: boolean;
|
|
26
35
|
};
|
|
27
36
|
}
|
|
28
37
|
export interface UseChartProZoomPublicApi {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTc0MDY5NzIwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import { CommonDefaultizedProps, CommonSeriesType, CartesianSeriesType } from '@mui/x-charts/internals';
|
|
3
|
-
export type HeatmapValueType = [number, number, number];
|
|
3
|
+
export type HeatmapValueType = readonly [number, number, number];
|
|
4
4
|
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color'>, CartesianSeriesType {
|
|
5
5
|
type: 'heatmap';
|
|
6
6
|
/**
|
|
7
7
|
* Data associated to each bar.
|
|
8
8
|
*/
|
|
9
|
-
data?: HeatmapValueType[];
|
|
9
|
+
data?: readonly HeatmapValueType[];
|
|
10
10
|
/**
|
|
11
11
|
* The key used to retrieve data from the dataset.
|
|
12
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-pro",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.13",
|
|
4
4
|
"description": "The Pro plan edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@react-spring/web": "^9.7.5",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"prop-types": "^15.8.1",
|
|
38
|
-
"@mui/x-charts": "8.0.0-alpha.
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
41
|
-
"@mui/x-
|
|
38
|
+
"@mui/x-charts": "8.0.0-alpha.13",
|
|
39
|
+
"@mui/x-charts-vendor": "8.0.0-alpha.13",
|
|
40
|
+
"@mui/x-internals": "8.0.0-alpha.13",
|
|
41
|
+
"@mui/x-license": "8.0.0-alpha.13"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.9.0",
|