@mui/x-charts-pro 8.0.0-alpha.1 → 8.0.0-alpha.10

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.
Files changed (178) hide show
  1. package/BarChartPro/BarChartPro.d.ts +2 -2
  2. package/BarChartPro/BarChartPro.js +72 -31
  3. package/CHANGELOG.md +1903 -231
  4. package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
  5. package/ChartContainerPro/ChartContainerPro.js +55 -37
  6. package/ChartContainerPro/useChartContainerProProps.d.ts +6 -5
  7. package/ChartContainerPro/useChartContainerProProps.js +11 -7
  8. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
  9. package/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -80
  10. package/{context → ChartDataProviderPro}/package.json +1 -1
  11. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
  12. package/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
  13. package/Heatmap/Heatmap.js +31 -8
  14. package/Heatmap/HeatmapItem.js +1 -1
  15. package/Heatmap/HeatmapTooltip.js +8 -28
  16. package/Heatmap/extremums.d.ts +2 -2
  17. package/Heatmap/formatter.d.ts +2 -2
  18. package/Heatmap/formatter.js +2 -1
  19. package/Heatmap/heatmapClasses.js +2 -1
  20. package/Heatmap/plugin.d.ts +2 -2
  21. package/Heatmap/plugin.js +4 -2
  22. package/Heatmap/tooltip.d.ts +3 -0
  23. package/Heatmap/tooltip.js +25 -0
  24. package/LineChartPro/LineChartPro.d.ts +2 -2
  25. package/LineChartPro/LineChartPro.js +78 -51
  26. package/README.md +1 -1
  27. package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
  28. package/ScatterChartPro/ScatterChartPro.js +49 -33
  29. package/hooks/index.d.ts +1 -0
  30. package/hooks/index.js +2 -1
  31. package/hooks/useSeries.d.ts +2 -4
  32. package/hooks/zoom/index.d.ts +1 -0
  33. package/hooks/zoom/index.js +1 -0
  34. package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
  35. package/hooks/zoom/useIsZoomInteracting.js +14 -0
  36. package/index.d.ts +3 -1
  37. package/index.js +5 -5
  38. package/internals/plugins/allPlugins.d.ts +11 -0
  39. package/internals/plugins/allPlugins.js +5 -0
  40. package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +3 -0
  41. package/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
  42. package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
  43. package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
  44. package/internals/plugins/useChartProZoom/index.d.ts +3 -0
  45. package/internals/plugins/useChartProZoom/index.js +3 -0
  46. package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
  47. package/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
  48. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +377 -0
  49. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
  50. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +50 -0
  51. package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
  52. package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
  53. package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
  54. package/internals/utils/releaseInfo.js +2 -2
  55. package/models/index.d.ts +1 -0
  56. package/models/index.js +2 -1
  57. package/modern/BarChartPro/BarChartPro.js +72 -31
  58. package/modern/ChartContainerPro/ChartContainerPro.js +55 -37
  59. package/modern/ChartContainerPro/useChartContainerProProps.js +11 -7
  60. package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -80
  61. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
  62. package/modern/Heatmap/Heatmap.js +31 -8
  63. package/modern/Heatmap/HeatmapItem.js +1 -1
  64. package/modern/Heatmap/HeatmapTooltip.js +8 -28
  65. package/modern/Heatmap/formatter.js +2 -1
  66. package/modern/Heatmap/heatmapClasses.js +2 -1
  67. package/modern/Heatmap/plugin.js +4 -2
  68. package/modern/Heatmap/tooltip.js +25 -0
  69. package/modern/LineChartPro/LineChartPro.js +78 -51
  70. package/modern/ScatterChartPro/ScatterChartPro.js +49 -33
  71. package/modern/hooks/index.js +2 -1
  72. package/modern/hooks/zoom/index.js +1 -0
  73. package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
  74. package/modern/index.js +5 -5
  75. package/modern/internals/plugins/allPlugins.js +5 -0
  76. package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
  77. package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
  78. package/modern/internals/plugins/useChartProZoom/index.js +3 -0
  79. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
  80. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
  81. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
  82. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
  83. package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
  84. package/modern/internals/utils/releaseInfo.js +2 -2
  85. package/modern/models/index.js +2 -1
  86. package/node/BarChartPro/BarChartPro.js +71 -30
  87. package/node/ChartContainerPro/ChartContainerPro.js +54 -36
  88. package/node/ChartContainerPro/useChartContainerProProps.js +11 -7
  89. package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +67 -77
  90. package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
  91. package/node/Heatmap/Heatmap.js +31 -8
  92. package/node/Heatmap/HeatmapItem.js +2 -2
  93. package/node/Heatmap/HeatmapTooltip.js +6 -26
  94. package/node/Heatmap/formatter.js +2 -1
  95. package/node/Heatmap/heatmapClasses.js +5 -4
  96. package/node/Heatmap/plugin.js +4 -2
  97. package/node/Heatmap/tooltip.js +31 -0
  98. package/node/LineChartPro/LineChartPro.js +77 -50
  99. package/node/ScatterChartPro/ScatterChartPro.js +48 -32
  100. package/node/hooks/index.js +16 -1
  101. package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
  102. package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
  103. package/node/index.js +34 -12
  104. package/node/internals/plugins/allPlugins.js +11 -0
  105. package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +19 -0
  106. package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
  107. package/node/internals/plugins/useChartProZoom/index.js +38 -0
  108. package/node/internals/plugins/useChartProZoom/useChartProZoom.js +310 -0
  109. package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +18 -0
  110. package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
  111. package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
  112. package/node/internals/utils/releaseInfo.js +4 -3
  113. package/package.json +6 -6
  114. package/typeOverloads/modules.d.ts +8 -1
  115. package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
  116. package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
  117. package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -12
  118. package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
  119. package/context/CartesianProviderPro/index.d.ts +0 -1
  120. package/context/CartesianProviderPro/index.js +0 -1
  121. package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -10
  122. package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -14
  123. package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
  124. package/context/ZoomProvider/Zoom.types.d.ts +0 -144
  125. package/context/ZoomProvider/ZoomContext.d.ts +0 -4
  126. package/context/ZoomProvider/ZoomContext.js +0 -16
  127. package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
  128. package/context/ZoomProvider/ZoomProvider.js +0 -56
  129. package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
  130. package/context/ZoomProvider/ZoomSetup.js +0 -16
  131. package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
  132. package/context/ZoomProvider/defaultizeZoom.js +0 -32
  133. package/context/ZoomProvider/index.d.ts +0 -3
  134. package/context/ZoomProvider/index.js +0 -3
  135. package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
  136. package/context/ZoomProvider/initializeZoomData.js +0 -13
  137. package/context/ZoomProvider/useSetupPan.d.ts +0 -1
  138. package/context/ZoomProvider/useSetupPan.js +0 -106
  139. package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
  140. package/context/ZoomProvider/useSetupZoom.js +0 -274
  141. package/context/ZoomProvider/useZoom.d.ts +0 -7
  142. package/context/ZoomProvider/useZoom.js +0 -19
  143. package/context/index.d.ts +0 -3
  144. package/context/index.js +0 -5
  145. package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
  146. package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
  147. package/modern/context/CartesianProviderPro/index.js +0 -1
  148. package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
  149. package/modern/context/ZoomProvider/ZoomContext.js +0 -16
  150. package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
  151. package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
  152. package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
  153. package/modern/context/ZoomProvider/index.js +0 -3
  154. package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
  155. package/modern/context/ZoomProvider/useSetupPan.js +0 -106
  156. package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
  157. package/modern/context/ZoomProvider/useZoom.js +0 -19
  158. package/modern/context/index.js +0 -5
  159. package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
  160. package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
  161. package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
  162. package/node/context/ZoomProvider/ZoomContext.js +0 -23
  163. package/node/context/ZoomProvider/ZoomProvider.js +0 -63
  164. package/node/context/ZoomProvider/ZoomSetup.js +0 -20
  165. package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
  166. package/node/context/ZoomProvider/index.js +0 -38
  167. package/node/context/ZoomProvider/initializeZoomData.js +0 -20
  168. package/node/context/ZoomProvider/useSetupPan.js +0 -114
  169. package/node/context/ZoomProvider/useSetupZoom.js +0 -281
  170. package/node/context/ZoomProvider/useZoom.js +0 -25
  171. package/node/context/index.js +0 -27
  172. /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.d.ts +0 -0
  173. /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  174. /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
  175. /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
  176. /package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  177. /package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  178. /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
