@mui/x-charts-pro 8.0.0-alpha.12 → 8.0.0-alpha.14
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.d.ts +2 -1
- package/BarChartPro/BarChartPro.js +25 -30
- package/CHANGELOG.md +430 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/ChartContainerPro/ChartContainerPro.js +1 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/FunnelChart/FunnelChart.d.ts +37 -0
- package/FunnelChart/FunnelChart.js +218 -0
- package/FunnelChart/FunnelPlot.d.ts +16 -0
- package/FunnelChart/FunnelPlot.js +191 -0
- package/FunnelChart/FunnelSection.d.ts +15 -0
- package/FunnelChart/FunnelSection.js +62 -0
- package/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/FunnelChart/categoryAxis.types.js +5 -0
- package/FunnelChart/funnel.types.d.ts +124 -0
- package/FunnelChart/funnel.types.js +5 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/FunnelChart/funnelPlotSlots.types.js +5 -0
- package/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/FunnelChart/funnelSectionClasses.js +28 -0
- package/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/FunnelChart/funnelSlots.types.js +5 -0
- package/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/FunnelChart/funnelStepCurve.js +74 -0
- package/FunnelChart/index.d.ts +7 -0
- package/FunnelChart/index.js +59 -0
- package/FunnelChart/labelUtils.d.ts +42 -0
- package/FunnelChart/labelUtils.js +174 -0
- package/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/FunnelChart/seriesConfig/extremums.js +50 -0
- package/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/FunnelChart/seriesConfig/getColor.js +10 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +18 -0
- package/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/FunnelChart/seriesConfig/index.js +22 -0
- package/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/FunnelChart/seriesConfig/legend.js +31 -0
- package/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/FunnelChart/seriesConfig/seriesProcessor.js +96 -0
- package/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/FunnelChart/seriesConfig/tooltip.js +36 -0
- package/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/FunnelChart/useFunnelChartProps.js +168 -0
- package/Heatmap/Heatmap.d.ts +5 -4
- package/Heatmap/Heatmap.js +37 -52
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/Heatmap/seriesConfig/index.js +3 -1
- package/LineChartPro/LineChartPro.d.ts +2 -1
- package/LineChartPro/LineChartPro.js +25 -30
- package/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/BarChartPro/BarChartPro.d.ts +2 -1
- 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.d.ts +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/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/esm/FunnelChart/FunnelChart.d.ts +37 -0
- package/esm/FunnelChart/FunnelChart.js +212 -0
- package/esm/FunnelChart/FunnelPlot.d.ts +16 -0
- package/esm/FunnelChart/FunnelPlot.js +184 -0
- package/esm/FunnelChart/FunnelSection.d.ts +15 -0
- package/esm/FunnelChart/FunnelSection.js +56 -0
- package/esm/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/esm/FunnelChart/categoryAxis.types.js +1 -0
- package/esm/FunnelChart/funnel.types.d.ts +124 -0
- package/esm/FunnelChart/funnel.types.js +1 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/esm/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/esm/FunnelChart/funnelSectionClasses.js +20 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/esm/FunnelChart/funnelSlots.types.js +1 -0
- package/esm/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/esm/FunnelChart/funnelStepCurve.js +67 -0
- package/esm/FunnelChart/index.d.ts +7 -0
- package/esm/FunnelChart/index.js +5 -0
- package/esm/FunnelChart/labelUtils.d.ts +42 -0
- package/esm/FunnelChart/labelUtils.js +166 -0
- package/esm/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/extremums.js +42 -0
- package/esm/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getColor.js +4 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/esm/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/esm/FunnelChart/seriesConfig/index.js +15 -0
- package/esm/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/legend.js +25 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/esm/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/esm/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/esm/FunnelChart/useFunnelChartProps.js +161 -0
- package/esm/Heatmap/Heatmap.d.ts +5 -4
- package/esm/Heatmap/Heatmap.js +37 -52
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/Heatmap/seriesConfig/index.js +3 -1
- package/esm/LineChartPro/LineChartPro.d.ts +2 -1
- package/esm/LineChartPro/LineChartPro.js +25 -30
- package/esm/ScatterChartPro/ScatterChartPro.js +25 -30
- package/esm/hooks/useFunnelSeries.d.ts +33 -0
- package/esm/hooks/useFunnelSeries.js +42 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +4 -2
- package/esm/internals/plugins/allPlugins.d.ts +3 -3
- package/esm/internals/plugins/allPlugins.js +2 -2
- 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/esm/typeOverloads/modules.d.ts +13 -2
- package/hooks/useFunnelSeries.d.ts +33 -0
- package/hooks/useFunnelSeries.js +48 -0
- package/index.d.ts +3 -1
- package/index.js +23 -1
- package/internals/plugins/allPlugins.d.ts +3 -3
- package/internals/plugins/allPlugins.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.d.ts +2 -1
- 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.d.ts +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/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/modern/FunnelChart/FunnelChart.d.ts +37 -0
- package/modern/FunnelChart/FunnelChart.js +212 -0
- package/modern/FunnelChart/FunnelPlot.d.ts +16 -0
- package/modern/FunnelChart/FunnelPlot.js +184 -0
- package/modern/FunnelChart/FunnelSection.d.ts +15 -0
- package/modern/FunnelChart/FunnelSection.js +56 -0
- package/modern/FunnelChart/categoryAxis.types.d.ts +24 -0
- package/modern/FunnelChart/categoryAxis.types.js +1 -0
- package/modern/FunnelChart/funnel.types.d.ts +124 -0
- package/modern/FunnelChart/funnel.types.js +1 -0
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +20 -0
- package/modern/FunnelChart/funnelPlotSlots.types.js +1 -0
- package/modern/FunnelChart/funnelSectionClasses.d.ts +13 -0
- package/modern/FunnelChart/funnelSectionClasses.js +20 -0
- package/modern/FunnelChart/funnelSlots.types.d.ts +19 -0
- package/modern/FunnelChart/funnelSlots.types.js +1 -0
- package/modern/FunnelChart/funnelStepCurve.d.ts +4 -0
- package/modern/FunnelChart/funnelStepCurve.js +67 -0
- package/modern/FunnelChart/index.d.ts +7 -0
- package/modern/FunnelChart/index.js +5 -0
- package/modern/FunnelChart/labelUtils.d.ts +42 -0
- package/modern/FunnelChart/labelUtils.js +166 -0
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/extremums.js +42 -0
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getColor.js +4 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/modern/FunnelChart/seriesConfig/index.d.ts +2 -0
- package/modern/FunnelChart/seriesConfig/index.js +15 -0
- package/modern/FunnelChart/seriesConfig/legend.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/legend.js +25 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +89 -0
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +3 -0
- package/modern/FunnelChart/seriesConfig/tooltip.js +29 -0
- package/modern/FunnelChart/useFunnelChartProps.d.ts +30 -0
- package/modern/FunnelChart/useFunnelChartProps.js +161 -0
- package/modern/Heatmap/Heatmap.d.ts +5 -4
- package/modern/Heatmap/Heatmap.js +37 -52
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/Heatmap/seriesConfig/index.js +3 -1
- package/modern/LineChartPro/LineChartPro.d.ts +2 -1
- package/modern/LineChartPro/LineChartPro.js +25 -30
- package/modern/ScatterChartPro/ScatterChartPro.js +25 -30
- package/modern/hooks/useFunnelSeries.d.ts +33 -0
- package/modern/hooks/useFunnelSeries.js +42 -0
- package/modern/index.d.ts +3 -1
- package/modern/index.js +4 -2
- package/modern/internals/plugins/allPlugins.d.ts +3 -3
- package/modern/internals/plugins/allPlugins.js +2 -2
- 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/modern/typeOverloads/modules.d.ts +13 -2
- package/package.json +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/typeOverloads/modules.d.ts +13 -2
package/esm/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from '@mui/x-charts/PieChart';
|
|
|
20
20
|
export * from '@mui/x-charts/ScatterChart';
|
|
21
21
|
export * from '@mui/x-charts/SparkLineChart';
|
|
22
22
|
export * from '@mui/x-charts/Gauge';
|
|
23
|
+
export * from '@mui/x-charts/RadarChart';
|
|
23
24
|
export * from '@mui/x-charts/ChartsSurface';
|
|
24
25
|
export * from '@mui/x-charts/ChartDataProvider';
|
|
25
26
|
export * from '@mui/x-charts/ChartsLabel';
|
|
@@ -29,4 +30,5 @@ export * from "./ChartContainerPro/index.js";
|
|
|
29
30
|
export * from "./ChartDataProviderPro/index.js";
|
|
30
31
|
export * from "./ScatterChartPro/index.js";
|
|
31
32
|
export * from "./BarChartPro/index.js";
|
|
32
|
-
export * from "./LineChartPro/index.js";
|
|
33
|
+
export * from "./LineChartPro/index.js";
|
|
34
|
+
export * from "./FunnelChart/index.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro v8.0.0-alpha.
|
|
2
|
+
* @mui/x-charts-pro v8.0.0-alpha.14
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -29,6 +29,7 @@ export * from '@mui/x-charts/PieChart';
|
|
|
29
29
|
export * from '@mui/x-charts/ScatterChart';
|
|
30
30
|
export * from '@mui/x-charts/SparkLineChart';
|
|
31
31
|
export * from '@mui/x-charts/Gauge';
|
|
32
|
+
export * from '@mui/x-charts/RadarChart';
|
|
32
33
|
export * from '@mui/x-charts/ChartsSurface';
|
|
33
34
|
export * from '@mui/x-charts/ChartDataProvider';
|
|
34
35
|
export * from '@mui/x-charts/ChartsLabel';
|
|
@@ -40,4 +41,5 @@ export * from "./ChartContainerPro/index.js";
|
|
|
40
41
|
export * from "./ChartDataProviderPro/index.js";
|
|
41
42
|
export * from "./ScatterChartPro/index.js";
|
|
42
43
|
export * from "./BarChartPro/index.js";
|
|
43
|
-
export * from "./LineChartPro/index.js";
|
|
44
|
+
export * from "./LineChartPro/index.js";
|
|
45
|
+
export * from "./FunnelChart/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProZoomSignature } from "./useChartProZoom/index.js";
|
|
3
|
-
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
3
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
4
4
|
export type AllPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<TSeries>>;
|
|
5
|
-
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
|
|
5
|
+
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
2
2
|
|
|
3
|
-
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight } from '@mui/x-charts/internals';
|
|
3
|
+
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis } from '@mui/x-charts/internals';
|
|
4
4
|
import { useChartProZoom } from "./useChartProZoom/index.js";
|
|
5
|
-
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
|
5
|
+
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
|
@@ -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 = "MTc0MTMwMjAwMDAwMA==";
|
|
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
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
1
|
+
import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
2
2
|
import { AxisId, ZoomOptions } from '@mui/x-charts/internals';
|
|
3
3
|
import { HeatmapItemIdentifier, HeatmapSeriesType, DefaultizedHeatmapSeriesType, HeatmapValueType } from "../models/seriesType/heatmap.js";
|
|
4
|
+
import { DefaultizedFunnelSeriesType, FunnelItemIdentifier, FunnelSeriesType, FunnelValueType } from "../FunnelChart/funnel.types.js";
|
|
4
5
|
declare module '@mui/x-charts/internals' {
|
|
5
6
|
interface ChartsSeriesConfig {
|
|
6
7
|
heatmap: {
|
|
@@ -9,7 +10,17 @@ declare module '@mui/x-charts/internals' {
|
|
|
9
10
|
seriesProp: HeatmapSeriesType;
|
|
10
11
|
itemIdentifier: HeatmapItemIdentifier;
|
|
11
12
|
valueType: HeatmapValueType;
|
|
12
|
-
|
|
13
|
+
axisType: 'cartesian';
|
|
14
|
+
};
|
|
15
|
+
funnel: {
|
|
16
|
+
seriesInput: Omit<DefaultizedProps<FunnelSeriesType, 'id'>, 'data'> & {
|
|
17
|
+
data: MakeRequired<FunnelValueType, 'color'>[];
|
|
18
|
+
};
|
|
19
|
+
series: DefaultizedFunnelSeriesType;
|
|
20
|
+
seriesProp: FunnelSeriesType;
|
|
21
|
+
itemIdentifier: FunnelItemIdentifier;
|
|
22
|
+
valueType: MakeRequired<FunnelValueType, 'id' | 'color'>;
|
|
23
|
+
axisType: 'cartesian';
|
|
13
24
|
};
|
|
14
25
|
}
|
|
15
26
|
interface DefaultizedZoomOptions extends Required<ZoomOptions> {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ProcessedSeries, SeriesId, ChartSeriesDefaultized } from '@mui/x-charts/internals';
|
|
2
|
+
export type UseFunnelSeriesReturnValue = ChartSeriesDefaultized<'funnel'>;
|
|
3
|
+
export type UseFunnelSeriesContextReturnValue = ProcessedSeries['funnel'];
|
|
4
|
+
/**
|
|
5
|
+
* Get access to the internal state of funnel series.
|
|
6
|
+
*
|
|
7
|
+
* @param {SeriesId} seriesId The id of the series to get.
|
|
8
|
+
* @returns {UseFunnelSeriesReturnValue} the funnel series
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFunnelSeries(seriesId: SeriesId): UseFunnelSeriesReturnValue | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Get access to the internal state of funnel series.
|
|
13
|
+
*
|
|
14
|
+
* When called without arguments, it returns all funnel series.
|
|
15
|
+
*
|
|
16
|
+
* @returns {UseFunnelSeriesReturnValue[]} the funnel series
|
|
17
|
+
*/
|
|
18
|
+
export declare function useFunnelSeries(): UseFunnelSeriesReturnValue[];
|
|
19
|
+
/**
|
|
20
|
+
* Get access to the internal state of funnel series.
|
|
21
|
+
*
|
|
22
|
+
* @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
|
|
23
|
+
* @returns {UseFunnelSeriesReturnValue[]} the funnel series
|
|
24
|
+
*/
|
|
25
|
+
export declare function useFunnelSeries(seriesIds: SeriesId[]): UseFunnelSeriesReturnValue[];
|
|
26
|
+
/**
|
|
27
|
+
* Get access to the internal state of funnel series.
|
|
28
|
+
* The returned object contains:
|
|
29
|
+
* - series: a mapping from ids to series attributes.
|
|
30
|
+
* - seriesOrder: the array of series ids.
|
|
31
|
+
* @returns the funnel series
|
|
32
|
+
*/
|
|
33
|
+
export declare function useFunnelSeriesContext(): UseFunnelSeriesContextReturnValue;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useFunnelSeries = useFunnelSeries;
|
|
8
|
+
exports.useFunnelSeriesContext = useFunnelSeriesContext;
|
|
9
|
+
var _internals = require("@mui/x-charts/internals");
|
|
10
|
+
const useSelectorSeries = (0, _internals.createSeriesSelectorsOfType)('funnel');
|
|
11
|
+
const useSelectorSeriesContext = (0, _internals.createAllSeriesSelectorOfType)('funnel');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get access to the internal state of funnel series.
|
|
15
|
+
*
|
|
16
|
+
* @param {SeriesId} seriesId The id of the series to get.
|
|
17
|
+
* @returns {UseFunnelSeriesReturnValue} the funnel series
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get access to the internal state of funnel series.
|
|
22
|
+
*
|
|
23
|
+
* When called without arguments, it returns all funnel series.
|
|
24
|
+
*
|
|
25
|
+
* @returns {UseFunnelSeriesReturnValue[]} the funnel series
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get access to the internal state of funnel series.
|
|
30
|
+
*
|
|
31
|
+
* @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
|
|
32
|
+
* @returns {UseFunnelSeriesReturnValue[]} the funnel series
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
function useFunnelSeries(seriesIds) {
|
|
36
|
+
return useSelectorSeries(seriesIds);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get access to the internal state of funnel series.
|
|
41
|
+
* The returned object contains:
|
|
42
|
+
* - series: a mapping from ids to series attributes.
|
|
43
|
+
* - seriesOrder: the array of series ids.
|
|
44
|
+
* @returns the funnel series
|
|
45
|
+
*/
|
|
46
|
+
function useFunnelSeriesContext() {
|
|
47
|
+
return useSelectorSeriesContext();
|
|
48
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from '@mui/x-charts/PieChart';
|
|
|
20
20
|
export * from '@mui/x-charts/ScatterChart';
|
|
21
21
|
export * from '@mui/x-charts/SparkLineChart';
|
|
22
22
|
export * from '@mui/x-charts/Gauge';
|
|
23
|
+
export * from '@mui/x-charts/RadarChart';
|
|
23
24
|
export * from '@mui/x-charts/ChartsSurface';
|
|
24
25
|
export * from '@mui/x-charts/ChartDataProvider';
|
|
25
26
|
export * from '@mui/x-charts/ChartsLabel';
|
|
@@ -29,4 +30,5 @@ export * from "./ChartContainerPro/index.js";
|
|
|
29
30
|
export * from "./ChartDataProviderPro/index.js";
|
|
30
31
|
export * from "./ScatterChartPro/index.js";
|
|
31
32
|
export * from "./BarChartPro/index.js";
|
|
32
|
-
export * from "./LineChartPro/index.js";
|
|
33
|
+
export * from "./LineChartPro/index.js";
|
|
34
|
+
export * from "./FunnelChart/index.js";
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro v8.0.0-alpha.
|
|
2
|
+
* @mui/x-charts-pro v8.0.0-alpha.14
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -242,6 +242,17 @@ Object.keys(_Gauge).forEach(function (key) {
|
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
|
+
var _RadarChart = require("@mui/x-charts/RadarChart");
|
|
246
|
+
Object.keys(_RadarChart).forEach(function (key) {
|
|
247
|
+
if (key === "default" || key === "__esModule") return;
|
|
248
|
+
if (key in exports && exports[key] === _RadarChart[key]) return;
|
|
249
|
+
Object.defineProperty(exports, key, {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function () {
|
|
252
|
+
return _RadarChart[key];
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
});
|
|
245
256
|
var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
|
|
246
257
|
Object.keys(_ChartsSurface).forEach(function (key) {
|
|
247
258
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -351,4 +362,15 @@ Object.keys(_LineChartPro).forEach(function (key) {
|
|
|
351
362
|
return _LineChartPro[key];
|
|
352
363
|
}
|
|
353
364
|
});
|
|
365
|
+
});
|
|
366
|
+
var _FunnelChart = require("./FunnelChart");
|
|
367
|
+
Object.keys(_FunnelChart).forEach(function (key) {
|
|
368
|
+
if (key === "default" || key === "__esModule") return;
|
|
369
|
+
if (key in exports && exports[key] === _FunnelChart[key]) return;
|
|
370
|
+
Object.defineProperty(exports, key, {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
get: function () {
|
|
373
|
+
return _FunnelChart[key];
|
|
374
|
+
}
|
|
375
|
+
});
|
|
354
376
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProZoomSignature } from "./useChartProZoom/index.js";
|
|
3
|
-
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
3
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
4
4
|
export type AllPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<TSeries>>;
|
|
5
|
-
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
|
|
5
|
+
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
|
|
@@ -8,4 +8,4 @@ var _internals = require("@mui/x-charts/internals");
|
|
|
8
8
|
var _useChartProZoom = require("./useChartProZoom");
|
|
9
9
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
10
10
|
|
|
11
|
-
const ALL_PLUGINS = exports.ALL_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
|
|
11
|
+
const ALL_PLUGINS = exports.ALL_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartPolarAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
|