@mui/x-charts 8.11.3 → 8.13.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 (304) hide show
  1. package/BarChart/BarChart.d.ts +2 -2
  2. package/BarChart/BarChart.js +1 -0
  3. package/BarChart/BarChart.plugins.d.ts +3 -2
  4. package/BarChart/BarChart.plugins.js +2 -1
  5. package/BarChart/BarElement.js +10 -2
  6. package/BarChart/index.d.ts +1 -0
  7. package/BarChart/index.js +12 -0
  8. package/BarChart/useBarChartProps.d.ts +2 -2
  9. package/CHANGELOG.md +296 -6
  10. package/ChartContainer/ChartContainer.js +4 -2
  11. package/ChartContainer/useChartContainerProps.js +4 -2
  12. package/ChartsLegend/ContinuousColorLegend.js +1 -0
  13. package/ChartsLegend/PiecewiseColorLegend.js +1 -0
  14. package/ChartsSurface/ChartsSurface.js +23 -3
  15. package/ChartsWrapper/ChartsWrapper.d.ts +2 -1
  16. package/ChartsWrapper/ChartsWrapper.js +49 -46
  17. package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  18. package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  19. package/LineChart/FocusedMark.d.ts +2 -0
  20. package/LineChart/FocusedMark.js +44 -0
  21. package/LineChart/LineChart.d.ts +2 -2
  22. package/LineChart/LineChart.js +3 -1
  23. package/LineChart/LineChart.plugins.d.ts +3 -2
  24. package/LineChart/LineChart.plugins.js +2 -1
  25. package/LineChart/index.d.ts +1 -0
  26. package/LineChart/index.js +12 -0
  27. package/LineChart/useLineChartProps.d.ts +2 -2
  28. package/PieChart/PieArc.d.ts +4 -0
  29. package/PieChart/PieArc.js +16 -11
  30. package/PieChart/PieArcPlot.js +28 -3
  31. package/PieChart/PieChart.js +1 -0
  32. package/PieChart/PieChart.plugins.d.ts +2 -1
  33. package/PieChart/PieChart.plugins.js +2 -1
  34. package/PieChart/dataTransform/useTransformData.d.ts +1 -0
  35. package/PieChart/dataTransform/useTransformData.js +9 -1
  36. package/PieChart/index.d.ts +1 -0
  37. package/PieChart/index.js +12 -0
  38. package/RadarChart/RadarChart.plugins.d.ts +1 -1
  39. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  40. package/RadarChart/index.d.ts +2 -1
  41. package/RadarChart/index.js +12 -0
  42. package/RadarChart/useRadarChartProps.d.ts +2 -2
  43. package/ScatterChart/BatchScatter.d.ts +32 -0
  44. package/ScatterChart/BatchScatter.js +171 -0
  45. package/ScatterChart/Scatter.js +13 -5
  46. package/ScatterChart/ScatterChart.d.ts +4 -4
  47. package/ScatterChart/ScatterChart.js +13 -2
  48. package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  49. package/ScatterChart/ScatterChart.plugins.js +3 -2
  50. package/ScatterChart/ScatterPlot.d.ts +10 -0
  51. package/ScatterChart/ScatterPlot.js +14 -2
  52. package/ScatterChart/index.d.ts +1 -0
  53. package/ScatterChart/index.js +12 -0
  54. package/ScatterChart/useScatterChartProps.d.ts +2 -2
  55. package/ScatterChart/useScatterChartProps.js +8 -5
  56. package/SparkLineChart/SparkLineChart.js +10 -5
  57. package/Toolbar/Toolbar.js +1 -2
  58. package/colorPalettes/types.d.ts +1 -1
  59. package/context/ChartApi.d.ts +6 -6
  60. package/esm/BarChart/BarChart.d.ts +2 -2
  61. package/esm/BarChart/BarChart.js +1 -0
  62. package/esm/BarChart/BarChart.plugins.d.ts +3 -2
  63. package/esm/BarChart/BarChart.plugins.js +2 -1
  64. package/esm/BarChart/BarElement.js +10 -2
  65. package/esm/BarChart/index.d.ts +1 -0
  66. package/esm/BarChart/index.js +1 -0
  67. package/esm/BarChart/useBarChartProps.d.ts +2 -2
  68. package/esm/ChartContainer/ChartContainer.js +4 -2
  69. package/esm/ChartContainer/useChartContainerProps.js +4 -2
  70. package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
  71. package/esm/ChartsLegend/PiecewiseColorLegend.js +1 -0
  72. package/esm/ChartsSurface/ChartsSurface.js +23 -3
  73. package/esm/ChartsWrapper/ChartsWrapper.d.ts +2 -1
  74. package/esm/ChartsWrapper/ChartsWrapper.js +49 -46
  75. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
  76. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
  77. package/esm/LineChart/FocusedMark.d.ts +2 -0
  78. package/esm/LineChart/FocusedMark.js +38 -0
  79. package/esm/LineChart/LineChart.d.ts +2 -2
  80. package/esm/LineChart/LineChart.js +3 -1
  81. package/esm/LineChart/LineChart.plugins.d.ts +3 -2
  82. package/esm/LineChart/LineChart.plugins.js +2 -1
  83. package/esm/LineChart/index.d.ts +1 -0
  84. package/esm/LineChart/index.js +1 -0
  85. package/esm/LineChart/useLineChartProps.d.ts +2 -2
  86. package/esm/PieChart/PieArc.d.ts +4 -0
  87. package/esm/PieChart/PieArc.js +17 -12
  88. package/esm/PieChart/PieArcPlot.js +30 -5
  89. package/esm/PieChart/PieChart.js +1 -0
  90. package/esm/PieChart/PieChart.plugins.d.ts +2 -1
  91. package/esm/PieChart/PieChart.plugins.js +2 -1
  92. package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
  93. package/esm/PieChart/dataTransform/useTransformData.js +9 -1
  94. package/esm/PieChart/index.d.ts +1 -0
  95. package/esm/PieChart/index.js +1 -0
  96. package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
  97. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
  98. package/esm/RadarChart/index.d.ts +2 -1
  99. package/esm/RadarChart/index.js +2 -1
  100. package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
  101. package/esm/ScatterChart/BatchScatter.d.ts +32 -0
  102. package/esm/ScatterChart/BatchScatter.js +165 -0
  103. package/esm/ScatterChart/Scatter.js +13 -5
  104. package/esm/ScatterChart/ScatterChart.d.ts +4 -4
  105. package/esm/ScatterChart/ScatterChart.js +13 -2
  106. package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
  107. package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
  108. package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
  109. package/esm/ScatterChart/ScatterPlot.js +14 -2
  110. package/esm/ScatterChart/index.d.ts +1 -0
  111. package/esm/ScatterChart/index.js +1 -0
  112. package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
  113. package/esm/ScatterChart/useScatterChartProps.js +8 -5
  114. package/esm/SparkLineChart/SparkLineChart.js +10 -5
  115. package/esm/Toolbar/Toolbar.js +1 -2
  116. package/esm/colorPalettes/types.d.ts +1 -1
  117. package/esm/context/ChartApi.d.ts +6 -6
  118. package/esm/hooks/useAxis.d.ts +5 -5
  119. package/esm/hooks/useDrawingArea.d.ts +20 -2
  120. package/esm/hooks/useFocusedItem.d.ts +15 -0
  121. package/esm/hooks/useFocusedItem.js +20 -0
  122. package/esm/hooks/useIsItemFocused.d.ts +12 -0
  123. package/esm/hooks/useIsItemFocused.js +15 -0
  124. package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
  125. package/esm/hooks/useIsItemFocusedGetter.js +14 -0
  126. package/esm/hooks/useScale.js +6 -0
  127. package/esm/index.d.ts +1 -0
  128. package/esm/index.js +2 -1
  129. package/esm/internals/animation/Transition.js +1 -3
  130. package/esm/internals/index.d.ts +3 -2
  131. package/esm/internals/index.js +3 -2
  132. package/esm/internals/plugins/allPlugins.d.ts +5 -4
  133. package/esm/internals/plugins/allPlugins.js +3 -2
  134. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +60 -32
  135. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
  136. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  137. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  138. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
  139. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  140. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  141. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  142. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
  143. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
  144. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
  145. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +121 -0
  146. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  147. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  148. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
  149. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
  150. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +41 -21
  151. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
  152. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
  153. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  154. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
  155. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  156. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
  157. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  158. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
  159. package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  160. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  161. package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
  162. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  163. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
  164. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  165. package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
  166. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
  167. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
  168. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +2 -1
  169. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
  170. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  171. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
  172. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  173. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  174. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
  175. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +170 -0
  176. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
  177. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +33 -0
  178. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
  179. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
  180. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -5
  181. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  182. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  183. package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  184. package/esm/internals/scaleGuards.d.ts +7 -0
  185. package/esm/internals/scaleGuards.js +6 -0
  186. package/esm/internals/ticks.d.ts +3 -5
  187. package/esm/internals/ticks.js +6 -5
  188. package/esm/locales/elGR.d.ts +96 -0
  189. package/esm/locales/elGR.js +100 -0
  190. package/esm/locales/enUS.d.ts +96 -0
  191. package/esm/locales/enUS.js +99 -1
  192. package/esm/locales/frFR.d.ts +96 -0
  193. package/esm/locales/frFR.js +100 -2
  194. package/esm/locales/ptBR.d.ts +96 -0
  195. package/esm/locales/ptBR.js +100 -0
  196. package/esm/locales/ptPT.d.ts +96 -0
  197. package/esm/locales/ptPT.js +100 -0
  198. package/esm/locales/svSE.d.ts +97 -1
  199. package/esm/locales/svSE.js +100 -0
  200. package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  201. package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
  202. package/esm/plugins/index.d.ts +6 -0
  203. package/esm/plugins/index.js +12 -0
  204. package/hooks/useAxis.d.ts +5 -5
  205. package/hooks/useDrawingArea.d.ts +20 -2
  206. package/hooks/useFocusedItem.d.ts +15 -0
  207. package/hooks/useFocusedItem.js +26 -0
  208. package/hooks/useIsItemFocused.d.ts +12 -0
  209. package/hooks/useIsItemFocused.js +20 -0
  210. package/hooks/useIsItemFocusedGetter.d.ts +8 -0
  211. package/hooks/useIsItemFocusedGetter.js +18 -0
  212. package/hooks/useScale.js +6 -0
  213. package/index.d.ts +1 -0
  214. package/index.js +13 -1
  215. package/internals/animation/Transition.js +0 -2
  216. package/internals/index.d.ts +3 -2
  217. package/internals/index.js +20 -8
  218. package/internals/plugins/allPlugins.d.ts +5 -4
  219. package/internals/plugins/allPlugins.js +3 -2
  220. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +59 -31
  221. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
  222. package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
  223. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
  224. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
  225. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
  226. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
  227. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
  228. package/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
  229. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
  230. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
  231. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +131 -0
  232. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
  233. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
  234. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
  235. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
  236. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +42 -22
  237. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
  238. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
  239. package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
  240. package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
  241. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
  242. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
  243. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
  244. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
  245. package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
  246. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
  247. package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
  248. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
  249. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
  250. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
  251. package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
  252. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
  253. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
  254. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +3 -2
  255. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
  256. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
  257. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
  258. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
  259. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
  260. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
  261. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +178 -0
  262. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
  263. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +39 -0
  264. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
  265. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
  266. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -4
  267. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
  268. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
  269. package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
  270. package/internals/scaleGuards.d.ts +7 -0
  271. package/internals/scaleGuards.js +8 -0
  272. package/internals/ticks.d.ts +3 -5
  273. package/internals/ticks.js +7 -5
  274. package/locales/elGR.d.ts +96 -0
  275. package/locales/elGR.js +100 -0
  276. package/locales/enUS.d.ts +96 -0
  277. package/locales/enUS.js +99 -1
  278. package/locales/frFR.d.ts +96 -0
  279. package/locales/frFR.js +100 -2
  280. package/locales/ptBR.d.ts +96 -0
  281. package/locales/ptBR.js +100 -0
  282. package/locales/ptPT.d.ts +96 -0
  283. package/locales/ptPT.js +100 -0
  284. package/locales/svSE.d.ts +97 -1
  285. package/locales/svSE.js +100 -0
  286. package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
  287. package/locales/utils/getChartsLocalization.d.ts +96 -0
  288. package/package.json +5 -5
  289. package/plugins/index.d.ts +6 -0
  290. package/plugins/index.js +47 -0
  291. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
  292. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  293. package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
  294. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  295. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  296. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
  297. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
  298. package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
  299. package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
  300. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
  301. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
  302. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
  303. /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
  304. /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedXAxis = void 0;
