@mui/x-charts 8.14.0 → 8.15.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 (164) hide show
  1. package/BarChart/BarChart.js +8 -0
  2. package/BarChart/BarChart.plugins.d.ts +2 -1
  3. package/BarChart/BarChart.plugins.js +2 -1
  4. package/BarChart/useBarChartProps.js +4 -2
  5. package/BarChart/useBarPlotData.js +20 -33
  6. package/CHANGELOG.md +202 -0
  7. package/ChartContainer/ChartContainer.js +8 -0
  8. package/ChartContainer/useChartContainerProps.js +4 -2
  9. package/ChartsBrushOverlay/ChartsBrushOverlay.classes.d.ts +12 -0
  10. package/ChartsBrushOverlay/ChartsBrushOverlay.classes.js +9 -0
  11. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +6 -0
  12. package/ChartsBrushOverlay/ChartsBrushOverlay.js +102 -0
  13. package/ChartsBrushOverlay/index.d.ts +4 -0
  14. package/ChartsBrushOverlay/index.js +19 -0
  15. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  16. package/ChartsReferenceLine/ChartsXReferenceLine.js +13 -8
  17. package/ChartsReferenceLine/ChartsYReferenceLine.js +13 -8
  18. package/ChartsReferenceLine/common.d.ts +3 -1
  19. package/ChartsReferenceLine/common.js +3 -1
  20. package/ChartsTooltip/ChartsTooltipContainer.js +20 -2
  21. package/ChartsXAxis/getVisibleLabels.js +45 -25
  22. package/Gauge/Gauge.js +2 -9
  23. package/Gauge/GaugeReferenceArc.d.ts +4 -1
  24. package/Gauge/GaugeReferenceArc.js +12 -3
  25. package/Gauge/GaugeValueArc.d.ts +4 -1
  26. package/Gauge/GaugeValueArc.js +16 -8
  27. package/Gauge/GaugeValueText.js +3 -1
  28. package/LineChart/LineChart.js +8 -0
  29. package/LineChart/LineChart.plugins.d.ts +2 -1
  30. package/LineChart/LineChart.plugins.js +2 -1
  31. package/LineChart/useLineChartProps.js +4 -2
  32. package/ScatterChart/ScatterChart.js +8 -0
  33. package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  34. package/ScatterChart/ScatterChart.plugins.js +2 -1
  35. package/ScatterChart/seriesConfig/seriesProcessor.js +1 -1
  36. package/ScatterChart/useScatterChartProps.js +5 -3
  37. package/SparkLineChart/SparkLineChart.js +8 -0
  38. package/esm/BarChart/BarChart.js +8 -0
  39. package/esm/BarChart/BarChart.plugins.d.ts +2 -1
  40. package/esm/BarChart/BarChart.plugins.js +2 -1
  41. package/esm/BarChart/useBarChartProps.js +4 -2
  42. package/esm/BarChart/useBarPlotData.js +20 -33
  43. package/esm/ChartContainer/ChartContainer.js +8 -0
  44. package/esm/ChartContainer/useChartContainerProps.js +4 -2
  45. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.classes.d.ts +12 -0
  46. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.classes.js +2 -0
  47. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +6 -0
  48. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.js +95 -0
  49. package/esm/ChartsBrushOverlay/index.d.ts +4 -0
  50. package/esm/ChartsBrushOverlay/index.js +2 -0
  51. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  52. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +14 -9
  53. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +14 -9
  54. package/esm/ChartsReferenceLine/common.d.ts +3 -1
  55. package/esm/ChartsReferenceLine/common.js +2 -0
  56. package/esm/ChartsTooltip/ChartsTooltipContainer.js +20 -2
  57. package/esm/ChartsXAxis/getVisibleLabels.js +45 -25
  58. package/esm/Gauge/Gauge.js +2 -9
  59. package/esm/Gauge/GaugeReferenceArc.d.ts +4 -1
  60. package/esm/Gauge/GaugeReferenceArc.js +11 -2
  61. package/esm/Gauge/GaugeValueArc.d.ts +4 -1
  62. package/esm/Gauge/GaugeValueArc.js +16 -8
  63. package/esm/Gauge/GaugeValueText.js +3 -1
  64. package/esm/LineChart/LineChart.js +8 -0
  65. package/esm/LineChart/LineChart.plugins.d.ts +2 -1
  66. package/esm/LineChart/LineChart.plugins.js +2 -1
  67. package/esm/LineChart/useLineChartProps.js +4 -2
  68. package/esm/ScatterChart/ScatterChart.js +8 -0
  69. package/esm/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  70. package/esm/ScatterChart/ScatterChart.plugins.js +2 -1
  71. package/esm/ScatterChart/seriesConfig/seriesProcessor.js +1 -1
  72. package/esm/ScatterChart/useScatterChartProps.js +5 -3
  73. package/esm/SparkLineChart/SparkLineChart.js +8 -0
  74. package/esm/hooks/index.d.ts +2 -1
  75. package/esm/hooks/index.js +2 -1
  76. package/esm/hooks/useBrush.d.ts +18 -0
  77. package/esm/hooks/useBrush.js +16 -0
  78. package/esm/index.d.ts +2 -1
  79. package/esm/index.js +2 -1
  80. package/esm/internals/Flatbush.d.ts +63 -0
  81. package/esm/internals/Flatbush.js +468 -0
  82. package/esm/internals/domUtils.d.ts +9 -4
  83. package/esm/internals/domUtils.js +115 -52
  84. package/esm/internals/index.d.ts +1 -0
  85. package/esm/internals/index.js +1 -0
  86. package/esm/internals/plugins/allPlugins.d.ts +4 -3
  87. package/esm/internals/plugins/allPlugins.js +2 -1
  88. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +16 -10
  89. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +2 -2
  90. package/esm/internals/plugins/featurePlugins/useChartBrush/index.d.ts +3 -0
  91. package/esm/internals/plugins/featurePlugins/useChartBrush/index.js +3 -0
  92. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.d.ts +3 -0
  93. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +109 -0
  94. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +82 -0
  95. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +75 -0
  96. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.d.ts +72 -0
  97. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.js +1 -0
  98. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
  99. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
  100. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +2 -1
  101. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +8 -3
  102. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +6 -2
  103. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -6
  104. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +3 -1
  105. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +19 -0
  106. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +41 -0
  107. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
  108. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +13 -6
  109. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +4 -1
  110. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +5 -0
  111. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +33 -0
  112. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +40 -81
  113. package/esm/internals/plugins/utils/selectors.d.ts +1 -1
  114. package/esm/locales/elGR.js +97 -99
  115. package/esm/models/seriesType/scatter.d.ts +2 -0
  116. package/esm/tests/constants.js +1 -0
  117. package/esm/themeAugmentation/components.d.ts +3 -0
  118. package/esm/themeAugmentation/overrides.d.ts +2 -0
  119. package/hooks/index.d.ts +2 -1
  120. package/hooks/index.js +12 -0
  121. package/hooks/useBrush.d.ts +18 -0
  122. package/hooks/useBrush.js +21 -0
  123. package/index.d.ts +2 -1
  124. package/index.js +13 -1
  125. package/internals/Flatbush.d.ts +63 -0
  126. package/internals/Flatbush.js +477 -0
  127. package/internals/domUtils.d.ts +9 -4
  128. package/internals/domUtils.js +119 -54
  129. package/internals/index.d.ts +1 -0
  130. package/internals/index.js +12 -0
  131. package/internals/plugins/allPlugins.d.ts +4 -3
  132. package/internals/plugins/allPlugins.js +2 -1
  133. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +16 -10
  134. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +2 -2
  135. package/internals/plugins/featurePlugins/useChartBrush/index.d.ts +3 -0
  136. package/internals/plugins/featurePlugins/useChartBrush/index.js +38 -0
  137. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.d.ts +3 -0
  138. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +117 -0
  139. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +82 -0
  140. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +82 -0
  141. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.d.ts +72 -0
  142. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.types.js +5 -0
  143. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
  144. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
  145. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +2 -1
  146. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +8 -3
  147. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +6 -2
  148. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -6
  149. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +3 -1
  150. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +19 -0
  151. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +43 -1
  152. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
  153. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +13 -6
  154. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +4 -1
  155. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +5 -0
  156. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +39 -0
  157. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +39 -80
  158. package/internals/plugins/utils/selectors.d.ts +1 -1
  159. package/locales/elGR.js +97 -99
  160. package/models/seriesType/scatter.d.ts +2 -0
  161. package/package.json +5 -4
  162. package/tests/constants.js +7 -0
  163. package/themeAugmentation/components.d.ts +3 -0
  164. package/themeAugmentation/overrides.d.ts +2 -0
