@mui/x-charts 8.5.3 → 8.7.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 (228) hide show
  1. package/BarChart/AnimatedBarElement.js +3 -1
  2. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
  3. package/BarChart/BarLabel/BarLabelPlot.js +33 -25
  4. package/BarChart/BarPlot.js +59 -183
  5. package/BarChart/barClasses.d.ts +12 -0
  6. package/BarChart/barClasses.js +25 -0
  7. package/BarChart/index.d.ts +3 -1
  8. package/BarChart/index.js +23 -1
  9. package/BarChart/types.d.ts +5 -1
  10. package/BarChart/useBarPlotData.d.ts +8 -0
  11. package/BarChart/useBarPlotData.js +146 -0
  12. package/CHANGELOG.md +210 -0
  13. package/ChartContainer/ChartContainer.d.ts +1 -21
  14. package/ChartContainer/ChartContainer.js +0 -8
  15. package/ChartContainer/index.d.ts +8 -1
  16. package/ChartsLegend/ChartsLegend.js +1 -0
  17. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  18. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
  19. package/ChartsReferenceLine/ChartsXReferenceLine.js +48 -1
  20. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
  21. package/ChartsReferenceLine/ChartsYReferenceLine.js +48 -1
  22. package/ChartsReferenceLine/index.d.ts +3 -1
  23. package/ChartsSurface/ChartsSurface.js +2 -1
  24. package/ChartsTooltip/ChartsTooltipContainer.js +6 -3
  25. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  26. package/ChartsTooltip/utils.js +18 -29
  27. package/ChartsXAxis/ChartsXAxis.js +4 -108
  28. package/ChartsXAxis/getVisibleLabels.d.ts +14 -0
  29. package/ChartsXAxis/getVisibleLabels.js +71 -0
  30. package/ChartsXAxis/shortenLabels.d.ts +4 -0
  31. package/ChartsXAxis/shortenLabels.js +48 -0
  32. package/ChartsYAxis/ChartsYAxis.js +2 -39
  33. package/ChartsYAxis/shortenLabels.d.ts +4 -0
  34. package/ChartsYAxis/shortenLabels.js +46 -0
  35. package/LineChart/AnimatedArea.js +4 -1
  36. package/LineChart/AnimatedLine.js +4 -1
  37. package/LineChart/AreaPlot.js +5 -115
  38. package/LineChart/CircleMarkElement.js +4 -1
  39. package/LineChart/LinePlot.js +5 -99
  40. package/LineChart/MarkElement.js +4 -1
  41. package/LineChart/MarkPlot.js +1 -0
  42. package/LineChart/useAreaPlotData.d.ts +12 -0
  43. package/LineChart/useAreaPlotData.js +125 -0
  44. package/LineChart/useLinePlotData.d.ts +11 -0
  45. package/LineChart/useLinePlotData.js +108 -0
  46. package/PieChart/PieArc.js +3 -1
  47. package/PieChart/PiePlot.js +6 -0
  48. package/PieChart/index.d.ts +3 -1
  49. package/PieChart/index.js +18 -1
  50. package/PieChart/pieClasses.d.ts +12 -0
  51. package/PieChart/pieClasses.js +24 -0
  52. package/ScatterChart/Scatter.js +22 -48
  53. package/ScatterChart/useScatterPlotData.d.ts +8 -0
  54. package/ScatterChart/useScatterPlotData.js +33 -0
  55. package/Toolbar/ToolbarButton.js +2 -0
  56. package/context/ChartApi.d.ts +22 -0
  57. package/context/ChartApi.js +5 -0
  58. package/context/ChartProvider/ChartContext.js +1 -0
  59. package/context/index.d.ts +2 -1
  60. package/context/useChartApiContext.d.ts +1 -1
  61. package/esm/BarChart/AnimatedBarElement.js +3 -1
  62. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
  63. package/esm/BarChart/BarLabel/BarLabelPlot.js +33 -25
  64. package/esm/BarChart/BarPlot.js +60 -185
  65. package/esm/BarChart/barClasses.d.ts +12 -0
  66. package/esm/BarChart/barClasses.js +15 -0
  67. package/esm/BarChart/index.d.ts +3 -1
  68. package/esm/BarChart/index.js +2 -1
  69. package/esm/BarChart/types.d.ts +5 -1
  70. package/esm/BarChart/useBarPlotData.d.ts +8 -0
  71. package/esm/BarChart/useBarPlotData.js +139 -0
  72. package/esm/ChartContainer/ChartContainer.d.ts +1 -21
  73. package/esm/ChartContainer/ChartContainer.js +0 -8
  74. package/esm/ChartContainer/index.d.ts +8 -1
  75. package/esm/ChartContainer/index.js +6 -1
  76. package/esm/ChartsLegend/ChartsLegend.js +1 -0
  77. package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  78. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
  79. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +47 -0
  80. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
  81. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +47 -0
  82. package/esm/ChartsReferenceLine/index.d.ts +3 -1
  83. package/esm/ChartsReferenceLine/index.js +2 -1
  84. package/esm/ChartsSurface/ChartsSurface.js +2 -1
  85. package/esm/ChartsTooltip/ChartsTooltipContainer.js +6 -3
  86. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  87. package/esm/ChartsTooltip/utils.js +18 -29
  88. package/esm/ChartsXAxis/ChartsXAxis.js +2 -106
  89. package/esm/ChartsXAxis/getVisibleLabels.d.ts +14 -0
  90. package/esm/ChartsXAxis/getVisibleLabels.js +67 -0
  91. package/esm/ChartsXAxis/shortenLabels.d.ts +4 -0
  92. package/esm/ChartsXAxis/shortenLabels.js +42 -0
  93. package/esm/ChartsYAxis/ChartsYAxis.js +1 -38
  94. package/esm/ChartsYAxis/shortenLabels.d.ts +4 -0
  95. package/esm/ChartsYAxis/shortenLabels.js +41 -0
  96. package/esm/LineChart/AnimatedArea.js +4 -1
  97. package/esm/LineChart/AnimatedLine.js +4 -1
  98. package/esm/LineChart/AreaPlot.js +5 -115
  99. package/esm/LineChart/CircleMarkElement.js +4 -1
  100. package/esm/LineChart/LinePlot.js +5 -99
  101. package/esm/LineChart/MarkElement.js +4 -1
  102. package/esm/LineChart/MarkPlot.js +1 -0
  103. package/esm/LineChart/useAreaPlotData.d.ts +12 -0
  104. package/esm/LineChart/useAreaPlotData.js +118 -0
  105. package/esm/LineChart/useLinePlotData.d.ts +11 -0
  106. package/esm/LineChart/useLinePlotData.js +101 -0
  107. package/esm/PieChart/PieArc.js +3 -1
  108. package/esm/PieChart/PiePlot.js +6 -0
  109. package/esm/PieChart/index.d.ts +3 -1
  110. package/esm/PieChart/index.js +2 -1
  111. package/esm/PieChart/pieClasses.d.ts +12 -0
  112. package/esm/PieChart/pieClasses.js +15 -0
  113. package/esm/ScatterChart/Scatter.js +23 -49
  114. package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
  115. package/esm/ScatterChart/useScatterPlotData.js +26 -0
  116. package/esm/Toolbar/ToolbarButton.js +2 -0
  117. package/esm/context/ChartApi.d.ts +22 -0
  118. package/esm/context/ChartApi.js +1 -0
  119. package/esm/context/ChartProvider/ChartContext.js +2 -0
  120. package/esm/context/index.d.ts +2 -1
  121. package/esm/context/useChartApiContext.d.ts +1 -1
  122. package/esm/hooks/useInteractionItemProps.d.ts +14 -9
  123. package/esm/hooks/useInteractionItemProps.js +28 -28
  124. package/esm/index.d.ts +2 -1
  125. package/esm/index.js +2 -2
  126. package/esm/internals/components/NotRendered.d.ts +9 -0
  127. package/esm/internals/components/NotRendered.js +10 -0
  128. package/esm/internals/index.d.ts +6 -0
  129. package/esm/internals/index.js +6 -0
  130. package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
  131. package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
  132. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  133. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
  134. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  135. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
  136. package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +2 -0
  137. package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  138. package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
  139. package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.js +1 -0
  140. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
  141. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +77 -0
  142. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
  143. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +1 -0
  144. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  145. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  146. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
  147. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
  148. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
  149. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  150. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  151. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +52 -36
  152. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  153. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
  154. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +47 -30
  155. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  156. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  157. package/esm/internals/store/useCharts.d.ts +1 -1
  158. package/esm/locales/elGR.d.ts +19 -0
  159. package/esm/locales/elGR.js +15 -0
  160. package/esm/locales/enUS.d.ts +3 -0
  161. package/esm/locales/enUS.js +8 -2
  162. package/esm/locales/frFR.d.ts +3 -0
  163. package/esm/locales/frFR.js +7 -0
  164. package/esm/locales/index.d.ts +1 -0
  165. package/esm/locales/index.js +1 -0
  166. package/esm/locales/ptBR.d.ts +3 -0
  167. package/esm/locales/ptBR.js +7 -1
  168. package/esm/locales/ptPT.d.ts +3 -0
  169. package/esm/locales/ptPT.js +7 -1
  170. package/esm/locales/utils/chartsLocaleTextApi.d.ts +17 -0
  171. package/esm/locales/utils/getChartsLocalization.d.ts +3 -0
  172. package/esm/locales/utils/imageMimeTypes.d.ts +2 -0
  173. package/esm/locales/utils/imageMimeTypes.js +5 -0
  174. package/esm/models/slots/chartsBaseSlotProps.d.ts +4 -0
  175. package/hooks/useInteractionItemProps.d.ts +14 -9
  176. package/hooks/useInteractionItemProps.js +29 -28
  177. package/index.d.ts +2 -1
  178. package/index.js +37 -11
  179. package/internals/components/NotRendered.d.ts +9 -0
  180. package/internals/components/NotRendered.js +16 -0
  181. package/internals/index.d.ts +6 -0
  182. package/internals/index.js +56 -0
  183. package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
  184. package/internals/plugins/corePlugins/corePlugins.js +2 -1
  185. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  186. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
  187. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  188. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
  189. package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -0
  190. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  191. package/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
  192. package/internals/plugins/corePlugins/useChartInteractionListener/index.js +12 -0
  193. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
  194. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +84 -0
  195. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
  196. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +5 -0
  197. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  198. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  199. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
  200. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
  201. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
  202. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  203. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  204. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +52 -36
  205. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  206. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
  207. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +46 -30
  208. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  209. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  210. package/internals/store/useCharts.d.ts +1 -1
  211. package/locales/elGR.d.ts +19 -0
  212. package/locales/elGR.js +21 -0
  213. package/locales/enUS.d.ts +3 -0
  214. package/locales/enUS.js +8 -2
  215. package/locales/frFR.d.ts +3 -0
  216. package/locales/frFR.js +7 -0
  217. package/locales/index.d.ts +1 -0
  218. package/locales/index.js +11 -0
  219. package/locales/ptBR.d.ts +3 -0
  220. package/locales/ptBR.js +7 -1
  221. package/locales/ptPT.d.ts +3 -0
  222. package/locales/ptPT.js +7 -1
  223. package/locales/utils/chartsLocaleTextApi.d.ts +17 -0
  224. package/locales/utils/getChartsLocalization.d.ts +3 -0
  225. package/locales/utils/imageMimeTypes.d.ts +2 -0
  226. package/locales/utils/imageMimeTypes.js +11 -0
  227. package/models/slots/chartsBaseSlotProps.d.ts +4 -0
  228. package/package.json +3 -2
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.5.3
2
+ * @mui/x-charts v8.7.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -10,9 +10,19 @@
10
10
  Object.defineProperty(exports, "__esModule", {
11
11
  value: true
12
12
  });