6
+ exports.selectorChartPreviewYScales = exports.selectorChartPreviewXScales = exports.selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedXAxis = void 0;
7
7
  var _selectors = require("../../utils/selectors");
8
8
  var _useChartCartesianAxisLayout = require("./useChartCartesianAxisLayout.selectors");
9
9
  var _useChartSeries = require("../../corePlugins/useChartSeries");
@@ -11,6 +11,8 @@ var _computeAxisValue = require("./computeAxisValue");
11
11
  var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
12
12
  var _useChartDimensions = require("../../corePlugins/useChartDimensions");
13
13
  var _constants = require("../../../constants");
14
+ var _useChartExperimentalFeature = require("../../corePlugins/useChartExperimentalFeature");
15
+ var _getAxisScale = require("./getAxisScale");
14
16
  function createPreviewDrawingArea(axisDirection, mainChartDrawingArea) {
15
17
  return axisDirection === 'x' ? {
16
18
  left: 0,
@@ -28,7 +30,26 @@ function createPreviewDrawingArea(axisDirection, mainChartDrawingArea) {
28
30
  bottom: mainChartDrawingArea.height
29
31
  };
30
32
  }
31
- const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, (_, axisId) => axisId], (xAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, axisId) => {
33
+ const selectorChartPreviewXScales = exports.selectorChartPreviewXScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, _useChartCartesianAxisRendering.selectorDefaultXAxisTickNumber, (_, axisId) => axisId], function selectorChartPreviewXScales(xAxes, chartDrawingArea, formattedSeries, seriesConfig, zoomOptions, preferStrictDomainInLineCharts, defaultTickNumber, axisId) {
34
+ const hasAxis = xAxes?.some(axis => axis.id === axisId);
35
+ const drawingArea = createPreviewDrawingArea(hasAxis ? 'x' : 'y', chartDrawingArea);
36
+ const options = zoomOptions[axisId];
37
+ const zoomMap = new Map([[axisId, {
38
+ axisId,
39
+ start: options.minStart,
40
+ end: options.maxEnd
41
+ }]]);
42
+ return (0, _getAxisScale.getXAxesScales)({
43
+ drawingArea,
44
+ formattedSeries,
45
+ axis: xAxes,
46
+ seriesConfig,
47
+ zoomMap,
48
+ preferStrictDomainInLineCharts,
49
+ defaultTickNumber
50
+ });
51
+ });
52
+ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartPreviewXScales, (_, axisId) => axisId], (xAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, preferStrictDomainInLineCharts, scales, axisId) => {
32
53
  const hasAxis = xAxes?.some(axis => axis.id === axisId);
33
54
  const drawingArea = createPreviewDrawingArea(hasAxis ? 'x' : 'y', chartDrawingArea);
34
55
  const options = zoomOptions[axisId];
@@ -38,6 +59,7 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
38
59
  end: options.maxEnd
39
60
  }]]);