@@ -4,65 +4,65 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getStyleString = exports.getStringSize = exports.MEASUREMENT_SPAN_ID = void 0;
7
+ exports.batchMeasureStrings = batchMeasureStrings;
8
+ exports.clearStringMeasurementCache = clearStringMeasurementCache;
9
+ exports.getStringSize = void 0;
10
+ exports.getStyleString = getStyleString;
8
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- // DOM utils taken from
12
+ // DOM utils adapted from
10
13
  // https://github.com/recharts/recharts/blob/master/src/util/DOMUtils.ts
11
14
 
12
15
  function isSsr() {
13
16
  return typeof window === 'undefined';
14
17
  }
15
18
  const stringCache = new Map();
19
+ function clearStringMeasurementCache() {
20
+ stringCache.clear();
21
+ }
16
22
  const MAX_CACHE_NUM = 2000;
17
- const SPAN_STYLE = {
18
- position: 'absolute',
19
- top: '-20000px',
20
- left: 0,
21
- padding: 0,
22
- margin: 0,
23
- border: 'none',
24
- whiteSpace: 'pre'
25
- };
26
- const STYLE_LIST = ['minWidth', 'maxWidth', 'width', 'minHeight', 'maxHeight', 'height', 'top', 'left', 'fontSize', 'padding', 'margin', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom'];
27
- const MEASUREMENT_SPAN_ID = exports.MEASUREMENT_SPAN_ID = 'mui_measurement_span';
23
+ const PIXEL_STYLES = new Set(['minWidth', 'maxWidth', 'width', 'minHeight', 'maxHeight', 'height', 'top', 'left', 'fontSize', 'padding', 'margin', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom']);
28
24
 
29
25
  /**
30
- *
26
+ * Convert number value to pixel value for certain CSS properties
31
27
  * @param name CSS property name
32
28
  * @param value
33
29
  * @returns add 'px' for distance properties
34
30
  */
35
- function autoCompleteStyle(name, value) {
36
- if (STYLE_LIST.indexOf(name) >= 0 && value === +value) {
31
+ function convertPixelValue(name, value) {
32
+ if (PIXEL_STYLES.has(name) && value === +value) {
37
33
  return `${value}px`;
38
34
  }
39
35
  return value;
40
36
  }
41
37
 
42
38
  /**
43
- *
39
+ * Converts camelcase to dash-case
44
40
  * @param text camelcase css property
45
- * @returns css property
46
41
  */
47
- function camelToMiddleLine(text) {
48
- const strs = text.split('');
49
- const formatStrs = strs.reduce((result, entry) => {
50
- if (entry === entry.toUpperCase()) {
51
- return [...result, '-', entry.toLowerCase()];
52
- }
53
- return [...result, entry];
54
- }, []);
55
- return formatStrs.join('');
42
+ const AZ = /([A-Z])/g;
43
+ function camelCaseToDashCase(text) {
44
+ return String(text).replace(AZ, match => `-${match.toLowerCase()}`);
56
45
  }
57
46
 
58
47
  /**
59
- *
48
+ * Converts a style object into a string to be used as a cache key
60
49
  * @param style React style object
61
50
  * @returns CSS styling string
62
51
  */
63
- const getStyleString = style => Object.keys(style).sort().reduce((result, s) => `${result}${camelToMiddleLine(s)}:${autoCompleteStyle(s, style[s])};`, '');
64
- exports.getStyleString = getStyleString;
65
- let domCleanTimeout;
52
+ function getStyleString(style) {
53
+ let result = '';
54
+ for (const key in style) {
55
+ if (Object.hasOwn(style, key)) {
56
+ const k = key;
57
+ const value = style[k];
58
+ if (value === undefined) {
59
+ continue;
60
+ }
61
+ result += `${camelCaseToDashCase(k)}:${convertPixelValue(k, value)};`;
62
+ }
63
+ }
64
+ return result;
65
+ }
66
66
 
67
67
  /**
68
68
  *
@@ -77,7 +77,7 @@ const getStringSize = (text, style = {}) => {
77
77
  height: 0
78
78
  };
79
79
  }
80
- const str = `${text}`;
80
+ const str = String(text);
81
81
  const styleString = getStyleString(style);
82
82
  const cacheKey = `${str}-${styleString}`;
83
83
  const size = stringCache.get(cacheKey);
@@ -85,22 +85,18 @@ const getStringSize = (text, style = {}) => {
85
85
  return size;
86
86
  }
87
87
  try {
88
- let measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
89
- if (measurementSpan === null) {
90
- measurementSpan = document.createElement('span');
91
- measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
92
- measurementSpan.setAttribute('aria-hidden', 'true');
93
- document.body.appendChild(measurementSpan);
94
- }
88
+ const measurementSpanContainer = getMeasurementContainer();
89
+ const measurementElem = document.createElementNS('http://www.w3.org/2000/svg', 'text');
90
+
95
91
  // Need to use CSS Object Model (CSSOM) to be able to comply with Content Security Policy (CSP)
96
92
  // https://en.wikipedia.org/wiki/Content_Security_Policy
97
- const measurementSpanStyle = (0, _extends2.default)({}, SPAN_STYLE, style);
98
- Object.keys(measurementSpanStyle).map(styleKey => {
99
- measurementSpan.style[camelToMiddleLine(styleKey)] = autoCompleteStyle(styleKey, measurementSpanStyle[styleKey]);
93
+ Object.keys(style).map(styleKey => {
94
+ measurementElem.style[camelCaseToDashCase(styleKey)] = convertPixelValue(styleKey, style[styleKey]);
100
95
  return styleKey;
101
96
  });
102
- measurementSpan.textContent = str;
103
- const rect = measurementSpan.getBoundingClientRect();
97
+ measurementElem.textContent = str;
98
+ measurementSpanContainer.replaceChildren(measurementElem);
99
+ const rect = measurementElem.getBoundingClientRect();
104
100
  const result = {
105
101
  width: rect.width,
106
102
  height: rect.height
@@ -111,15 +107,7 @@ const getStringSize = (text, style = {}) => {
111
107
  }
112
108
  if (process.env.NODE_ENV === 'test') {
113
109
  // In test environment, we clean the measurement span immediately
114
- measurementSpan.textContent = '';
115
- } else {
116
- if (domCleanTimeout) {
117
- clearTimeout(domCleanTimeout);
118
- }
119
- domCleanTimeout = setTimeout(() => {
120
- // Limit node cleaning to once per render cycle
121
- measurementSpan.textContent = '';
122
- }, 0);
110
+ measurementSpanContainer.replaceChildren();
123
111
  }
124
112
  return result;
125
113
  } catch {
@@ -129,4 +117,81 @@ const getStringSize = (text, style = {}) => {
129
117
  };
130
118
  }
131
119
  };
132
- exports.getStringSize = getStringSize;
120
+ exports.getStringSize = getStringSize;
121
+ function batchMeasureStrings(texts, style = {}) {
122
+ if (isSsr()) {
123
+ return new Map(Array.from(texts).map(text => [text, {
124
+ width: 0,
125
+ height: 0
126
+ }]));
127
+ }
128
+ const sizeMap = new Map();
129
+ const textToMeasure = [];
130
+ const styleString = getStyleString(style);
131
+ for (const text of texts) {
132
+ const cacheKey = `${text}-${styleString}`;
133
+ const size = stringCache.get(cacheKey);
134
+ if (size) {
135
+ sizeMap.set(text, size);
136
+ } else {
137
+ textToMeasure.push(text);
138
+ }
139
+ }
140
+ const measurementContainer = getMeasurementContainer();
141
+ // Need to use CSS Object Model (CSSOM) to be able to comply with Content Security Policy (CSP)
142
+ // https://en.wikipedia.org/wiki/Content_Security_Policy
143
+ const measurementSpanStyle = (0, _extends2.default)({}, style);
144
+ Object.keys(measurementSpanStyle).map(styleKey => {
145
+ measurementContainer.style[camelCaseToDashCase(styleKey)] = convertPixelValue(styleKey, measurementSpanStyle[styleKey]);
146
+ return styleKey;
147
+ });
148
+ const measurementElems = [];
149
+ for (const string of textToMeasure) {
150
+ const measurementElem = document.createElementNS('http://www.w3.org/2000/svg', 'text');
151
+ measurementElem.textContent = `${string}`;
152
+ measurementElems.push(measurementElem);
153
+ }
154
+ measurementContainer.replaceChildren(...measurementElems);
155
+ for (let i = 0; i < textToMeasure.length; i += 1) {
156
+ const text = textToMeasure[i];
157
+ const measurementSpan = measurementContainer.children[i];
158
+ const rect = measurementSpan.getBoundingClientRect();
159
+ const result = {
160
+ width: rect.width,
161
+ height: rect.height
162
+ };
163
+ const cacheKey = `${text}-${styleString}`;
164
+ stringCache.set(cacheKey, result);
165
+ sizeMap.set(text, result);
166
+ }
167
+ if (stringCache.size + 1 > MAX_CACHE_NUM) {
168
+ stringCache.clear();
169
+ }
170
+ if (process.env.NODE_ENV === 'test') {
171
+ // In test environment, we clean the measurement span immediately
172
+ measurementContainer.replaceChildren();
173
+ }
174
+ return sizeMap;
175
+ }
176
+ let measurementContainer = null;
177
+
178
+ /**
179
+ * Get (or create) a hidden span element to measure text size.
180
+ */
181
+ function getMeasurementContainer() {
182
+ if (measurementContainer === null) {
183
+ measurementContainer = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
184
+ measurementContainer.setAttribute('aria-hidden', 'true');
185
+ measurementContainer.style.position = 'absolute';
186
+ measurementContainer.style.top = '-20000px';
187
+ measurementContainer.style.left = '0';
188
+ measurementContainer.style.padding = '0';
189
+ measurementContainer.style.margin = '0';
190
+ measurementContainer.style.border = 'none';
191
+ measurementContainer.style.pointerEvents = 'none';
192
+ measurementContainer.style.visibility = 'hidden';
193
+ measurementContainer.style.contain = 'strict';
194
+ document.body.appendChild(measurementContainer);
195
+ }
196
+ return measurementContainer;
197
+ }
@@ -27,6 +27,7 @@ export * from "./plugins/featurePlugins/useChartInteraction/index.js";
27
27
  export * from "./plugins/featurePlugins/useChartHighlight/index.js";
28
28
  export * from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
29
29
  export * from "./plugins/featurePlugins/useChartClosestPoint/index.js";
30
+ export * from "./plugins/featurePlugins/useChartBrush/index.js";
30
31
  export * from "./plugins/utils/selectors.js";
31
32
  export { getAxisTriggerTooltip as getCartesianAxisTriggerTooltip } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js";
32
33
  export { getAxisIndex as getCartesianAxisIndex } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js";
@@ -326,6 +326,18 @@ Object.keys(_useChartClosestPoint).forEach(function (key) {
326
326
  }
327
327
  });
328
328
  });
329
+ var _useChartBrush = require("./plugins/featurePlugins/useChartBrush");
330
+ Object.keys(_useChartBrush).forEach(function (key) {
331
+ if (key === "default" || key === "__esModule") return;
332
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
333
+ if (key in exports && exports[key] === _useChartBrush[key]) return;
334
+ Object.defineProperty(exports, key, {
335
+ enumerable: true,
336
+ get: function () {
337
+ return _useChartBrush[key];
338
+ }
339
+ });
340
+ });
329
341
  var _selectors = require("./plugins/utils/selectors");
330
342
  Object.keys(_selectors).forEach(function (key) {
331
343
  if (key === "default" || key === "__esModule") return;
@@ -6,6 +6,7 @@ import { UseChartKeyboardNavigationSignature } from "./featurePlugins/useChartKe
6
6
  import { UseChartPolarAxisSignature } from "./featurePlugins/useChartPolarAxis/index.js";
7
7
  import { UseChartClosestPointSignature } from "./featurePlugins/useChartClosestPoint/index.js";
8
8
  import { UseChartZAxisSignature } from "./featurePlugins/useChartZAxis/index.js";
9
- export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
10
- export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
11
- export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>];
9
+ import { UseChartBrushSignature } from "./featurePlugins/useChartBrush/index.js";
10
+ export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
11
+ export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<TSeries>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
12
+ export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartBrushSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>];
@@ -10,6 +10,7 @@ var _useChartInteraction = require("./featurePlugins/useChartInteraction");
10
10
  var _useChartKeyboardNavigation = require("./featurePlugins/useChartKeyboardNavigation");
11
11
  var _useChartClosestPoint = require("./featurePlugins/useChartClosestPoint");
12
12
  var _useChartZAxis = require("./featurePlugins/useChartZAxis");
13
+ var _useChartBrush = require("./featurePlugins/useChartBrush");
13
14
  // This file should be removed after creating all plugins in favor of a file per chart type.
14
15
 
15
- const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
16
+ const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
@@ -24,14 +24,26 @@ const useChartInteractionListener = ({
24
24
  name: 'pan',
25
25
  threshold: 0,
26
26
  maxPointers: 1
27
+ }), new _core.MoveGesture({
28
+ name: 'move',
29
+ preventIf: ['pan', 'zoomPinch', 'zoomPan']
30
+ }), new _core.TapGesture({
31
+ name: 'tap',
32
+ preventIf: ['pan', 'zoomPinch', 'zoomPan']
33
+ }), new _core.PressGesture({
34
+ name: 'quickPress',
35
+ duration: 50
27
36
  }), new _core.PanGesture({
37
+ name: 'brush',
38
+ threshold: 0,
39
+ maxPointers: 1
40
+ }),
41
+ // Zoom gestures
42
+ new _core.PanGesture({
28
43
  name: 'zoomPan',
29
44
  threshold: 0,
30
45
  maxPointers: 1,
31
46
  preventIf: ['zoomTapAndDrag', 'zoomPressAndDrag']
32
- }), new _core.MoveGesture({
33
- name: 'move',
34
- preventIf: ['pan', 'zoomPinch', 'zoomPan'] // Prevent move gesture when pan is active
35
47
  }), new _core.PinchGesture({
36
48
  name: 'zoomPinch',
37
49
  threshold: 5,
@@ -40,12 +52,6 @@ const useChartInteractionListener = ({
40
52
  name: 'zoomTurnWheel',
41
53
  sensitivity: 0.01,
42
54
  initialDelta: 1
43
- }), new _core.TapGesture({
44
- name: 'tap',
45
- preventIf: ['pan', 'zoomPan', 'zoomPinch']
46
- }), new _core.PressGesture({
47
- name: 'quickPress',
48
- duration: 50
49
55
  }), new _core.TapAndDragGesture({
50
56
  name: 'zoomTapAndDrag',
51
57
  dragThreshold: 10
@@ -62,7 +68,7 @@ const useChartInteractionListener = ({
62
68
  if (!svg || !gestureManager) {
63
69
  return undefined;
64
70
  }
65
- gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag', 'zoomPressAndDrag'], svg);
71
+ gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag', 'zoomPressAndDrag', 'brush'], svg);
66
72
  return () => {
67
73
  // Cleanup gesture manager
68
74
  gestureManager.unregisterAllGestures(svg);
@@ -1,11 +1,11 @@
1
1
  import { MoveEvent, PanEvent, PanGestureOptions, PinchEvent, PinchGestureOptions, PressEvent, TapEvent, TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
2
2
  import { ChartPluginSignature } from "../../models/index.js";
3
- export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'zoomTurnWheel' | 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd' | 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd' | 'move' | 'moveStart' | 'moveEnd' | 'tap' | 'quickPress' | 'quickPressEnd';
3
+ export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'zoomTurnWheel' | 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd' | 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd' | 'move' | 'moveStart' | 'moveEnd' | 'tap' | 'quickPress' | 'quickPressEnd' | 'brush' | 'brushStart' | 'brushCancel' | 'brushEnd';
4
4
  export type InteractionListenerResult = {
5
5
  cleanup: () => void;
6
6
  };
7
7
  export type AddInteractionListener = {
8
- <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd', callback: (event: PanEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
8
+ <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'brush' | 'brushStart' | 'brushCancel' | 'brushEnd', callback: (event: PanEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
9
9
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd', callback: (event: PinchEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
10
10
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'zoomTurnWheel', callback: (event: TurnWheelEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
11
11
  <CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'move' | 'moveStart' | 'moveEnd', callback: (event: MoveEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
@@ -0,0 +1,3 @@
1
+ export * from "./useChartBrush.js";
2
+ export * from "./useChartBrush.types.js";
3
+ export * from "./useChartBrush.selectors.js";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useChartBrush = require("./useChartBrush");
7
+ Object.keys(_useChartBrush).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useChartBrush[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _useChartBrush[key];
14
+ }
15
+ });
16
+ });
17
+ var _useChartBrush2 = require("./useChartBrush.types");
18
+ Object.keys(_useChartBrush2).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _useChartBrush2[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _useChartBrush2[key];
25
+ }
26
+ });
27
+ });
28
+ var _useChartBrush3 = require("./useChartBrush.selectors");
29
+ Object.keys(_useChartBrush3).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _useChartBrush3[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _useChartBrush3[key];
36
+ }
37
+ });
38
+ });
@@ -0,0 +1,3 @@
1
+ import { ChartPlugin } from "../../models/index.js";
2
+ import { UseChartBrushSignature } from "./useChartBrush.types.js";
3
+ export declare const useChartBrush: ChartPlugin<UseChartBrushSignature>;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.useChartBrush = void 0;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
12
+ var React = _interopRequireWildcard(require("react"));
13
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
14
+ var _getSVGPoint = require("../../../getSVGPoint");
15
+ const useChartBrush = ({
16
+ store,
17
+ svgRef,
18
+ instance,
19
+ params
20
+ }) => {
21
+ (0, _useEnhancedEffect.default)(() => {
22
+ store.update(prev => {
23
+ return (0, _extends2.default)({}, prev, {
24
+ brush: (0, _extends2.default)({}, prev.brush, {
25
+ enabled: params.brushConfig.enabled,
26
+ preventTooltip: params.brushConfig.preventTooltip,
27
+ preventHighlight: params.brushConfig.preventHighlight
28
+ })
29
+ });
30
+ });
31
+ }, [store, params.brushConfig.enabled, params.brushConfig.preventTooltip, params.brushConfig.preventHighlight]);
32
+ const setBrushCoordinates = (0, _useEventCallback.default)(function setBrushCoordinates(point) {
33
+ store.update(prev => {
34
+ return (0, _extends2.default)({}, prev, {
35
+ brush: (0, _extends2.default)({}, prev.brush, {
36
+ start: prev.brush.start ?? point,
37
+ current: point
38
+ })
39
+ });
40
+ });
41
+ });
42
+ const clearBrush = (0, _useEventCallback.default)(function clearBrush() {
43
+ store.update(prev => {
44
+ return (0, _extends2.default)({}, prev, {
45
+ brush: (0, _extends2.default)({}, prev.brush, {
46
+ start: null,
47
+ current: null
48
+ })
49
+ });
50
+ });
51
+ });
52
+ React.useEffect(() => {
53
+ const element = svgRef.current;
54
+ if (element === null || !store.getSnapshot().brush.enabled) {
55
+ return () => {};
56
+ }
57
+ const handleBrushStart = event => {
58
+ if (event.detail.target?.closest('[data-charts-zoom-slider]')) {
59
+ return;
60
+ }
61
+ const point = (0, _getSVGPoint.getSVGPoint)(element, {
62
+ clientX: event.detail.initialCentroid.x,
63
+ clientY: event.detail.initialCentroid.y
64
+ });
65
+ setBrushCoordinates(point);
66
+ };
67
+ const handleBrush = event => {
68
+ const currentPoint = (0, _getSVGPoint.getSVGPoint)(element, {
69
+ clientX: event.detail.centroid.x,
70
+ clientY: event.detail.centroid.y
71
+ });
72
+ setBrushCoordinates(currentPoint);
73
+ };
74
+ const brushStartHandler = instance.addInteractionListener('brushStart', handleBrushStart);
75
+ const brushHandler = instance.addInteractionListener('brush', handleBrush);
76
+ const brushCancelHandler = instance.addInteractionListener('brushCancel', clearBrush);
77
+ const brushEndHandler = instance.addInteractionListener('brushEnd', clearBrush);
78
+ return () => {
79
+ brushStartHandler.cleanup();
80
+ brushHandler.cleanup();
81
+ brushEndHandler.cleanup();
82
+ brushCancelHandler.cleanup();
83
+ };
84
+ }, [svgRef, instance, store, clearBrush, setBrushCoordinates]);
85
+ return {
86
+ instance: {
87
+ setBrushCoordinates,
88
+ clearBrush
89
+ }
90
+ };
91
+ };
92
+ exports.useChartBrush = useChartBrush;
93
+ useChartBrush.params = {
94
+ brushConfig: true
95
+ };
96
+ useChartBrush.getDefaultizedParams = ({
97
+ params
98
+ }) => {
99
+ return (0, _extends2.default)({}, params, {
100
+ brushConfig: {
101
+ enabled: params?.brushConfig?.enabled ?? false,
102
+ preventTooltip: params?.brushConfig?.preventTooltip ?? true,
103
+ preventHighlight: params?.brushConfig?.preventHighlight ?? true
104
+ }
105
+ });
106
+ };
107
+ useChartBrush.getInitialState = params => {
108
+ return {
109
+ brush: {
110
+ enabled: params.brushConfig.enabled,
111
+ preventTooltip: params.brushConfig.preventTooltip,
112
+ preventHighlight: params.brushConfig.preventHighlight,
113
+ start: null,
114
+ current: null
115
+ }
116
+ };
117
+ };
@@ -0,0 +1,82 @@
1
+ import { type ChartOptionalRootSelector } from "../../utils/selectors.js";
2
+ import type { UseChartBrushSignature } from "./useChartBrush.types.js";
3
+ export declare const selectorBrush: ChartOptionalRootSelector<UseChartBrushSignature>;
4
+ export declare const selectorBrushStart: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
5
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
6
+ } & {
7
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
8
+ }, import("./useChartBrush.types.js").Point | null | undefined, any[]>;
9
+ export declare const selectorBrushCurrent: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
10
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
11
+ } & {
12
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
13
+ }, import("./useChartBrush.types.js").Point | null | undefined, any[]>;
14
+ export declare const selectorBrushStartX: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
15
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
16
+ } & {
17
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
18
+ }, number | null, any[]>;
19
+ export declare const selectorBrushStartY: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
20
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
21
+ } & {
22
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
23
+ }, number | null, any[]>;
24
+ export declare const selectorBrushCurrentX: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
25
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
26
+ } & {
27
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
28
+ }, number | null, any[]>;
29
+ export declare const selectorBrushCurrentY: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
30
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
31
+ } & {
32
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
33
+ }, number | null, any[]>;
34
+ export declare const selectorBrushState: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
35
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
36
+ } & {
37
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
38
+ }, {
39
+ start: {
40
+ x: number;
41
+ y: number;
42
+ };
43
+ current: {
44
+ x: number;
45
+ y: number;
46
+ };
47
+ } | null, any[]>;
48
+ export declare const selectorBrushConfigNoZoom: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
49
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
50
+ } & {
51
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
52
+ }, "x" | "y" | "xy", any[]>;
53
+ export declare const selectorBrushConfigZoom: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState> & {
54
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
55
+ } & {
56
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
57
+ }, "x" | "y" | "xy" | null, []>;
58
+ export declare const selectorBrushConfig: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
59
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
60
+ } & {
61
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
62
+ } & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState>, "x" | "y" | "xy", any[]>;
63
+ export declare const selectorIsBrushEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
64
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
65
+ } & {
66
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
67
+ }, boolean | undefined, any[]>;
68
+ export declare const selectorIsBrushSelectionActive: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
69
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
70
+ } & {
71
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
72
+ }, boolean | undefined, any[]>;
73
+ export declare const selectorBrushShouldPreventAxisHighlight: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
74
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
75
+ } & {
76
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
77
+ }, boolean | undefined, any[]>;
78
+ export declare const selectorBrushShouldPreventTooltip: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartBrush.types.js").UseChartBrushState> & {
79
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
80
+ } & {
81
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
82
+ }, boolean | undefined, any[]>;