@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,53 +0,0 @@
|
|
|
1
|
-
import { UseChartSeriesSignature, ChartPluginSignature, UseChartCartesianAxisSignature, UseChartCartesianAxisDefaultizedParameters, ZoomData } from '@mui/x-charts/internals';
|
|
2
|
-
export interface UseChartProZoomParameters {
|
|
3
|
-
/**
|
|
4
|
-
* The list of zoom data related to each axis.
|
|
5
|
-
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
6
|
-
*/
|
|
7
|
-
initialZoom?: readonly ZoomData[];
|
|
8
|
-
/**
|
|
9
|
-
* Callback fired when the zoom has changed.
|
|
10
|
-
*
|
|
11
|
-
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
12
|
-
*/
|
|
13
|
-
onZoomChange?: (zoomData: ZoomData[]) => void;
|
|
14
|
-
/**
|
|
15
|
-
* The list of zoom data related to each axis.
|
|
16
|
-
*/
|
|
17
|
-
zoomData?: readonly ZoomData[];
|
|
18
|
-
}
|
|
19
|
-
export type UseChartProZoomDefaultizedParameters = UseChartProZoomParameters & UseChartCartesianAxisDefaultizedParameters;
|
|
20
|
-
export interface UseChartProZoomState {
|
|
21
|
-
zoom: {
|
|
22
|
-
/**
|
|
23
|
-
* Whether the user is currently interacting with the chart.
|
|
24
|
-
* This is useful to disable animations while the user is interacting.
|
|
25
|
-
*/
|
|
26
|
-
isInteracting: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Mapping of axis id to the zoom data.
|
|
29
|
-
*/
|
|
30
|
-
zoomData: readonly ZoomData[];
|
|
31
|
-
/**
|
|
32
|
-
* Internal information to know if the user control the state or not.
|
|
33
|
-
*/
|
|
34
|
-
isControlled: boolean;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export interface UseChartProZoomPublicApi {
|
|
38
|
-
/**
|
|
39
|
-
* Set the zoom data state.
|
|
40
|
-
* @param {ZoomData[] | ((prev: ZoomData[]) => ZoomData[])} value The new value. Can either be the new zoom data, or an updater function.
|
|
41
|
-
* @returns {void}
|
|
42
|
-
*/
|
|
43
|
-
setZoomData: (value: ZoomData[] | ((prev: ZoomData[]) => ZoomData[])) => void;
|
|
44
|
-
}
|
|
45
|
-
export interface UseChartProZoomInstance extends UseChartProZoomPublicApi {}
|
|
46
|
-
export type UseChartProZoomSignature = ChartPluginSignature<{
|
|
47
|
-
params: UseChartProZoomParameters;
|
|
48
|
-
defaultizedParams: UseChartProZoomDefaultizedParameters;
|
|
49
|
-
state: UseChartProZoomState;
|
|
50
|
-
publicAPI: UseChartProZoomPublicApi;
|
|
51
|
-
instance: UseChartProZoomInstance;
|
|
52
|
-
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
53
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { DefaultizedZoomOptions, ZoomData } from '@mui/x-charts/internals';
|
|
2
|
-
/**
|
|
3
|
-
* Helper to get the range (in percents of a reference range) corresponding to a given scale.
|
|
4
|
-
* @param centerRatio {number} The ratio of the point that should not move between the previous and next range.
|
|
5
|
-
* @param scaleRatio {number} The target scale ratio.
|
|
6
|
-
* @returns The range to display.
|
|
7
|
-
*/
|
|
8
|
-
export declare const zoomAtPoint: (centerRatio: number, scaleRatio: number, currentZoomData: ZoomData, options: DefaultizedZoomOptions) => number[];
|
|
9
|
-
/**
|
|
10
|
-
* Checks if the new span is valid.
|
|
11
|
-
*/
|
|
12
|
-
export declare function isSpanValid(minRange: number, maxRange: number, isZoomIn: boolean, option: DefaultizedZoomOptions): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Get the scale ratio and if it's a zoom in or out from a wheel event.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getWheelScaleRatio(event: WheelEvent, step: number): {
|
|
17
|
-
scaleRatio: number;
|
|
18
|
-
isZoomIn: boolean;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Get the scale ratio and if it's a zoom in or out from a pinch gesture.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getPinchScaleRatio(curDiff: number, prevDiff: number, step: number): {
|
|
24
|
-
scaleRatio: number;
|
|
25
|
-
isZoomIn: boolean;
|
|
26
|
-
};
|
|
27
|
-
export declare function getDiff(eventCache: PointerEvent[]): number;
|
|
28
|
-
/**
|
|
29
|
-
* Get the ratio of the point in the horizontal center of the area.
|
|
30
|
-
*/
|
|
31
|
-
export declare function getHorizontalCenterRatio(point: {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
}, area: {
|
|
35
|
-
left: number;
|
|
36
|
-
width: number;
|
|
37
|
-
}): number;
|
|
38
|
-
export declare function preventDefault(event: TouchEvent): void;
|
|
39
|
-
export declare function getVerticalCenterRatio(point: {
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
}, area: {
|
|
43
|
-
top: number;
|
|
44
|
-
height: number;
|
|
45
|
-
}): number;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper to get the range (in percents of a reference range) corresponding to a given scale.
|
|
3
|
-
* @param centerRatio {number} The ratio of the point that should not move between the previous and next range.
|
|
4
|
-
* @param scaleRatio {number} The target scale ratio.
|
|
5
|
-
* @returns The range to display.
|
|
6
|
-
*/
|
|
7
|
-
export const zoomAtPoint = (centerRatio, scaleRatio, currentZoomData, options) => {
|
|
8
|
-
const MIN_RANGE = options.minStart;
|
|
9
|
-
const MAX_RANGE = options.maxEnd;
|
|
10
|
-
const MIN_ALLOWED_SPAN = options.minSpan;
|
|
11
|
-
const minRange = currentZoomData.start;
|
|
12
|
-
const maxRange = currentZoomData.end;
|
|
13
|
-
const point = minRange + centerRatio * (maxRange - minRange);
|
|
14
|
-
let newMinRange = (minRange + point * (scaleRatio - 1)) / scaleRatio;
|
|
15
|
-
let newMaxRange = (maxRange + point * (scaleRatio - 1)) / scaleRatio;
|
|
16
|
-
let minSpillover = 0;
|
|
17
|
-
let maxSpillover = 0;
|
|
18
|
-
if (newMinRange < MIN_RANGE) {
|
|
19
|
-
minSpillover = Math.abs(newMinRange);
|
|
20
|
-
newMinRange = MIN_RANGE;
|
|
21
|
-
}
|
|
22
|
-
if (newMaxRange > MAX_RANGE) {
|
|
23
|
-
maxSpillover = Math.abs(newMaxRange - MAX_RANGE);
|
|
24
|
-
newMaxRange = MAX_RANGE;
|
|
25
|
-
}
|
|
26
|
-
if (minSpillover > 0 && maxSpillover > 0) {
|
|
27
|
-
return [MIN_RANGE, MAX_RANGE];
|
|
28
|
-
}
|
|
29
|
-
newMaxRange += minSpillover;
|
|
30
|
-
newMinRange -= maxSpillover;
|
|
31
|
-
newMinRange = Math.min(MAX_RANGE - MIN_ALLOWED_SPAN, Math.max(MIN_RANGE, newMinRange));
|
|
32
|
-
newMaxRange = Math.max(MIN_ALLOWED_SPAN, Math.min(MAX_RANGE, newMaxRange));
|
|
33
|
-
return [newMinRange, newMaxRange];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Checks if the new span is valid.
|
|
38
|
-
*/
|
|
39
|
-
export function isSpanValid(minRange, maxRange, isZoomIn, option) {
|
|
40
|
-
const newSpanPercent = maxRange - minRange;
|
|
41
|
-
if (isZoomIn && newSpanPercent < option.minSpan || !isZoomIn && newSpanPercent > option.maxSpan) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (minRange < option.minStart || maxRange > option.maxEnd) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
function getMultiplier(event) {
|
|
50
|
-
const ctrlMultiplier = event.ctrlKey ? 3 : 1;
|
|
51
|
-
|
|
52
|
-
// DeltaMode: 0 is pixel, 1 is line, 2 is page
|
|
53
|
-
// This is defined by the browser.
|
|
54
|
-
if (event.deltaMode === 1) {
|
|
55
|
-
return 1 * ctrlMultiplier;
|
|
56
|
-
}
|
|
57
|
-
if (event.deltaMode) {
|
|
58
|
-
return 10 * ctrlMultiplier;
|
|
59
|
-
}
|
|
60
|
-
return 0.2 * ctrlMultiplier;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Get the scale ratio and if it's a zoom in or out from a wheel event.
|
|
65
|
-
*/
|
|
66
|
-
export function getWheelScaleRatio(event, step) {
|
|
67
|
-
const deltaY = -event.deltaY;
|
|
68
|
-
const multiplier = getMultiplier(event);
|
|
69
|
-
const scaledStep = step * multiplier * deltaY / 1000;
|
|
70
|
-
// Clamp the scale ratio between 0.1 and 1.9 so that the zoom is not too big or too small.
|
|
71
|
-
const scaleRatio = Math.min(Math.max(1 + scaledStep, 0.1), 1.9);
|
|
72
|
-
const isZoomIn = deltaY > 0;
|
|
73
|
-
return {
|
|
74
|
-
scaleRatio,
|
|
75
|
-
isZoomIn
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Get the scale ratio and if it's a zoom in or out from a pinch gesture.
|
|
81
|
-
*/
|
|
82
|
-
export function getPinchScaleRatio(curDiff, prevDiff, step) {
|
|
83
|
-
const scaledStep = step / 1000;
|
|
84
|
-
let scaleRatio = 0;
|
|
85
|
-
let isZoomIn = false;
|
|
86
|
-
const hasMoved = prevDiff > 0;
|
|
87
|
-
if (hasMoved && curDiff > prevDiff) {
|
|
88
|
-
// The distance between the two pointers has increased
|
|
89
|
-
scaleRatio = 1 + scaledStep;
|
|
90
|
-
isZoomIn = true;
|
|
91
|
-
}
|
|
92
|
-
if (hasMoved && curDiff < prevDiff) {
|
|
93
|
-
// The distance between the two pointers has decreased
|
|
94
|
-
scaleRatio = 1 - scaledStep;
|
|
95
|
-
isZoomIn = false;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
scaleRatio,
|
|
99
|
-
isZoomIn
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
export function getDiff(eventCache) {
|
|
103
|
-
const [firstEvent, secondEvent] = eventCache;
|
|
104
|
-
return Math.hypot(firstEvent.pageX - secondEvent.pageX, firstEvent.pageY - secondEvent.pageY);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Get the ratio of the point in the horizontal center of the area.
|
|
109
|
-
*/
|
|
110
|
-
export function getHorizontalCenterRatio(point, area) {
|
|
111
|
-
const {
|
|
112
|
-
left,
|
|
113
|
-
width
|
|
114
|
-
} = area;
|
|
115
|
-
return (point.x - left) / width;
|
|
116
|
-
}
|
|
117
|
-
export function preventDefault(event) {
|
|
118
|
-
event.preventDefault();
|
|
119
|
-
}
|
|
120
|
-
export function getVerticalCenterRatio(point, area) {
|
|
121
|
-
const {
|
|
122
|
-
top,
|
|
123
|
-
height
|
|
124
|
-
} = area;
|
|
125
|
-
return (point.y - top) / height * -1 + 1;
|
|
126
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getReleaseInfo: () => any;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ponyfillGlobal from '@mui/utils/ponyfillGlobal';
|
|
2
|
-
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "MTc0MzYzMTIwMDAwMA==";
|
|
4
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5
|
-
// A simple hack to set the value in the test environment (has no build step).
|
|
6
|
-
// eslint-disable-next-line no-useless-concat
|
|
7
|
-
if (releaseInfo === '__RELEASE' + '_INFO__') {
|
|
8
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
9
|
-
return ponyfillGlobal.__MUI_RELEASE_INFO__;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return releaseInfo;
|
|
13
|
-
};
|
package/modern/models/index.d.ts
DELETED
package/modern/models/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
-
import { CommonDefaultizedProps, CommonSeriesType, CartesianSeriesType } from '@mui/x-charts/internals';
|
|
3
|
-
export type HeatmapValueType = readonly [number, number, number];
|
|
4
|
-
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color'>, CartesianSeriesType {
|
|
5
|
-
type: 'heatmap';
|
|
6
|
-
/**
|
|
7
|
-
* Data associated to each bar.
|
|
8
|
-
*/
|
|
9
|
-
data?: readonly HeatmapValueType[];
|
|
10
|
-
/**
|
|
11
|
-
* The key used to retrieve data from the dataset.
|
|
12
|
-
*/
|
|
13
|
-
dataKey?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
16
|
-
*/
|
|
17
|
-
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* An object that allows to identify a single bar.
|
|
21
|
-
* Used for item interaction
|
|
22
|
-
*/
|
|
23
|
-
export type HeatmapItemIdentifier = {
|
|
24
|
-
type: 'heatmap';
|
|
25
|
-
seriesId: DefaultizedHeatmapSeriesType['id'];
|
|
26
|
-
dataIndex: number;
|
|
27
|
-
};
|
|
28
|
-
export interface DefaultizedHeatmapSeriesType extends DefaultizedProps<HeatmapSeriesType, CommonDefaultizedProps> {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./heatmap.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./heatmap.js";
|
package/modern/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module","sideEffects":false}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentsProps, ComponentsOverrides } from '@mui/material/styles';
|
|
2
|
-
export interface ChartsProComponents<Theme = unknown> {
|
|
3
|
-
// BarChartPro components
|
|
4
|
-
MuiBarChartPro?: {
|
|
5
|
-
defaultProps?: ComponentsProps['MuiBarChartPro'];
|
|
6
|
-
};
|
|
7
|
-
// LineChartPro components
|
|
8
|
-
MuiLineChartPro?: {
|
|
9
|
-
defaultProps?: ComponentsProps['MuiLineChartPro'];
|
|
10
|
-
};
|
|
11
|
-
// Heatmap components
|
|
12
|
-
MuiHeatmap?: {
|
|
13
|
-
defaultProps?: ComponentsProps['MuiHeatmap'];
|
|
14
|
-
styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmap'];
|
|
15
|
-
};
|
|
16
|
-
// ScatterChartPro components
|
|
17
|
-
MuiScatterChartPro?: {
|
|
18
|
-
defaultProps?: ComponentsProps['MuiScatterChartPro'];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
declare module '@mui/material/styles' {
|
|
22
|
-
interface Components<Theme = unknown> extends ChartsProComponents<Theme> {}
|
|
23
|
-
}
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HeatmapClassKey } from "../Heatmap/index.js";
|
|
2
|
-
export interface ChartsProComponentNameToClassKey {
|
|
3
|
-
// Heatmap components
|
|
4
|
-
MuiHeatmap: HeatmapClassKey;
|
|
5
|
-
}
|
|
6
|
-
declare module '@mui/material/styles' {
|
|
7
|
-
interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// disable automatic export
|
|
11
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ScatterChartProProps } from "../ScatterChartPro/index.js";
|
|
2
|
-
import { BarChartProProps } from "../BarChartPro/index.js";
|
|
3
|
-
import { HeatmapProps } from "../Heatmap/Heatmap.js";
|
|
4
|
-
import { LineChartProProps } from "../LineChartPro/index.js";
|
|
5
|
-
export interface ChartsProComponentsPropsList {
|
|
6
|
-
// BarChartPro components
|
|
7
|
-
MuiBarChartPro: BarChartProProps;
|
|
8
|
-
// LineChartPro components
|
|
9
|
-
MuiLineChartPro: LineChartProProps;
|
|
10
|
-
// Heatmap components
|
|
11
|
-
MuiHeatmap: HeatmapProps;
|
|
12
|
-
// ScatterChartPro components
|
|
13
|
-
MuiScatterChartPro: ScatterChartProProps;
|
|
14
|
-
}
|
|
15
|
-
declare module '@mui/material/styles' {
|
|
16
|
-
interface ComponentsPropsList extends ChartsProComponentsPropsList {}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// disable automatic export
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {} from "./modules.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {} from "./modules.js";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
2
|
-
import { AxisId, ZoomOptions } from '@mui/x-charts/internals';
|
|
3
|
-
import { HeatmapItemIdentifier, HeatmapSeriesType, DefaultizedHeatmapSeriesType, HeatmapValueType } from "../models/seriesType/heatmap.js";
|
|
4
|
-
import { DefaultizedFunnelSeriesType, FunnelItemIdentifier, FunnelSeriesType, FunnelValueType } from "../FunnelChart/funnel.types.js";
|
|
5
|
-
declare module '@mui/x-charts/internals' {
|
|
6
|
-
interface ChartsSeriesConfig {
|
|
7
|
-
heatmap: {
|
|
8
|
-
seriesInput: DefaultizedProps<HeatmapSeriesType, 'id'>;
|
|
9
|
-
series: DefaultizedHeatmapSeriesType;
|
|
10
|
-
seriesProp: HeatmapSeriesType;
|
|
11
|
-
itemIdentifier: HeatmapItemIdentifier;
|
|
12
|
-
valueType: HeatmapValueType;
|
|
13
|
-
axisType: 'cartesian';
|
|
14
|
-
};
|
|
15
|
-
funnel: {
|
|
16
|
-
seriesInput: Omit<DefaultizedProps<FunnelSeriesType, 'id'>, 'data'> & {
|
|
17
|
-
data: MakeRequired<FunnelValueType, 'color'>[];
|
|
18
|
-
};
|
|
19
|
-
series: DefaultizedFunnelSeriesType;
|
|
20
|
-
seriesProp: FunnelSeriesType;
|
|
21
|
-
itemIdentifier: FunnelItemIdentifier;
|
|
22
|
-
valueType: MakeRequired<FunnelValueType, 'id' | 'color'>;
|
|
23
|
-
axisType: 'cartesian';
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
interface DefaultizedZoomOptions extends Required<ZoomOptions> {
|
|
27
|
-
axisId: AxisId;
|
|
28
|
-
axisDirection: 'x' | 'y';
|
|
29
|
-
}
|
|
30
|
-
interface AxisConfigExtension {
|
|
31
|
-
zoom?: boolean | ZoomOptions;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|