40
61
  const computedAxes = (0, _computeAxisValue.computeAxisValue)({
62
+ scales,
41
63
  drawingArea,
42
64
  formattedSeries,
43
65
  axis: xAxes,
@@ -45,7 +67,8 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
45
67
  axisDirection: 'x',
46
68
  zoomMap,
47
69
  zoomOptions,
48
- getFilters
70
+ getFilters,
71
+ preferStrictDomainInLineCharts
49
72
  });
50
73
  if (computedAxes.axis[axisId]) {
51
74
  return {
@@ -54,7 +77,26 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
54
77
  }
55
78
  return computedAxes.axis;
56
79
  });
57
- const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, (_, axisId) => axisId], (yAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, axisId) => {
80
+ const selectorChartPreviewYScales = exports.selectorChartPreviewYScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, _useChartCartesianAxisRendering.selectorDefaultYAxisTickNumber, (_, axisId) => axisId], function selectorChartPreviewYScales(yAxes, chartDrawingArea, formattedSeries, seriesConfig, zoomOptions, preferStrictDomainInLineCharts, defaultTickNumber, axisId) {
81
+ const hasAxis = yAxes?.some(axis => axis.id === axisId);
82
+ const drawingArea = createPreviewDrawingArea(hasAxis ? 'y' : 'x', chartDrawingArea);
83
+ const options = zoomOptions[axisId];
84
+ const zoomMap = new Map([[axisId, {
85
+ axisId,
86
+ start: options.minStart,
87
+ end: options.maxEnd
88
+ }]]);
89
+ return (0, _getAxisScale.getYAxesScales)({
90
+ drawingArea,
91
+ formattedSeries,
92
+ axis: yAxes,
93
+ seriesConfig,
94
+ zoomMap,
95
+ preferStrictDomainInLineCharts,
96
+ defaultTickNumber
97
+ });
98
+ });
99
+ const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartPreviewYScales, (_, axisId) => axisId], (yAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, preferStrictDomainInLineCharts, scales, axisId) => {
58
100
  const hasAxis = yAxes?.some(axis => axis.id === axisId);
59
101
  const drawingArea = createPreviewDrawingArea(hasAxis ? 'y' : 'x', chartDrawingArea);
60
102
  const options = zoomOptions[axisId];
@@ -64,6 +106,7 @@ const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYA
64
106
  end: options.maxEnd
65
107
  }]]);
