@mui/x-charts-pro 8.0.0-beta.3 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.js +796 -14
- package/BarChartPro/BarChartPro.plugins.d.ts +2 -1
- package/BarChartPro/BarChartPro.plugins.js +2 -1
- package/CHANGELOG.md +388 -96
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -0
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +36 -22
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.js +2 -2
- package/FunnelChart/FunnelChart.js +78 -4
- package/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/FunnelChart/funnelSectionClasses.js +1 -1
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/useFunnelChartProps.js +3 -3
- package/Heatmap/Heatmap.js +5 -2
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/heatmapClasses.d.ts +5 -0
- package/Heatmap/heatmapClasses.js +1 -1
- package/LineChartPro/LineChartPro.js +796 -14
- package/LineChartPro/LineChartPro.plugins.d.ts +2 -1
- package/LineChartPro/LineChartPro.plugins.js +2 -1
- package/ScatterChartPro/ScatterChartPro.js +796 -14
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
- package/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
- package/esm/BarChartPro/BarChartPro.js +796 -14
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +2 -1
- package/esm/BarChartPro/BarChartPro.plugins.js +2 -1
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +37 -23
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -2
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +2 -2
- package/esm/FunnelChart/FunnelChart.js +78 -4
- package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
- package/esm/FunnelChart/funnelSectionClasses.js +1 -1
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.js +3 -3
- package/esm/Heatmap/Heatmap.js +5 -2
- package/esm/Heatmap/HeatmapItem.js +1 -1
- package/esm/Heatmap/heatmapClasses.d.ts +5 -0
- package/esm/Heatmap/heatmapClasses.js +1 -1
- package/esm/LineChartPro/LineChartPro.js +796 -14
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +2 -1
- package/esm/LineChartPro/LineChartPro.plugins.js +2 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +796 -14
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- package/esm/internals/plugins/useChartProExport/index.d.ts +2 -0
- package/esm/internals/plugins/useChartProExport/index.js +2 -0
- package/esm/internals/plugins/useChartProExport/print.d.ts +4 -0
- package/esm/internals/plugins/useChartProExport/print.js +72 -0
- package/esm/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
- package/esm/internals/plugins/useChartProExport/useChartProExport.js +45 -0
- package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +35 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +73 -56
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- package/internals/plugins/useChartProExport/index.d.ts +2 -0
- package/internals/plugins/useChartProExport/index.js +27 -0
- package/internals/plugins/useChartProExport/print.d.ts +4 -0
- package/internals/plugins/useChartProExport/print.js +79 -0
- package/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
- package/internals/plugins/useChartProExport/useChartProExport.js +53 -0
- package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +35 -0
- package/internals/plugins/useChartProExport/useChartProExport.types.js +5 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +74 -56
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
- package/locales/index.d.ts +1 -0
- package/locales/index.js +16 -0
- package/package.json +6 -14
- package/esm/internals/utils/releaseInfo.d.ts +0 -1
- package/esm/internals/utils/releaseInfo.js +0 -13
- package/internals/utils/releaseInfo.d.ts +0 -1
- package/internals/utils/releaseInfo.js +0 -21
- package/modern/BarChartPro/BarChartPro.d.ts +0 -18
- package/modern/BarChartPro/BarChartPro.js +0 -406
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
- package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
- package/modern/BarChartPro/index.d.ts +0 -1
- package/modern/BarChartPro/index.js +0 -1
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
- package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
- package/modern/ChartContainerPro/index.d.ts +0 -2
- package/modern/ChartContainerPro/index.js +0 -2
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
- package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
- package/modern/ChartDataProviderPro/index.d.ts +0 -2
- package/modern/ChartDataProviderPro/index.js +0 -2
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
- package/modern/FunnelChart/FunnelChart.d.ts +0 -37
- package/modern/FunnelChart/FunnelChart.js +0 -212
- package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
- package/modern/FunnelChart/FunnelPlot.js +0 -184
- package/modern/FunnelChart/FunnelSection.d.ts +0 -15
- package/modern/FunnelChart/FunnelSection.js +0 -56
- package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
- package/modern/FunnelChart/funnel.types.d.ts +0 -124
- package/modern/FunnelChart/funnel.types.js +0 -1
- package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
- package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
- package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
- package/modern/FunnelChart/funnelSectionClasses.js +0 -20
- package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
- package/modern/FunnelChart/funnelSlots.types.js +0 -1
- package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
- package/modern/FunnelChart/funnelStepCurve.js +0 -67
- package/modern/FunnelChart/index.d.ts +0 -7
- package/modern/FunnelChart/index.js +0 -5
- package/modern/FunnelChart/labelUtils.d.ts +0 -42
- package/modern/FunnelChart/labelUtils.js +0 -166
- package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
- package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
- package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
- package/modern/FunnelChart/seriesConfig/index.js +0 -15
- package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/legend.js +0 -25
- package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
- package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
- package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
- package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
- package/modern/FunnelChart/useFunnelChartProps.js +0 -161
- package/modern/Heatmap/Heatmap.d.ts +0 -57
- package/modern/Heatmap/Heatmap.js +0 -389
- package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
- package/modern/Heatmap/Heatmap.plugins.js +0 -2
- package/modern/Heatmap/HeatmapItem.d.ts +0 -49
- package/modern/Heatmap/HeatmapItem.js +0 -106
- package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
- package/modern/Heatmap/HeatmapPlot.js +0 -59
- package/modern/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +0 -16
- package/modern/Heatmap/HeatmapTooltip/HeatmapTooltip.js +0 -284
- package/modern/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +0 -4
- package/modern/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +0 -22
- package/modern/Heatmap/HeatmapTooltip/index.d.ts +0 -1
- package/modern/Heatmap/HeatmapTooltip/index.js +0 -1
- package/modern/Heatmap/heatmapClasses.d.ts +0 -11
- package/modern/Heatmap/heatmapClasses.js +0 -14
- package/modern/Heatmap/index.d.ts +0 -4
- package/modern/Heatmap/index.js +0 -4
- package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/extremums.js +0 -8
- package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getColor.js +0 -15
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
- package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
- package/modern/Heatmap/seriesConfig/index.js +0 -14
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
- package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
- package/modern/LineChartPro/LineChartPro.d.ts +0 -17
- package/modern/LineChartPro/LineChartPro.js +0 -403
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
- package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
- package/modern/LineChartPro/index.d.ts +0 -1
- package/modern/LineChartPro/index.js +0 -1
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
- package/modern/ScatterChartPro/ScatterChartPro.js +0 -397
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
- package/modern/ScatterChartPro/index.d.ts +0 -1
- package/modern/ScatterChartPro/index.js +0 -1
- package/modern/hooks/index.d.ts +0 -2
- package/modern/hooks/index.js +0 -2
- package/modern/hooks/useFunnelSeries.d.ts +0 -33
- package/modern/hooks/useFunnelSeries.js +0 -42
- package/modern/hooks/useHeatmapSeries.d.ts +0 -33
- package/modern/hooks/useHeatmapSeries.js +0 -42
- package/modern/hooks/zoom/index.d.ts +0 -1
- package/modern/hooks/zoom/index.js +0 -1
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
- package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
- package/modern/index.d.ts +0 -34
- package/modern/index.js +0 -45
- package/modern/internals/plugins/allPlugins.d.ts +0 -8
- package/modern/internals/plugins/allPlugins.js +0 -6
- package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/index.js +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
- package/modern/internals/utils/releaseInfo.d.ts +0 -1
- package/modern/internals/utils/releaseInfo.js +0 -13
- package/modern/models/index.d.ts +0 -2
- package/modern/models/index.js +0 -2
- package/modern/models/seriesType/heatmap.d.ts +0 -28
- package/modern/models/seriesType/heatmap.js +0 -1
- package/modern/models/seriesType/index.d.ts +0 -1
- package/modern/models/seriesType/index.js +0 -1
- package/modern/package.json +0 -1
- package/modern/themeAugmentation/components.d.ts +0 -23
- package/modern/themeAugmentation/index.d.ts +0 -4
- package/modern/themeAugmentation/index.js +0 -0
- package/modern/themeAugmentation/overrides.d.ts +0 -11
- package/modern/themeAugmentation/props.d.ts +0 -20
- package/modern/typeOverloads/index.d.ts +0 -1
- package/modern/typeOverloads/index.js +0 -1
- package/modern/typeOverloads/modules.d.ts +0 -33
- package/modern/typeOverloads/modules.js +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
- /package/{modern/FunnelChart/categoryAxis.types.js → esm/internals/plugins/useChartProExport/useChartProExport.types.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
2
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
3
|
-
export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature];
|
|
4
|
+
export type ScatterChartProPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVoronoiSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
4
5
|
export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginsSignatures>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi } from '@mui/x-charts/internals';
|
|
2
|
+
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
2
3
|
import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
|
|
3
|
-
export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi, useChartProZoom];
|
|
4
|
+
export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartVoronoi, useChartProZoom, useChartProExport];
|
package/esm/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from '@mui/x-charts/ChartsGrid';
|
|
|
13
13
|
export * from '@mui/x-charts/ChartsText';
|
|
14
14
|
export * from '@mui/x-charts/ChartsTooltip';
|
|
15
15
|
export * from '@mui/x-charts/ChartsLegend';
|
|
16
|
+
export * from '@mui/x-charts/ChartsLocalizationProvider';
|
|
16
17
|
export * from '@mui/x-charts/ChartsAxisHighlight';
|
|
17
18
|
export * from '@mui/x-charts/BarChart';
|
|
18
19
|
export * from '@mui/x-charts/LineChart';
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro v8.
|
|
2
|
+
* @mui/x-charts-pro v8.1.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -22,6 +22,7 @@ export * from '@mui/x-charts/ChartsGrid';
|
|
|
22
22
|
export * from '@mui/x-charts/ChartsText';
|
|
23
23
|
export * from '@mui/x-charts/ChartsTooltip';
|
|
24
24
|
export * from '@mui/x-charts/ChartsLegend';
|
|
25
|
+
export * from '@mui/x-charts/ChartsLocalizationProvider';
|
|
25
26
|
export * from '@mui/x-charts/ChartsAxisHighlight';
|
|
26
27
|
export * from '@mui/x-charts/BarChart';
|
|
27
28
|
export * from '@mui/x-charts/LineChart';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "./useChartProExport/index.js";
|
|
2
3
|
import { UseChartProZoomSignature } from "./useChartProZoom/index.js";
|
|
3
|
-
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
4
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
4
5
|
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>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
|
|
6
|
-
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature];
|
|
6
|
+
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | 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>>)[];
|
|
7
|
+
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
7
8
|
export type DefaultPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<DefaultPluginSignatures<TSeries>>;
|
|
8
|
-
export declare const DEFAULT_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>>)[];
|
|
9
|
+
export declare const DEFAULT_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | 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>>)[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
2
2
|
|
|
3
3
|
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis } from '@mui/x-charts/internals';
|
|
4
|
+
import { useChartProExport } from "./useChartProExport/index.js";
|
|
4
5
|
import { useChartProZoom } from "./useChartProZoom/index.js";
|
|
5
|
-
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
|
6
|
-
export const DEFAULT_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
|
6
|
+
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];
|
|
7
|
+
export const DEFAULT_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom, useChartProExport];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import ownerDocument from '@mui/utils/ownerDocument';
|
|
2
|
+
export function printChart(element, {
|
|
3
|
+
fileName
|
|
4
|
+
} = {}) {
|
|
5
|
+
const printWindow = buildPrintWindow(fileName);
|
|
6
|
+
const doc = ownerDocument(element);
|
|
7
|
+
printWindow.onload = async () => {
|
|
8
|
+
const printDoc = printWindow.contentDocument;
|
|
9
|
+
const elementClone = element.cloneNode(true);
|
|
10
|
+
const container = document.createElement('div');
|
|
11
|
+
container.appendChild(elementClone);
|
|
12
|
+
printDoc.body.innerHTML = container.innerHTML;
|
|
13
|
+
await loadStyleSheets(printDoc, element);
|
|
14
|
+
printWindow.contentWindow.print();
|
|
15
|
+
const mediaQueryList = printWindow.contentWindow.matchMedia('print');
|
|
16
|
+
mediaQueryList.addEventListener('change', mql => {
|
|
17
|
+
const isAfterPrint = mql.matches === false;
|
|
18
|
+
if (isAfterPrint) {
|
|
19
|
+
doc.body.removeChild(printWindow);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
doc.body.appendChild(printWindow);
|
|
24
|
+
}
|
|
25
|
+
function buildPrintWindow(title) {
|
|
26
|
+
const iframeEl = document.createElement('iframe');
|
|
27
|
+
iframeEl.style.position = 'absolute';
|
|
28
|
+
iframeEl.style.width = '0px';
|
|
29
|
+
iframeEl.style.height = '0px';
|
|
30
|
+
iframeEl.title = title || document.title;
|
|
31
|
+
return iframeEl;
|
|
32
|
+
}
|
|
33
|
+
function loadStyleSheets(printDoc, element) {
|
|
34
|
+
const stylesheetLoadPromises = [];
|
|
35
|
+
const doc = ownerDocument(element);
|
|
36
|
+
const rootCandidate = element.getRootNode();
|
|
37
|
+
const root = rootCandidate.constructor.name === 'ShadowRoot' ? rootCandidate : doc;
|
|
38
|
+
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
|
|
39
|
+
for (let i = 0; i < headStyleElements.length; i += 1) {
|
|
40
|
+
const node = headStyleElements[i];
|
|
41
|
+
if (node.tagName === 'STYLE') {
|
|
42
|
+
const newHeadStyleElements = printDoc.createElement(node.tagName);
|
|
43
|
+
const sheet = node.sheet;
|
|
44
|
+
if (sheet) {
|
|
45
|
+
let styleCSS = '';
|
|
46
|
+
// NOTE: for-of is not supported by IE
|
|
47
|
+
for (let j = 0; j < sheet.cssRules.length; j += 1) {
|
|
48
|
+
if (typeof sheet.cssRules[j].cssText === 'string') {
|
|
49
|
+
styleCSS += `${sheet.cssRules[j].cssText}\r\n`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
newHeadStyleElements.appendChild(printDoc.createTextNode(styleCSS));
|
|
53
|
+
printDoc.head.appendChild(newHeadStyleElements);
|
|
54
|
+
}
|
|
55
|
+
} else if (node.getAttribute('href')) {
|
|
56
|
+
// If `href` tag is empty, avoid loading these links
|
|
57
|
+
|
|
58
|
+
const newHeadStyleElements = printDoc.createElement(node.tagName);
|
|
59
|
+
for (let j = 0; j < node.attributes.length; j += 1) {
|
|
60
|
+
const attr = node.attributes[j];
|
|
61
|
+
if (attr) {
|
|
62
|
+
newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
stylesheetLoadPromises.push(new Promise(resolve => {
|
|
66
|
+
newHeadStyleElements.addEventListener('load', () => resolve());
|
|
67
|
+
}));
|
|
68
|
+
printDoc.head.appendChild(newHeadStyleElements);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return Promise.all(stylesheetLoadPromises);
|
|
72
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { printChart } from "./print.js";
|
|
3
|
+
function waitForAnimationFrame() {
|
|
4
|
+
let resolve;
|
|
5
|
+
const promise = new Promise(res => {
|
|
6
|
+
resolve = res;
|
|
7
|
+
});
|
|
8
|
+
window.requestAnimationFrame(() => {
|
|
9
|
+
resolve();
|
|
10
|
+
});
|
|
11
|
+
return promise;
|
|
12
|
+
}
|
|
13
|
+
export const useChartProExport = ({
|
|
14
|
+
chartRootRef,
|
|
15
|
+
instance
|
|
16
|
+
}) => {
|
|
17
|
+
const exportAsPrint = async options => {
|
|
18
|
+
const chartRoot = chartRootRef.current;
|
|
19
|
+
if (chartRoot) {
|
|
20
|
+
const enableAnimation = instance.disableAnimation();
|
|
21
|
+
try {
|
|
22
|
+
// Wait for animation frame to ensure the animation finished
|
|
23
|
+
await waitForAnimationFrame();
|
|
24
|
+
printChart(chartRoot, options);
|
|
25
|
+
} finally {
|
|
26
|
+
enableAnimation();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
publicAPI: {
|
|
32
|
+
exportAsPrint
|
|
33
|
+
},
|
|
34
|
+
instance: {
|
|
35
|
+
exportAsPrint
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
useChartProExport.params = {};
|
|
40
|
+
useChartProExport.getDefaultizedParams = ({
|
|
41
|
+
params
|
|
42
|
+
}) => _extends({}, params);
|
|
43
|
+
useChartProExport.getInitialState = () => ({
|
|
44
|
+
export: {}
|
|
45
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UseChartSeriesSignature, ChartPluginSignature, UseChartCartesianAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
+
export interface UseChartProExportParameters {}
|
|
3
|
+
export type UseChartProExportDefaultizedParameters = UseChartProExportParameters;
|
|
4
|
+
export interface UseChartProExportState {
|
|
5
|
+
export: {};
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The options to apply on the Print export.
|
|
9
|
+
* @demos
|
|
10
|
+
* - [Print export](/x/react-charts/export/#print-export-as-pdf)
|
|
11
|
+
*/
|
|
12
|
+
export interface ChartPrintExportOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The value to be used as the print window title.
|
|
15
|
+
* @default The title of the page.
|
|
16
|
+
*/
|
|
17
|
+
fileName?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UseChartProExportPublicApi {
|
|
20
|
+
/**
|
|
21
|
+
* Opens the browser's print dialog, which can be used to print the chart or export it as PDF.
|
|
22
|
+
* @param {ChartPrintExportOptions} options Options to customize the print export.
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
exportAsPrint: (options?: ChartPrintExportOptions) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface UseChartProExportInstance extends UseChartProExportPublicApi {}
|
|
28
|
+
export type UseChartProExportSignature = ChartPluginSignature<{
|
|
29
|
+
params: UseChartProExportParameters;
|
|
30
|
+
defaultizedParams: UseChartProExportDefaultizedParameters;
|
|
31
|
+
state: UseChartProExportState;
|
|
32
|
+
publicAPI: UseChartProExportPublicApi;
|
|
33
|
+
instance: UseChartProExportInstance;
|
|
34
|
+
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
35
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { ChartPlugin } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartPlugin, AxisId, DefaultizedZoomOptions, ZoomData } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
|
|
3
|
+
export declare function initializeZoomData(options: Record<AxisId, DefaultizedZoomOptions>, zoomData?: readonly ZoomData[]): ZoomData[];
|
|
3
4
|
export declare const useChartProZoom: ChartPlugin<UseChartProZoomSignature>;
|
|
@@ -2,21 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
6
5
|
import { useSelector, getSVGPoint, selectorChartDrawingArea, createZoomLookup, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
6
|
+
import { useEventCallback } from '@mui/material/utils';
|
|
7
|
+
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
8
|
+
import debounce from '@mui/utils/debounce';
|
|
7
9
|
import { getDiff, getHorizontalCenterRatio, getPinchScaleRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, preventDefault, zoomAtPoint } from "./useChartProZoom.utils.js";
|
|
8
10
|
|
|
9
11
|
// It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
|
|
10
|
-
function initializeZoomData(options) {
|
|
12
|
+
export function initializeZoomData(options, zoomData) {
|
|
13
|
+
const zoomDataMap = new Map();
|
|
14
|
+
zoomData?.forEach(zoom => {
|
|
15
|
+
const option = options[zoom.axisId];
|
|
16
|
+
if (option) {
|
|
17
|
+
zoomDataMap.set(zoom.axisId, zoom);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
11
20
|
return Object.values(options).map(({
|
|
12
21
|
axisId,
|
|
13
22
|
minStart: start,
|
|
14
23
|
maxEnd: end
|
|
15
|
-
}) =>
|
|
16
|
-
axisId
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
}) => {
|
|
25
|
+
if (zoomDataMap.has(axisId)) {
|
|
26
|
+
return zoomDataMap.get(axisId);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
axisId,
|
|
30
|
+
start,
|
|
31
|
+
end
|
|
32
|
+
};
|
|
33
|
+
});
|
|
20
34
|
}
|
|
21
35
|
export const useChartProZoom = ({
|
|
22
36
|
store,
|
|
@@ -26,15 +40,15 @@ export const useChartProZoom = ({
|
|
|
26
40
|
}) => {
|
|
27
41
|
const {
|
|
28
42
|
zoomData: paramsZoomData,
|
|
29
|
-
onZoomChange
|
|
43
|
+
onZoomChange: onZoomChangeProp
|
|
30
44
|
} = params;
|
|
31
45
|
const drawingArea = useSelector(store, selectorChartDrawingArea);
|
|
32
46
|
const optionsLookup = useSelector(store, selectorChartZoomOptionsLookup);
|
|
33
47
|
const isZoomEnabled = Object.keys(optionsLookup).length > 0;
|
|
48
|
+
const onZoomChange = useEventCallback(onZoomChangeProp ?? (() => {}));
|
|
34
49
|
|
|
35
50
|
// Manage controlled state
|
|
36
|
-
|
|
37
|
-
useEnhancedEffect(() => {
|
|
51
|
+
React.useEffect(() => {
|
|
38
52
|
if (paramsZoomData === undefined) {
|
|
39
53
|
return undefined;
|
|
40
54
|
}
|
|
@@ -63,14 +77,14 @@ export const useChartProZoom = ({
|
|
|
63
77
|
};
|
|
64
78
|
}, [store, paramsZoomData]);
|
|
65
79
|
|
|
66
|
-
//
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
zoom: _extends({},
|
|
70
|
-
isInteracting
|
|
80
|
+
// This is debounced. We want to run it only once after the interaction ends.
|
|
81
|
+
const removeIsInteracting = React.useMemo(() => debounce(() => store.update(prevState => {
|
|
82
|
+
return _extends({}, prevState, {
|
|
83
|
+
zoom: _extends({}, prevState.zoom, {
|
|
84
|
+
isInteracting: false
|
|
71
85
|
})
|
|
72
|
-
})
|
|
73
|
-
}, [store]);
|
|
86
|
+
});
|
|
87
|
+
}), 166), [store]);
|
|
74
88
|
const setZoomDataCallback = React.useCallback(zoomData => {
|
|
75
89
|
store.update(prevState => {
|
|
76
90
|
const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
|
|
@@ -78,19 +92,25 @@ export const useChartProZoom = ({
|
|
|
78
92
|
if (prevState.zoom.isControlled) {
|
|
79
93
|
return prevState;
|
|
80
94
|
}
|
|
95
|
+
removeIsInteracting();
|
|
81
96
|
return _extends({}, prevState, {
|
|
82
97
|
zoom: _extends({}, prevState.zoom, {
|
|
98
|
+
isInteracting: true,
|
|
83
99
|
zoomData: newZoomData
|
|
84
100
|
})
|
|
85
101
|
});
|
|
86
102
|
});
|
|
87
|
-
}, [onZoomChange, store]);
|
|
103
|
+
}, [onZoomChange, store, removeIsInteracting]);
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
return () => {
|
|
106
|
+
removeIsInteracting.clear();
|
|
107
|
+
};
|
|
108
|
+
}, [setZoomDataCallback, removeIsInteracting]);
|
|
88
109
|
|
|
89
110
|
// Add events
|
|
90
111
|
const panningEventCacheRef = React.useRef([]);
|
|
91
112
|
const zoomEventCacheRef = React.useRef([]);
|
|
92
113
|
const eventPrevDiff = React.useRef(0);
|
|
93
|
-
const interactionTimeoutRef = React.useRef(undefined);
|
|
94
114
|
|
|
95
115
|
// Add event for chart panning
|
|
96
116
|
const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
|
|
@@ -101,17 +121,10 @@ export const useChartProZoom = ({
|
|
|
101
121
|
if (element === null || !isPanEnabled) {
|
|
102
122
|
return () => {};
|
|
103
123
|
}
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (touchStartRef.current == null) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const point = getSVGPoint(element, event);
|
|
112
|
-
const movementX = point.x - touchStartRef.current.x;
|
|
113
|
-
const movementY = (point.y - touchStartRef.current.y) * -1;
|
|
114
|
-
const newZoomData = touchStartRef.current.zoomData.map(zoom => {
|
|
124
|
+
const throttledHandlePan = rafThrottle((touchStart, point) => {
|
|
125
|
+
const movementX = point.x - touchStart.x;
|
|
126
|
+
const movementY = (point.y - touchStart.y) * -1;
|
|
127
|
+
const newZoomData = touchStart.zoomData.map(zoom => {
|
|
115
128
|
const options = optionsLookup[zoom.axisId];
|
|
116
129
|
if (!options || !options.panning) {
|
|
117
130
|
return zoom;
|
|
@@ -142,6 +155,17 @@ export const useChartProZoom = ({
|
|
|
142
155
|
});
|
|
143
156
|
});
|
|
144
157
|
setZoomDataCallback(newZoomData);
|
|
158
|
+
});
|
|
159
|
+
const handlePan = event => {
|
|
160
|
+
if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (touchStartRef.current == null) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const touchStart = touchStartRef.current;
|
|
167
|
+
const point = getSVGPoint(element, event);
|
|
168
|
+
throttledHandlePan(touchStart, point);
|
|
145
169
|
};
|
|
146
170
|
const handleDown = event => {
|
|
147
171
|
panningEventCacheRef.current.push(event);
|
|
@@ -154,7 +178,6 @@ export const useChartProZoom = ({
|
|
|
154
178
|
event.preventDefault();
|
|
155
179
|
}
|
|
156
180
|
isDraggingRef.current = true;
|
|
157
|
-
setIsInteracting(true);
|
|
158
181
|
touchStartRef.current = {
|
|
159
182
|
x: point.x,
|
|
160
183
|
y: point.y,
|
|
@@ -163,7 +186,6 @@ export const useChartProZoom = ({
|
|
|
163
186
|
};
|
|
164
187
|
const handleUp = event => {
|
|
165
188
|
panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
166
|
-
setIsInteracting(false);
|
|
167
189
|
isDraggingRef.current = false;
|
|
168
190
|
touchStartRef.current = null;
|
|
169
191
|
};
|
|
@@ -178,8 +200,9 @@ export const useChartProZoom = ({
|
|
|
178
200
|
document.removeEventListener('pointerup', handleUp);
|
|
179
201
|
document.removeEventListener('pointercancel', handleUp);
|
|
180
202
|
document.removeEventListener('pointerleave', handleUp);
|
|
203
|
+
throttledHandlePan.clear();
|
|
181
204
|
};
|
|
182
|
-
}, [instance, svgRef, isDraggingRef,
|
|
205
|
+
}, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
|
|
183
206
|
|
|
184
207
|
// Add event for chart zoom in/out
|
|
185
208
|
React.useEffect(() => {
|
|
@@ -187,6 +210,7 @@ export const useChartProZoom = ({
|
|
|
187
210
|
if (element === null || !isZoomEnabled) {
|
|
188
211
|
return () => {};
|
|
189
212
|
}
|
|
213
|
+
const rafThrottledSetZoomData = rafThrottle(setZoomDataCallback);
|
|
190
214
|
const wheelHandler = event => {
|
|
191
215
|
if (element === null) {
|
|
192
216
|
return;
|
|
@@ -196,16 +220,13 @@ export const useChartProZoom = ({
|
|
|
196
220
|
return;
|
|
197
221
|
}
|
|
198
222
|
event.preventDefault();
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
setIsInteracting(false);
|
|
207
|
-
}, 166);
|
|
208
|
-
setZoomDataCallback(prevZoomData => {
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* Need to throttle `setZoomDataCallback` instead of `wheelHandler` because we're calling `event.preventDefault()`.
|
|
226
|
+
* If we throttle the event, then some events' default behavior won't be prevented and the page will scroll while
|
|
227
|
+
* the user is trying to zoom in.
|
|
228
|
+
*/
|
|
229
|
+
rafThrottledSetZoomData(prevZoomData => {
|
|
209
230
|
return prevZoomData.map(zoom => {
|
|
210
231
|
const option = optionsLookup[zoom.axisId];
|
|
211
232
|
if (!option) {
|
|
@@ -230,9 +251,8 @@ export const useChartProZoom = ({
|
|
|
230
251
|
};
|
|
231
252
|
function pointerDownHandler(event) {
|
|
232
253
|
zoomEventCacheRef.current.push(event);
|
|
233
|
-
setIsInteracting(true);
|
|
234
254
|
}
|
|
235
|
-
function pointerMoveHandler(event) {
|
|
255
|
+
const pointerMoveHandler = rafThrottle(function pointerMoveHandler(event) {
|
|
236
256
|
if (element === null) {
|
|
237
257
|
return;
|
|
238
258
|
}
|
|
@@ -275,15 +295,12 @@ export const useChartProZoom = ({
|
|
|
275
295
|
eventPrevDiff.current = curDiff;
|
|
276
296
|
return newZoomData;
|
|
277
297
|
});
|
|
278
|
-
}
|
|
298
|
+
});
|
|
279
299
|
function pointerUpHandler(event) {
|
|
280
300
|
zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
281
301
|
if (zoomEventCacheRef.current.length < 2) {
|
|
282
302
|
eventPrevDiff.current = 0;
|
|
283
303
|
}
|
|
284
|
-
if (event.type === 'pointerup' || event.type === 'pointercancel') {
|
|
285
|
-
setIsInteracting(false);
|
|
286
|
-
}
|
|
287
304
|
}
|
|
288
305
|
element.addEventListener('wheel', wheelHandler);
|
|
289
306
|
element.addEventListener('pointerdown', pointerDownHandler);
|
|
@@ -306,11 +323,10 @@ export const useChartProZoom = ({
|
|
|
306
323
|
element.removeEventListener('pointerleave', pointerUpHandler);
|
|
307
324
|
element.removeEventListener('touchstart', preventDefault);
|
|
308
325
|
element.removeEventListener('touchmove', preventDefault);
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
326
|
+
pointerMoveHandler.clear();
|
|
327
|
+
rafThrottledSetZoomData.clear();
|
|
312
328
|
};
|
|
313
|
-
}, [svgRef, drawingArea, isZoomEnabled, optionsLookup,
|
|
329
|
+
}, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
|
|
314
330
|
return {
|
|
315
331
|
publicAPI: {
|
|
316
332
|
setZoomData: setZoomDataCallback
|
|
@@ -338,11 +354,12 @@ useChartProZoom.getInitialState = params => {
|
|
|
338
354
|
defaultizedYAxis
|
|
339
355
|
} = params;
|
|
340
356
|
const optionsLookup = _extends({}, createZoomLookup('x')(defaultizedXAxis), createZoomLookup('y')(defaultizedYAxis));
|
|
357
|
+
const userZoomData =
|
|
358
|
+
// eslint-disable-next-line no-nested-ternary
|
|
359
|
+
zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : undefined;
|
|
341
360
|
return {
|
|
342
361
|
zoom: {
|
|
343
|
-
zoomData:
|
|
344
|
-
// eslint-disable-next-line no-nested-ternary
|
|
345
|
-
zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : initializeZoomData(optionsLookup),
|
|
362
|
+
zoomData: initializeZoomData(optionsLookup, userZoomData),
|
|
346
363
|
isInteracting: false,
|
|
347
364
|
isControlled: zoomData !== undefined
|
|
348
365
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChartRootSelector } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
|
|
3
3
|
export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
|
|
4
|
-
export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
|
|
4
|
+
export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
6
6
|
}) => boolean) & {
|
|
7
7
|
clearCache: () => void;
|
|
@@ -32,7 +32,7 @@ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-cha
|
|
|
32
32
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
33
33
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
34
34
|
};
|
|
35
|
-
export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
35
|
+
export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
36
36
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
37
37
|
}) => boolean) & {
|
|
38
38
|
clearCache: () => void;
|
|
@@ -52,7 +52,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
52
52
|
resetResultsCount: () => void;
|
|
53
53
|
};
|
|
54
54
|
lastResult: () => boolean;
|
|
55
|
-
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
55
|
+
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
56
56
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
57
57
|
}) => {
|
|
58
58
|
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
@@ -78,7 +78,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
78
78
|
[x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
79
79
|
[x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
|
|
80
80
|
};
|
|
81
|
-
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
81
|
+
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
82
82
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
83
83
|
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
84
84
|
clearCache: () => void;
|
|
@@ -92,7 +92,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
92
92
|
resetResultsCount: () => void;
|
|
93
93
|
};
|
|
94
94
|
lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
95
|
-
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
95
|
+
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
96
96
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
97
97
|
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
|
|
98
98
|
clearCache: () => void;
|
|
@@ -131,7 +131,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
131
131
|
} & {
|
|
132
132
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
133
133
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
134
|
-
}, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
134
|
+
}, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
135
135
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
136
136
|
}) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
|
|
137
137
|
clearCache: () => void;
|
|
@@ -145,7 +145,7 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
|
|
|
145
145
|
resetResultsCount: () => void;
|
|
146
146
|
};
|
|
147
147
|
lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
|
|
148
|
-
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
148
|
+
dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
149
149
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
150
150
|
}) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
|
|
151
151
|
clearCache: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/locales';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/locales';
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from '@mui/x-charts/ChartsGrid';
|
|
|
13
13
|
export * from '@mui/x-charts/ChartsText';
|
|
14
14
|
export * from '@mui/x-charts/ChartsTooltip';
|
|
15
15
|
export * from '@mui/x-charts/ChartsLegend';
|
|
16
|
+
export * from '@mui/x-charts/ChartsLocalizationProvider';
|
|
16
17
|
export * from '@mui/x-charts/ChartsAxisHighlight';
|
|
17
18
|
export * from '@mui/x-charts/BarChart';
|
|
18
19
|
export * from '@mui/x-charts/LineChart';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro v8.
|
|
2
|
+
* @mui/x-charts-pro v8.1.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -165,6 +165,17 @@ Object.keys(_ChartsLegend).forEach(function (key) {
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
});
|
|
168
|
+
var _ChartsLocalizationProvider = require("@mui/x-charts/ChartsLocalizationProvider");
|
|
169
|
+
Object.keys(_ChartsLocalizationProvider).forEach(function (key) {
|
|
170
|
+
if (key === "default" || key === "__esModule") return;
|
|
171
|
+
if (key in exports && exports[key] === _ChartsLocalizationProvider[key]) return;
|
|
172
|
+
Object.defineProperty(exports, key, {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return _ChartsLocalizationProvider[key];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
168
179
|
var _ChartsAxisHighlight = require("@mui/x-charts/ChartsAxisHighlight");
|
|
169
180
|
Object.keys(_ChartsAxisHighlight).forEach(function (key) {
|
|
170
181
|
if (key === "default" || key === "__esModule") return;
|