@mui/x-charts-pro 8.0.0-beta.2 → 8.0.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.
Files changed (200) hide show
  1. package/BarChartPro/BarChartPro.js +788 -9
  2. package/CHANGELOG.md +423 -96
  3. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  4. package/ChartDataProviderPro/ChartDataProviderPro.js +27 -22
  5. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  6. package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  7. package/FunnelChart/FunnelChart.js +73 -4
  8. package/FunnelChart/categoryAxis.types.d.ts +3 -2
  9. package/FunnelChart/funnelSectionClasses.d.ts +5 -0
  10. package/FunnelChart/funnelSectionClasses.js +1 -1
  11. package/FunnelChart/index.d.ts +1 -0
  12. package/FunnelChart/index.js +12 -0
  13. package/FunnelChart/useFunnelChartProps.js +3 -3
  14. package/Heatmap/Heatmap.d.ts +1 -1
  15. package/Heatmap/Heatmap.js +4 -3
  16. package/Heatmap/{HeatmapTooltip.js → HeatmapTooltip/HeatmapTooltip.js} +30 -34
  17. package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
  18. package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +26 -0
  19. package/Heatmap/HeatmapTooltip/index.d.ts +1 -0
  20. package/Heatmap/HeatmapTooltip/index.js +16 -0
  21. package/Heatmap/heatmapClasses.d.ts +5 -0
  22. package/Heatmap/heatmapClasses.js +1 -1
  23. package/Heatmap/index.d.ts +1 -1
  24. package/LineChartPro/LineChartPro.js +788 -9
  25. package/ScatterChartPro/ScatterChartPro.js +788 -9
  26. package/esm/BarChartPro/BarChartPro.js +788 -9
  27. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  28. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +28 -23
  29. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  30. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  31. package/esm/FunnelChart/FunnelChart.js +73 -4
  32. package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
  33. package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
  34. package/esm/FunnelChart/funnelSectionClasses.js +1 -1
  35. package/esm/FunnelChart/index.d.ts +1 -0
  36. package/esm/FunnelChart/index.js +1 -0
  37. package/esm/FunnelChart/useFunnelChartProps.js +3 -3
  38. package/esm/Heatmap/Heatmap.d.ts +1 -1
  39. package/esm/Heatmap/Heatmap.js +4 -3
  40. package/{modern/Heatmap → esm/Heatmap/HeatmapTooltip}/HeatmapTooltip.js +30 -34
  41. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +4 -0
  42. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +22 -0
  43. package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -0
  44. package/esm/Heatmap/HeatmapTooltip/index.js +1 -0
  45. package/esm/Heatmap/heatmapClasses.d.ts +5 -0
  46. package/esm/Heatmap/heatmapClasses.js +1 -1
  47. package/esm/Heatmap/index.d.ts +1 -1
  48. package/esm/Heatmap/index.js +1 -1
  49. package/esm/LineChartPro/LineChartPro.js +788 -9
  50. package/esm/ScatterChartPro/ScatterChartPro.js +788 -9
  51. package/esm/index.js +1 -1
  52. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +28 -35
  53. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  54. package/index.js +1 -1
  55. package/internals/plugins/useChartProZoom/useChartProZoom.js +28 -34
  56. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  57. package/package.json +9 -19
  58. package/esm/Heatmap/HeatmapTooltip.js +0 -288
  59. package/esm/internals/utils/releaseInfo.d.ts +0 -1
  60. package/esm/internals/utils/releaseInfo.js +0 -13
  61. package/internals/utils/releaseInfo.d.ts +0 -1
  62. package/internals/utils/releaseInfo.js +0 -21
  63. package/modern/BarChartPro/BarChartPro.d.ts +0 -18
  64. package/modern/BarChartPro/BarChartPro.js +0 -404
  65. package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
  66. package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
  67. package/modern/BarChartPro/index.d.ts +0 -1
  68. package/modern/BarChartPro/index.js +0 -1
  69. package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
  70. package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
  71. package/modern/ChartContainerPro/index.d.ts +0 -2
  72. package/modern/ChartContainerPro/index.js +0 -2
  73. package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
  74. package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
  75. package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
  76. package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
  77. package/modern/ChartDataProviderPro/index.d.ts +0 -2
  78. package/modern/ChartDataProviderPro/index.js +0 -2
  79. package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
  80. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
  81. package/modern/FunnelChart/FunnelChart.d.ts +0 -37
  82. package/modern/FunnelChart/FunnelChart.js +0 -212
  83. package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
  84. package/modern/FunnelChart/FunnelPlot.js +0 -184
  85. package/modern/FunnelChart/FunnelSection.d.ts +0 -15
  86. package/modern/FunnelChart/FunnelSection.js +0 -56
  87. package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
  88. package/modern/FunnelChart/categoryAxis.types.js +0 -1
  89. package/modern/FunnelChart/funnel.types.d.ts +0 -124
  90. package/modern/FunnelChart/funnel.types.js +0 -1
  91. package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
  92. package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
  93. package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
  94. package/modern/FunnelChart/funnelSectionClasses.js +0 -20
  95. package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
  96. package/modern/FunnelChart/funnelSlots.types.js +0 -1
  97. package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
  98. package/modern/FunnelChart/funnelStepCurve.js +0 -67
  99. package/modern/FunnelChart/index.d.ts +0 -7
  100. package/modern/FunnelChart/index.js +0 -5
  101. package/modern/FunnelChart/labelUtils.d.ts +0 -42
  102. package/modern/FunnelChart/labelUtils.js +0 -166
  103. package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
  104. package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
  105. package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
  106. package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
  107. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  108. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
  109. package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
  110. package/modern/FunnelChart/seriesConfig/index.js +0 -15
  111. package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
  112. package/modern/FunnelChart/seriesConfig/legend.js +0 -25
  113. package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
  114. package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
  115. package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
  116. package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
  117. package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
  118. package/modern/FunnelChart/useFunnelChartProps.js +0 -161
  119. package/modern/Heatmap/Heatmap.d.ts +0 -57
  120. package/modern/Heatmap/Heatmap.js +0 -387
  121. package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
  122. package/modern/Heatmap/Heatmap.plugins.js +0 -2
  123. package/modern/Heatmap/HeatmapItem.d.ts +0 -49
  124. package/modern/Heatmap/HeatmapItem.js +0 -106
  125. package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
  126. package/modern/Heatmap/HeatmapPlot.js +0 -59
  127. package/modern/Heatmap/HeatmapTooltip.d.ts +0 -16
  128. package/modern/Heatmap/heatmapClasses.d.ts +0 -11
  129. package/modern/Heatmap/heatmapClasses.js +0 -14
  130. package/modern/Heatmap/index.d.ts +0 -4
  131. package/modern/Heatmap/index.js +0 -4
  132. package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
  133. package/modern/Heatmap/seriesConfig/extremums.js +0 -8
  134. package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
  135. package/modern/Heatmap/seriesConfig/getColor.js +0 -15
  136. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  137. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
  138. package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
  139. package/modern/Heatmap/seriesConfig/index.js +0 -14
  140. package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
  141. package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
  142. package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
  143. package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
  144. package/modern/LineChartPro/LineChartPro.d.ts +0 -17
  145. package/modern/LineChartPro/LineChartPro.js +0 -401
  146. package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
  147. package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
  148. package/modern/LineChartPro/index.d.ts +0 -1
  149. package/modern/LineChartPro/index.js +0 -1
  150. package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
  151. package/modern/ScatterChartPro/ScatterChartPro.js +0 -395
  152. package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
  153. package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
  154. package/modern/ScatterChartPro/index.d.ts +0 -1
  155. package/modern/ScatterChartPro/index.js +0 -1
  156. package/modern/hooks/index.d.ts +0 -2
  157. package/modern/hooks/index.js +0 -2
  158. package/modern/hooks/useFunnelSeries.d.ts +0 -33
  159. package/modern/hooks/useFunnelSeries.js +0 -42
  160. package/modern/hooks/useHeatmapSeries.d.ts +0 -33
  161. package/modern/hooks/useHeatmapSeries.js +0 -42
  162. package/modern/hooks/zoom/index.d.ts +0 -1
  163. package/modern/hooks/zoom/index.js +0 -1
  164. package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
  165. package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
  166. package/modern/index.d.ts +0 -34
  167. package/modern/index.js +0 -45
  168. package/modern/internals/plugins/allPlugins.d.ts +0 -8
  169. package/modern/internals/plugins/allPlugins.js +0 -6
  170. package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
  171. package/modern/internals/plugins/useChartProZoom/index.js +0 -3
  172. package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
  173. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
  174. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
  175. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
  176. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
  177. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
  178. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
  179. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
  180. package/modern/internals/utils/releaseInfo.d.ts +0 -1
  181. package/modern/internals/utils/releaseInfo.js +0 -13
  182. package/modern/models/index.d.ts +0 -2
  183. package/modern/models/index.js +0 -2
  184. package/modern/models/seriesType/heatmap.d.ts +0 -28
  185. package/modern/models/seriesType/heatmap.js +0 -1
  186. package/modern/models/seriesType/index.d.ts +0 -1
  187. package/modern/models/seriesType/index.js +0 -1
  188. package/modern/package.json +0 -1
  189. package/modern/themeAugmentation/components.d.ts +0 -23
  190. package/modern/themeAugmentation/index.d.ts +0 -4
  191. package/modern/themeAugmentation/index.js +0 -0
  192. package/modern/themeAugmentation/overrides.d.ts +0 -11
  193. package/modern/themeAugmentation/props.d.ts +0 -20
  194. package/modern/typeOverloads/index.d.ts +0 -1
  195. package/modern/typeOverloads/index.js +0 -1
  196. package/modern/typeOverloads/modules.d.ts +0 -33
  197. package/modern/typeOverloads/modules.js +0 -1
  198. package/tsconfig.build.tsbuildinfo +0 -1
  199. /package/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
  200. /package/esm/Heatmap/{HeatmapTooltip.d.ts → HeatmapTooltip/HeatmapTooltip.d.ts} +0 -0