66
108
  const computedAxes = (0, _computeAxisValue.computeAxisValue)({
109
+ scales,
67
110
  drawingArea,
68
111
  formattedSeries,
69
112
  axis: yAxes,
@@ -71,7 +114,8 @@ const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYA
71
114
  axisDirection: 'y',
72
115
  zoomMap,
73
116
  zoomOptions,
74
- getFilters
117
+ getFilters,
118
+ preferStrictDomainInLineCharts
75
119
  });
76
120
  if (computedAxes.axis[axisId]) {
77
121
  return {
@@ -23,6 +23,26 @@ export declare const selectorChartZoomOptionsLookup: import("reselect").Selector
23
23
  [x: number]: import("./useChartCartesianAxis.types.js").DefaultizedZoomOptions;
24
24
  }, []>;
25
25
  export declare const selectorChartAxisZoomOptionsLookup: import("reselect").Selector<any, import("./useChartCartesianAxis.types.js").DefaultizedZoomOptions, [axisId: AxisId]>;
26
+ export declare const selectorDefaultXAxisTickNumber: 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<{}> & {
27
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
28
+ } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
29
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
30
+ }, number, []>;
31
+ export declare const selectorDefaultYAxisTickNumber: 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<{}> & {
32
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
33
+ } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
34
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
35
+ }, number, []>;
36
+ export declare const selectorChartXScales: 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.types.js").UseChartCartesianAxisState> & {
37
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
38
+ } & Partial<{}> & {
39
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
40
+ }, Record<AxisId, import("./getAxisScale.js").ScaleDefinition>, []>;
41
+ export declare const selectorChartYScales: 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.types.js").UseChartCartesianAxisState> & {
42
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
43
+ } & Partial<{}> & {
44
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
45
+ }, Record<AxisId, import("./getAxisScale.js").ScaleDefinition>, []>;
26
46
  export declare const selectorChartZoomAxisFilters: 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.types.js").UseChartCartesianAxisState> & {