13
+ var _exportNames = {
14
+ ChartContainer: true
15
+ };
16
+ Object.defineProperty(exports, "ChartContainer", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _ChartContainer.ChartContainer;
20
+ }
21
+ });
13
22
  var _constants = require("./constants");
14
23
  Object.keys(_constants).forEach(function (key) {
15
24
  if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
26
  if (key in exports && exports[key] === _constants[key]) return;
17
27
  Object.defineProperty(exports, key, {
18
28
  enumerable: true,
@@ -24,6 +34,7 @@ Object.keys(_constants).forEach(function (key) {
24
34
  var _context = require("./context");
25
35
  Object.keys(_context).forEach(function (key) {
26
36
  if (key === "default" || key === "__esModule") return;
37
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
27
38
  if (key in exports && exports[key] === _context[key]) return;
28
39
  Object.defineProperty(exports, key, {
29
40
  enumerable: true,
@@ -35,6 +46,7 @@ Object.keys(_context).forEach(function (key) {
35
46
  var _hooks = require("./hooks");
36
47
  Object.keys(_hooks).forEach(function (key) {
37
48
  if (key === "default" || key === "__esModule") return;
49
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
38
50
  if (key in exports && exports[key] === _hooks[key]) return;
39
51
  Object.defineProperty(exports, key, {
40
52
  enumerable: true,
@@ -46,6 +58,7 @@ Object.keys(_hooks).forEach(function (key) {
46
58
  var _colorPalettes = require("./colorPalettes");
47
59
  Object.keys(_colorPalettes).forEach(function (key) {
48
60
  if (key === "default" || key === "__esModule") return;
61
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
49
62
  if (key in exports && exports[key] === _colorPalettes[key]) return;
50
63
  Object.defineProperty(exports, key, {
51
64
  enumerable: true,
@@ -57,6 +70,7 @@ Object.keys(_colorPalettes).forEach(function (key) {
57
70
  var _models = require("./models");
58
71
  Object.keys(_models).forEach(function (key) {
59
72
  if (key === "default" || key === "__esModule") return;
73
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
60
74
  if (key in exports && exports[key] === _models[key]) return;
61
75
  Object.defineProperty(exports, key, {
62
76
  enumerable: true,
@@ -68,6 +82,7 @@ Object.keys(_models).forEach(function (key) {
68
82
  var _ChartsClipPath = require("./ChartsClipPath");
69
83
  Object.keys(_ChartsClipPath).forEach(function (key) {
70
84
  if (key === "default" || key === "__esModule") return;
85
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
71
86
  if (key in exports && exports[key] === _ChartsClipPath[key]) return;
72
87
  Object.defineProperty(exports, key, {
73
88
  enumerable: true,
@@ -79,6 +94,7 @@ Object.keys(_ChartsClipPath).forEach(function (key) {
79
94
  var _ChartsReferenceLine = require("./ChartsReferenceLine");
80
95
  Object.keys(_ChartsReferenceLine).forEach(function (key) {
81
96
  if (key === "default" || key === "__esModule") return;
97
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
82
98
  if (key in exports && exports[key] === _ChartsReferenceLine[key]) return;
83
99
  Object.defineProperty(exports, key, {
84
100
  enumerable: true,
@@ -90,6 +106,7 @@ Object.keys(_ChartsReferenceLine).forEach(function (key) {
90
106
  var _ChartsAxis = require("./ChartsAxis");
91
107
  Object.keys(_ChartsAxis).forEach(function (key) {
92
108
  if (key === "default" || key === "__esModule") return;
109
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
93
110
  if (key in exports && exports[key] === _ChartsAxis[key]) return;
94
111
  Object.defineProperty(exports, key, {
95
112
  enumerable: true,
@@ -101,6 +118,7 @@ Object.keys(_ChartsAxis).forEach(function (key) {
101
118
  var _ChartsXAxis = require("./ChartsXAxis");
102
119
  Object.keys(_ChartsXAxis).forEach(function (key) {
103
120
  if (key === "default" || key === "__esModule") return;
121
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
104
122
  if (key in exports && exports[key] === _ChartsXAxis[key]) return;
105
123
  Object.defineProperty(exports, key, {
106
124
  enumerable: true,
@@ -112,6 +130,7 @@ Object.keys(_ChartsXAxis).forEach(function (key) {
112
130
  var _ChartsYAxis = require("./ChartsYAxis");
113
131
  Object.keys(_ChartsYAxis).forEach(function (key) {
114
132
  if (key === "default" || key === "__esModule") return;
133
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
115
134
  if (key in exports && exports[key] === _ChartsYAxis[key]) return;
116
135
  Object.defineProperty(exports, key, {
117
136
  enumerable: true,
@@ -123,6 +142,7 @@ Object.keys(_ChartsYAxis).forEach(function (key) {
123
142
  var _ChartsGrid = require("./ChartsGrid");
124
143
  Object.keys(_ChartsGrid).forEach(function (key) {
125
144
  if (key === "default" || key === "__esModule") return;
145
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
126
146
  if (key in exports && exports[key] === _ChartsGrid[key]) return;
127
147
  Object.defineProperty(exports, key, {
128
148
  enumerable: true,
@@ -134,6 +154,7 @@ Object.keys(_ChartsGrid).forEach(function (key) {
134
154
  var _ChartsText = require("./ChartsText");
135
155
  Object.keys(_ChartsText).forEach(function (key) {
136
156
  if (key === "default" || key === "__esModule") return;
157
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
137
158
  if (key in exports && exports[key] === _ChartsText[key]) return;
138
159
  Object.defineProperty(exports, key, {
139
160
  enumerable: true,
@@ -145,6 +166,7 @@ Object.keys(_ChartsText).forEach(function (key) {
145
166
  var _ChartsTooltip = require("./ChartsTooltip");
146
167
  Object.keys(_ChartsTooltip).forEach(function (key) {
147
168
  if (key === "default" || key === "__esModule") return;
169
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
148
170
  if (key in exports && exports[key] === _ChartsTooltip[key]) return;
149
171
  Object.defineProperty(exports, key, {
150
172
  enumerable: true,
@@ -156,6 +178,7 @@ Object.keys(_ChartsTooltip).forEach(function (key) {
156
178
  var _ChartsLabel = require("./ChartsLabel");
157
179
  Object.keys(_ChartsLabel).forEach(function (key) {
158
180
  if (key === "default" || key === "__esModule") return;
181
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
159
182
  if (key in exports && exports[key] === _ChartsLabel[key]) return;
160
183
  Object.defineProperty(exports, key, {
161
184
  enumerable: true,
@@ -167,6 +190,7 @@ Object.keys(_ChartsLabel).forEach(function (key) {
167
190
  var _ChartsLegend = require("./ChartsLegend");
168
191
  Object.keys(_ChartsLegend).forEach(function (key) {
169
192
  if (key === "default" || key === "__esModule") return;
193
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
170
194
  if (key in exports && exports[key] === _ChartsLegend[key]) return;
171
195
  Object.defineProperty(exports, key, {
172
196
  enumerable: true,
@@ -178,6 +202,7 @@ Object.keys(_ChartsLegend).forEach(function (key) {
178
202
  var _ChartsLocalizationProvider = require("./ChartsLocalizationProvider");
179
203
  Object.keys(_ChartsLocalizationProvider).forEach(function (key) {
180
204
  if (key === "default" || key === "__esModule") return;
205
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
181
206
  if (key in exports && exports[key] === _ChartsLocalizationProvider[key]) return;
182
207
  Object.defineProperty(exports, key, {
183
208
  enumerable: true,
@@ -189,6 +214,7 @@ Object.keys(_ChartsLocalizationProvider).forEach(function (key) {
189
214
  var _ChartsAxisHighlight = require("./ChartsAxisHighlight");
190
215
  Object.keys(_ChartsAxisHighlight).forEach(function (key) {
191
216
  if (key === "default" || key === "__esModule") return;
217
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
192
218
  if (key in exports && exports[key] === _ChartsAxisHighlight[key]) return;
193
219
  Object.defineProperty(exports, key, {
194
220
  enumerable: true,
@@ -200,6 +226,7 @@ Object.keys(_ChartsAxisHighlight).forEach(function (key) {
200
226
  var _BarChart = require("./BarChart");
201
227
  Object.keys(_BarChart).forEach(function (key) {
202
228
  if (key === "default" || key === "__esModule") return;
229
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
203
230
  if (key in exports && exports[key] === _BarChart[key]) return;
204
231
  Object.defineProperty(exports, key, {
205
232
  enumerable: true,
@@ -211,6 +238,7 @@ Object.keys(_BarChart).forEach(function (key) {
211
238
  var _LineChart = require("./LineChart");
212
239
  Object.keys(_LineChart).forEach(function (key) {
213
240
  if (key === "default" || key === "__esModule") return;
241
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
214
242
  if (key in exports && exports[key] === _LineChart[key]) return;
215
243
  Object.defineProperty(exports, key, {
216
244
  enumerable: true,
@@ -222,6 +250,7 @@ Object.keys(_LineChart).forEach(function (key) {
222
250
  var _PieChart = require("./PieChart");
223
251
  Object.keys(_PieChart).forEach(function (key) {
224
252
  if (key === "default" || key === "__esModule") return;
253
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
225
254
  if (key in exports && exports[key] === _PieChart[key]) return;
226
255
  Object.defineProperty(exports, key, {
227
256
  enumerable: true,
@@ -233,6 +262,7 @@ Object.keys(_PieChart).forEach(function (key) {
233
262
  var _ScatterChart = require("./ScatterChart");
234
263
  Object.keys(_ScatterChart).forEach(function (key) {
235
264
  if (key === "default" || key === "__esModule") return;
265
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
236
266
  if (key in exports && exports[key] === _ScatterChart[key]) return;
237
267
  Object.defineProperty(exports, key, {
238
268
  enumerable: true,
@@ -244,6 +274,7 @@ Object.keys(_ScatterChart).forEach(function (key) {
244
274
  var _SparkLineChart = require("./SparkLineChart");
245
275
  Object.keys(_SparkLineChart).forEach(function (key) {
246
276
  if (key === "default" || key === "__esModule") return;
277
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
247
278
  if (key in exports && exports[key] === _SparkLineChart[key]) return;
248
279
  Object.defineProperty(exports, key, {
249
280
  enumerable: true,
@@ -255,6 +286,7 @@ Object.keys(_SparkLineChart).forEach(function (key) {
255
286
  var _Gauge = require("./Gauge");
256
287
  Object.keys(_Gauge).forEach(function (key) {
257
288
  if (key === "default" || key === "__esModule") return;
289
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
258
290
  if (key in exports && exports[key] === _Gauge[key]) return;
259
291
  Object.defineProperty(exports, key, {
260
292
  enumerable: true,
@@ -266,6 +298,7 @@ Object.keys(_Gauge).forEach(function (key) {
266
298
  var _RadarChart = require("./RadarChart");
267
299
  Object.keys(_RadarChart).forEach(function (key) {
268
300
  if (key === "default" || key === "__esModule") return;
301
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
269
302
  if (key in exports && exports[key] === _RadarChart[key]) return;
270
303
  Object.defineProperty(exports, key, {
271
304
  enumerable: true,
@@ -277,6 +310,7 @@ Object.keys(_RadarChart).forEach(function (key) {
277
310
  var _ChartsSurface = require("./ChartsSurface");
278
311
  Object.keys(_ChartsSurface).forEach(function (key) {
279
312
  if (key === "default" || key === "__esModule") return;
313
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
280
314
  if (key in exports && exports[key] === _ChartsSurface[key]) return;
281
315
  Object.defineProperty(exports, key, {
282
316
  enumerable: true,
@@ -286,19 +320,10 @@ Object.keys(_ChartsSurface).forEach(function (key) {
286
320
  });
287
321
  });
288
322
  var _ChartContainer = require("./ChartContainer");
289
- Object.keys(_ChartContainer).forEach(function (key) {
290
- if (key === "default" || key === "__esModule") return;
291
- if (key in exports && exports[key] === _ChartContainer[key]) return;
292
- Object.defineProperty(exports, key, {
293
- enumerable: true,
294
- get: function () {
295
- return _ChartContainer[key];
296
- }
297
- });
298
- });
299
323
  var _ChartDataProvider = require("./ChartDataProvider");
300
324
  Object.keys(_ChartDataProvider).forEach(function (key) {
301
325
  if (key === "default" || key === "__esModule") return;
326
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
302
327
  if (key in exports && exports[key] === _ChartDataProvider[key]) return;
303
328
  Object.defineProperty(exports, key, {
304
329
  enumerable: true,
@@ -310,6 +335,7 @@ Object.keys(_ChartDataProvider).forEach(function (key) {
310
335
  var _Toolbar = require("./Toolbar");
311
336
  Object.keys(_Toolbar).forEach(function (key) {
312
337
  if (key === "default" || key === "__esModule") return;
338
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
313
339
  if (key in exports && exports[key] === _Toolbar[key]) return;
314
340
  Object.defineProperty(exports, key, {
315
341
  enumerable: true,
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * This component is used to assert that a certain component should not be rendered.
4
+ * It is used in cases where we want to apply styles to a component that is not rendered because we use the `as` prop (introduced by `styled`) to replace the rendered component.
5
+ * We need it because we don't know the component that will be rendered at the time of writing the styles.
6
+ *
7
+ * @param _props Not used
8
+ */
9
+ export declare function NotRendered<T>(_props: T): React.ReactNode;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NotRendered = NotRendered;
7
+ /**
8
+ * This component is used to assert that a certain component should not be rendered.
9
+ * It is used in cases where we want to apply styles to a component that is not rendered because we use the `as` prop (introduced by `styled`) to replace the rendered component.
10
+ * We need it because we don't know the component that will be rendered at the time of writing the styles.
11
+ *
12
+ * @param _props Not used
13
+ */
14
+ function NotRendered(_props) {
15
+ throw new Error('Failed assertion: should not be rendered');
16
+ }
@@ -1,12 +1,17 @@
1
1
  export * from "./components/ChartsAxesGradients/index.js";
2
2
  export * from "./components/ChartsWrapper/index.js";
3
3
  export * from "../ChartsLabel/ChartsLabelMark.js";
4
+ export * from "./components/NotRendered.js";
4
5
  export { useSeries } from "../hooks/useSeries.js";
5
6
  export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
6
7
  export { useDrawingArea } from "../hooks/useDrawingArea.js";
7
8
  export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
9
+ export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
8
10
  export { useLineChartProps } from "../LineChart/useLineChartProps.js";
11
+ export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
12
+ export { useLinePlotData } from "../LineChart/useLinePlotData.js";
9
13
  export { useBarChartProps } from "../BarChart/useBarChartProps.js";
14
+ export { useBarPlotData } from "../BarChart/useBarPlotData.js";
10
15
  export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
11
16
  export * from "../ChartContainer/useChartContainerProps.js";
12
17
  export * from "../ChartDataProvider/useChartDataProviderProps.js";
@@ -14,6 +19,7 @@ export * from "./createSeriesSelectorOfType.js";
14
19
  export * from "./plugins/corePlugins/useChartId/index.js";
15
20
  export * from "./plugins/corePlugins/useChartSeries/index.js";
16
21
  export * from "./plugins/corePlugins/useChartDimensions/index.js";
22
+ export * from "./plugins/corePlugins/useChartInteractionListener/index.js";
17
23
  export * from "./plugins/featurePlugins/useChartZAxis/index.js";
18
24
  export * from "./plugins/featurePlugins/useChartCartesianAxis/index.js";
19
25
  export * from "./plugins/featurePlugins/useChartPolarAxis/index.js";
@@ -8,8 +8,12 @@ var _exportNames = {
8
8
  useInteractionItemProps: true,
9
9
  useDrawingArea: true,
10
10
  useScatterChartProps: true,
11
+ useScatterPlotData: true,
11
12
  useLineChartProps: true,
13
+ useAreaPlotData: true,
14
+ useLinePlotData: true,
12
15
  useBarChartProps: true,
16
+ useBarPlotData: true,
13
17
  useRadarChartProps: true,
14
18
  getCartesianAxisTriggerTooltip: true,
15
19
  getCartesianAxisIndex: true,
@@ -33,12 +37,24 @@ Object.defineProperty(exports, "getCartesianAxisTriggerTooltip", {
33
37
  return _getAxisTriggerTooltip.getAxisTriggerTooltip;
34
38
  }
35
39
  });
40
+ Object.defineProperty(exports, "useAreaPlotData", {
41
+ enumerable: true,
42
+ get: function () {
43
+ return _useAreaPlotData.useAreaPlotData;
44
+ }
45
+ });
36
46
  Object.defineProperty(exports, "useBarChartProps", {
37
47
  enumerable: true,
38
48
  get: function () {
39
49
  return _useBarChartProps.useBarChartProps;
40
50
  }
41
51
  });
52
+ Object.defineProperty(exports, "useBarPlotData", {
53
+ enumerable: true,
54
+ get: function () {
55
+ return _useBarPlotData.useBarPlotData;
56
+ }
57
+ });
42
58
  Object.defineProperty(exports, "useDrawingArea", {
43
59
  enumerable: true,
44
60
  get: function () {
@@ -57,6 +73,12 @@ Object.defineProperty(exports, "useLineChartProps", {
57
73
  return _useLineChartProps.useLineChartProps;
58
74
  }
59
75
  });
76
+ Object.defineProperty(exports, "useLinePlotData", {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _useLinePlotData.useLinePlotData;
80
+ }
81
+ });
60
82
  Object.defineProperty(exports, "useRadarChartProps", {
61
83
  enumerable: true,
62
84
  get: function () {
@@ -69,6 +91,12 @@ Object.defineProperty(exports, "useScatterChartProps", {
69
91
  return _useScatterChartProps.useScatterChartProps;
70
92
  }
71
93
  });
94
+ Object.defineProperty(exports, "useScatterPlotData", {
95
+ enumerable: true,
96
+ get: function () {
97
+ return _useScatterPlotData.useScatterPlotData;
98
+ }
99
+ });
72
100
  Object.defineProperty(exports, "useSeries", {
73
101
  enumerable: true,
74
102
  get: function () {
@@ -111,12 +139,28 @@ Object.keys(_ChartsLabelMark).forEach(function (key) {
111
139
  }
112
140
  });
113
141
  });
142
+ var _NotRendered = require("./components/NotRendered");
143
+ Object.keys(_NotRendered).forEach(function (key) {
144
+ if (key === "default" || key === "__esModule") return;
145
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
146
+ if (key in exports && exports[key] === _NotRendered[key]) return;
147
+ Object.defineProperty(exports, key, {
148
+ enumerable: true,
149
+ get: function () {
150
+ return _NotRendered[key];
151
+ }
152
+ });
153
+ });
114
154
  var _useSeries = require("../hooks/useSeries");
115
155
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
116
156
  var _useDrawingArea = require("../hooks/useDrawingArea");
117
157
  var _useScatterChartProps = require("../ScatterChart/useScatterChartProps");
158
+ var _useScatterPlotData = require("../ScatterChart/useScatterPlotData");
118
159
  var _useLineChartProps = require("../LineChart/useLineChartProps");
160
+ var _useAreaPlotData = require("../LineChart/useAreaPlotData");
161
+ var _useLinePlotData = require("../LineChart/useLinePlotData");
119
162
  var _useBarChartProps = require("../BarChart/useBarChartProps");
163
+ var _useBarPlotData = require("../BarChart/useBarPlotData");
120
164
  var _useRadarChartProps = require("../RadarChart/useRadarChartProps");
121
165
  var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
122
166
  Object.keys(_useChartContainerProps).forEach(function (key) {
@@ -190,6 +234,18 @@ Object.keys(_useChartDimensions).forEach(function (key) {
190
234
  }
191
235
  });
192
236
  });
237
+ var _useChartInteractionListener = require("./plugins/corePlugins/useChartInteractionListener");
238
+ Object.keys(_useChartInteractionListener).forEach(function (key) {
239
+ if (key === "default" || key === "__esModule") return;
240
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
241
+ if (key in exports && exports[key] === _useChartInteractionListener[key]) return;
242
+ Object.defineProperty(exports, key, {
243
+ enumerable: true,
244
+ get: function () {
245
+ return _useChartInteractionListener[key];
246
+ }
247
+ });
248
+ });
193
249
  var _useChartZAxis = require("./plugins/featurePlugins/useChartZAxis");
194
250
  Object.keys(_useChartZAxis).forEach(function (key) {
195
251
  if (key === "default" || key === "__esModule") return;
@@ -2,10 +2,11 @@ import { type UseChartAnimationSignature } from "./useChartAnimation/index.js";
2
2
  import { type UseChartDimensionsSignature } from "./useChartDimensions/index.js";
3
3
  import { type UseChartIdSignature, UseChartIdParameters } from "./useChartId/index.js";
4
4
  import { type UseChartSeriesSignature } from "./useChartSeries/index.js";
5
+ import { type UseChartInteractionListenerSignature } from "./useChartInteractionListener/index.js";
5
6
  /**
6
7
  * Internal plugins that create the tools used by the other plugins.
7
8
  * These plugins are used by the Charts components.
8
9
  */
9
- export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
10
- export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature];
10
+ export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartInteractionListenerSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
11
+ export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature, UseChartInteractionListenerSignature];
11
12
  export interface ChartCorePluginParameters extends UseChartIdParameters {}
@@ -8,8 +8,9 @@ var _useChartAnimation = require("./useChartAnimation");
8
8
  var _useChartDimensions = require("./useChartDimensions");
9
9
  var _useChartId = require("./useChartId");
10
10
  var _useChartSeries = require("./useChartSeries");
11
+ var _useChartInteractionListener = require("./useChartInteractionListener");
11
12
  /**
12
13
  * Internal plugins that create the tools used by the other plugins.
13
14
  * These plugins are used by the Charts components.
14
15
  */
15
- const CHART_CORE_PLUGINS = exports.CHART_CORE_PLUGINS = [_useChartId.useChartId, _useChartDimensions.useChartDimensions, _useChartSeries.useChartSeries, _useChartAnimation.useChartAnimation];
16
+ const CHART_CORE_PLUGINS = exports.CHART_CORE_PLUGINS = [_useChartId.useChartId, _useChartDimensions.useChartDimensions, _useChartSeries.useChartSeries, _useChartInteractionListener.useChartInteractionListener, _useChartAnimation.useChartAnimation];
@@ -1,4 +1,4 @@
1
- export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
1
+ export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
2
2
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
3
3
  } & {
4
4
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -156,7 +156,7 @@ const useChartDimensions = ({
156
156
  const isYInside = React.useCallback(y => y >= drawingArea.top - 1 && y <= drawingArea.top + drawingArea.height, [drawingArea.height, drawingArea.top]);
157
157
  const isPointInside = React.useCallback((x, y, targetElement) => {
158
158
  // For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
159
- if (targetElement && targetElement.closest('[data-drawing-container]')) {
159
+ if (targetElement && 'closest' in targetElement && targetElement.closest('[data-drawing-container]')) {
160
160
  return true;
161
161
  }
162
162
  return isXInside(x) && isYInside(y);
@@ -3,7 +3,7 @@ import type { UseChartDimensionsSignature } from "./useChartDimensions.types.js"
3
3
  import { ChartState } from "../../models/chart.js";
4
4
  export declare const selectorChartDimensionsState: ChartRootSelector<UseChartDimensionsSignature>;
5
5
  export declare const selectorChartMargin: (state: ChartState<[UseChartDimensionsSignature]>) => import("./useChartDimensions.types.js").ChartMargin;
6
- export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
6
+ export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
7
7
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
8
8
  } & Partial<import("../../../index.js").UseChartCartesianAxisState> & {
9
9
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -15,7 +15,7 @@ export declare const selectorChartDrawingArea: import("reselect").Selector<impor
15
15
  top: number;
16
16
  bottom: number;
17
17
  }, []>;
18
- export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
18
+ export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
19
19
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
20
20
  } & {
21
21
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -23,7 +23,7 @@ export declare const selectorChartPropsSize: import("reselect").Selector<import(
23
23
  width: number | undefined;
24
24
  height: number | undefined;
25
25
  }, any[]>;
26
- export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
26
+ export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
27
27
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
28
28
  } & {
29
29
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -67,10 +67,10 @@ export interface UseChartDimensionsInstance {
67
67
  * Checks if a point is inside the drawing area.
68
68
  * @param {number} x The x coordinate of the point.
69
69
  * @param {number} y The y coordinate of the point.
70
- * @param {Element} targetElement The element to check if it is allowed to overflow the drawing area.
70
+ * @param {Element | EventTarget | null} targetElement The element to check if it is allowed to overflow the drawing area.
71
71
  * @returns {boolean} `true` if the point is inside the drawing area, `false` otherwise.
72
72
  */
73
- isPointInside: (x: number, y: number, targetElement?: Element) => boolean;
73
+ isPointInside: (x: number, y: number, targetElement?: Element | EventTarget | null) => boolean;
74
74
  /**
75
75
  * Checks if the x coordinate is inside the drawing area.
76
76
  * @param {number} x The x coordinate of the point.
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
@@ -3,7 +3,7 @@
3
3
  * @param {ChartState<[UseChartIdSignature]>} state The state of the chart.
4
4
  * @returns {string} The id attribute of the chart.
5
5
  */
6
- export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
6
+ export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
7
7
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
8
8
  } & {
9
9
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -0,0 +1,2 @@
1
+ export { useChartInteractionListener } from "./useChartInteractionListener.js";
2
+ export type { UseChartInteractionListenerParameters, UseChartInteractionListenerState, UseChartInteractionListenerInstance, UseChartInteractionListenerSignature, ChartInteraction } from "./useChartInteractionListener.types.js";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "useChartInteractionListener", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _useChartInteractionListener.useChartInteractionListener;
10
+ }
11
+ });
12
+ var _useChartInteractionListener = require("./useChartInteractionListener");
@@ -0,0 +1,3 @@
1
+ import { ChartPlugin } from "../../models/index.js";
2
+ import { UseChartInteractionListenerSignature } from "./useChartInteractionListener.types.js";
3
+ export declare const useChartInteractionListener: ChartPlugin<UseChartInteractionListenerSignature>;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useChartInteractionListener = void 0;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _core = require("@mui/x-internal-gestures/core");
11
+ const preventDefault = event => event.preventDefault();
12
+ const useChartInteractionListener = ({
13
+ svgRef
14
+ }) => {
15
+ React.useEffect(() => {
16
+ const svg = svgRef.current;
17
+ if (!svg) {
18
+ return undefined;
19
+ }
20
+ const gestureManager = new _core.GestureManager({
21
+ gestures: [new _core.PanGesture({
22
+ name: 'pan',
23
+ threshold: 0,
24
+ maxPointers: 1
25
+ }), new _core.MoveGesture({
26
+ name: 'move',
27
+ preventIf: ['pan', 'pinch'] // Prevent move gesture when pan is active
28
+ }), new _core.PinchGesture({
29
+ name: 'pinch',
30
+ threshold: 5,
31
+ preventIf: ['pan']
32
+ }), new _core.TurnWheelGesture({
33
+ name: 'turnWheel',
34
+ sensitivity: 0.01,
35
+ initialDelta: 1
36
+ }), new _core.TapGesture({
37
+ name: 'tap',
38
+ maxDistance: 10,
39
+ preventIf: ['pan', 'pinch']
40
+ }), new _core.PressGesture({
41
+ name: 'quickPress',
42
+ duration: 50,
43
+ maxDistance: 10
44
+ })]
45
+ });
46
+ gestureManager.registerElement(['pan', 'move', 'pinch', 'turnWheel', 'tap', 'quickPress'], svg);
47
+ return () => {
48
+ // Cleanup gesture manager
49
+ gestureManager.destroy();
50
+ };
51
+ }, [svgRef]);
52
+ const addInteractionListener = React.useCallback((interaction, callback, options) => {
53
+ // Forcefully cast the svgRef to any, it is annoying to fix the types.
54
+ const svg = svgRef.current;
55
+ svg?.addEventListener(interaction, callback, options);
56
+ return {
57
+ cleanup: () => svg?.removeEventListener(interaction, callback)
58
+ };
59
+ }, [svgRef]);
60
+ React.useEffect(() => {
61
+ const svg = svgRef.current;
62
+
63
+ // Disable gesture on safari
64
+ // https://use-gesture.netlify.app/docs/gestures/#about-the-pinch-gesture
65
+ svg?.addEventListener('gesturestart', preventDefault);
66
+ svg?.addEventListener('gesturechange', preventDefault);
67
+ svg?.addEventListener('gestureend', preventDefault);
68
+ return () => {
69
+ svg?.removeEventListener('gesturestart', preventDefault);
70
+ svg?.removeEventListener('gesturechange', preventDefault);
71
+ svg?.removeEventListener('gestureend', preventDefault);
72
+ };
73
+ }, [svgRef]);
74
+ return {
75
+ instance: {
76
+ addInteractionListener
77
+ }
78
+ };
79
+ };
80
+ exports.useChartInteractionListener = useChartInteractionListener;
81
+ useChartInteractionListener.params = {};
82
+ useChartInteractionListener.getInitialState = () => {
83
+ return {};
84
+ };