@mui/x-charts-pro 8.0.0-alpha.11 → 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.d.ts +3 -4
- package/BarChartPro/BarChartPro.js +245 -244
- package/BarChartPro/BarChartPro.plugins.d.ts +3 -9
- package/BarChartPro/BarChartPro.plugins.js +9 -3
- package/BarChartPro/index.d.ts +1 -1
- package/BarChartPro/index.js +16 -1
- package/CHANGELOG.md +460 -1
- package/ChartContainerPro/ChartContainerPro.d.ts +5 -5
- package/ChartContainerPro/ChartContainerPro.js +179 -173
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +17 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +3 -3
- package/ChartContainerPro/useChartContainerProProps.js +20 -11
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +4 -4
- package/ChartDataProviderPro/ChartDataProviderPro.js +37 -30
- package/ChartDataProviderPro/index.d.ts +2 -1
- package/ChartDataProviderPro/index.js +17 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +4 -4
- package/ChartDataProviderPro/useChartDataProviderProProps.js +10 -4
- package/Heatmap/Heatmap.d.ts +45 -44
- package/Heatmap/Heatmap.js +232 -241
- package/Heatmap/Heatmap.plugins.d.ts +2 -7
- package/Heatmap/Heatmap.plugins.js +8 -2
- package/Heatmap/HeatmapItem.d.ts +33 -33
- package/Heatmap/HeatmapItem.js +39 -32
- package/Heatmap/HeatmapPlot.d.ts +4 -5
- package/Heatmap/HeatmapPlot.js +22 -16
- package/Heatmap/HeatmapTooltip.d.ts +3 -4
- package/Heatmap/HeatmapTooltip.js +97 -89
- package/Heatmap/heatmapClasses.d.ts +7 -7
- package/Heatmap/heatmapClasses.js +15 -7
- package/Heatmap/index.d.ts +4 -4
- package/Heatmap/index.js +47 -4
- package/Heatmap/{extremums.d.ts → seriesConfig/extremums.d.ts} +1 -1
- package/Heatmap/{getColor.d.ts → seriesConfig/getColor.d.ts} +1 -1
- package/Heatmap/seriesConfig/index.d.ts +2 -0
- package/{node/Heatmap/plugin.js → Heatmap/seriesConfig/index.js} +4 -4
- package/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{node/Heatmap/formatter.js → Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/Heatmap/{tooltip.d.ts → seriesConfig/tooltip.d.ts} +1 -1
- package/LineChartPro/LineChartPro.d.ts +3 -4
- package/LineChartPro/LineChartPro.js +257 -256
- package/LineChartPro/LineChartPro.plugins.d.ts +3 -9
- package/LineChartPro/LineChartPro.plugins.js +9 -3
- package/LineChartPro/index.d.ts +1 -1
- package/LineChartPro/index.js +16 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +4 -4
- package/ScatterChartPro/ScatterChartPro.js +234 -235
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -10
- package/ScatterChartPro/ScatterChartPro.plugins.js +9 -3
- package/ScatterChartPro/index.d.ts +1 -1
- package/ScatterChartPro/index.js +16 -1
- package/esm/BarChartPro/BarChartPro.d.ts +17 -0
- package/esm/BarChartPro/BarChartPro.js +450 -0
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/esm/BarChartPro/BarChartPro.plugins.js +3 -0
- package/esm/BarChartPro/index.d.ts +1 -0
- package/esm/BarChartPro/index.js +1 -0
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/esm/ChartContainerPro/ChartContainerPro.js +290 -0
- package/esm/ChartContainerPro/index.d.ts +2 -0
- package/esm/ChartContainerPro/index.js +2 -0
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/esm/ChartContainerPro/useChartContainerProProps.js +35 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/{node → esm}/ChartDataProviderPro/ChartDataProviderPro.js +31 -36
- package/esm/ChartDataProviderPro/index.d.ts +2 -0
- package/esm/ChartDataProviderPro/index.js +2 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/esm/Heatmap/Heatmap.d.ts +57 -0
- package/esm/Heatmap/Heatmap.js +387 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/esm/Heatmap/Heatmap.plugins.js +2 -0
- package/esm/Heatmap/HeatmapItem.d.ts +49 -0
- package/esm/Heatmap/HeatmapItem.js +106 -0
- package/esm/Heatmap/HeatmapPlot.d.ts +8 -0
- package/{node → esm}/Heatmap/HeatmapPlot.js +16 -22
- package/esm/Heatmap/HeatmapTooltip.d.ts +8 -0
- package/esm/Heatmap/HeatmapTooltip.js +276 -0
- package/esm/Heatmap/heatmapClasses.d.ts +11 -0
- package/esm/Heatmap/heatmapClasses.js +14 -0
- package/esm/Heatmap/index.d.ts +4 -0
- package/esm/Heatmap/index.js +4 -0
- package/esm/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/esm/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/index.d.ts +2 -0
- package/{Heatmap/plugin.js → esm/Heatmap/seriesConfig/index.js} +3 -3
- package/esm/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{Heatmap/formatter.js → esm/Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/esm/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/esm/LineChartPro/LineChartPro.d.ts +16 -0
- package/esm/LineChartPro/LineChartPro.js +501 -0
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/esm/LineChartPro/LineChartPro.plugins.js +3 -0
- package/esm/LineChartPro/index.d.ts +1 -0
- package/esm/LineChartPro/index.js +1 -0
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +395 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- package/esm/ScatterChartPro/index.d.ts +1 -0
- package/esm/ScatterChartPro/index.js +1 -0
- package/esm/hooks/index.d.ts +2 -0
- package/esm/hooks/index.js +2 -0
- package/esm/hooks/useHeatmapSeries.d.ts +33 -0
- package/esm/hooks/useHeatmapSeries.js +42 -0
- package/esm/hooks/zoom/index.d.ts +1 -0
- package/esm/hooks/zoom/index.js +1 -0
- package/esm/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/esm/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/esm/index.d.ts +32 -0
- package/esm/index.js +43 -0
- package/esm/internals/plugins/allPlugins.d.ts +5 -0
- package/esm/internals/plugins/allPlugins.js +5 -0
- package/esm/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/esm/internals/plugins/useChartProZoom/index.js +3 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.js +94 -54
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.utils.js +8 -22
- package/esm/internals/utils/releaseInfo.d.ts +1 -0
- package/esm/internals/utils/releaseInfo.js +13 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/seriesType/heatmap.d.ts +28 -0
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/themeAugmentation/components.d.ts +23 -0
- package/esm/themeAugmentation/index.d.ts +4 -0
- package/esm/themeAugmentation/index.js +0 -0
- package/esm/themeAugmentation/overrides.d.ts +11 -0
- package/esm/themeAugmentation/props.d.ts +20 -0
- package/esm/typeOverloads/index.d.ts +1 -0
- package/esm/typeOverloads/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +22 -0
- package/esm/typeOverloads/modules.js +1 -0
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +27 -2
- package/hooks/useHeatmapSeries.d.ts +33 -0
- package/hooks/useHeatmapSeries.js +48 -0
- package/hooks/zoom/index.d.ts +1 -1
- package/hooks/zoom/index.js +16 -1
- package/hooks/zoom/useIsZoomInteracting.d.ts +1 -1
- package/hooks/zoom/useIsZoomInteracting.js +10 -5
- package/index.d.ts +8 -7
- package/index.js +347 -36
- package/internals/plugins/allPlugins.d.ts +3 -9
- package/internals/plugins/allPlugins.js +9 -3
- package/internals/plugins/useChartProZoom/index.d.ts +3 -3
- package/internals/plugins/useChartProZoom/index.js +38 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.js +101 -47
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +154 -328
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -10
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +42 -39
- package/internals/plugins/useChartProZoom/useChartProZoom.types.js +5 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +13 -13
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +22 -8
- package/internals/utils/releaseInfo.d.ts +1 -1
- package/internals/utils/releaseInfo.js +13 -5
- package/models/index.d.ts +1 -1
- package/models/index.js +16 -2
- package/models/seriesType/heatmap.d.ts +18 -19
- package/models/seriesType/heatmap.js +5 -1
- package/models/seriesType/index.d.ts +1 -1
- package/models/seriesType/index.js +16 -1
- package/modern/BarChartPro/BarChartPro.d.ts +17 -0
- package/modern/BarChartPro/BarChartPro.js +25 -30
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/modern/BarChartPro/index.d.ts +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +1 -1
- package/modern/ChartContainerPro/index.d.ts +2 -0
- package/modern/ChartContainerPro/index.js +1 -0
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/modern/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- package/modern/ChartDataProviderPro/index.d.ts +2 -0
- package/modern/ChartDataProviderPro/index.js +1 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/modern/Heatmap/Heatmap.d.ts +57 -0
- package/modern/Heatmap/Heatmap.js +39 -54
- package/modern/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/modern/Heatmap/HeatmapItem.d.ts +49 -0
- package/modern/Heatmap/HeatmapPlot.d.ts +8 -0
- package/modern/Heatmap/HeatmapPlot.js +2 -2
- package/modern/Heatmap/HeatmapTooltip.d.ts +8 -0
- package/modern/Heatmap/HeatmapTooltip.js +6 -4
- package/modern/Heatmap/heatmapClasses.d.ts +11 -0
- package/modern/Heatmap/index.d.ts +4 -0
- package/modern/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/modern/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/index.d.ts +2 -0
- package/modern/Heatmap/{plugin.js → seriesConfig/index.js} +3 -3
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/Heatmap/{formatter.js → seriesConfig/seriesProcessor.js} +2 -2
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/modern/LineChartPro/LineChartPro.d.ts +16 -0
- package/modern/LineChartPro/LineChartPro.js +25 -30
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/modern/LineChartPro/index.d.ts +1 -0
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +26 -33
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +2 -2
- package/modern/ScatterChartPro/index.d.ts +1 -0
- package/modern/hooks/index.d.ts +2 -0
- package/modern/hooks/index.js +1 -1
- package/modern/hooks/useHeatmapSeries.d.ts +33 -0
- package/modern/hooks/useHeatmapSeries.js +42 -0
- package/modern/hooks/zoom/index.d.ts +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/modern/index.d.ts +32 -0
- package/modern/index.js +2 -2
- package/modern/internals/plugins/allPlugins.d.ts +5 -0
- package/modern/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +65 -18
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -7
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/modern/internals/utils/releaseInfo.d.ts +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.d.ts +2 -0
- package/modern/models/seriesType/heatmap.d.ts +28 -0
- package/modern/models/seriesType/index.d.ts +1 -0
- package/modern/package.json +1 -0
- package/modern/themeAugmentation/components.d.ts +23 -0
- package/modern/themeAugmentation/index.d.ts +4 -0
- package/modern/themeAugmentation/overrides.d.ts +11 -0
- package/modern/themeAugmentation/props.d.ts +20 -0
- package/modern/typeOverloads/index.d.ts +1 -0
- package/modern/typeOverloads/modules.d.ts +22 -0
- package/package.json +41 -11
- package/themeAugmentation/components.d.ts +1 -3
- package/themeAugmentation/index.d.ts +1 -1
- package/themeAugmentation/index.js +1 -0
- package/themeAugmentation/overrides.d.ts +2 -4
- package/themeAugmentation/props.d.ts +5 -7
- package/tsconfig.build.tsbuildinfo +1 -0
- package/typeOverloads/index.d.ts +1 -1
- package/typeOverloads/index.js +6 -1
- package/typeOverloads/modules.d.ts +20 -23
- package/typeOverloads/modules.js +5 -1
- package/BarChartPro/package.json +0 -6
- package/ChartContainerPro/package.json +0 -6
- package/ChartDataProviderPro/package.json +0 -6
- package/Heatmap/formatter.d.ts +0 -3
- package/Heatmap/package.json +0 -6
- package/Heatmap/plugin.d.ts +0 -2
- package/LineChartPro/package.json +0 -6
- package/ScatterChartPro/package.json +0 -6
- package/hooks/package.json +0 -6
- package/hooks/useSeries.d.ts +0 -9
- package/hooks/useSeries.js +0 -16
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +0 -3
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +0 -2
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +0 -53
- package/models/package.json +0 -6
- package/modern/hooks/useSeries.js +0 -16
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/node/BarChartPro/BarChartPro.js +0 -461
- package/node/BarChartPro/BarChartPro.plugins.js +0 -9
- package/node/BarChartPro/index.js +0 -16
- package/node/ChartContainerPro/ChartContainerPro.js +0 -296
- package/node/ChartContainerPro/index.js +0 -16
- package/node/ChartContainerPro/useChartContainerProProps.js +0 -40
- package/node/ChartDataProviderPro/index.js +0 -16
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +0 -21
- package/node/Heatmap/Heatmap.js +0 -408
- package/node/Heatmap/Heatmap.plugins.js +0 -8
- package/node/Heatmap/HeatmapItem.js +0 -113
- package/node/Heatmap/HeatmapTooltip.js +0 -280
- package/node/Heatmap/heatmapClasses.js +0 -22
- package/node/Heatmap/index.js +0 -47
- package/node/LineChartPro/LineChartPro.js +0 -512
- package/node/LineChartPro/LineChartPro.plugins.js +0 -9
- package/node/LineChartPro/index.js +0 -16
- package/node/ScatterChartPro/ScatterChartPro.js +0 -408
- package/node/ScatterChartPro/ScatterChartPro.plugins.js +0 -9
- package/node/ScatterChartPro/index.js +0 -16
- package/node/hooks/index.js +0 -27
- package/node/hooks/useSeries.js +0 -21
- package/node/hooks/zoom/index.js +0 -16
- package/node/hooks/zoom/useIsZoomInteracting.js +0 -19
- package/node/index.js +0 -354
- package/node/internals/plugins/allPlugins.js +0 -11
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -19
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -33
- package/node/internals/plugins/useChartProZoom/index.js +0 -38
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -18
- package/node/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -5
- package/node/internals/plugins/useChartProZoom/zoom.types.js +0 -5
- package/node/internals/utils/releaseInfo.js +0 -21
- package/node/models/index.js +0 -16
- package/node/models/seriesType/heatmap.js +0 -5
- package/node/models/seriesType/index.js +0 -16
- package/node/themeAugmentation/index.js +0 -1
- package/node/typeOverloads/index.js +0 -6
- package/node/typeOverloads/modules.js +0 -5
- package/themeAugmentation/package.json +0 -6
- package/typeOverloads/package.json +0 -6
- /package/{node/Heatmap → Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/getColor.js +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/tooltip.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/getColor.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/tooltip.js +0 -0
- /package/{internals/plugins/useChartProZoom/zoom.types.js → esm/internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/internals/plugins/useChartProZoom/zoom.types.js → esm/models/seriesType/heatmap.js} +0 -0
- /package/modern/Heatmap/{extremums.js → seriesConfig/extremums.js} +0 -0
- /package/modern/Heatmap/{getColor.js → seriesConfig/getColor.js} +0 -0
- /package/modern/Heatmap/{tooltip.js → seriesConfig/tooltip.js} +0 -0
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
6
|
+
import { useSelector, getSVGPoint, selectorChartDrawingArea, createZoomLookup, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
7
7
|
import { getDiff, getHorizontalCenterRatio, getPinchScaleRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, preventDefault, zoomAtPoint } from "./useChartProZoom.utils.js";
|
|
8
|
-
import { selectorChartZoomOptionsLookup } from "./useChartProZoom.selectors.js";
|
|
9
8
|
|
|
10
9
|
// It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
|
|
11
10
|
function initializeZoomData(options) {
|
|
@@ -25,15 +24,46 @@ export const useChartProZoom = ({
|
|
|
25
24
|
svgRef,
|
|
26
25
|
params
|
|
27
26
|
}) => {
|
|
27
|
+
const {
|
|
28
|
+
zoomData: paramsZoomData,
|
|
29
|
+
onZoomChange
|
|
30
|
+
} = params;
|
|
28
31
|
const drawingArea = useSelector(store, selectorChartDrawingArea);
|
|
29
32
|
const optionsLookup = useSelector(store, selectorChartZoomOptionsLookup);
|
|
30
33
|
const isZoomEnabled = Object.keys(optionsLookup).length > 0;
|
|
31
34
|
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
37
67
|
const setIsInteracting = React.useCallback(isInteracting => {
|
|
38
68
|
store.update(prev => _extends({}, prev, {
|
|
39
69
|
zoom: _extends({}, prev.zoom, {
|
|
@@ -43,15 +73,24 @@ export const useChartProZoom = ({
|
|
|
43
73
|
}, [store]);
|
|
44
74
|
const setZoomDataCallback = React.useCallback(zoomData => {
|
|
45
75
|
store.update(prevState => {
|
|
46
|
-
const newZoomData = typeof zoomData === 'function' ? zoomData(prevState.zoom.zoomData) : zoomData;
|
|
47
|
-
|
|
76
|
+
const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
|
|
77
|
+
onZoomChange?.(newZoomData);
|
|
78
|
+
if (prevState.zoom.isControlled) {
|
|
79
|
+
return prevState;
|
|
80
|
+
}
|
|
48
81
|
return _extends({}, prevState, {
|
|
49
82
|
zoom: _extends({}, prevState.zoom, {
|
|
50
83
|
zoomData: newZoomData
|
|
51
84
|
})
|
|
52
85
|
});
|
|
53
86
|
});
|
|
54
|
-
}, [
|
|
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);
|
|
55
94
|
|
|
56
95
|
// Add event for chart panning
|
|
57
96
|
const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
|
|
@@ -283,21 +322,29 @@ export const useChartProZoom = ({
|
|
|
283
322
|
};
|
|
284
323
|
useChartProZoom.params = {
|
|
285
324
|
initialZoom: true,
|
|
286
|
-
onZoomChange: true
|
|
325
|
+
onZoomChange: true,
|
|
326
|
+
zoomData: true
|
|
287
327
|
};
|
|
288
328
|
useChartProZoom.getDefaultizedParams = ({
|
|
289
329
|
params
|
|
290
330
|
}) => {
|
|
291
|
-
|
|
292
|
-
return _extends({}, params, {
|
|
293
|
-
optionsLookup
|
|
294
|
-
});
|
|
331
|
+
return _extends({}, params);
|
|
295
332
|
};
|
|
296
333
|
useChartProZoom.getInitialState = params => {
|
|
334
|
+
const {
|
|
335
|
+
initialZoom,
|
|
336
|
+
zoomData,
|
|
337
|
+
defaultizedXAxis,
|
|
338
|
+
defaultizedYAxis
|
|
339
|
+
} = params;
|
|
340
|
+
const optionsLookup = _extends({}, createZoomLookup('x')(defaultizedXAxis), createZoomLookup('y')(defaultizedYAxis));
|
|
297
341
|
return {
|
|
298
342
|
zoom: {
|
|
299
|
-
zoomData:
|
|
300
|
-
|
|
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
|
|
301
348
|
}
|
|
302
349
|
};
|
|
303
350
|
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { ChartRootSelector } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
|
|
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<{}> & {
|
|
5
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
6
|
+
}) => boolean) & {
|
|
7
|
+
clearCache: () => void;
|
|
8
|
+
resultsCount: () => number;
|
|
9
|
+
resetResultsCount: () => void;
|
|
10
|
+
} & {
|
|
11
|
+
resultFunc: (resultFuncArgs_0: {
|
|
12
|
+
isInteracting: boolean;
|
|
13
|
+
zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
|
|
14
|
+
isControlled: boolean;
|
|
15
|
+
}) => boolean;
|
|
16
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
17
|
+
isInteracting: boolean;
|
|
18
|
+
zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
|
|
19
|
+
isControlled: boolean;
|
|
20
|
+
}) => boolean) & {
|
|
21
|
+
clearCache: () => void;
|
|
22
|
+
resultsCount: () => number;
|
|
23
|
+
resetResultsCount: () => void;
|
|
24
|
+
};
|
|
25
|
+
lastResult: () => boolean;
|
|
26
|
+
dependencies: [ChartRootSelector<UseChartProZoomSignature>];
|
|
27
|
+
recomputations: () => number;
|
|
28
|
+
resetRecomputations: () => void;
|
|
29
|
+
dependencyRecomputations: () => number;
|
|
30
|
+
resetDependencyRecomputations: () => void;
|
|
31
|
+
} & {
|
|
32
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
33
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
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> & {
|
|
36
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
37
|
+
}) => boolean) & {
|
|
38
|
+
clearCache: () => void;
|
|
39
|
+
resultsCount: () => number;
|
|
40
|
+
resetResultsCount: () => void;
|
|
41
|
+
} & {
|
|
42
|
+
resultFunc: (resultFuncArgs_0: {
|
|
43
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
44
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
45
|
+
}) => boolean;
|
|
46
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
47
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
48
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
49
|
+
}) => boolean) & {
|
|
50
|
+
clearCache: () => void;
|
|
51
|
+
resultsCount: () => number;
|
|
52
|
+
resetResultsCount: () => void;
|
|
53
|
+
};
|
|
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> & {
|
|
56
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
57
|
+
}) => {
|
|
58
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
59
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
60
|
+
}) & {
|
|
61
|
+
clearCache: () => void;
|
|
62
|
+
resultsCount: () => number;
|
|
63
|
+
resetResultsCount: () => void;
|
|
64
|
+
} & {
|
|
65
|
+
resultFunc: (resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
|
|
66
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
67
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
68
|
+
};
|
|
69
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
|
|
70
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
71
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
72
|
+
}) & {
|
|
73
|
+
clearCache: () => void;
|
|
74
|
+
resultsCount: () => number;
|
|
75
|
+
resetResultsCount: () => void;
|
|
76
|
+
};
|
|
77
|
+
lastResult: () => {
|
|
78
|
+
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
79
|
+
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
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> & {
|
|
82
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
83
|
+
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
84
|
+
clearCache: () => void;
|
|
85
|
+
resultsCount: () => number;
|
|
86
|
+
resetResultsCount: () => void;
|
|
87
|
+
} & {
|
|
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>) & {
|
|
90
|
+
clearCache: () => void;
|
|
91
|
+
resultsCount: () => number;
|
|
92
|
+
resetResultsCount: () => void;
|
|
93
|
+
};
|
|
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> & {
|
|
96
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
97
|
+
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
|
|
98
|
+
clearCache: () => void;
|
|
99
|
+
resultsCount: () => number;
|
|
100
|
+
resetResultsCount: () => void;
|
|
101
|
+
} & {
|
|
102
|
+
resultFunc: (resultFuncArgs_0: {
|
|
103
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
104
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
105
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
|
|
106
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
107
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
108
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
109
|
+
} | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
|
|
110
|
+
clearCache: () => void;
|
|
111
|
+
resultsCount: () => number;
|
|
112
|
+
resetResultsCount: () => void;
|
|
113
|
+
};
|
|
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]>) => {
|
|
116
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
117
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
118
|
+
} | undefined];
|
|
119
|
+
recomputations: () => number;
|
|
120
|
+
resetRecomputations: () => void;
|
|
121
|
+
dependencyRecomputations: () => number;
|
|
122
|
+
resetDependencyRecomputations: () => void;
|
|
123
|
+
} & {
|
|
124
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
125
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
126
|
+
}];
|
|
127
|
+
recomputations: () => number;
|
|
128
|
+
resetRecomputations: () => void;
|
|
129
|
+
dependencyRecomputations: () => number;
|
|
130
|
+
resetDependencyRecomputations: () => void;
|
|
131
|
+
} & {
|
|
132
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
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> & {
|
|
135
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
136
|
+
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
137
|
+
clearCache: () => void;
|
|
138
|
+
resultsCount: () => number;
|
|
139
|
+
resetResultsCount: () => void;
|
|
140
|
+
} & {
|
|
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>) & {
|
|
143
|
+
clearCache: () => void;
|
|
144
|
+
resultsCount: () => number;
|
|
145
|
+
resetResultsCount: () => void;
|
|
146
|
+
};
|
|
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> & {
|
|
149
|
+
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
150
|
+
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
|
|
151
|
+
clearCache: () => void;
|
|
152
|
+
resultsCount: () => number;
|
|
153
|
+
resetResultsCount: () => void;
|
|
154
|
+
} & {
|
|
155
|
+
resultFunc: (resultFuncArgs_0: {
|
|
156
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
157
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, 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;
|
|
159
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
160
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
161
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, 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) & {
|
|
163
|
+
clearCache: () => void;
|
|
164
|
+
resultsCount: () => number;
|
|
165
|
+
resetResultsCount: () => void;
|
|
166
|
+
};
|
|
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]>) => {
|
|
169
|
+
x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
|
|
170
|
+
y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
|
|
171
|
+
} | undefined];
|
|
172
|
+
recomputations: () => number;
|
|
173
|
+
resetRecomputations: () => void;
|
|
174
|
+
dependencyRecomputations: () => number;
|
|
175
|
+
resetDependencyRecomputations: () => void;
|
|
176
|
+
} & {
|
|
177
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
178
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
179
|
+
}];
|
|
180
|
+
recomputations: () => number;
|
|
181
|
+
resetRecomputations: () => void;
|
|
182
|
+
dependencyRecomputations: () => number;
|
|
183
|
+
resetDependencyRecomputations: () => void;
|
|
184
|
+
} & {
|
|
185
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
186
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
187
|
+
}];
|
|
188
|
+
recomputations: () => number;
|
|
189
|
+
resetRecomputations: () => void;
|
|
190
|
+
dependencyRecomputations: () => number;
|
|
191
|
+
resetDependencyRecomputations: () => void;
|
|
192
|
+
} & {
|
|
193
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
194
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
195
|
+
}];
|
|
196
|
+
recomputations: () => number;
|
|
197
|
+
resetRecomputations: () => void;
|
|
198
|
+
dependencyRecomputations: () => number;
|
|
199
|
+
resetDependencyRecomputations: () => void;
|
|
200
|
+
} & {
|
|
201
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
202
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
203
|
+
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createSelector, selectorChartRawXAxis, selectorChartRawYAxis } from '@mui/x-charts/internals';
|
|
3
|
-
import { creatZoomLookup } from "./creatZoomLookup.js";
|
|
1
|
+
import { createSelector, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
4
2
|
export const selectorChartZoomState = state => state.zoom;
|
|
5
|
-
const selectorChartXZoomOptionsLookup = createSelector(selectorChartRawXAxis, creatZoomLookup('x'));
|
|
6
|
-
const selectorChartYZoomOptionsLookup = createSelector(selectorChartRawYAxis, creatZoomLookup('y'));
|
|
7
|
-
export const selectorChartZoomOptionsLookup = createSelector([selectorChartXZoomOptionsLookup, selectorChartYZoomOptionsLookup], (xLookup, yLookup) => _extends({}, xLookup, yLookup));
|
|
8
|
-
export const selectorChartZoomData = createSelector(selectorChartZoomState, zoom => zoom.zoomData);
|
|
9
3
|
export const selectorChartZoomIsInteracting = createSelector(selectorChartZoomState, zoom => zoom.isInteracting);
|
|
10
4
|
export const selectorChartZoomIsEnabled = createSelector(selectorChartZoomOptionsLookup, optionsLookup => Object.keys(optionsLookup).length > 0);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { UseChartSeriesSignature, ChartPluginSignature, UseChartCartesianAxisSignature, UseChartCartesianAxisDefaultizedParameters, ZoomData } from '@mui/x-charts/internals';
|
|
2
|
+
export interface UseChartProZoomParameters {
|
|
3
|
+
/**
|
|
4
|
+
* The list of zoom data related to each axis.
|
|
5
|
+
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
6
|
+
*/
|
|
7
|
+
initialZoom?: readonly ZoomData[];
|
|
8
|
+
/**
|
|
9
|
+
* Callback fired when the zoom has changed.
|
|
10
|
+
*
|
|
11
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
12
|
+
*/
|
|
13
|
+
onZoomChange?: (zoomData: ZoomData[]) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The list of zoom data related to each axis.
|
|
16
|
+
*/
|
|
17
|
+
zoomData?: readonly ZoomData[];
|
|
18
|
+
}
|
|
19
|
+
export type UseChartProZoomDefaultizedParameters = UseChartProZoomParameters & UseChartCartesianAxisDefaultizedParameters;
|
|
20
|
+
export interface UseChartProZoomState {
|
|
21
|
+
zoom: {
|
|
22
|
+
/**
|
|
23
|
+
* Whether the user is currently interacting with the chart.
|
|
24
|
+
* This is useful to disable animations while the user is interacting.
|
|
25
|
+
*/
|
|
26
|
+
isInteracting: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Mapping of axis id to the zoom data.
|
|
29
|
+
*/
|
|
30
|
+
zoomData: readonly ZoomData[];
|
|
31
|
+
/**
|
|
32
|
+
* Internal information to know if the user control the state or not.
|
|
33
|
+
*/
|
|
34
|
+
isControlled: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface UseChartProZoomPublicApi {
|
|
38
|
+
/**
|
|
39
|
+
* Set the zoom data state.
|
|
40
|
+
* @param {ZoomData[] | ((prev: ZoomData[]) => ZoomData[])} value The new value. Can either be the new zoom data, or an updater function.
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
setZoomData: (value: ZoomData[] | ((prev: ZoomData[]) => ZoomData[])) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface UseChartProZoomInstance extends UseChartProZoomPublicApi {}
|
|
46
|
+
export type UseChartProZoomSignature = ChartPluginSignature<{
|
|
47
|
+
params: UseChartProZoomParameters;
|
|
48
|
+
defaultizedParams: UseChartProZoomDefaultizedParameters;
|
|
49
|
+
state: UseChartProZoomState;
|
|
50
|
+
publicAPI: UseChartProZoomPublicApi;
|
|
51
|
+
instance: UseChartProZoomInstance;
|
|
52
|
+
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
53
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DefaultizedZoomOptions, ZoomData } from '@mui/x-charts/internals';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to get the range (in percents of a reference range) corresponding to a given scale.
|
|
4
|
+
* @param centerRatio {number} The ratio of the point that should not move between the previous and next range.
|
|
5
|
+
* @param scaleRatio {number} The target scale ratio.
|
|
6
|
+
* @returns The range to display.
|
|
7
|
+
*/
|
|
8
|
+
export declare const zoomAtPoint: (centerRatio: number, scaleRatio: number, currentZoomData: ZoomData, options: DefaultizedZoomOptions) => number[];
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the new span is valid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isSpanValid(minRange: number, maxRange: number, isZoomIn: boolean, option: DefaultizedZoomOptions): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get the scale ratio and if it's a zoom in or out from a wheel event.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getWheelScaleRatio(event: WheelEvent, step: number): {
|
|
17
|
+
scaleRatio: number;
|
|
18
|
+
isZoomIn: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get the scale ratio and if it's a zoom in or out from a pinch gesture.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPinchScaleRatio(curDiff: number, prevDiff: number, step: number): {
|
|
24
|
+
scaleRatio: number;
|
|
25
|
+
isZoomIn: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare function getDiff(eventCache: PointerEvent[]): number;
|
|
28
|
+
/**
|
|
29
|
+
* Get the ratio of the point in the horizontal center of the area.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getHorizontalCenterRatio(point: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}, area: {
|
|
35
|
+
left: number;
|
|
36
|
+
width: number;
|
|
37
|
+
}): number;
|
|
38
|
+
export declare function preventDefault(event: TouchEvent): void;
|
|
39
|
+
export declare function getVerticalCenterRatio(point: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}, area: {
|
|
43
|
+
top: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getReleaseInfo: () => any;
|
|
@@ -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
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { CommonDefaultizedProps, CommonSeriesType, CartesianSeriesType } from '@mui/x-charts/internals';
|
|
3
|
+
export type HeatmapValueType = readonly [number, number, number];
|
|
4
|
+
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color'>, CartesianSeriesType {
|
|
5
|
+
type: 'heatmap';
|
|
6
|
+
/**
|
|
7
|
+
* Data associated to each bar.
|
|
8
|
+
*/
|
|
9
|
+
data?: readonly HeatmapValueType[];
|
|
10
|
+
/**
|
|
11
|
+
* The key used to retrieve data from the dataset.
|
|
12
|
+
*/
|
|
13
|
+
dataKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
16
|
+
*/
|
|
17
|
+
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An object that allows to identify a single bar.
|
|
21
|
+
* Used for item interaction
|
|
22
|
+
*/
|
|
23
|
+
export type HeatmapItemIdentifier = {
|
|
24
|
+
type: 'heatmap';
|
|
25
|
+
seriesId: DefaultizedHeatmapSeriesType['id'];
|
|
26
|
+
dataIndex: number;
|
|
27
|
+
};
|
|
28
|
+
export interface DefaultizedHeatmapSeriesType extends DefaultizedProps<HeatmapSeriesType, CommonDefaultizedProps> {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./heatmap.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module","sideEffects":false}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentsProps, ComponentsOverrides } from '@mui/material/styles';
|
|
2
|
+
export interface ChartsProComponents<Theme = unknown> {
|
|
3
|
+
// BarChartPro components
|
|
4
|
+
MuiBarChartPro?: {
|
|
5
|
+
defaultProps?: ComponentsProps['MuiBarChartPro'];
|
|
6
|
+
};
|
|
7
|
+
// LineChartPro components
|
|
8
|
+
MuiLineChartPro?: {
|
|
9
|
+
defaultProps?: ComponentsProps['MuiLineChartPro'];
|
|
10
|
+
};
|
|
11
|
+
// Heatmap components
|
|
12
|
+
MuiHeatmap?: {
|
|
13
|
+
defaultProps?: ComponentsProps['MuiHeatmap'];
|
|
14
|
+
styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmap'];
|
|
15
|
+
};
|
|
16
|
+
// ScatterChartPro components
|
|
17
|
+
MuiScatterChartPro?: {
|
|
18
|
+
defaultProps?: ComponentsProps['MuiScatterChartPro'];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
declare module '@mui/material/styles' {
|
|
22
|
+
interface Components<Theme = unknown> extends ChartsProComponents<Theme> {}
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HeatmapClassKey } from "../Heatmap/index.js";
|
|
2
|
+
export interface ChartsProComponentNameToClassKey {
|
|
3
|
+
// Heatmap components
|
|
4
|
+
MuiHeatmap: HeatmapClassKey;
|
|
5
|
+
}
|
|
6
|
+
declare module '@mui/material/styles' {
|
|
7
|
+
interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// disable automatic export
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ScatterChartProProps } from "../ScatterChartPro/index.js";
|
|
2
|
+
import { BarChartProProps } from "../BarChartPro/index.js";
|
|
3
|
+
import { HeatmapProps } from "../Heatmap/Heatmap.js";
|
|
4
|
+
import { LineChartProProps } from "../LineChartPro/index.js";
|
|
5
|
+
export interface ChartsProComponentsPropsList {
|
|
6
|
+
// BarChartPro components
|
|
7
|
+
MuiBarChartPro: BarChartProProps;
|
|
8
|
+
// LineChartPro components
|
|
9
|
+
MuiLineChartPro: LineChartProProps;
|
|
10
|
+
// Heatmap components
|
|
11
|
+
MuiHeatmap: HeatmapProps;
|
|
12
|
+
// ScatterChartPro components
|
|
13
|
+
MuiScatterChartPro: ScatterChartProProps;
|
|
14
|
+
}
|
|
15
|
+
declare module '@mui/material/styles' {
|
|
16
|
+
interface ComponentsPropsList extends ChartsProComponentsPropsList {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// disable automatic export
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {} from "./modules.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { AxisId, ZoomOptions } from '@mui/x-charts/internals';
|
|
3
|
+
import { HeatmapItemIdentifier, HeatmapSeriesType, DefaultizedHeatmapSeriesType, HeatmapValueType } from "../models/seriesType/heatmap.js";
|
|
4
|
+
declare module '@mui/x-charts/internals' {
|
|
5
|
+
interface ChartsSeriesConfig {
|
|
6
|
+
heatmap: {
|
|
7
|
+
seriesInput: DefaultizedProps<HeatmapSeriesType, 'id'>;
|
|
8
|
+
series: DefaultizedHeatmapSeriesType;
|
|
9
|
+
seriesProp: HeatmapSeriesType;
|
|
10
|
+
itemIdentifier: HeatmapItemIdentifier;
|
|
11
|
+
valueType: HeatmapValueType;
|
|
12
|
+
cartesian: true;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface DefaultizedZoomOptions extends Required<ZoomOptions> {
|
|
16
|
+
axisId: AxisId;
|
|
17
|
+
axisDirection: 'x' | 'y';
|
|
18
|
+
}
|
|
19
|
+
interface AxisConfigExtension {
|
|
20
|
+
zoom?: boolean | ZoomOptions;
|
|
21
|
+
}
|
|
22
|
+
}
|