@@ -0,0 +1,377 @@
1
+ import { ChartRootSelector } from '@mui/x-charts/internals';
2
+ import { UseChartProZoomSignature } from './useChartProZoom.types';
3
+ export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
+ export declare const selectorChartZoomOptionsLookup: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
5
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
+ } & {
7
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
8
+ }) => {
9
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
10
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
11
+ }) & {
12
+ clearCache: () => void;
13
+ resultsCount: () => number;
14
+ resetResultsCount: () => void;
15
+ } & {
16
+ resultFunc: (resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
17
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
18
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
19
+ };
20
+ memoizedResultFunc: ((resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
21
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
22
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
23
+ }) & {
24
+ clearCache: () => void;
25
+ resultsCount: () => number;
26
+ resetResultsCount: () => void;
27
+ };
28
+ lastResult: () => {
29
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
30
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
31
+ };
32
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
33
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
34
+ }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
35
+ clearCache: () => void;
36
+ resultsCount: () => number;
37
+ resetResultsCount: () => void;
38
+ } & {
39
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
40
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
41
+ clearCache: () => void;
42
+ resultsCount: () => number;
43
+ resetResultsCount: () => void;
44
+ };
45
+ lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
46
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
47
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
48
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
49
+ clearCache: () => void;
50
+ resultsCount: () => number;
51
+ resetResultsCount: () => void;
52
+ } & {
53
+ resultFunc: (resultFuncArgs_0: {
54
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
55
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
56
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
57
+ memoizedResultFunc: ((resultFuncArgs_0: {
58
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
59
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
60
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
61
+ clearCache: () => void;
62
+ resultsCount: () => number;
63
+ resetResultsCount: () => void;
64
+ };
65
+ lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
66
+ dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
67
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
68
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
69
+ }];
70
+ recomputations: () => number;
71
+ resetRecomputations: () => void;
72
+ dependencyRecomputations: () => number;
73
+ resetDependencyRecomputations: () => void;
74
+ } & {
75
+ memoize: typeof import("reselect").weakMapMemoize;
76
+ argsMemoize: typeof import("reselect").weakMapMemoize;
77
+ }];
78
+ recomputations: () => number;
79
+ resetRecomputations: () => void;
80
+ dependencyRecomputations: () => number;
81
+ resetDependencyRecomputations: () => void;
82
+ } & {
83
+ argsMemoize: typeof import("reselect").weakMapMemoize;
84
+ memoize: typeof import("reselect").weakMapMemoize;
85
+ }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
86
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
87
+ }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
88
+ clearCache: () => void;
89
+ resultsCount: () => number;
90
+ resetResultsCount: () => void;
91
+ } & {
92
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
93
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
94
+ clearCache: () => void;
95
+ resultsCount: () => number;
96
+ resetResultsCount: () => void;
97
+ };
98
+ lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
99
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
100
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
101
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
102
+ clearCache: () => void;
103
+ resultsCount: () => number;
104
+ resetResultsCount: () => void;
105
+ } & {
106
+ resultFunc: (resultFuncArgs_0: {
107
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
108
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
109
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
110
+ memoizedResultFunc: ((resultFuncArgs_0: {
111
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
112
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
113
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
114
+ clearCache: () => void;
115
+ resultsCount: () => number;
116
+ resetResultsCount: () => void;
117
+ };
118
+ lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
119
+ dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
120
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
121
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
122
+ }];
123
+ recomputations: () => number;
124
+ resetRecomputations: () => void;
125
+ dependencyRecomputations: () => number;
126
+ resetDependencyRecomputations: () => void;
127
+ } & {
128
+ memoize: typeof import("reselect").weakMapMemoize;
129
+ argsMemoize: typeof import("reselect").weakMapMemoize;
130
+ }];
131
+ recomputations: () => number;
132
+ resetRecomputations: () => void;
133
+ dependencyRecomputations: () => number;
134
+ resetDependencyRecomputations: () => void;
135
+ } & {
136
+ argsMemoize: typeof import("reselect").weakMapMemoize;
137
+ memoize: typeof import("reselect").weakMapMemoize;
138
+ }];
139
+ recomputations: () => number;
140
+ resetRecomputations: () => void;
141
+ dependencyRecomputations: () => number;
142
+ resetDependencyRecomputations: () => void;
143
+ } & {
144
+ argsMemoize: typeof import("reselect").weakMapMemoize;
145
+ memoize: typeof import("reselect").weakMapMemoize;
146
+ };
147
+ export declare const selectorChartZoomData: ((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<{}> & {
148
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
149
+ }) => import("@mui/x-charts/internals").ZoomData[]) & {
150
+ clearCache: () => void;
151
+ resultsCount: () => number;
152
+ resetResultsCount: () => void;
153
+ } & {
154
+ resultFunc: (resultFuncArgs_0: {
155
+ isInteracting: boolean;
156
+ zoomData: import("@mui/x-charts/internals").ZoomData[];
157
+ }) => import("@mui/x-charts/internals").ZoomData[];
158
+ memoizedResultFunc: ((resultFuncArgs_0: {
159
+ isInteracting: boolean;
160
+ zoomData: import("@mui/x-charts/internals").ZoomData[];
161
+ }) => import("@mui/x-charts/internals").ZoomData[]) & {
162
+ clearCache: () => void;
163
+ resultsCount: () => number;
164
+ resetResultsCount: () => void;
165
+ };
166
+ lastResult: () => import("@mui/x-charts/internals").ZoomData[];
167
+ dependencies: [ChartRootSelector<UseChartProZoomSignature>];
168
+ recomputations: () => number;
169
+ resetRecomputations: () => void;
170
+ dependencyRecomputations: () => number;
171
+ resetDependencyRecomputations: () => void;
172
+ } & {
173
+ argsMemoize: typeof import("reselect").weakMapMemoize;
174
+ memoize: typeof import("reselect").weakMapMemoize;
175
+ };
176
+ 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<{}> & {
177
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
178
+ }) => boolean) & {
179
+ clearCache: () => void;
180
+ resultsCount: () => number;
181
+ resetResultsCount: () => void;
182
+ } & {
183
+ resultFunc: (resultFuncArgs_0: {
184
+ isInteracting: boolean;
185
+ zoomData: import("@mui/x-charts/internals").ZoomData[];
186
+ }) => boolean;
187
+ memoizedResultFunc: ((resultFuncArgs_0: {
188
+ isInteracting: boolean;
189
+ zoomData: import("@mui/x-charts/internals").ZoomData[];
190
+ }) => boolean) & {
191
+ clearCache: () => void;
192
+ resultsCount: () => number;
193
+ resetResultsCount: () => void;
194
+ };
195
+ lastResult: () => boolean;
196
+ dependencies: [ChartRootSelector<UseChartProZoomSignature>];
197
+ recomputations: () => number;
198
+ resetRecomputations: () => void;
199
+ dependencyRecomputations: () => number;
200
+ resetDependencyRecomputations: () => void;
201
+ } & {
202
+ argsMemoize: typeof import("reselect").weakMapMemoize;
203
+ memoize: typeof import("reselect").weakMapMemoize;
204
+ };
205
+ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
206
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
207
+ } & {
208
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
209
+ }) => boolean) & {
210
+ clearCache: () => void;
211
+ resultsCount: () => number;
212
+ resetResultsCount: () => void;
213
+ } & {
214
+ resultFunc: (resultFuncArgs_0: {
215
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
216
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
217
+ }) => boolean;
218
+ memoizedResultFunc: ((resultFuncArgs_0: {
219
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
220
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
221
+ }) => boolean) & {
222
+ clearCache: () => void;
223
+ resultsCount: () => number;
224
+ resetResultsCount: () => void;
225
+ };
226
+ lastResult: () => boolean;
227
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
228
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
229
+ } & {
230
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
231
+ }) => {
232
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
233
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
234
+ }) & {
235
+ clearCache: () => void;
236
+ resultsCount: () => number;
237
+ resetResultsCount: () => void;
238
+ } & {
239
+ resultFunc: (resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
240
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
241
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
242
+ };
243
+ memoizedResultFunc: ((resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
244
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
245
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
246
+ }) & {
247
+ clearCache: () => void;
248
+ resultsCount: () => number;
249
+ resetResultsCount: () => void;
250
+ };
251
+ lastResult: () => {
252
+ [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
253
+ [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
254
+ };
255
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
256
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
257
+ }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
258
+ clearCache: () => void;
259
+ resultsCount: () => number;
260
+ resetResultsCount: () => void;
261
+ } & {
262
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
263
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
264
+ clearCache: () => void;
265
+ resultsCount: () => number;
266
+ resetResultsCount: () => void;
267
+ };
268
+ lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
269
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
270
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
271
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
272
+ clearCache: () => void;
273
+ resultsCount: () => number;
274
+ resetResultsCount: () => void;
275
+ } & {
276
+ resultFunc: (resultFuncArgs_0: {
277
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
278
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
279
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
280
+ memoizedResultFunc: ((resultFuncArgs_0: {
281
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
282
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
283
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[]) & {
284
+ clearCache: () => void;
285
+ resultsCount: () => number;
286
+ resetResultsCount: () => void;
287
+ };
288
+ lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[];
289
+ dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
290
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
291
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
292
+ }];
293
+ recomputations: () => number;
294
+ resetRecomputations: () => void;
295
+ dependencyRecomputations: () => number;
296
+ resetDependencyRecomputations: () => void;
297
+ } & {
298
+ memoize: typeof import("reselect").weakMapMemoize;
299
+ argsMemoize: typeof import("reselect").weakMapMemoize;
300
+ }];
301
+ recomputations: () => number;
302
+ resetRecomputations: () => void;
303
+ dependencyRecomputations: () => number;
304
+ resetDependencyRecomputations: () => void;
305
+ } & {
306
+ argsMemoize: typeof import("reselect").weakMapMemoize;
307
+ memoize: typeof import("reselect").weakMapMemoize;
308
+ }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
309
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
310
+ }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
311
+ clearCache: () => void;
312
+ resultsCount: () => number;
313
+ resetResultsCount: () => void;
314
+ } & {
315
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
316
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
317
+ clearCache: () => void;
318
+ resultsCount: () => number;
319
+ resetResultsCount: () => void;
320
+ };
321
+ lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
322
+ dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals").UseChartCartesianAxisState & Partial<{}> & {
323
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
324
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
325
+ clearCache: () => void;
326
+ resultsCount: () => number;
327
+ resetResultsCount: () => void;
328
+ } & {
329
+ resultFunc: (resultFuncArgs_0: {
330
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
331
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
332
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
333
+ memoizedResultFunc: ((resultFuncArgs_0: {
334
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
335
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
336
+ }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[]) & {
337
+ clearCache: () => void;
338
+ resultsCount: () => number;
339
+ resetResultsCount: () => void;
340
+ };
341
+ lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[];
342
+ dependencies: [(state: import("@mui/x-charts/internals").ChartState<[import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
343
+ x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
344
+ y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
345
+ }];
346
+ recomputations: () => number;
347
+ resetRecomputations: () => void;
348
+ dependencyRecomputations: () => number;
349
+ resetDependencyRecomputations: () => void;
350
+ } & {
351
+ memoize: typeof import("reselect").weakMapMemoize;
352
+ argsMemoize: typeof import("reselect").weakMapMemoize;
353
+ }];
354
+ recomputations: () => number;
355
+ resetRecomputations: () => void;
356
+ dependencyRecomputations: () => number;
357
+ resetDependencyRecomputations: () => void;
358
+ } & {
359
+ argsMemoize: typeof import("reselect").weakMapMemoize;
360
+ memoize: typeof import("reselect").weakMapMemoize;
361
+ }];
362
+ recomputations: () => number;
363
+ resetRecomputations: () => void;
364
+ dependencyRecomputations: () => number;
365
+ resetDependencyRecomputations: () => void;
366
+ } & {
367
+ argsMemoize: typeof import("reselect").weakMapMemoize;
368
+ memoize: typeof import("reselect").weakMapMemoize;
369
+ }];
370
+ recomputations: () => number;
371
+ resetRecomputations: () => void;
372
+ dependencyRecomputations: () => number;
373
+ resetDependencyRecomputations: () => void;
374
+ } & {
375
+ argsMemoize: typeof import("reselect").weakMapMemoize;
376
+ memoize: typeof import("reselect").weakMapMemoize;
377
+ };
@@ -0,0 +1,10 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { createSelector, selectorChartRawXAxis, selectorChartRawYAxis } from '@mui/x-charts/internals';
3
+ import { creatZoomLookup } from "./creatZoomLookup.js";
4
+ export const selectorChartZoomState = state => state.zoom;
5
+ const selectorChartXZoomOptionsLookup = createSelector(selectorChartRawXAxis, creatZoomLookup('x'));
6
+ const selectorChartYZoomOptionsLookup = createSelector(selectorChartRawYAxis, creatZoomLookup('y'));
7
+ export const selectorChartZoomOptionsLookup = createSelector([selectorChartXZoomOptionsLookup, selectorChartYZoomOptionsLookup], (xLookup, yLookup) => _extends({}, xLookup, yLookup));
8
+ export const selectorChartZoomData = createSelector(selectorChartZoomState, zoom => zoom.zoomData);
9
+ export const selectorChartZoomIsInteracting = createSelector(selectorChartZoomState, zoom => zoom.isInteracting);
10
+ export const selectorChartZoomIsEnabled = createSelector(selectorChartZoomOptionsLookup, optionsLookup => Object.keys(optionsLookup).length > 0);
@@ -0,0 +1,50 @@
1
+ import { AxisId, UseChartSeriesSignature, ChartPluginSignature, DefaultizedZoomOptions, UseChartCartesianAxisSignature, UseChartCartesianAxisDefaultizedParameters, ZoomData } from '@mui/x-charts/internals';
2
+ export interface UseChartProZoomParameters {
3
+ /**
4
+ * The list of zoom data related to each axis.
5
+ */
6
+ initialZoom?: ZoomData[];
7
+ /**
8
+ * Callback fired when the zoom has changed.
9
+ *
10
+ * @param {ZoomData[]} zoomData Updated zoom data.
11
+ */
12
+ onZoomChange?: (zoomData: ZoomData[] | ((zoomData: ZoomData[]) => ZoomData[])) => void;
13
+ }
14
+ export type UseChartProZoomDefaultizedParameters = UseChartProZoomParameters & UseChartCartesianAxisDefaultizedParameters & {
15
+ /**
16
+ * The zoom options for each axis.
17
+ */
18
+ optionsLookup: Record<AxisId, DefaultizedZoomOptions>;
19
+ };
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: ZoomData[];
31
+ };
32
+ }
33
+ export interface UseChartProZoomPublicApi {
34
+ /**
35
+ * Set the zoom data state.
36
+ * @param {ZoomData[] | ((prev: ZoomData[]) => ZoomData[])} value The new value. Can either be the new zoom data, or an updater function.
37
+ * @returns {void}
38
+ */
39
+ setZoomData: (value: ZoomData[] | ((prev: ZoomData[]) => ZoomData[])) => void;
40
+ }
41
+ export interface UseChartProZoomInstance extends UseChartProZoomPublicApi {
42
+ }
43
+ export type UseChartProZoomSignature = ChartPluginSignature<{
44
+ params: UseChartProZoomParameters;
45
+ defaultizedParams: UseChartProZoomDefaultizedParameters;
46
+ state: UseChartProZoomState;
47
+ publicAPI: UseChartProZoomPublicApi;
48
+ instance: UseChartProZoomInstance;
49
+ dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
50
+ }>;
@@ -0,0 +1,45 @@
1
+ import { DefaultizedZoomOptions, ZoomData } from '@mui/x-charts/internals';
2
+ /**
3
+ * Helper to get the range (in percents of a reference range) corresponding to a given scale.
4
+ * @param centerRatio {number} The ratio of the point that should not move between the previous and next range.
5
+ * @param scaleRatio {number} The target scale ratio.
6
+ * @returns The range to display.
7
+ */
8
+ export declare const zoomAtPoint: (centerRatio: number, scaleRatio: number, currentZoomData: ZoomData, options: DefaultizedZoomOptions) => number[];
9
+ /**
10
+ * Checks if the new span is valid.
11
+ */
12
+ export declare function isSpanValid(minRange: number, maxRange: number, isZoomIn: boolean, option: DefaultizedZoomOptions): boolean;
13
+ /**
14
+ * Get the scale ratio and if it's a zoom in or out from a wheel event.
15
+ */
16
+ export declare function getWheelScaleRatio(event: WheelEvent, step: number): {
17
+ scaleRatio: number;
18
+ isZoomIn: boolean;
19
+ };
20
+ /**
21
+ * Get the scale ratio and if it's a zoom in or out from a pinch gesture.
22
+ */
23
+ export declare function getPinchScaleRatio(curDiff: number, prevDiff: number, step: number): {
24
+ scaleRatio: number;
25
+ isZoomIn: boolean;
26
+ };
27
+ export declare function getDiff(eventCache: PointerEvent[]): number;
28
+ /**
29
+ * Get the ratio of the point in the horizontal center of the area.
30
+ */
31
+ export declare function getHorizontalCenterRatio(point: {
32
+ x: number;
33
+ y: number;
34
+ }, area: {
35
+ left: number;
36
+ width: number;
37
+ }): number;
38
+ export declare function preventDefault(event: TouchEvent): void;
39
+ export declare function getVerticalCenterRatio(point: {
40
+ x: number;
41
+ y: number;
42
+ }, area: {
43
+ top: number;
44
+ height: number;
45
+ }): number;
@@ -0,0 +1,126 @@
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
+ }