@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,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>>)[];
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_PLUGINS = exports.ALL_PLUGINS = void 0;
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
var _useChartProExport = require("./useChartProExport");
|
|
8
9
|
var _useChartProZoom = require("./useChartProZoom");
|
|
9
10
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
10
11
|
|
|
11
|
-
const ALL_PLUGINS = exports.ALL_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartPolarAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
|
|
12
|
-
const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom];
|
|
12
|
+
const ALL_PLUGINS = exports.ALL_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartPolarAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
|
|
13
|
+
const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useChartProExport = require("./useChartProExport");
|
|
7
|
+
Object.keys(_useChartProExport).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useChartProExport[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _useChartProExport[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _useChartProExport2 = require("./useChartProExport.types");
|
|
18
|
+
Object.keys(_useChartProExport2).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useChartProExport2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useChartProExport2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.printChart = printChart;
|
|
8
|
+
var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"));
|
|
9
|
+
function printChart(element, {
|
|
10
|
+
fileName
|
|
11
|
+
} = {}) {
|
|
12
|
+
const printWindow = buildPrintWindow(fileName);
|
|
13
|
+
const doc = (0, _ownerDocument.default)(element);
|
|
14
|
+
printWindow.onload = async () => {
|
|
15
|
+
const printDoc = printWindow.contentDocument;
|
|
16
|
+
const elementClone = element.cloneNode(true);
|
|
17
|
+
const container = document.createElement('div');
|
|
18
|
+
container.appendChild(elementClone);
|
|
19
|
+
printDoc.body.innerHTML = container.innerHTML;
|
|
20
|
+
await loadStyleSheets(printDoc, element);
|
|
21
|
+
printWindow.contentWindow.print();
|
|
22
|
+
const mediaQueryList = printWindow.contentWindow.matchMedia('print');
|
|
23
|
+
mediaQueryList.addEventListener('change', mql => {
|
|
24
|
+
const isAfterPrint = mql.matches === false;
|
|
25
|
+
if (isAfterPrint) {
|
|
26
|
+
doc.body.removeChild(printWindow);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
doc.body.appendChild(printWindow);
|
|
31
|
+
}
|
|
32
|
+
function buildPrintWindow(title) {
|
|
33
|
+
const iframeEl = document.createElement('iframe');
|
|
34
|
+
iframeEl.style.position = 'absolute';
|
|
35
|
+
iframeEl.style.width = '0px';
|
|
36
|
+
iframeEl.style.height = '0px';
|
|
37
|
+
iframeEl.title = title || document.title;
|
|
38
|
+
return iframeEl;
|
|
39
|
+
}
|
|
40
|
+
function loadStyleSheets(printDoc, element) {
|
|
41
|
+
const stylesheetLoadPromises = [];
|
|
42
|
+
const doc = (0, _ownerDocument.default)(element);
|
|
43
|
+
const rootCandidate = element.getRootNode();
|
|
44
|
+
const root = rootCandidate.constructor.name === 'ShadowRoot' ? rootCandidate : doc;
|
|
45
|
+
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
|
|
46
|
+
for (let i = 0; i < headStyleElements.length; i += 1) {
|
|
47
|
+
const node = headStyleElements[i];
|
|
48
|
+
if (node.tagName === 'STYLE') {
|
|
49
|
+
const newHeadStyleElements = printDoc.createElement(node.tagName);
|
|
50
|
+
const sheet = node.sheet;
|
|
51
|
+
if (sheet) {
|
|
52
|
+
let styleCSS = '';
|
|
53
|
+
// NOTE: for-of is not supported by IE
|
|
54
|
+
for (let j = 0; j < sheet.cssRules.length; j += 1) {
|
|
55
|
+
if (typeof sheet.cssRules[j].cssText === 'string') {
|
|
56
|
+
styleCSS += `${sheet.cssRules[j].cssText}\r\n`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
newHeadStyleElements.appendChild(printDoc.createTextNode(styleCSS));
|
|
60
|
+
printDoc.head.appendChild(newHeadStyleElements);
|
|
61
|
+
}
|
|
62
|
+
} else if (node.getAttribute('href')) {
|
|
63
|
+
// If `href` tag is empty, avoid loading these links
|
|
64
|
+
|
|
65
|
+
const newHeadStyleElements = printDoc.createElement(node.tagName);
|
|
66
|
+
for (let j = 0; j < node.attributes.length; j += 1) {
|
|
67
|
+
const attr = node.attributes[j];
|
|
68
|
+
if (attr) {
|
|
69
|
+
newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
stylesheetLoadPromises.push(new Promise(resolve => {
|
|
73
|
+
newHeadStyleElements.addEventListener('load', () => resolve());
|
|
74
|
+
}));
|
|
75
|
+
printDoc.head.appendChild(newHeadStyleElements);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return Promise.all(stylesheetLoadPromises);
|
|
79
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useChartProExport = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _print = require("./print");
|
|
10
|
+
function waitForAnimationFrame() {
|
|
11
|
+
let resolve;
|
|
12
|
+
const promise = new Promise(res => {
|
|
13
|
+
resolve = res;
|
|
14
|
+
});
|
|
15
|
+
window.requestAnimationFrame(() => {
|
|
16
|
+
resolve();
|
|
17
|
+
});
|
|
18
|
+
return promise;
|
|
19
|
+
}
|
|
20
|
+
const useChartProExport = ({
|
|
21
|
+
chartRootRef,
|
|
22
|
+
instance
|
|
23
|
+
}) => {
|
|
24
|
+
const exportAsPrint = async options => {
|
|
25
|
+
const chartRoot = chartRootRef.current;
|
|
26
|
+
if (chartRoot) {
|
|
27
|
+
const enableAnimation = instance.disableAnimation();
|
|
28
|
+
try {
|
|
29
|
+
// Wait for animation frame to ensure the animation finished
|
|
30
|
+
await waitForAnimationFrame();
|
|
31
|
+
(0, _print.printChart)(chartRoot, options);
|
|
32
|
+
} finally {
|
|
33
|
+
enableAnimation();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
publicAPI: {
|
|
39
|
+
exportAsPrint
|
|
40
|
+
},
|
|
41
|
+
instance: {
|
|
42
|
+
exportAsPrint
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exports.useChartProExport = useChartProExport;
|
|
47
|
+
useChartProExport.params = {};
|
|
48
|
+
useChartProExport.getDefaultizedParams = ({
|
|
49
|
+
params
|
|
50
|
+
}) => (0, _extends2.default)({}, params);
|
|
51
|
+
useChartProExport.getInitialState = () => ({
|
|
52
|
+
export: {}
|
|
53
|
+
});
|
|
@@ -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>;
|
|
@@ -6,23 +6,38 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
+
exports.initializeZoomData = initializeZoomData;
|
|
9
10
|
exports.useChartProZoom = void 0;
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _utils = require("@mui/material/utils");
|
|
15
|
+
var _rafThrottle = require("@mui/x-internals/rafThrottle");
|
|
16
|
+
var _debounce = _interopRequireDefault(require("@mui/utils/debounce"));
|
|
14
17
|
var _useChartProZoom = require("./useChartProZoom.utils");
|
|
15
18
|
// It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
|
|
16
|
-
function initializeZoomData(options) {
|
|
19
|
+
function initializeZoomData(options, zoomData) {
|
|
20
|
+
const zoomDataMap = new Map();
|
|
21
|
+
zoomData?.forEach(zoom => {
|
|
22
|
+
const option = options[zoom.axisId];
|
|
23
|
+
if (option) {
|
|
24
|
+
zoomDataMap.set(zoom.axisId, zoom);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
17
27
|
return Object.values(options).map(({
|
|
18
28
|
axisId,
|
|
19
29
|
minStart: start,
|
|
20
30
|
maxEnd: end
|
|
21
|
-
}) =>
|
|
22
|
-
axisId
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
}) => {
|
|
32
|
+
if (zoomDataMap.has(axisId)) {
|
|
33
|
+
return zoomDataMap.get(axisId);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
axisId,
|
|
37
|
+
start,
|
|
38
|
+
end
|
|
39
|
+
};
|
|
40
|
+
});
|
|
26
41
|
}
|
|
27
42
|
const useChartProZoom = ({
|
|
28
43
|
store,
|
|
@@ -32,15 +47,15 @@ const useChartProZoom = ({
|
|
|
32
47
|
}) => {
|
|
33
48
|
const {
|
|
34
49
|
zoomData: paramsZoomData,
|
|
35
|
-
onZoomChange
|
|
50
|
+
onZoomChange: onZoomChangeProp
|
|
36
51
|
} = params;
|
|
37
52
|
const drawingArea = (0, _internals.useSelector)(store, _internals.selectorChartDrawingArea);
|
|
38
53
|
const optionsLookup = (0, _internals.useSelector)(store, _internals.selectorChartZoomOptionsLookup);
|
|
39
54
|
const isZoomEnabled = Object.keys(optionsLookup).length > 0;
|
|
55
|
+
const onZoomChange = (0, _utils.useEventCallback)(onZoomChangeProp ?? (() => {}));
|
|
40
56
|
|
|
41
57
|
// Manage controlled state
|
|
42
|
-
|
|
43
|
-
(0, _useEnhancedEffect.default)(() => {
|
|
58
|
+
React.useEffect(() => {
|
|
44
59
|
if (paramsZoomData === undefined) {
|
|
45
60
|
return undefined;
|
|
46
61
|
}
|
|
@@ -69,14 +84,14 @@ const useChartProZoom = ({
|
|
|
69
84
|
};
|
|
70
85
|
}, [store, paramsZoomData]);
|
|
71
86
|
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
zoom: (0, _extends2.default)({},
|
|
76
|
-
isInteracting
|
|
87
|
+
// This is debounced. We want to run it only once after the interaction ends.
|
|
88
|
+
const removeIsInteracting = React.useMemo(() => (0, _debounce.default)(() => store.update(prevState => {
|
|
89
|
+
return (0, _extends2.default)({}, prevState, {
|
|
90
|
+
zoom: (0, _extends2.default)({}, prevState.zoom, {
|
|
91
|
+
isInteracting: false
|
|
77
92
|
})
|
|
78
|
-
})
|
|
79
|
-
}, [store]);
|
|
93
|
+
});
|
|
94
|
+
}), 166), [store]);
|
|
80
95
|
const setZoomDataCallback = React.useCallback(zoomData => {
|
|
81
96
|
store.update(prevState => {
|
|
82
97
|
const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
|
|
@@ -84,19 +99,25 @@ const useChartProZoom = ({
|
|
|
84
99
|
if (prevState.zoom.isControlled) {
|
|
85
100
|
return prevState;
|
|
86
101
|
}
|
|
102
|
+
removeIsInteracting();
|
|
87
103
|
return (0, _extends2.default)({}, prevState, {
|
|
88
104
|
zoom: (0, _extends2.default)({}, prevState.zoom, {
|
|
105
|
+
isInteracting: true,
|
|
89
106
|
zoomData: newZoomData
|
|
90
107
|
})
|
|
91
108
|
});
|
|
92
109
|
});
|
|
93
|
-
}, [onZoomChange, store]);
|
|
110
|
+
}, [onZoomChange, store, removeIsInteracting]);
|
|
111
|
+
React.useEffect(() => {
|
|
112
|
+
return () => {
|
|
113
|
+
removeIsInteracting.clear();
|
|
114
|
+
};
|
|
115
|
+
}, [setZoomDataCallback, removeIsInteracting]);
|
|
94
116
|
|
|
95
117
|
// Add events
|
|
96
118
|
const panningEventCacheRef = React.useRef([]);
|
|
97
119
|
const zoomEventCacheRef = React.useRef([]);
|
|
98
120
|
const eventPrevDiff = React.useRef(0);
|
|
99
|
-
const interactionTimeoutRef = React.useRef(undefined);
|
|
100
121
|
|
|
101
122
|
// Add event for chart panning
|
|
102
123
|
const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
|
|
@@ -107,17 +128,10 @@ const useChartProZoom = ({
|
|
|
107
128
|
if (element === null || !isPanEnabled) {
|
|
108
129
|
return () => {};
|
|
109
130
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (touchStartRef.current == null) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const point = (0, _internals.getSVGPoint)(element, event);
|
|
118
|
-
const movementX = point.x - touchStartRef.current.x;
|
|
119
|
-
const movementY = (point.y - touchStartRef.current.y) * -1;
|
|
120
|
-
const newZoomData = touchStartRef.current.zoomData.map(zoom => {
|
|
131
|
+
const throttledHandlePan = (0, _rafThrottle.rafThrottle)((touchStart, point) => {
|
|
132
|
+
const movementX = point.x - touchStart.x;
|
|
133
|
+
const movementY = (point.y - touchStart.y) * -1;
|
|
134
|
+
const newZoomData = touchStart.zoomData.map(zoom => {
|
|
121
135
|
const options = optionsLookup[zoom.axisId];
|
|
122
136
|
if (!options || !options.panning) {
|
|
123
137
|
return zoom;
|
|
@@ -148,6 +162,17 @@ const useChartProZoom = ({
|
|
|
148
162
|
});
|
|
149
163
|
});
|
|
150
164
|
setZoomDataCallback(newZoomData);
|
|
165
|
+
});
|
|
166
|
+
const handlePan = event => {
|
|
167
|
+
if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (touchStartRef.current == null) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const touchStart = touchStartRef.current;
|
|
174
|
+
const point = (0, _internals.getSVGPoint)(element, event);
|
|
175
|
+
throttledHandlePan(touchStart, point);
|
|
151
176
|
};
|
|
152
177
|
const handleDown = event => {
|
|
153
178
|
panningEventCacheRef.current.push(event);
|
|
@@ -160,7 +185,6 @@ const useChartProZoom = ({
|
|
|
160
185
|
event.preventDefault();
|
|
161
186
|
}
|
|
162
187
|
isDraggingRef.current = true;
|
|
163
|
-
setIsInteracting(true);
|
|
164
188
|
touchStartRef.current = {
|
|
165
189
|
x: point.x,
|
|
166
190
|
y: point.y,
|
|
@@ -169,7 +193,6 @@ const useChartProZoom = ({
|
|
|
169
193
|
};
|
|
170
194
|
const handleUp = event => {
|
|
171
195
|
panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
172
|
-
setIsInteracting(false);
|
|
173
196
|
isDraggingRef.current = false;
|
|
174
197
|
touchStartRef.current = null;
|
|
175
198
|
};
|
|
@@ -184,8 +207,9 @@ const useChartProZoom = ({
|
|
|
184
207
|
document.removeEventListener('pointerup', handleUp);
|
|
185
208
|
document.removeEventListener('pointercancel', handleUp);
|
|
186
209
|
document.removeEventListener('pointerleave', handleUp);
|
|
210
|
+
throttledHandlePan.clear();
|
|
187
211
|
};
|
|
188
|
-
}, [instance, svgRef, isDraggingRef,
|
|
212
|
+
}, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
|
|
189
213
|
|
|
190
214
|
// Add event for chart zoom in/out
|
|
191
215
|
React.useEffect(() => {
|
|
@@ -193,6 +217,7 @@ const useChartProZoom = ({
|
|
|
193
217
|
if (element === null || !isZoomEnabled) {
|
|
194
218
|
return () => {};
|
|
195
219
|
}
|
|
220
|
+
const rafThrottledSetZoomData = (0, _rafThrottle.rafThrottle)(setZoomDataCallback);
|
|
196
221
|
const wheelHandler = event => {
|
|
197
222
|
if (element === null) {
|
|
198
223
|
return;
|
|
@@ -202,16 +227,13 @@ const useChartProZoom = ({
|
|
|
202
227
|
return;
|
|
203
228
|
}
|
|
204
229
|
event.preventDefault();
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
setIsInteracting(false);
|
|
213
|
-
}, 166);
|
|
214
|
-
setZoomDataCallback(prevZoomData => {
|
|
230
|
+
|
|
231
|
+
/*
|
|
232
|
+
* Need to throttle `setZoomDataCallback` instead of `wheelHandler` because we're calling `event.preventDefault()`.
|
|
233
|
+
* If we throttle the event, then some events' default behavior won't be prevented and the page will scroll while
|
|
234
|
+
* the user is trying to zoom in.
|
|
235
|
+
*/
|
|
236
|
+
rafThrottledSetZoomData(prevZoomData => {
|
|
215
237
|
return prevZoomData.map(zoom => {
|
|
216
238
|
const option = optionsLookup[zoom.axisId];
|
|
217
239
|
if (!option) {
|
|
@@ -236,9 +258,8 @@ const useChartProZoom = ({
|
|
|
236
258
|
};
|
|
237
259
|
function pointerDownHandler(event) {
|
|
238
260
|
zoomEventCacheRef.current.push(event);
|
|
239
|
-
setIsInteracting(true);
|
|
240
261
|
}
|
|
241
|
-
function pointerMoveHandler(event) {
|
|
262
|
+
const pointerMoveHandler = (0, _rafThrottle.rafThrottle)(function pointerMoveHandler(event) {
|
|
242
263
|
if (element === null) {
|
|
243
264
|
return;
|
|
244
265
|
}
|
|
@@ -281,15 +302,12 @@ const useChartProZoom = ({
|
|
|
281
302
|
eventPrevDiff.current = curDiff;
|
|
282
303
|
return newZoomData;
|
|
283
304
|
});
|
|
284
|
-
}
|
|
305
|
+
});
|
|
285
306
|
function pointerUpHandler(event) {
|
|
286
307
|
zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
287
308
|
if (zoomEventCacheRef.current.length < 2) {
|
|
288
309
|
eventPrevDiff.current = 0;
|
|
289
310
|
}
|
|
290
|
-
if (event.type === 'pointerup' || event.type === 'pointercancel') {
|
|
291
|
-
setIsInteracting(false);
|
|
292
|
-
}
|
|
293
311
|
}
|
|
294
312
|
element.addEventListener('wheel', wheelHandler);
|
|
295
313
|
element.addEventListener('pointerdown', pointerDownHandler);
|
|
@@ -312,11 +330,10 @@ const useChartProZoom = ({
|
|
|
312
330
|
element.removeEventListener('pointerleave', pointerUpHandler);
|
|
313
331
|
element.removeEventListener('touchstart', _useChartProZoom.preventDefault);
|
|
314
332
|
element.removeEventListener('touchmove', _useChartProZoom.preventDefault);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
333
|
+
pointerMoveHandler.clear();
|
|
334
|
+
rafThrottledSetZoomData.clear();
|
|
318
335
|
};
|
|
319
|
-
}, [svgRef, drawingArea, isZoomEnabled, optionsLookup,
|
|
336
|
+
}, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
|
|
320
337
|
return {
|
|
321
338
|
publicAPI: {
|
|
322
339
|
setZoomData: setZoomDataCallback
|
|
@@ -345,11 +362,12 @@ useChartProZoom.getInitialState = params => {
|
|
|
345
362
|
defaultizedYAxis
|
|
346
363
|
} = params;
|
|
347
364
|
const optionsLookup = (0, _extends2.default)({}, (0, _internals.createZoomLookup)('x')(defaultizedXAxis), (0, _internals.createZoomLookup)('y')(defaultizedYAxis));
|
|
365
|
+
const userZoomData =
|
|
366
|
+
// eslint-disable-next-line no-nested-ternary
|
|
367
|
+
zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : undefined;
|
|
348
368
|
return {
|
|
349
369
|
zoom: {
|
|
350
|
-
zoomData:
|
|
351
|
-
// eslint-disable-next-line no-nested-ternary
|
|
352
|
-
zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : initializeZoomData(optionsLookup),
|
|
370
|
+
zoomData: initializeZoomData(optionsLookup, userZoomData),
|
|
353
371
|
isInteracting: false,
|
|
354
372
|
isControlled: zoomData !== undefined
|
|
355
373
|
}
|
|
@@ -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';
|
package/locales/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _locales = require("@mui/x-charts/locales");
|
|
7
|
+
Object.keys(_locales).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _locales[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _locales[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|