27
47
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
28
48
  } & {
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartZoomAxisFilters = exports.selectorChartYAxis = exports.selectorChartXAxis = exports.selectorChartRawAxis = exports.selectorChartAxisZoomOptionsLookup = exports.selectorChartAxis = exports.createZoomMap = void 0;
7
+ exports.selectorDefaultYAxisTickNumber = exports.selectorDefaultXAxisTickNumber = exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartZoomAxisFilters = exports.selectorChartYScales = exports.selectorChartYAxis = exports.selectorChartXScales = exports.selectorChartXAxis = exports.selectorChartRawAxis = exports.selectorChartAxisZoomOptionsLookup = exports.selectorChartAxis = exports.createZoomMap = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _useChartDimensions = require("../../corePlugins/useChartDimensions");
10
10
  var _useChartSeries = require("../../corePlugins/useChartSeries");
@@ -14,6 +14,8 @@ var _createAxisFilterMapper = require("./createAxisFilterMapper");
14
14
  var _createZoomLookup = require("./createZoomLookup");
15
15
  var _useChartCartesianAxisLayout = require("./useChartCartesianAxisLayout.selectors");
16
16
  var _useChartExperimentalFeature = require("../../corePlugins/useChartExperimentalFeature");
17
+ var _getAxisScale = require("./getAxisScale");
18
+ var _ticks = require("../../../ticks");
17
19
  const createZoomMap = zoom => {
18
20
  const zoomItemMap = new Map();
19
21
  zoom.forEach(zoomItem => {
@@ -32,34 +34,50 @@ const selectorChartZoomIsInteracting = exports.selectorChartZoomIsInteracting =
32
34
  const selectorChartZoomMap = exports.selectorChartZoomMap = (0, _selectors.createSelector)([selectorChartZoomState], zoom => zoom?.zoomData && createZoomMap(zoom?.zoomData));
33
35
  const selectorChartZoomOptionsLookup = exports.selectorChartZoomOptionsLookup = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis], (xAxis, yAxis) => (0, _extends2.default)({}, (0, _createZoomLookup.createZoomLookup)('x')(xAxis), (0, _createZoomLookup.createZoomLookup)('y')(yAxis)));
34
36
  const selectorChartAxisZoomOptionsLookup = exports.selectorChartAxisZoomOptionsLookup = (0, _selectors.createSelector)([selectorChartZoomOptionsLookup, (_, axisId) => axisId], (axisLookup, axisId) => axisLookup[axisId]);
35
- const selectorChartXFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup, _useChartSeries.selectorChartSeriesConfig, _useChartSeries.selectorChartSeriesProcessed], (zoomMap, zoomOptions, seriesConfig, formattedSeries) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)({
36
- zoomMap,
37
- zoomOptions,
38
- seriesConfig,
39
- formattedSeries,
40
- direction: 'x'
41
- }));
42
- const selectorChartYFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup, _useChartSeries.selectorChartSeriesConfig, _useChartSeries.selectorChartSeriesProcessed], (zoomMap, zoomOptions, seriesConfig, formattedSeries) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)({
43
- zoomMap,
44
- zoomOptions,
45
- seriesConfig,
46
- formattedSeries,
47
- direction: 'y'
48
- }));
49
- const selectorChartZoomAxisFilters = exports.selectorChartZoomAxisFilters = (0, _selectors.createSelector)([selectorChartXFilter, selectorChartYFilter, _useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis], (xMapper, yMapper, xAxis, yAxis) => {
37
+ const selectorChartXFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup], (zoomMap, zoomOptions) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)(zoomMap, zoomOptions, 'x'));
38
+ const selectorChartYFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup], (zoomMap, zoomOptions) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)(zoomMap, zoomOptions, 'y'));
39
+ const selectorDefaultXAxisTickNumber = exports.selectorDefaultXAxisTickNumber = (0, _selectors.createSelector)([_useChartDimensions.selectorChartDrawingArea], function selectorDefaultXAxisTickNumber(drawingArea) {
40
+ return (0, _ticks.getDefaultTickNumber)(drawingArea.width);
41
+ });
42
+ const selectorDefaultYAxisTickNumber = exports.selectorDefaultYAxisTickNumber = (0, _selectors.createSelector)([_useChartDimensions.selectorChartDrawingArea], function selectorDefaultYAxisTickNumber(drawingArea) {
43
+ return (0, _ticks.getDefaultTickNumber)(drawingArea.height);
44
+ });
45
+ const selectorChartXScales = exports.selectorChartXScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorDefaultXAxisTickNumber], function selectorChartXScales(axis, drawingArea, formattedSeries, seriesConfig, zoomMap, preferStrictDomainInLineCharts, defaultTickNumber) {
46
+ return (0, _getAxisScale.getXAxesScales)({
47
+ drawingArea,
48
+ formattedSeries,
49
+ axis,
50
+ seriesConfig,
51
+ zoomMap,
52
+ preferStrictDomainInLineCharts,
53
+ defaultTickNumber
54
+ });
55
+ });
56
+ const selectorChartYScales = exports.selectorChartYScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorDefaultYAxisTickNumber], function selectorChartYScales(axis, drawingArea, formattedSeries, seriesConfig, zoomMap, preferStrictDomainInLineCharts, defaultTickNumber) {
57
+ return (0, _getAxisScale.getYAxesScales)({
58
+ drawingArea,
59
+ formattedSeries,
60
+ axis,
61
+ seriesConfig,
62
+ zoomMap,
63
+ preferStrictDomainInLineCharts,
64
+ defaultTickNumber
65
+ });
66
+ });
67
+ const selectorChartZoomAxisFilters = exports.selectorChartZoomAxisFilters = (0, _selectors.createSelector)([selectorChartXFilter, selectorChartYFilter, _useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis, selectorChartXScales, selectorChartYScales], (xMapper, yMapper, xAxis, yAxis, xScales, yScales) => {
50
68
  if (xMapper === undefined || yMapper === undefined) {
51
69
  // Early return if there is no zoom.
52
70
  return undefined;
53
71
  }
54
- const xFilters = xAxis?.reduce((acc, axis, index) => {
55
- const filter = xMapper(axis, index);
72
+ const xFilters = xAxis?.reduce((acc, axis) => {
73
+ const filter = xMapper(axis.id, axis.data, xScales[axis.id].scale);
56
74
  if (filter !== null) {
57
75
  acc[axis.id] = filter;
58
76
  }
59
77
  return acc;
60
78
  }, {});
61
- const yFilters = yAxis?.reduce((acc, axis, index) => {
62
- const filter = yMapper(axis, index);
79
+ const yFilters = yAxis?.reduce((acc, axis) => {
80
+ const filter = yMapper(axis.id, axis.data, yScales[axis.id].scale);
63
81
  if (filter !== null) {
64
82
  acc[axis.id] = filter;
65
83
  }
@@ -75,7 +93,8 @@ const selectorChartZoomAxisFilters = exports.selectorChartZoomAxisFilters = (0,
75
93
  * The only interesting selectors that merge axis data and zoom if provided.
76
94
  */
77
95
 
78
- const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => (0, _computeAxisValue.computeAxisValue)({
96
+ const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartXScales], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts, scales) => (0, _computeAxisValue.computeAxisValue)({
97
+ scales,
79
98
  drawingArea,
80
99
  formattedSeries,
81
100
  axis,
@@ -86,7 +105,8 @@ const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSel
86
105
  getFilters,
87
106
  preferStrictDomainInLineCharts
88
107
  }));
89
- const selectorChartYAxis = exports.selectorChartYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => (0, _computeAxisValue.computeAxisValue)({
108
+ const selectorChartYAxis = exports.selectorChartYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartYScales], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts, scales) => (0, _computeAxisValue.computeAxisValue)({
109
+ scales,
90
110
  drawingArea,
91
111
  formattedSeries,
92
112
  axis,
@@ -13,7 +13,7 @@ export declare const selectorChartsHighlightXAxisValue: import("reselect").Selec
13
13
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
14
14
  } & {
15
15
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
16
- } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
16
+ } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}> & Partial<import("../useChartKeyboardNavigation/useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState>, {
17
17
  value: any;
18
18
  axisId: import("../../../index.js").AxisId;
19
19
  dataIndex: number;
@@ -26,7 +26,7 @@ export declare const selectorChartsHighlightYAxisValue: import("reselect").Selec
26
26
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
27
27
  } & {
28
28
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
29
- } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
29
+ } & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}> & Partial<import("../useChartKeyboardNavigation/useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState>, {
30
30
  value: any;
31
31
  axisId: import("../../../index.js").AxisId;
32
32
  dataIndex: number;
@@ -9,6 +9,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _selectors = require("../../utils/selectors");
10
10
  var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
11
11
  var _useChartCartesianInteraction = require("./useChartCartesianInteraction.selectors");
12
+ var _useChartKeyboardNavigation = require("../useChartKeyboardNavigation/useChartKeyboardNavigation.selectors");
13
+ var _useChartInteraction = require("../useChartInteraction/useChartInteraction.selectors");
12
14
  const selectorChartControlledCartesianAxisHighlight = state => state.controlledCartesianAxisHighlight;
13
15
  const selectAxisHighlight = (computedIndex, axis, axisItems) => {
14
16
  if (axisItems !== undefined) {
@@ -21,22 +23,43 @@ const selectAxisHighlight = (computedIndex, axis, axisItems) => {
21
23
  };
22
24
  const selectorChartsHighlightXAxisIndex = exports.selectorChartsHighlightXAxisIndex = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
23
25
  const selectorChartsHighlightYAxisIndex = exports.selectorChartsHighlightYAxisIndex = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
24
- const selectAxisHighlightWithValue = (computedIndex, computedValue, axis, axisItems) => {
25
- if (axisItems !== undefined) {
26
- return axisItems.map(item => (0, _extends2.default)({}, item, {
26
+ const selectAxisHighlightWithValue = (computedIndex, computedValue, axis, controlledAxisItems, keyboardAxisItem, lastInteractionUpdate) => {
27
+ if (controlledAxisItems !== undefined) {
28
+ return controlledAxisItems.map(item => (0, _extends2.default)({}, item, {
27
29
  value: axis.axis[item.axisId]?.data?.[item.dataIndex]
28
30
  })).filter(({
29
31
  value
30
32
  }) => value !== undefined);
31
33
  }
32
- return computedValue === null ? [] : [{
34
+ const pointerHighlight = computedValue !== null && {
33
35
  axisId: axis.axisIds[0],
34
36
  dataIndex: computedIndex,
35
37
  value: computedValue
36
- }];
38
+ };
39
+ const keyboardValue = keyboardAxisItem && axis.axis[keyboardAxisItem.axisId]?.data?.[keyboardAxisItem.dataIndex];
40
+ const keyboardHighlight = keyboardAxisItem && keyboardValue != null && (0, _extends2.default)({}, keyboardAxisItem, {
41
+ value: keyboardValue
42
+ });
43
+ if (lastInteractionUpdate === 'pointer') {
44
+ if (pointerHighlight) {
45
+ return [pointerHighlight];
46
+ }
47
+ if (keyboardHighlight) {
48
+ return [keyboardHighlight];
49
+ }
50
+ }
51
+ if (lastInteractionUpdate === 'keyboard') {
52
+ if (keyboardHighlight) {
53
+ return [keyboardHighlight];
54
+ }
55
+ if (pointerHighlight) {
56
+ return [pointerHighlight];
57
+ }
58
+ }
59
+ return [];
37
60
  };
38
- const selectorChartsHighlightXAxisValue = exports.selectorChartsHighlightXAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionXAxisValue, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
39
- const selectorChartsHighlightYAxisValue = exports.selectorChartsHighlightYAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionYAxisValue, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
61
+ const selectorChartsHighlightXAxisValue = exports.selectorChartsHighlightXAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionXAxisValue, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight, _useChartKeyboardNavigation.selectorChartsKeyboardXAxisIndex, _useChartInteraction.selectorChartsLastInteraction], selectAxisHighlightWithValue);
62
+ const selectorChartsHighlightYAxisValue = exports.selectorChartsHighlightYAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionYAxisValue, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight, _useChartKeyboardNavigation.selectorChartsKeyboardYAxisIndex, _useChartInteraction.selectorChartsLastInteraction], selectAxisHighlightWithValue);
40
63
 
41
64
  /**
42
65
  * Get the scale of the axis with highlight if controlled. The default axis otherwise.
@@ -0,0 +1,3 @@
1
+ export { useChartClosestPoint } from "./useChartClosestPoint.js";
2
+ export * from "./useChartClosestPoint.selectors.js";
3
+ export type { UseChartClosestPointSignature } from "./useChartClosestPoint.types.js";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ useChartClosestPoint: true
8
+ };
9
+ Object.defineProperty(exports, "useChartClosestPoint", {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _useChartClosestPoint.useChartClosestPoint;
13
+ }
14
+ });
15
+ var _useChartClosestPoint = require("./useChartClosestPoint");
16
+ var _useChartClosestPoint2 = require("./useChartClosestPoint.selectors");
17
+ Object.keys(_useChartClosestPoint2).forEach(function (key) {
18
+ if (key === "default" || key === "__esModule") return;
19
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
+ if (key in exports && exports[key] === _useChartClosestPoint2[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _useChartClosestPoint2[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,3 @@
1
+ import { ChartPlugin } from "../../models/index.js";
2
+ import { UseChartClosestPointSignature } from "./useChartClosestPoint.types.js";
3
+ export declare const useChartClosestPoint: ChartPlugin<UseChartClosestPointSignature>;
@@ -6,7 +6,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
- exports.useChartVoronoi = void 0;
9
+ exports.useChartClosestPoint = void 0;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
@@ -18,7 +18,7 @@ var _useSelector = require("../../../store/useSelector");
18
18
  var _useChartCartesianAxis = require("../useChartCartesianAxis");
19
19
  var _useChartSeries = require("../../corePlugins/useChartSeries/useChartSeries.selectors");
20
20
  var _useChartDimensions = require("../../corePlugins/useChartDimensions");
21
- const useChartVoronoi = ({
21
+ const useChartClosestPoint = ({
22
22
  svgRef,
23
23
  params,
24
24
  store,
@@ -93,7 +93,8 @@ const useChartVoronoi = ({
93
93
  seriesId,
94
94
  seriesIndexes,
95
95
  startIndex: points.length,
96
- endIndex: points.length + seriesPoints.length
96
+ endIndex: points.length + seriesPoints.length,
97
+ markerSize: series[seriesId].markerSize
97
98
  };
98
99
  points = points.concat(seriesPoints);
99
100
  });
@@ -130,11 +131,12 @@ const useChartVoronoi = ({
130
131
  // The point index in the series with id=closestSeries.seriesId.
131
132
  const seriesPointIndex = (2 * closestPointIndex - voronoiRef.current[closestSeries.seriesId].startIndex) / 2;
132
133
  const dataIndex = voronoiRef.current[closestSeries.seriesId].seriesIndexes[seriesPointIndex];
133
- if (voronoiMaxRadius !== undefined) {
134
+ const maxRadius = voronoiMaxRadius === 'item' ? closestSeries.markerSize : voronoiMaxRadius;
135
+ if (maxRadius !== undefined) {
134
136
  const pointX = delauneyRef.current.points[2 * closestPointIndex];
135
137
  const pointY = delauneyRef.current.points[2 * closestPointIndex + 1];
136
138
  const dist2 = (pointX - svgPoint.x) ** 2 + (pointY - svgPoint.y) ** 2;
137
- if (dist2 > voronoiMaxRadius ** 2) {
139
+ if (dist2 > maxRadius ** 2) {
138
140
  // The closest point is too far to be considered.
139
141
  return 'outside-voronoi-max-radius';
140
142
  }
@@ -240,18 +242,18 @@ const useChartVoronoi = ({
240
242
  }
241
243
  };
242
244
  };
243
- exports.useChartVoronoi = useChartVoronoi;
244
- useChartVoronoi.getDefaultizedParams = ({
245
+ exports.useChartClosestPoint = useChartClosestPoint;
246
+ useChartClosestPoint.getDefaultizedParams = ({
245
247
  params
246
248
  }) => (0, _extends2.default)({}, params, {
247
249
  disableVoronoi: params.disableVoronoi ?? !params.series.some(item => item.type === 'scatter')
248
250
  });
249
- useChartVoronoi.getInitialState = params => ({
251
+ useChartClosestPoint.getInitialState = params => ({
250
252
  voronoi: {
251
253
  isVoronoiEnabled: !params.disableVoronoi
252
254
  }
253
255
  });
254
- useChartVoronoi.params = {
256
+ useChartClosestPoint.params = {
255
257
  disableVoronoi: true,
256
258
  voronoiMaxRadius: true,
257
259
  onItemClick: true
@@ -0,0 +1,5 @@
1
+ export declare const selectorChartsIsVoronoiEnabled: 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 & import("./useChartClosestPoint.types.js").UseChartVoronoiState & Partial<{}> & {
2
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
3
+ } & {
4
+ cacheKey: import("../../models/index.js").ChartStateCacheKey;
5
+ }, boolean | undefined, any[]>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.selectorChartsIsVoronoiEnabled = void 0;
7
+ var _selectors = require("../../utils/selectors");
8
+ const selectVoronoi = state => state.voronoi;
9
+ const selectorChartsIsVoronoiEnabled = exports.selectorChartsIsVoronoiEnabled = (0, _selectors.createSelector)([selectVoronoi], voronoi => voronoi?.isVoronoiEnabled);
@@ -29,10 +29,11 @@ export interface UseChartVoronoiParameters {
29
29
  */
30
30
  disableVoronoi?: boolean;
31
31
  /**
32
- * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
32
+ * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
33
+ * If set to `'item'`, the radius is the `markerSize`.
33
34
  * If `undefined`, the radius is assumed to be infinite.
34
35
  */
35
- voronoiMaxRadius?: number | undefined;
36
+ voronoiMaxRadius?: 'item' | number | undefined;
36
37
  /**
37
38
  * Callback fired when clicking close to an item.
38
39
  * This is only available for scatter plot for now.
@@ -41,10 +42,13 @@ export interface UseChartVoronoiParameters {
41
42
  */
42
43
  onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
43
44
  }
44
- export type UseChartVoronoiDefaultizedParameters = UseChartVoronoiParameters & {
45
+ export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'voronoiMaxRadius' | 'onItemClick'> & {
46
+ /**
47
+ * If true, the voronoi plugin is disabled.
48
+ */
45
49
  disableVoronoi: boolean;
46
50
  };
47
- export type UseChartVoronoiSignature = ChartPluginSignature<{
51
+ export type UseChartClosestPointSignature = ChartPluginSignature<{
48
52
  instance: UseChartVoronoiInstance;
49
53
  state: UseChartVoronoiState;
50
54
  params: UseChartVoronoiParameters;
@@ -0,0 +1,16 @@
1
+ import { HighlightItemData } from "./useChartHighlight.types.js";
2
+ import { HighlightScope } from "./highlightConfig.types.js";
3
+ import { SeriesId } from "../../../../models/seriesType/common.js";
4
+ export declare function isSeriesHighlighted(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): boolean;
5
+ export declare function isSeriesFaded(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): boolean;
6
+ /**
7
+ * Returns the data index of the highlighted item for a specific series.
8
+ * If the item is not highlighted, it returns `null`.
9
+ */
10
+ export declare function getSeriesHighlightedItem(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): number | null | undefined;
11
+ /**
12
+ * Returns the data index of the "unfaded item" for a specific series.
13
+ * An "unfaded item" is the only item of a faded series that shouldn't be faded.
14
+ * If the series is not faded or if there is no highlighted item, it returns `null`.
15
+ */
16
+ export declare function getSeriesUnfadedItem(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): number | null | undefined;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getSeriesHighlightedItem = getSeriesHighlightedItem;
7
+ exports.getSeriesUnfadedItem = getSeriesUnfadedItem;
8
+ exports.isSeriesFaded = isSeriesFaded;
9
+ exports.isSeriesHighlighted = isSeriesHighlighted;
10
+ function isSeriesHighlighted(scope, item, seriesId) {
11
+ return scope?.highlight === 'series' && item?.seriesId === seriesId;
12
+ }
13
+ function isSeriesFaded(scope, item, seriesId) {
14
+ if (isSeriesHighlighted(scope, item, seriesId)) {
15
+ return false;
16
+ }
17
+ return scope?.fade === 'global' && item != null || scope?.fade === 'series' && item?.seriesId === seriesId;
18
+ }
19
+
20
+ /**
21
+ * Returns the data index of the highlighted item for a specific series.
22
+ * If the item is not highlighted, it returns `null`.
23
+ */
24
+ function getSeriesHighlightedItem(scope, item, seriesId) {
25
+ return scope?.highlight === 'item' && item?.seriesId === seriesId ? item.dataIndex : null;
26
+ }
27
+
28
+ /**
29
+ * Returns the data index of the "unfaded item" for a specific series.
30
+ * An "unfaded item" is the only item of a faded series that shouldn't be faded.
31
+ * If the series is not faded or if there is no highlighted item, it returns `null`.
32
+ */
33
+ function getSeriesUnfadedItem(scope, item, seriesId) {
34
+ if (isSeriesHighlighted(scope, item, seriesId)) {
35
+ return null;
36
+ }
37
+ if (getSeriesHighlightedItem(scope, item, seriesId) === item?.dataIndex) {
38
+ return null;
39
+ }
40
+ return (scope?.fade === 'series' || scope?.fade === 'global') && item?.seriesId === seriesId ? item.dataIndex : null;
41
+ }
@@ -27,4 +27,8 @@ export declare const selectorChartsIsFadedCallback: import("reselect").Selector<
27
27
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
28
28
  } & import("./useChartHighlight.types.js").UseChartHighlightState, (item: HighlightItemData | null) => boolean, any[]>;
29
29
  export declare const selectorChartsIsHighlighted: import("reselect").Selector<any, boolean, [item: HighlightItemData | null]>;
30
+ export declare const selectorChartIsSeriesHighlighted: import("reselect").Selector<any, boolean, [seriesId: SeriesId]>;
31
+ export declare const selectorChartIsSeriesFaded: import("reselect").Selector<any, boolean, [seriesId: SeriesId]>;
32
+ export declare const selectorChartSeriesUnfadedItem: import("reselect").Selector<any, number | null | undefined, [seriesId: SeriesId]>;
33
+ export declare const selectorChartSeriesHighlightedItem: import("reselect").Selector<any, number | null | undefined, [seriesId: SeriesId]>;
30
34
  export declare const selectorChartsIsFaded: import("reselect").Selector<any, boolean, [item: HighlightItemData | null]>;
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.selectorChartsIsHighlightedCallback = exports.selectorChartsIsHighlighted = exports.selectorChartsIsFadedCallback = exports.selectorChartsIsFaded = exports.selectorChartsHighlightedItem = exports.selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScope = void 0;
6
+ exports.selectorChartsIsHighlightedCallback = exports.selectorChartsIsHighlighted = exports.selectorChartsIsFadedCallback = exports.selectorChartsIsFaded = exports.selectorChartsHighlightedItem = exports.selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScope = exports.selectorChartSeriesUnfadedItem = exports.selectorChartSeriesHighlightedItem = exports.selectorChartIsSeriesHighlighted = exports.selectorChartIsSeriesFaded = void 0;
7
7
  var _selectors = require("../../utils/selectors");
8
8
  var _createIsHighlighted = require("./createIsHighlighted");
9
9
  var _createIsFaded = require("./createIsFaded");
10
+ var _highlightStates = require("./highlightStates");
10
11
  const selectHighlight = state => state.highlight;
11
12
  const selectSeries = state => state.series;
12
13
  const selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScopePerSeriesId = (0, _selectors.createSelector)([selectSeries], series => {
@@ -38,6 +39,10 @@ const selectorChartsIsFadedCallback = exports.selectorChartsIsFadedCallback = (0
38
39
  const selectorChartsIsHighlighted = exports.selectorChartsIsHighlighted = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, item) => item], function selectorChartsIsHighlighted(highlightScope, highlightedItem, item) {
39
40
  return (0, _createIsHighlighted.createIsHighlighted)(highlightScope, highlightedItem)(item);
40
41
  });
42
+ const selectorChartIsSeriesHighlighted = exports.selectorChartIsSeriesHighlighted = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.isSeriesHighlighted);
43
+ const selectorChartIsSeriesFaded = exports.selectorChartIsSeriesFaded = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.isSeriesFaded);
44
+ const selectorChartSeriesUnfadedItem = exports.selectorChartSeriesUnfadedItem = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.getSeriesUnfadedItem);
45
+ const selectorChartSeriesHighlightedItem = exports.selectorChartSeriesHighlightedItem = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.getSeriesHighlightedItem);
41
46
  const selectorChartsIsFaded = exports.selectorChartsIsFaded = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, item) => item], function selectorChartsIsFaded(highlightScope, highlightedItem, item) {
42
47
  return (0, _createIsFaded.createIsFaded)(highlightScope, highlightedItem)(item);
43
48
  });
@@ -0,0 +1,3 @@
1
+ import { ChartAnyPluginSignature, ChartUsedInstance } from "../../models/plugin.js";
2
+ import { UseChartInteractionInstance } from "./useChartInteraction.types.js";
3
+ export declare function checkHasInteractionPlugin<T extends ChartAnyPluginSignature>(instance: ChartUsedInstance<T>): instance is ChartUsedInstance<T> & UseChartInteractionInstance;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.checkHasInteractionPlugin = checkHasInteractionPlugin;
7
+ function checkHasInteractionPlugin(instance) {
8
+ return instance.setPointerCoordinate !== undefined;
9
+ }