package/modern/index.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * @mui/x-charts-pro v8.0.0-beta.2
3
- *
4
- * @license MUI X Commercial
5
- * This source code is licensed under the commercial license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import "./typeOverloads/modules.js";
9
-
10
- // exports from MIT package
11
- export * from '@mui/x-charts/constants';
12
- export * from '@mui/x-charts/context';
13
- export * from '@mui/x-charts/hooks';
14
- export * from '@mui/x-charts/colorPalettes';
15
- export * from '@mui/x-charts/models';
16
- export * from '@mui/x-charts/ChartsClipPath';
17
- export * from '@mui/x-charts/ChartsReferenceLine';
18
- export * from '@mui/x-charts/ChartsAxis';
19
- export * from '@mui/x-charts/ChartsXAxis';
20
- export * from '@mui/x-charts/ChartsYAxis';
21
- export * from '@mui/x-charts/ChartsGrid';
22
- export * from '@mui/x-charts/ChartsText';
23
- export * from '@mui/x-charts/ChartsTooltip';
24
- export * from '@mui/x-charts/ChartsLegend';
25
- export * from '@mui/x-charts/ChartsAxisHighlight';
26
- export * from '@mui/x-charts/BarChart';
27
- export * from '@mui/x-charts/LineChart';
28
- export * from '@mui/x-charts/PieChart';
29
- export * from '@mui/x-charts/ScatterChart';
30
- export * from '@mui/x-charts/SparkLineChart';
31
- export * from '@mui/x-charts/Gauge';
32
- export * from '@mui/x-charts/RadarChart';
33
- export * from '@mui/x-charts/ChartsSurface';
34
- export * from '@mui/x-charts/ChartDataProvider';
35
- export * from '@mui/x-charts/ChartsLabel';
36
-
37
- // Pro components
38
- export * from "./hooks/index.js";
39
- export * from "./Heatmap/index.js";
40
- export * from "./ChartContainerPro/index.js";
41
- export * from "./ChartDataProviderPro/index.js";
42
- export * from "./ScatterChartPro/index.js";
43
- export * from "./BarChartPro/index.js";
44
- export * from "./LineChartPro/index.js";
45
- export * from "./FunnelChart/index.js";
@@ -1,8 +0,0 @@
1
- import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
2
- 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 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];
7
- 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>>)[];
@@ -1,6 +0,0 @@
1
- // This file should be removed after creating all plugins in favor of a file per chart type.
2
-
3
- import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis } from '@mui/x-charts/internals';
4
- import { useChartProZoom } from "./useChartProZoom/index.js";
5
- export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis, useChartInteraction, useChartHighlight, useChartProZoom];
6
- export const DEFAULT_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
@@ -1,3 +0,0 @@
1
- export * from "./useChartProZoom.selectors.js";
2
- export * from "./useChartProZoom.js";
3
- export * from "./useChartProZoom.types.js";
@@ -1,3 +0,0 @@
1
- export * from "./useChartProZoom.selectors.js";
2
- export * from "./useChartProZoom.js";
3
- export * from "./useChartProZoom.types.js";
@@ -1,3 +0,0 @@
1
- import { ChartPlugin } from '@mui/x-charts/internals';
2
- import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
- export declare const useChartProZoom: ChartPlugin<UseChartProZoomSignature>;
@@ -1,350 +0,0 @@
1
- 'use client';
2
-
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import * as React from 'react';
5
- import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
6
- import { useSelector, getSVGPoint, selectorChartDrawingArea, createZoomLookup, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
7
- import { getDiff, getHorizontalCenterRatio, getPinchScaleRatio, getVerticalCenterRatio, getWheelScaleRatio, isSpanValid, preventDefault, zoomAtPoint } from "./useChartProZoom.utils.js";
8
-
9
- // It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
10
- function initializeZoomData(options) {
11
- return Object.values(options).map(({
12
- axisId,
13
- minStart: start,
14
- maxEnd: end
15
- }) => ({
16
- axisId,
17
- start,
18
- end
19
- }));
20
- }
21
- export const useChartProZoom = ({
22
- store,
23
- instance,
24
- svgRef,
25
- params
26
- }) => {
27
- const {
28
- zoomData: paramsZoomData,
29
- onZoomChange
30
- } = params;
31
- const drawingArea = useSelector(store, selectorChartDrawingArea);
32
- const optionsLookup = useSelector(store, selectorChartZoomOptionsLookup);
33
- const isZoomEnabled = Object.keys(optionsLookup).length > 0;
34
-
35
- // Manage controlled state
36
-
37
- useEnhancedEffect(() => {
38
- if (paramsZoomData === undefined) {
39
- return undefined;
40
- }
41
- store.update(prevState => {
42
- if (process.env.NODE_ENV !== 'production' && !prevState.zoom.isControlled) {
43
- console.error([`MUI X: A chart component is changing the \`zoomData\` from uncontrolled to controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', 'Decide between using a controlled or uncontrolled for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
44
- }
45
- return _extends({}, prevState, {
46
- zoom: _extends({}, prevState.zoom, {
47
- isInteracting: true,
48
- zoomData: paramsZoomData
49
- })
50
- });
51
- });
52
- const timeout = setTimeout(() => {
53
- store.update(prevState => {
54
- return _extends({}, prevState, {
55
- zoom: _extends({}, prevState.zoom, {
56
- isInteracting: false
57
- })
58
- });
59
- });
60
- }, 166);
61
- return () => {
62
- clearTimeout(timeout);
63
- };
64
- }, [store, paramsZoomData]);
65
-
66
- // Add instance methods
67
- const setIsInteracting = React.useCallback(isInteracting => {
68
- store.update(prev => _extends({}, prev, {
69
- zoom: _extends({}, prev.zoom, {
70
- isInteracting
71
- })
72
- }));
73
- }, [store]);
74
- const setZoomDataCallback = React.useCallback(zoomData => {
75
- store.update(prevState => {
76
- const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
77
- onZoomChange?.(newZoomData);
78
- if (prevState.zoom.isControlled) {
79
- return prevState;
80
- }
81
- return _extends({}, prevState, {
82
- zoom: _extends({}, prevState.zoom, {
83
- zoomData: newZoomData
84
- })
85
- });
86
- });
87
- }, [onZoomChange, store]);
88
-
89
- // Add events
90
- const panningEventCacheRef = React.useRef([]);
91
- const zoomEventCacheRef = React.useRef([]);
92
- const eventPrevDiff = React.useRef(0);
93
- const interactionTimeoutRef = React.useRef(undefined);
94
-
95
- // Add event for chart panning
96
- const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
97
- const isDraggingRef = React.useRef(false);
98
- const touchStartRef = React.useRef(null);
99
- React.useEffect(() => {
100
- const element = svgRef.current;
101
- if (element === null || !isPanEnabled) {
102
- return () => {};
103
- }
104
- const handlePan = event => {
105
- if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
106
- return;
107
- }
108
- if (touchStartRef.current == null) {
109
- return;
110
- }
111
- const point = getSVGPoint(element, event);
112
- const movementX = point.x - touchStartRef.current.x;
113
- const movementY = (point.y - touchStartRef.current.y) * -1;
114
- const newZoomData = touchStartRef.current.zoomData.map(zoom => {
115
- const options = optionsLookup[zoom.axisId];
116
- if (!options || !options.panning) {
117
- return zoom;
118
- }
119
- const min = zoom.start;
120
- const max = zoom.end;
121
- const span = max - min;
122
- const MIN_PERCENT = options.minStart;
123
- const MAX_PERCENT = options.maxEnd;
124
- const movement = options.axisDirection === 'x' ? movementX : movementY;
125
- const dimension = options.axisDirection === 'x' ? drawingArea.width : drawingArea.height;
126
- let newMinPercent = min - movement / dimension * span;
127
- let newMaxPercent = max - movement / dimension * span;
128
- if (newMinPercent < MIN_PERCENT) {
129
- newMinPercent = MIN_PERCENT;
130
- newMaxPercent = newMinPercent + span;
131
- }
132
- if (newMaxPercent > MAX_PERCENT) {
133
- newMaxPercent = MAX_PERCENT;
134
- newMinPercent = newMaxPercent - span;
135
- }
136
- if (newMinPercent < MIN_PERCENT || newMaxPercent > MAX_PERCENT || span < options.minSpan || span > options.maxSpan) {
137
- return zoom;
138
- }
139
- return _extends({}, zoom, {
140
- start: newMinPercent,
141
- end: newMaxPercent
142
- });
143
- });
144
- setZoomDataCallback(newZoomData);
145
- };
146
- const handleDown = event => {
147
- panningEventCacheRef.current.push(event);
148
- const point = getSVGPoint(element, event);
149
- if (!instance.isPointInside(point)) {
150
- return;
151
- }
152
- // If there is only one pointer, prevent selecting text
153
- if (panningEventCacheRef.current.length === 1) {
154
- event.preventDefault();
155
- }
156
- isDraggingRef.current = true;
157
- setIsInteracting(true);
158
- touchStartRef.current = {
159
- x: point.x,
160
- y: point.y,
161
- zoomData: store.getSnapshot().zoom.zoomData
162
- };
163
- };
164
- const handleUp = event => {
165
- panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
166
- setIsInteracting(false);
167
- isDraggingRef.current = false;
168
- touchStartRef.current = null;
169
- };
170
- element.addEventListener('pointerdown', handleDown);
171
- document.addEventListener('pointermove', handlePan);
172
- document.addEventListener('pointerup', handleUp);
173
- document.addEventListener('pointercancel', handleUp);
174
- document.addEventListener('pointerleave', handleUp);
175
- return () => {
176
- element.removeEventListener('pointerdown', handleDown);
177
- document.removeEventListener('pointermove', handlePan);
178
- document.removeEventListener('pointerup', handleUp);
179
- document.removeEventListener('pointercancel', handleUp);
180
- document.removeEventListener('pointerleave', handleUp);
181
- };
182
- }, [instance, svgRef, isDraggingRef, setIsInteracting, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
183
-
184
- // Add event for chart zoom in/out
185
- React.useEffect(() => {
186
- const element = svgRef.current;
187
- if (element === null || !isZoomEnabled) {
188
- return () => {};
189
- }
190
- const wheelHandler = event => {
191
- if (element === null) {
192
- return;
193
- }
194
- const point = getSVGPoint(element, event);
195
- if (!instance.isPointInside(point)) {
196
- return;
197
- }
198
- event.preventDefault();
199
- if (interactionTimeoutRef.current) {
200
- clearTimeout(interactionTimeoutRef.current);
201
- }
202
- setIsInteracting(true);
203
- // Debounce transition to `isInteractive=false`.
204
- // Useful because wheel events don't have an "end" event.
205
- interactionTimeoutRef.current = window.setTimeout(() => {
206
- setIsInteracting(false);
207
- }, 166);
208
- setZoomDataCallback(prevZoomData => {
209
- return prevZoomData.map(zoom => {
210
- const option = optionsLookup[zoom.axisId];
211
- if (!option) {
212
- return zoom;
213
- }
214
- const centerRatio = option.axisDirection === 'x' ? getHorizontalCenterRatio(point, drawingArea) : getVerticalCenterRatio(point, drawingArea);
215
- const {
216
- scaleRatio,
217
- isZoomIn
218
- } = getWheelScaleRatio(event, option.step);
219
- const [newMinRange, newMaxRange] = zoomAtPoint(centerRatio, scaleRatio, zoom, option);
220
- if (!isSpanValid(newMinRange, newMaxRange, isZoomIn, option)) {
221
- return zoom;
222
- }
223
- return {
224
- axisId: zoom.axisId,
225
- start: newMinRange,
226
- end: newMaxRange
227
- };
228
- });
229
- });
230
- };
231
- function pointerDownHandler(event) {
232
- zoomEventCacheRef.current.push(event);
233
- setIsInteracting(true);
234
- }
235
- function pointerMoveHandler(event) {
236
- if (element === null) {
237
- return;
238
- }
239
- const index = zoomEventCacheRef.current.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
240
- zoomEventCacheRef.current[index] = event;
241
-
242
- // Not a pinch gesture
243
- if (zoomEventCacheRef.current.length !== 2) {
244
- return;
245
- }
246
- const firstEvent = zoomEventCacheRef.current[0];
247
- const curDiff = getDiff(zoomEventCacheRef.current);
248
- setZoomDataCallback(prevZoomData => {
249
- const newZoomData = prevZoomData.map(zoom => {
250
- const option = optionsLookup[zoom.axisId];
251
- if (!option) {
252
- return zoom;
253
- }
254
- const {
255
- scaleRatio,
256
- isZoomIn
257
- } = getPinchScaleRatio(curDiff, eventPrevDiff.current, option.step);
258
-
259
- // If the scale ratio is 0, it means the pinch gesture is not valid.
260
- if (scaleRatio === 0) {
261
- return zoom;
262
- }
263
- const point = getSVGPoint(element, firstEvent);
264
- const centerRatio = option.axisDirection === 'x' ? getHorizontalCenterRatio(point, drawingArea) : getVerticalCenterRatio(point, drawingArea);
265
- const [newMinRange, newMaxRange] = zoomAtPoint(centerRatio, scaleRatio, zoom, option);
266
- if (!isSpanValid(newMinRange, newMaxRange, isZoomIn, option)) {
267
- return zoom;
268
- }
269
- return {
270
- axisId: zoom.axisId,
271
- start: newMinRange,
272
- end: newMaxRange
273
- };
274
- });
275
- eventPrevDiff.current = curDiff;
276
- return newZoomData;
277
- });
278
- }
279
- function pointerUpHandler(event) {
280
- zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
281
- if (zoomEventCacheRef.current.length < 2) {
282
- eventPrevDiff.current = 0;
283
- }
284
- if (event.type === 'pointerup' || event.type === 'pointercancel') {
285
- setIsInteracting(false);
286
- }
287
- }
288
- element.addEventListener('wheel', wheelHandler);
289
- element.addEventListener('pointerdown', pointerDownHandler);
290
- element.addEventListener('pointermove', pointerMoveHandler);
291
- element.addEventListener('pointerup', pointerUpHandler);
292
- element.addEventListener('pointercancel', pointerUpHandler);
293
- element.addEventListener('pointerout', pointerUpHandler);
294
- element.addEventListener('pointerleave', pointerUpHandler);
295
-
296
- // Prevent zooming the entire page on touch devices
297
- element.addEventListener('touchstart', preventDefault);
298
- element.addEventListener('touchmove', preventDefault);
299
- return () => {
300
- element.removeEventListener('wheel', wheelHandler);
301
- element.removeEventListener('pointerdown', pointerDownHandler);
302
- element.removeEventListener('pointermove', pointerMoveHandler);
303
- element.removeEventListener('pointerup', pointerUpHandler);
304
- element.removeEventListener('pointercancel', pointerUpHandler);
305
- element.removeEventListener('pointerout', pointerUpHandler);
306
- element.removeEventListener('pointerleave', pointerUpHandler);
307
- element.removeEventListener('touchstart', preventDefault);
308
- element.removeEventListener('touchmove', preventDefault);
309
- if (interactionTimeoutRef.current) {
310
- clearTimeout(interactionTimeoutRef.current);
311
- }
312
- };
313
- }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, setIsInteracting, instance, setZoomDataCallback]);
314
- return {
315
- publicAPI: {
316
- setZoomData: setZoomDataCallback
317
- },
318
- instance: {
319
- setZoomData: setZoomDataCallback
320
- }
321
- };
322
- };
323
- useChartProZoom.params = {
324
- initialZoom: true,
325
- onZoomChange: true,
326
- zoomData: true
327
- };
328
- useChartProZoom.getDefaultizedParams = ({
329
- params
330
- }) => {
331
- return _extends({}, params);
332
- };
333
- useChartProZoom.getInitialState = params => {
334
- const {
335
- initialZoom,
336
- zoomData,
337
- defaultizedXAxis,
338
- defaultizedYAxis
339
- } = params;
340
- const optionsLookup = _extends({}, createZoomLookup('x')(defaultizedXAxis), createZoomLookup('y')(defaultizedYAxis));
341
- return {
342
- zoom: {
343
- zoomData:
344
- // eslint-disable-next-line no-nested-ternary
345
- zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : initializeZoomData(optionsLookup),
346
- isInteracting: false,
347
- isControlled: zoomData !== undefined
348
- }
349
- };
350
- };
@@ -1,203 +0,0 @@
1
- import { ChartRootSelector } from '@mui/x-charts/internals';
2
- import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
- export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
- export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
5
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
- }) => boolean) & {
7
- clearCache: () => void;
8
- resultsCount: () => number;
9
- resetResultsCount: () => void;
10
- } & {
11
- resultFunc: (resultFuncArgs_0: {
12
- isInteracting: boolean;
13
- zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
14
- isControlled: boolean;
15
- }) => boolean;
16
- memoizedResultFunc: ((resultFuncArgs_0: {
17
- isInteracting: boolean;
18
- zoomData: readonly import("@mui/x-charts/internals").ZoomData[];
19
- isControlled: boolean;
20
- }) => boolean) & {
21
- clearCache: () => void;
22
- resultsCount: () => number;
23
- resetResultsCount: () => void;
24
- };
25
- lastResult: () => boolean;
26
- dependencies: [ChartRootSelector<UseChartProZoomSignature>];
27
- recomputations: () => number;
28
- resetRecomputations: () => void;
29
- dependencyRecomputations: () => number;
30
- resetDependencyRecomputations: () => void;
31
- } & {
32
- argsMemoize: typeof import("reselect").weakMapMemoize;
33
- memoize: typeof import("reselect").weakMapMemoize;
34
- };
35
- export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
36
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
37
- }) => boolean) & {
38
- clearCache: () => void;
39
- resultsCount: () => number;
40
- resetResultsCount: () => void;
41
- } & {
42
- resultFunc: (resultFuncArgs_0: {
43
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
44
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
45
- }) => boolean;
46
- memoizedResultFunc: ((resultFuncArgs_0: {
47
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
48
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
49
- }) => boolean) & {
50
- clearCache: () => void;
51
- resultsCount: () => number;
52
- resetResultsCount: () => void;
53
- };
54
- lastResult: () => boolean;
55
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
56
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
57
- }) => {
58
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
59
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
60
- }) & {
61
- clearCache: () => void;
62
- resultsCount: () => number;
63
- resetResultsCount: () => void;
64
- } & {
65
- resultFunc: (resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
66
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
67
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
68
- };
69
- memoizedResultFunc: ((resultFuncArgs_0: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>, resultFuncArgs_1: Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) => {
70
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
71
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
72
- }) & {
73
- clearCache: () => void;
74
- resultsCount: () => number;
75
- resetResultsCount: () => void;
76
- };
77
- lastResult: () => {
78
- [x: string]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
79
- [x: number]: import("@mui/x-charts/internals").DefaultizedZoomOptions;
80
- };
81
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
82
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
83
- }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
84
- clearCache: () => void;
85
- resultsCount: () => number;
86
- resetResultsCount: () => void;
87
- } & {
88
- resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
89
- memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
90
- clearCache: () => void;
91
- resultsCount: () => number;
92
- resetResultsCount: () => void;
93
- };
94
- lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
95
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
96
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
97
- }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
98
- clearCache: () => void;
99
- resultsCount: () => number;
100
- resetResultsCount: () => void;
101
- } & {
102
- resultFunc: (resultFuncArgs_0: {
103
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
104
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
105
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
106
- memoizedResultFunc: ((resultFuncArgs_0: {
107
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
108
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
109
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
110
- clearCache: () => void;
111
- resultsCount: () => number;
112
- resetResultsCount: () => void;
113
- };
114
- lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
115
- dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
116
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
117
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
118
- } | undefined];
119
- recomputations: () => number;
120
- resetRecomputations: () => void;
121
- dependencyRecomputations: () => number;
122
- resetDependencyRecomputations: () => void;
123
- } & {
124
- memoize: typeof import("reselect").weakMapMemoize;
125
- argsMemoize: typeof import("reselect").weakMapMemoize;
126
- }];
127
- recomputations: () => number;
128
- resetRecomputations: () => void;
129
- dependencyRecomputations: () => number;
130
- resetDependencyRecomputations: () => void;
131
- } & {
132
- memoize: typeof import("reselect").weakMapMemoize;
133
- argsMemoize: typeof import("reselect").weakMapMemoize;
134
- }, ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
135
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
136
- }) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
137
- clearCache: () => void;
138
- resultsCount: () => number;
139
- resetResultsCount: () => void;
140
- } & {
141
- resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
142
- memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
143
- clearCache: () => void;
144
- resultsCount: () => number;
145
- resetResultsCount: () => void;
146
- };
147
- lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
148
- dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
149
- cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
150
- }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
151
- clearCache: () => void;
152
- resultsCount: () => number;
153
- resetResultsCount: () => void;
154
- } & {
155
- resultFunc: (resultFuncArgs_0: {
156
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
157
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
158
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
159
- memoizedResultFunc: ((resultFuncArgs_0: {
160
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
161
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
162
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
163
- clearCache: () => void;
164
- resultsCount: () => number;
165
- resetResultsCount: () => void;
166
- };
167
- lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
168
- dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
169
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
170
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
171
- } | undefined];
172
- recomputations: () => number;
173
- resetRecomputations: () => void;
174
- dependencyRecomputations: () => number;
175
- resetDependencyRecomputations: () => void;
176
- } & {
177
- memoize: typeof import("reselect").weakMapMemoize;
178
- argsMemoize: typeof import("reselect").weakMapMemoize;
179
- }];
180
- recomputations: () => number;
181
- resetRecomputations: () => void;
182
- dependencyRecomputations: () => number;
183
- resetDependencyRecomputations: () => void;
184
- } & {
185
- memoize: typeof import("reselect").weakMapMemoize;
186
- argsMemoize: typeof import("reselect").weakMapMemoize;
187
- }];
188
- recomputations: () => number;
189
- resetRecomputations: () => void;
190
- dependencyRecomputations: () => number;
191
- resetDependencyRecomputations: () => void;
192
- } & {
193
- memoize: typeof import("reselect").weakMapMemoize;
194
- argsMemoize: typeof import("reselect").weakMapMemoize;
195
- }];
196
- recomputations: () => number;
197
- resetRecomputations: () => void;
198
- dependencyRecomputations: () => number;
199
- resetDependencyRecomputations: () => void;
200
- } & {
201
- argsMemoize: typeof import("reselect").weakMapMemoize;
202
- memoize: typeof import("reselect").weakMapMemoize;
203
- };
@@ -1,4 +0,0 @@
1
- import { createSelector, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
2
- export const selectorChartZoomState = state => state.zoom;
3
- export const selectorChartZoomIsInteracting = createSelector(selectorChartZoomState, zoom => zoom.isInteracting);
4
- export const selectorChartZoomIsEnabled = createSelector(selectorChartZoomOptionsLookup, optionsLookup => Object.keys(optionsLookup).length > 0);