@fluentui/react-charts 0.0.0-nightly-20250423-1342.1 → 0.0.0-nightly-20250424-0405.1

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 (483) hide show
  1. package/CHANGELOG.md +16 -16
  2. package/dist/index.d.ts +3305 -0
  3. package/lib/AreaChart.js +1 -0
  4. package/lib/AreaChart.js.map +1 -0
  5. package/lib/CartesianChart.js +1 -0
  6. package/lib/CartesianChart.js.map +1 -0
  7. package/lib/DeclarativeChart.js +1 -0
  8. package/lib/DeclarativeChart.js.map +1 -0
  9. package/lib/DonutChart.js +1 -0
  10. package/lib/DonutChart.js.map +1 -0
  11. package/lib/GaugeChart.js +1 -0
  12. package/lib/GaugeChart.js.map +1 -0
  13. package/lib/GroupedVerticalBarChart.js +1 -0
  14. package/lib/GroupedVerticalBarChart.js.map +1 -0
  15. package/lib/HeatMapChart.js +1 -0
  16. package/lib/HeatMapChart.js.map +1 -0
  17. package/lib/HorizontalBarChart.js +1 -0
  18. package/lib/HorizontalBarChart.js.map +1 -0
  19. package/lib/HorizontalBarChartWithAxis.js +1 -0
  20. package/lib/HorizontalBarChartWithAxis.js.map +1 -0
  21. package/lib/Legends.js +1 -0
  22. package/lib/Legends.js.map +1 -0
  23. package/lib/LineChart.js +1 -0
  24. package/lib/LineChart.js.map +1 -0
  25. package/lib/Popover.js +1 -0
  26. package/lib/Popover.js.map +1 -0
  27. package/lib/ResponsiveContainer.js +1 -0
  28. package/lib/ResponsiveContainer.js.map +1 -0
  29. package/lib/SankeyChart.js +1 -0
  30. package/lib/SankeyChart.js.map +1 -0
  31. package/lib/ScatterChart.js +1 -0
  32. package/lib/ScatterChart.js.map +1 -0
  33. package/lib/Sparkline.js +1 -0
  34. package/lib/Sparkline.js.map +1 -0
  35. package/lib/VerticalBarChart.js +1 -0
  36. package/lib/VerticalBarChart.js.map +1 -0
  37. package/lib/VerticalStackedBarChart.js +1 -0
  38. package/lib/VerticalStackedBarChart.js.map +1 -0
  39. package/lib/components/AreaChart/AreaChart.js +775 -0
  40. package/lib/components/AreaChart/AreaChart.js.map +1 -0
  41. package/lib/components/AreaChart/AreaChart.types.js +4 -0
  42. package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
  43. package/lib/components/AreaChart/index.js +3 -0
  44. package/lib/components/AreaChart/index.js.map +1 -0
  45. package/lib/components/AreaChart/useAreaChartStyles.styles.js +55 -0
  46. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
  47. package/lib/components/CommonComponents/CartesianChart.js +478 -0
  48. package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
  49. package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
  50. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
  51. package/lib/components/CommonComponents/ChartPopover.js +187 -0
  52. package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
  53. package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
  54. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
  55. package/lib/components/CommonComponents/index.js +4 -0
  56. package/lib/components/CommonComponents/index.js.map +1 -0
  57. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +113 -0
  58. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  59. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +167 -0
  60. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  61. package/lib/components/DeclarativeChart/DeclarativeChart.js +197 -0
  62. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  63. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +811 -0
  64. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  65. package/lib/components/DeclarativeChart/imageExporter.js +221 -0
  66. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
  67. package/lib/components/DeclarativeChart/index.js +1 -0
  68. package/lib/components/DeclarativeChart/index.js.map +1 -0
  69. package/lib/components/DonutChart/Arc/Arc.js +110 -0
  70. package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
  71. package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
  72. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
  73. package/lib/components/DonutChart/Arc/index.js +2 -0
  74. package/lib/components/DonutChart/Arc/index.js.map +1 -0
  75. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
  76. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  77. package/lib/components/DonutChart/DonutChart.js +291 -0
  78. package/lib/components/DonutChart/DonutChart.js.map +1 -0
  79. package/lib/components/DonutChart/DonutChart.types.js +1 -0
  80. package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
  81. package/lib/components/DonutChart/Pie/Pie.js +72 -0
  82. package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
  83. package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
  84. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
  85. package/lib/components/DonutChart/Pie/index.js +2 -0
  86. package/lib/components/DonutChart/Pie/index.js.map +1 -0
  87. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +40 -0
  88. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  89. package/lib/components/DonutChart/index.js +3 -0
  90. package/lib/components/DonutChart/index.js.map +1 -0
  91. package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
  92. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  93. package/lib/components/GaugeChart/GaugeChart.js +592 -0
  94. package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
  95. package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
  96. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
  97. package/lib/components/GaugeChart/index.js +3 -0
  98. package/lib/components/GaugeChart/index.js.map +1 -0
  99. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +178 -0
  100. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  101. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
  102. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  103. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
  104. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  105. package/lib/components/GroupedVerticalBarChart/index.js +3 -0
  106. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
  107. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +81 -0
  108. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  109. package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
  110. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
  111. package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
  112. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  113. package/lib/components/HeatMapChart/index.js +3 -0
  114. package/lib/components/HeatMapChart/index.js.map +1 -0
  115. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +37 -0
  116. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
  117. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
  118. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  119. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
  120. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  121. package/lib/components/HorizontalBarChart/index.js +3 -0
  122. package/lib/components/HorizontalBarChart/index.js.map +1 -0
  123. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +156 -0
  124. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  125. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
  126. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
  127. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
  128. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
  129. package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
  130. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
  131. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +67 -0
  132. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
  133. package/lib/components/Legends/Legends.js +303 -0
  134. package/lib/components/Legends/Legends.js.map +1 -0
  135. package/lib/components/Legends/Legends.types.js +1 -0
  136. package/lib/components/Legends/Legends.types.js.map +1 -0
  137. package/lib/components/Legends/OverflowMenu.js +25 -0
  138. package/lib/components/Legends/OverflowMenu.js.map +1 -0
  139. package/lib/components/Legends/index.js +3 -0
  140. package/lib/components/Legends/index.js.map +1 -0
  141. package/lib/components/Legends/shape.js +35 -0
  142. package/lib/components/Legends/shape.js.map +1 -0
  143. package/lib/components/Legends/useLegendsStyles.styles.js +146 -0
  144. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
  145. package/lib/components/LineChart/LineChart.js +1034 -0
  146. package/lib/components/LineChart/LineChart.js.map +1 -0
  147. package/lib/components/LineChart/LineChart.types.js +3 -0
  148. package/lib/components/LineChart/LineChart.types.js.map +1 -0
  149. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
  150. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  151. package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
  152. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  153. package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
  154. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  155. package/lib/components/LineChart/index.js +4 -0
  156. package/lib/components/LineChart/index.js.map +1 -0
  157. package/lib/components/LineChart/useLineChartStyles.styles.js +56 -0
  158. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  159. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
  160. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  161. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
  162. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  163. package/lib/components/ResponsiveContainer/index.js +1 -0
  164. package/lib/components/ResponsiveContainer/index.js.map +1 -0
  165. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
  166. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  167. package/lib/components/SankeyChart/SankeyChart.js +1023 -0
  168. package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
  169. package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
  170. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
  171. package/lib/components/SankeyChart/index.js +3 -0
  172. package/lib/components/SankeyChart/index.js.map +1 -0
  173. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
  174. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
  175. package/lib/components/ScatterChart/ScatterChart.js +465 -0
  176. package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
  177. package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
  178. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
  179. package/lib/components/ScatterChart/index.js +3 -0
  180. package/lib/components/ScatterChart/index.js.map +1 -0
  181. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +56 -0
  182. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  183. package/lib/components/Sparkline/Sparkline.js +119 -0
  184. package/lib/components/Sparkline/Sparkline.js.map +1 -0
  185. package/lib/components/Sparkline/Sparkline.types.js +4 -0
  186. package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
  187. package/lib/components/Sparkline/index.js +3 -0
  188. package/lib/components/Sparkline/index.js.map +1 -0
  189. package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
  190. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  191. package/lib/components/VerticalBarChart/VerticalBarChart.js +926 -0
  192. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  193. package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
  194. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  195. package/lib/components/VerticalBarChart/index.js +3 -0
  196. package/lib/components/VerticalBarChart/index.js.map +1 -0
  197. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +66 -0
  198. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  199. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
  200. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  201. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
  202. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  203. package/lib/components/VerticalStackedBarChart/index.js +3 -0
  204. package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
  205. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +65 -0
  206. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
  207. package/lib/index.js +20 -0
  208. package/lib/index.js.map +1 -0
  209. package/lib/types/DataPoint.js +1 -0
  210. package/lib/types/DataPoint.js.map +1 -0
  211. package/lib/types/EventAnnotation.js +1 -0
  212. package/lib/types/EventAnnotation.js.map +1 -0
  213. package/lib/types/LegendDataItem.js +1 -0
  214. package/lib/types/LegendDataItem.js.map +1 -0
  215. package/lib/types/index.js +2 -0
  216. package/lib/types/index.js.map +1 -0
  217. package/lib/utilities/FocusableTooltipText.js +65 -0
  218. package/lib/utilities/FocusableTooltipText.js.map +1 -0
  219. package/lib/utilities/KeyCodes.js +8 -0
  220. package/lib/utilities/KeyCodes.js.map +1 -0
  221. package/lib/utilities/SVGTooltipText.js +183 -0
  222. package/lib/utilities/SVGTooltipText.js.map +1 -0
  223. package/lib/utilities/async-utils.js +380 -0
  224. package/lib/utilities/async-utils.js.map +1 -0
  225. package/lib/utilities/colors.js +269 -0
  226. package/lib/utilities/colors.js.map +1 -0
  227. package/lib/utilities/getWindow.js +25 -0
  228. package/lib/utilities/getWindow.js.map +1 -0
  229. package/lib/utilities/index.js +3 -0
  230. package/lib/utilities/index.js.map +1 -0
  231. package/lib/utilities/locale-util.js +15 -0
  232. package/lib/utilities/locale-util.js.map +1 -0
  233. package/lib/utilities/overflow-utils.js +27 -0
  234. package/lib/utilities/overflow-utils.js.map +1 -0
  235. package/lib/utilities/string.js +32 -0
  236. package/lib/utilities/string.js.map +1 -0
  237. package/lib/utilities/test-data.js +329 -0
  238. package/lib/utilities/test-data.js.map +1 -0
  239. package/lib/utilities/utilities.js +1405 -0
  240. package/lib/utilities/utilities.js.map +1 -0
  241. package/lib/utilities/vbc-utils.js +27 -0
  242. package/lib/utilities/vbc-utils.js.map +1 -0
  243. package/lib-commonjs/AreaChart.js +6 -0
  244. package/lib-commonjs/AreaChart.js.map +1 -0
  245. package/lib-commonjs/CartesianChart.js +6 -0
  246. package/lib-commonjs/CartesianChart.js.map +1 -0
  247. package/lib-commonjs/DeclarativeChart.js +6 -0
  248. package/lib-commonjs/DeclarativeChart.js.map +1 -0
  249. package/lib-commonjs/DonutChart.js +6 -0
  250. package/lib-commonjs/DonutChart.js.map +1 -0
  251. package/lib-commonjs/GaugeChart.js +6 -0
  252. package/lib-commonjs/GaugeChart.js.map +1 -0
  253. package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
  254. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
  255. package/lib-commonjs/HeatMapChart.js +6 -0
  256. package/lib-commonjs/HeatMapChart.js.map +1 -0
  257. package/lib-commonjs/HorizontalBarChart.js +6 -0
  258. package/lib-commonjs/HorizontalBarChart.js.map +1 -0
  259. package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
  260. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
  261. package/lib-commonjs/Legends.js +6 -0
  262. package/lib-commonjs/Legends.js.map +1 -0
  263. package/lib-commonjs/LineChart.js +6 -0
  264. package/lib-commonjs/LineChart.js.map +1 -0
  265. package/lib-commonjs/Popover.js +6 -0
  266. package/lib-commonjs/Popover.js.map +1 -0
  267. package/lib-commonjs/ResponsiveContainer.js +6 -0
  268. package/lib-commonjs/ResponsiveContainer.js.map +1 -0
  269. package/lib-commonjs/SankeyChart.js +6 -0
  270. package/lib-commonjs/SankeyChart.js.map +1 -0
  271. package/lib-commonjs/ScatterChart.js +6 -0
  272. package/lib-commonjs/ScatterChart.js.map +1 -0
  273. package/lib-commonjs/Sparkline.js +6 -0
  274. package/lib-commonjs/Sparkline.js.map +1 -0
  275. package/lib-commonjs/VerticalBarChart.js +6 -0
  276. package/lib-commonjs/VerticalBarChart.js.map +1 -0
  277. package/lib-commonjs/VerticalStackedBarChart.js +6 -0
  278. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
  279. package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
  280. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
  281. package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
  282. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
  283. package/lib-commonjs/components/AreaChart/index.js +8 -0
  284. package/lib-commonjs/components/AreaChart/index.js.map +1 -0
  285. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +95 -0
  286. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
  287. package/lib-commonjs/components/CommonComponents/CartesianChart.js +484 -0
  288. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
  289. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
  290. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
  291. package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
  292. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
  293. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
  294. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
  295. package/lib-commonjs/components/CommonComponents/index.js +9 -0
  296. package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
  297. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +166 -0
  298. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  299. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +236 -0
  300. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  301. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +205 -0
  302. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  303. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +859 -0
  304. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  305. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
  306. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
  307. package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
  308. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
  309. package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
  310. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
  311. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
  312. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
  313. package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
  314. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
  315. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
  316. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  317. package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
  318. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
  319. package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
  320. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
  321. package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
  322. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
  323. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
  324. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
  325. package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
  326. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
  327. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +54 -0
  328. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  329. package/lib-commonjs/components/DonutChart/index.js +8 -0
  330. package/lib-commonjs/components/DonutChart/index.js.map +1 -0
  331. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
  332. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  333. package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
  334. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
  335. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
  336. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
  337. package/lib-commonjs/components/GaugeChart/index.js +8 -0
  338. package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
  339. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +258 -0
  340. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  341. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
  342. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  343. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
  344. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  345. package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
  346. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
  347. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +130 -0
  348. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  349. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
  350. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
  351. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
  352. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  353. package/lib-commonjs/components/HeatMapChart/index.js +8 -0
  354. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
  355. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +59 -0
  356. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
  357. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
  358. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  359. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
  360. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  361. package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
  362. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
  363. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +237 -0
  364. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  365. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
  366. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
  367. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
  368. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
  369. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
  370. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
  371. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +107 -0
  372. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
  373. package/lib-commonjs/components/Legends/Legends.js +313 -0
  374. package/lib-commonjs/components/Legends/Legends.js.map +1 -0
  375. package/lib-commonjs/components/Legends/Legends.types.js +6 -0
  376. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
  377. package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
  378. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
  379. package/lib-commonjs/components/Legends/index.js +8 -0
  380. package/lib-commonjs/components/Legends/index.js.map +1 -0
  381. package/lib-commonjs/components/Legends/shape.js +46 -0
  382. package/lib-commonjs/components/Legends/shape.js.map +1 -0
  383. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
  384. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
  385. package/lib-commonjs/components/LineChart/LineChart.js +1040 -0
  386. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
  387. package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
  388. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
  389. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
  390. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  391. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
  392. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  393. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
  394. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  395. package/lib-commonjs/components/LineChart/index.js +9 -0
  396. package/lib-commonjs/components/LineChart/index.js.map +1 -0
  397. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +87 -0
  398. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  399. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
  400. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  401. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
  402. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  403. package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
  404. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
  405. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
  406. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  407. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1039 -0
  408. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
  409. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
  410. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
  411. package/lib-commonjs/components/SankeyChart/index.js +8 -0
  412. package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
  413. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
  414. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
  415. package/lib-commonjs/components/ScatterChart/ScatterChart.js +471 -0
  416. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
  417. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
  418. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
  419. package/lib-commonjs/components/ScatterChart/index.js +8 -0
  420. package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
  421. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +87 -0
  422. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  423. package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
  424. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
  425. package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
  426. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
  427. package/lib-commonjs/components/Sparkline/index.js +8 -0
  428. package/lib-commonjs/components/Sparkline/index.js.map +1 -0
  429. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
  430. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  431. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +928 -0
  432. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  433. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
  434. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  435. package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
  436. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
  437. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +110 -0
  438. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  439. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
  440. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  441. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
  442. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  443. package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
  444. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
  445. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +113 -0
  446. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
  447. package/lib-commonjs/index.js +25 -0
  448. package/lib-commonjs/index.js.map +1 -0
  449. package/lib-commonjs/types/DataPoint.js +4 -0
  450. package/lib-commonjs/types/DataPoint.js.map +1 -0
  451. package/lib-commonjs/types/EventAnnotation.js +6 -0
  452. package/lib-commonjs/types/EventAnnotation.js.map +1 -0
  453. package/lib-commonjs/types/LegendDataItem.js +4 -0
  454. package/lib-commonjs/types/LegendDataItem.js.map +1 -0
  455. package/lib-commonjs/types/index.js +7 -0
  456. package/lib-commonjs/types/index.js.map +1 -0
  457. package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
  458. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
  459. package/lib-commonjs/utilities/KeyCodes.js +18 -0
  460. package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
  461. package/lib-commonjs/utilities/SVGTooltipText.js +193 -0
  462. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
  463. package/lib-commonjs/utilities/async-utils.js +382 -0
  464. package/lib-commonjs/utilities/async-utils.js.map +1 -0
  465. package/lib-commonjs/utilities/colors.js +293 -0
  466. package/lib-commonjs/utilities/colors.js.map +1 -0
  467. package/lib-commonjs/utilities/getWindow.js +28 -0
  468. package/lib-commonjs/utilities/getWindow.js.map +1 -0
  469. package/lib-commonjs/utilities/index.js +8 -0
  470. package/lib-commonjs/utilities/index.js.map +1 -0
  471. package/lib-commonjs/utilities/locale-util.js +25 -0
  472. package/lib-commonjs/utilities/locale-util.js.map +1 -0
  473. package/lib-commonjs/utilities/overflow-utils.js +36 -0
  474. package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
  475. package/lib-commonjs/utilities/string.js +29 -0
  476. package/lib-commonjs/utilities/string.js.map +1 -0
  477. package/lib-commonjs/utilities/test-data.js +383 -0
  478. package/lib-commonjs/utilities/test-data.js.map +1 -0
  479. package/lib-commonjs/utilities/utilities.js +1371 -0
  480. package/lib-commonjs/utilities/utilities.js.map +1 -0
  481. package/lib-commonjs/utilities/vbc-utils.js +45 -0
  482. package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
  483. package/package.json +13 -13
@@ -0,0 +1,775 @@
1
+ import * as React from 'react';
2
+ import { useAreaChartStyles } from './useAreaChartStyles.styles';
3
+ import { max as d3Max, bisector } from 'd3-array';
4
+ import { pointer } from 'd3-selection';
5
+ import { select as d3Select } from 'd3-selection';
6
+ import { tokens } from '@fluentui/react-theme';
7
+ import { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';
8
+ import { CartesianChart } from '../../index';
9
+ import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, tooltipOfXAxislabels, getNextColor, getColorFromToken, formatDate, getSecureProps, areArraysEqual, getCurveFactory, find } from '../../utilities/index';
10
+ import { useId } from '@fluentui/react-utilities';
11
+ import { Legends } from '../Legends/index';
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ const bisect = bisector((d)=>d.x).left;
14
+ var InterceptVisibility;
15
+ (function(InterceptVisibility) {
16
+ InterceptVisibility["show"] = "visibility";
17
+ InterceptVisibility["hide"] = "hidden";
18
+ })(InterceptVisibility || (InterceptVisibility = {}));
19
+ //by default d3-shape 3.2.0 limits the< path> data point precision to 3 digits(d3/d3-path#10)
20
+ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
21
+ var _props_legendProps;
22
+ const _uniqueIdForGraph = useId('areaChart_');
23
+ const _verticalLineId = useId('verticalLine_');
24
+ const _circleId = useId('circle');
25
+ const _rectId = useId('rectangle');
26
+ const _tooltipId = useId('AreaChartTooltipID');
27
+ //enableComputationOptimization is used for optimized code to group data points by x value
28
+ //from O(n^2) to O(n) using a map.
29
+ const _enableComputationOptimization = true;
30
+ const _firstRenderOptimization = true;
31
+ const _emptyChartId = useId('_AreaChart_empty');
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ let _calloutPoints;
34
+ let _createSet;
35
+ let _colors;
36
+ let _opacity;
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ let _data;
39
+ let _chart;
40
+ let _margins;
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ let _xAxisRectScale;
43
+ // determines if the given area chart has multiple stacked bar charts
44
+ let _isMultiStackChart;
45
+ const cartesianChartRef = React.useRef(null);
46
+ const [selectedLegends, setSelectedLegends] = React.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
47
+ const [activeLegend, setActiveLegend] = React.useState(undefined);
48
+ const [hoverXValue, setHoverXValue] = React.useState('');
49
+ // eslint-disable-next-line @typescript-eslint/no-shadow
50
+ const [YValueHover, setYValueHover] = React.useState([]);
51
+ const [lineXValue, setLineXValue] = React.useState(0);
52
+ const [displayOfLine, setDisplayOfLine] = React.useState("hidden");
53
+ const [isCircleClicked, setIsCircleClicked] = React.useState(false);
54
+ const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState(null);
55
+ const [activePoint, setActivePoint] = React.useState('');
56
+ const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState();
57
+ const [stackCalloutProps, setStackCalloutProps] = React.useState();
58
+ const [xAxisCalloutAccessibilityData, setXAxisCalloutAccessibilityData] = React.useState();
59
+ const [clickPosition, setClickPosition] = React.useState({
60
+ x: 0,
61
+ y: 0
62
+ });
63
+ const [isPopoverOpen, setPopoverOpen] = React.useState(false);
64
+ const prevPropsRef = React.useRef(null);
65
+ React.useEffect(()=>{
66
+ if (prevPropsRef.current) {
67
+ var _prevProps_legendProps, _props_legendProps;
68
+ const prevProps = prevPropsRef.current;
69
+ if (!areArraysEqual((_prevProps_legendProps = prevProps.legendProps) === null || _prevProps_legendProps === void 0 ? void 0 : _prevProps_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
70
+ var _props_legendProps1;
71
+ setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
72
+ }
73
+ }
74
+ prevPropsRef.current = props;
75
+ }, [
76
+ props
77
+ ]);
78
+ React.useImperativeHandle(props.componentRef, ()=>{
79
+ var _cartesianChartRef_current;
80
+ var _cartesianChartRef_current_chartContainer;
81
+ return {
82
+ chartContainer: (_cartesianChartRef_current_chartContainer = (_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) !== null && _cartesianChartRef_current_chartContainer !== void 0 ? _cartesianChartRef_current_chartContainer : null
83
+ };
84
+ }, []);
85
+ const classes = useAreaChartStyles(props);
86
+ function _getMargins(margins) {
87
+ _margins = margins;
88
+ }
89
+ function _onRectMouseMove(mouseEvent) {
90
+ mouseEvent.persist();
91
+ const { data } = props;
92
+ const { lineChartData } = data;
93
+ _updatePosition(mouseEvent.clientX, mouseEvent.clientY);
94
+ // This will get the value of the X when mouse is on the chart
95
+ // eslint-disable-next-line @nx/workspace-no-restricted-globals
96
+ const xOffset = _xAxisRectScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId));
97
+ const i = bisect(lineChartData[0].data, xOffset);
98
+ const d0 = lineChartData[0].data[i - 1];
99
+ const d1 = lineChartData[0].data[i];
100
+ let pointToHighlight = null;
101
+ let index = null;
102
+ const axisType = lineChartData[0].data.length > 0 ? getTypeOfAxis(lineChartData[0].data[0].x, true) : null;
103
+ if (d0 === undefined && d1 !== undefined) {
104
+ pointToHighlight = d1.x;
105
+ index = i;
106
+ } else if (d0 !== undefined && d1 === undefined) {
107
+ pointToHighlight = d0.x;
108
+ index = i - 1;
109
+ } else {
110
+ let x0;
111
+ let point0;
112
+ let point1;
113
+ switch(axisType){
114
+ case XAxisTypes.DateAxis:
115
+ x0 = new Date(xOffset).getTime();
116
+ point0 = d0.x.getTime();
117
+ point1 = d1.x.getTime();
118
+ pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;
119
+ index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;
120
+ break;
121
+ case XAxisTypes.NumericAxis:
122
+ x0 = xOffset;
123
+ point0 = d0.x;
124
+ point1 = d1.x;
125
+ pointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;
126
+ index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;
127
+ break;
128
+ default:
129
+ break;
130
+ }
131
+ }
132
+ // eslint-disable-next-line @typescript-eslint/no-shadow
133
+ const { xAxisCalloutData, xAxisCalloutAccessibilityData } = lineChartData[0].data[index];
134
+ const formattedDate = pointToHighlight instanceof Date ? formatDate(pointToHighlight, props.useUTC) : pointToHighlight;
135
+ const modifiedXVal = pointToHighlight instanceof Date ? pointToHighlight.getTime() : pointToHighlight;
136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
+ const found = find(_calloutPoints, (element)=>{
138
+ return element.x === modifiedXVal;
139
+ });
140
+ // eslint-disable-next-line @typescript-eslint/no-shadow
141
+ const _nearestCircleToHighlight = axisType === XAxisTypes.DateAxis ? pointToHighlight.getTime() : pointToHighlight;
142
+ // if no points need to be called out then don't show vertical line and callout card
143
+ if (found) {
144
+ const filteredValues = _getFilteredLegendValues(found.values);
145
+ setNearestCircleToHighlight(_nearestCircleToHighlight);
146
+ setLineXValue(_xAxisRectScale(pointToHighlight));
147
+ setDisplayOfLine("visibility");
148
+ setIsCircleClicked(false);
149
+ setStackCalloutProps({
150
+ ...found,
151
+ values: filteredValues
152
+ });
153
+ setYValueHover(filteredValues);
154
+ setDataPointCalloutProps({
155
+ ...found,
156
+ values: filteredValues
157
+ });
158
+ setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);
159
+ setXAxisCalloutAccessibilityData(xAxisCalloutAccessibilityData);
160
+ setActivePoint('');
161
+ } else {
162
+ setPopoverOpen(false);
163
+ setNearestCircleToHighlight(nearestCircleToHighlight);
164
+ setDisplayOfLine("hidden");
165
+ setIsCircleClicked(false);
166
+ }
167
+ }
168
+ /**
169
+ * just cleaning up the state which we have set in the mouse move event
170
+ */ function _onRectMouseOut() {
171
+ /**/ }
172
+ function _updatePosition(newX, newY) {
173
+ const threshold = 1; // Set a threshold for movement
174
+ const { x, y } = clickPosition;
175
+ // Calculate the distance moved
176
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
177
+ // Update the position only if the distance moved is greater than the threshold
178
+ if (distance > threshold) {
179
+ setClickPosition({
180
+ x: newX,
181
+ y: newY
182
+ });
183
+ setPopoverOpen(true);
184
+ }
185
+ }
186
+ function _handleChartMouseLeave() {
187
+ setPopoverOpen(false);
188
+ setNearestCircleToHighlight(null);
189
+ setLineXValue(0);
190
+ setDisplayOfLine("hidden");
191
+ setIsCircleClicked(false);
192
+ setStackCalloutProps(undefined);
193
+ setDataPointCalloutProps(undefined);
194
+ setHoverXValue(undefined);
195
+ setYValueHover([]);
196
+ }
197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
+ function _getDataPoints(keys, dataSet) {
199
+ var _props_legendProps;
200
+ const renderPoints = [];
201
+ let maxOfYVal = 0;
202
+ if (props.mode === 'tozeroy') {
203
+ keys.forEach((key, index)=>{
204
+ const currentLayer = [];
205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
206
+ dataSet.forEach((d)=>{
207
+ currentLayer.push({
208
+ values: [
209
+ 0,
210
+ d[key]
211
+ ],
212
+ xVal: d.xVal
213
+ });
214
+ if (d[key] > maxOfYVal) {
215
+ maxOfYVal = d[key];
216
+ }
217
+ });
218
+ renderPoints.push(currentLayer);
219
+ });
220
+ } else {
221
+ const dataValues = d3Stack().keys(keys)(dataSet);
222
+ maxOfYVal = d3Max(dataValues[dataValues.length - 1], (dp)=>dp[1]);
223
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
224
+ dataValues.forEach((layer)=>{
225
+ const currentLayer = [];
226
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
+ layer.forEach((d)=>{
228
+ currentLayer.push({
229
+ values: d,
230
+ xVal: d.data.xVal
231
+ });
232
+ });
233
+ renderPoints.push(currentLayer);
234
+ });
235
+ }
236
+ _isMultiStackChart = !!(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) ? (renderPoints === null || renderPoints === void 0 ? void 0 : renderPoints.length) >= 1 : (renderPoints === null || renderPoints === void 0 ? void 0 : renderPoints.length) > 1);
237
+ return {
238
+ renderData: renderPoints,
239
+ maxOfYVal
240
+ };
241
+ }
242
+ function _createDataSet(points) {
243
+ if (props.enablePerfOptimization && _enableComputationOptimization) {
244
+ const allChartPoints = [];
245
+ const dataSet = [];
246
+ const colors = [];
247
+ const opacity = [];
248
+ const calloutPoints = calloutData(points);
249
+ points && points.length && points.forEach((singleChartPoint)=>{
250
+ colors.push(singleChartPoint.color);
251
+ opacity.push(singleChartPoint.opacity || 1);
252
+ allChartPoints.push(...singleChartPoint.data);
253
+ });
254
+ const mapOfXvalToListOfDataPoints = {};
255
+ allChartPoints.forEach((dataPoint)=>{
256
+ const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;
257
+ // map of x value to the list of data points which share the same x value .
258
+ if (mapOfXvalToListOfDataPoints[xValue]) {
259
+ mapOfXvalToListOfDataPoints[xValue].push(dataPoint);
260
+ } else {
261
+ mapOfXvalToListOfDataPoints[xValue] = [
262
+ dataPoint
263
+ ];
264
+ }
265
+ });
266
+ Object.keys(mapOfXvalToListOfDataPoints).forEach((key)=>{
267
+ const value = mapOfXvalToListOfDataPoints[key];
268
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
269
+ const singleDataset = {};
270
+ value.forEach((singleDataPoint, index)=>{
271
+ singleDataset.xVal = singleDataPoint.x;
272
+ singleDataset[`chart${index}`] = singleDataPoint.y;
273
+ });
274
+ dataSet.push(singleDataset);
275
+ });
276
+ // get keys from dataset, used to render data
277
+ const keysLength = dataSet && Object.keys(dataSet[0]).length;
278
+ const keys = [];
279
+ for(let i = 0; i < keysLength - 1; i++){
280
+ const keyVal = `chart${i}`;
281
+ keys.push(keyVal);
282
+ }
283
+ // Data used to draw graph
284
+ const data = _getDataPoints(keys, dataSet);
285
+ return {
286
+ colors,
287
+ opacity,
288
+ keys,
289
+ data,
290
+ calloutPoints
291
+ };
292
+ } else {
293
+ const allChartPoints = [];
294
+ const dataSet = [];
295
+ const colors = [];
296
+ const opacity = [];
297
+ const calloutPoints = calloutData(points);
298
+ points && points.length && points.forEach((singleChartPoint)=>{
299
+ colors.push(singleChartPoint.color);
300
+ opacity.push(singleChartPoint.opacity || 1);
301
+ allChartPoints.push(...singleChartPoint.data);
302
+ });
303
+ let tempArr = allChartPoints;
304
+ while(tempArr.length){
305
+ const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
306
+ const filteredChartPoints = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck);
307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
308
+ const singleDataset = {};
309
+ filteredChartPoints.forEach((singleDataPoint, index)=>{
310
+ singleDataset.xVal = singleDataPoint.x;
311
+ singleDataset[`chart${index}`] = singleDataPoint.y;
312
+ });
313
+ dataSet.push(singleDataset);
314
+ // removing compared objects from array
315
+ const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
316
+ tempArr = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val);
317
+ }
318
+ // get keys from dataset, used to create stacked data
319
+ const keysLength = dataSet && Object.keys(dataSet[0]).length;
320
+ const keys = [];
321
+ for(let i = 0; i < keysLength - 1; i++){
322
+ const keyVal = `chart${i}`;
323
+ keys.push(keyVal);
324
+ }
325
+ // Data used to draw graph
326
+ const data = _getDataPoints(keys, dataSet);
327
+ return {
328
+ colors,
329
+ opacity,
330
+ keys,
331
+ data,
332
+ calloutPoints
333
+ };
334
+ }
335
+ }
336
+ function _getCustomizedCallout() {
337
+ return props.onRenderCalloutPerStack ? props.onRenderCalloutPerStack(stackCalloutProps) : props.onRenderCalloutPerDataPoint ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps) : null;
338
+ }
339
+ function _getGraphData(// eslint-disable-next-line @typescript-eslint/no-explicit-any
340
+ xAxis, // eslint-disable-next-line @typescript-eslint/no-explicit-any
341
+ yAxis, containerHeight, containerWidth, xElement) {
342
+ _chart = _drawGraph(containerHeight, xAxis, yAxis, xElement);
343
+ }
344
+ function _onLegendHover(legend) {
345
+ setActiveLegend(legend);
346
+ }
347
+ function _onLegendLeave() {
348
+ setActiveLegend(undefined);
349
+ }
350
+ function _getLegendData(points) {
351
+ const data = points;
352
+ const actions = [];
353
+ data.forEach((singleChartData)=>{
354
+ const color = singleChartData.color;
355
+ const checkSimilarLegends = actions.filter((leg)=>leg.title === singleChartData.legend && leg.color === color);
356
+ if (checkSimilarLegends.length > 0) {
357
+ return;
358
+ }
359
+ const legend = {
360
+ title: singleChartData.legend,
361
+ color,
362
+ hoverAction: ()=>{
363
+ _handleChartMouseLeave();
364
+ _onLegendHover(singleChartData.legend);
365
+ },
366
+ onMouseOutAction: ()=>{
367
+ _onLegendLeave();
368
+ }
369
+ };
370
+ actions.push(legend);
371
+ });
372
+ return /*#__PURE__*/ React.createElement(Legends, {
373
+ legends: actions,
374
+ enabledWrapLines: props.enabledLegendsWrapLines,
375
+ ...props.legendProps,
376
+ onChange: _onLegendSelectionChange
377
+ });
378
+ }
379
+ function _onLegendSelectionChange(// eslint-disable-next-line @typescript-eslint/no-shadow
380
+ selectedLegends, event, currentLegend) {
381
+ var _props_legendProps, _props_legendProps1;
382
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
383
+ setSelectedLegends(selectedLegends);
384
+ } else {
385
+ setSelectedLegends(selectedLegends.slice(-1));
386
+ }
387
+ if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
388
+ props.legendProps.onChange(selectedLegends, event, currentLegend);
389
+ }
390
+ }
391
+ function _onDataPointClick(func) {
392
+ if (func) {
393
+ func();
394
+ }
395
+ setIsCircleClicked(true);
396
+ }
397
+ function _getOpacity(legend) {
398
+ if (!_isMultiStackChart) {
399
+ return 0.7;
400
+ } else {
401
+ const opacity = _legendHighlighted(legend) || _noLegendHighlighted() ? 0.7 : 0.1;
402
+ return opacity;
403
+ }
404
+ }
405
+ function _getLineOpacity(legend) {
406
+ if (!_isMultiStackChart) {
407
+ return 1;
408
+ } else {
409
+ let opacity = 0.3;
410
+ if (isPopoverOpen) {
411
+ opacity = 1;
412
+ }
413
+ if (!_noLegendHighlighted()) {
414
+ opacity = _legendHighlighted(legend) ? 0 : 0.1;
415
+ }
416
+ return opacity;
417
+ }
418
+ }
419
+ function _updateCircleFillColor(xDataPoint, lineColor, circleId) {
420
+ let fillColor = lineColor;
421
+ if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {
422
+ if (!isCircleClicked) {
423
+ fillColor = tokens.colorNeutralBackground1;
424
+ }
425
+ }
426
+ return fillColor;
427
+ }
428
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
429
+ function _drawGraph(containerHeight, xScale, yScale, xElement) {
430
+ const points = _addDefaultColors(props.data.lineChartData);
431
+ const { pointOptions, pointLineOptions } = props.data;
432
+ const graph = [];
433
+ let lineColor;
434
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
435
+ _data.forEach((singleStackedData, index)=>{
436
+ var _points_index_lineOptions, _points_index_lineOptions1, _points_index_lineOptions2, _points_index_lineOptions3, _points_index_lineOptions4;
437
+ const curveFactory = getCurveFactory((_points_index_lineOptions = points[index].lineOptions) === null || _points_index_lineOptions === void 0 ? void 0 : _points_index_lineOptions.curve, d3CurveBasis);
438
+ const area = d3Area()// eslint-disable-next-line @typescript-eslint/no-explicit-any
439
+ .x((d)=>xScale(d.xVal))// eslint-disable-next-line @typescript-eslint/no-explicit-any
440
+ .y0((d)=>yScale(d.values[0]))// eslint-disable-next-line @typescript-eslint/no-explicit-any
441
+ .y1((d)=>yScale(d.values[1])).curve(curveFactory);
442
+ const line = d3Line()// eslint-disable-next-line @typescript-eslint/no-explicit-any
443
+ .x((d)=>xScale(d.xVal))// eslint-disable-next-line @typescript-eslint/no-explicit-any
444
+ .y((d)=>yScale(d.values[1])).curve(curveFactory);
445
+ const layerOpacity = props.mode === 'tozeroy' ? 0.8 : _opacity[index];
446
+ var _points_index_lineOptions_strokeWidth;
447
+ graph.push(/*#__PURE__*/ React.createElement(React.Fragment, {
448
+ key: `${index}-graph-${_uniqueIdForGraph}`
449
+ }, props.enableGradient && /*#__PURE__*/ React.createElement("defs", null, /*#__PURE__*/ React.createElement("linearGradient", {
450
+ id: `gradient_${index}`,
451
+ x1: "0%",
452
+ x2: "0%",
453
+ y1: "0%",
454
+ y2: "100%"
455
+ }, /*#__PURE__*/ React.createElement("stop", {
456
+ offset: "0",
457
+ stopColor: _colors[index]
458
+ }), /*#__PURE__*/ React.createElement("stop", {
459
+ offset: "100%",
460
+ stopColor: "transparent"
461
+ }))), /*#__PURE__*/ React.createElement("path", {
462
+ id: `${index}-line-${_uniqueIdForGraph}`,
463
+ d: line(singleStackedData),
464
+ fill: 'transparent',
465
+ strokeWidth: (_points_index_lineOptions_strokeWidth = (_points_index_lineOptions1 = points[index].lineOptions) === null || _points_index_lineOptions1 === void 0 ? void 0 : _points_index_lineOptions1.strokeWidth) !== null && _points_index_lineOptions_strokeWidth !== void 0 ? _points_index_lineOptions_strokeWidth : 3,
466
+ stroke: _colors[index],
467
+ opacity: _getLineOpacity(points[index].legend),
468
+ onMouseMove: (event)=>_onRectMouseMove(event),
469
+ onMouseOut: _onRectMouseOut,
470
+ onMouseOver: (event)=>_onRectMouseMove(event),
471
+ strokeDasharray: (_points_index_lineOptions2 = points[index].lineOptions) === null || _points_index_lineOptions2 === void 0 ? void 0 : _points_index_lineOptions2.strokeDasharray,
472
+ strokeDashoffset: (_points_index_lineOptions3 = points[index].lineOptions) === null || _points_index_lineOptions3 === void 0 ? void 0 : _points_index_lineOptions3.strokeDashoffset,
473
+ strokeLinecap: (_points_index_lineOptions4 = points[index].lineOptions) === null || _points_index_lineOptions4 === void 0 ? void 0 : _points_index_lineOptions4.strokeLinecap
474
+ }), singleStackedData.length === 1 ? /*#__PURE__*/ React.createElement("circle", {
475
+ id: `${index}-graph-${_uniqueIdForGraph}`,
476
+ cx: xScale(singleStackedData[0].xVal),
477
+ cy: yScale(singleStackedData[0].values[1]),
478
+ r: 6,
479
+ stroke: _colors[index],
480
+ strokeWidth: 3,
481
+ fill: _colors[index],
482
+ opacity: layerOpacity,
483
+ fillOpacity: _getOpacity(points[index].legend),
484
+ onMouseMove: (event)=>_onRectMouseMove(event),
485
+ onMouseOut: _onRectMouseOut,
486
+ onMouseOver: (event)=>_onRectMouseMove(event)
487
+ }) : /*#__PURE__*/ React.createElement("path", {
488
+ id: `${index}-graph-${_uniqueIdForGraph}`,
489
+ d: area(singleStackedData),
490
+ fill: props.enableGradient ? `url(#gradient_${index})` : _colors[index],
491
+ opacity: layerOpacity,
492
+ fillOpacity: _getOpacity(points[index].legend),
493
+ onMouseMove: (event)=>_onRectMouseMove(event),
494
+ onMouseOut: _onRectMouseOut,
495
+ onMouseOver: (event)=>_onRectMouseMove(event),
496
+ ...props.optimizeLargeData && {
497
+ tabIndex: _legendHighlighted(points[index].legend) || _noLegendHighlighted() ? 0 : undefined,
498
+ role: 'img',
499
+ 'aria-label': `${points[index].legend}, series ${index + 1} of ${points.length} with ${points[index].data.length} data points.`
500
+ }
501
+ })));
502
+ });
503
+ const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;
504
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
505
+ _data.forEach((singleStackedData, index)=>{
506
+ if (points.length === index) {
507
+ return;
508
+ }
509
+ if (!props.optimizeLargeData || singleStackedData.length === 1) {
510
+ // Render circles for all data points
511
+ graph.push(/*#__PURE__*/ React.createElement("g", {
512
+ key: `${index}-dots-${_uniqueIdForGraph}`,
513
+ clipPath: "url(#clip)",
514
+ role: "region",
515
+ "aria-label": `${points[index].legend}, series ${index + 1} of ${points.length} with ${points[index].data.length} data points.`
516
+ }, singleStackedData.map((singlePoint, pointIndex)=>{
517
+ const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;
518
+ const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;
519
+ lineColor = points[index].color;
520
+ const legend = points[index].legend;
521
+ return /*#__PURE__*/ React.createElement("circle", {
522
+ key: circleId,
523
+ id: circleId,
524
+ tabIndex: _legendHighlighted(points[index].legend) || _noLegendHighlighted() ? 0 : undefined,
525
+ cx: xScale(singlePoint.xVal),
526
+ cy: yScale(singlePoint.values[1]),
527
+ stroke: lineColor,
528
+ strokeWidth: 3,
529
+ fill: _updateCircleFillColor(xDataPoint, lineColor, circleId),
530
+ onMouseOut: _onRectMouseOut,
531
+ onMouseOver: (event)=>_onRectMouseMove(event),
532
+ onClick: ()=>_onDataPointClick(points[index].data[pointIndex].onDataPointClick),
533
+ onFocus: ()=>_handleFocus(index, pointIndex, circleId),
534
+ onBlur: _handleBlur,
535
+ ...getSecureProps(pointOptions),
536
+ r: _getCircleRadius(xDataPoint, circleRadius, circleId, legend),
537
+ role: "img",
538
+ "aria-label": _getAriaLabel(index, pointIndex)
539
+ });
540
+ })));
541
+ } else {
542
+ // Render circles for data points close to the mouse pointer only
543
+ singleStackedData.forEach((singlePoint, pointIndex)=>{
544
+ const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;
545
+ if (nearestCircleToHighlight === xDataPoint) {
546
+ const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;
547
+ lineColor = points[index].color;
548
+ const legend = points[index].legend;
549
+ graph.push(/*#__PURE__*/ React.createElement("circle", {
550
+ key: circleId,
551
+ id: circleId,
552
+ cx: xScale(singlePoint.xVal),
553
+ cy: yScale(singlePoint.values[1]),
554
+ stroke: lineColor,
555
+ strokeWidth: 3,
556
+ fill: _updateCircleFillColor(xDataPoint, lineColor, circleId),
557
+ onMouseOut: _onRectMouseOut,
558
+ onMouseOver: (event)=>_onRectMouseMove(event),
559
+ onClick: ()=>_onDataPointClick(points[index].data[pointIndex].onDataPointClick),
560
+ ...getSecureProps(pointOptions),
561
+ r: _getCircleRadius(xDataPoint, circleRadius, circleId, legend)
562
+ }));
563
+ }
564
+ });
565
+ }
566
+ });
567
+ graph.push(/*#__PURE__*/ React.createElement("line", {
568
+ id: _verticalLineId,
569
+ key: _verticalLineId,
570
+ x1: lineXValue,
571
+ y1: 0,
572
+ x2: lineXValue,
573
+ y2: containerHeight,
574
+ strokeWidth: 1,
575
+ strokeDasharray: 5.5,
576
+ stroke: lineColor,
577
+ opacity: 0.5,
578
+ visibility: displayOfLine,
579
+ ...getSecureProps(pointLineOptions)
580
+ }));
581
+ // Removing un wanted tooltip div from DOM, when prop not provided.
582
+ if (!props.showXAxisLablesTooltip) {
583
+ try {
584
+ // eslint-disable-next-line @nx/workspace-no-restricted-globals
585
+ document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
586
+ // eslint-disable-next-line no-empty
587
+ } catch (e) {}
588
+ }
589
+ // Used to display tooltip at x axis labels.
590
+ if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {
591
+ const xAxisElement = d3Select(xElement).call(xScale);
592
+ try {
593
+ // eslint-disable-next-line @nx/workspace-no-restricted-globals
594
+ document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
595
+ // eslint-disable-next-line no-empty
596
+ } catch (e) {}
597
+ const tooltipProps = {
598
+ tooltipCls: classes.tooltip,
599
+ id: _tooltipId,
600
+ xAxis: xAxisElement
601
+ };
602
+ xAxisElement && tooltipOfXAxislabels(tooltipProps);
603
+ }
604
+ return graph;
605
+ }
606
+ function _getCircleRadius(xDataPoint, circleRadius, circleId, legend) {
607
+ // Show the circle if no legends are selected or if the point's legend is in the selected legends
608
+ if (!_noLegendHighlighted() && !_legendHighlighted(legend)) {
609
+ return 0;
610
+ }
611
+ if (isCircleClicked && nearestCircleToHighlight === xDataPoint) {
612
+ return 1;
613
+ } else if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {
614
+ return circleRadius;
615
+ } else {
616
+ return 0;
617
+ }
618
+ }
619
+ /**
620
+ * This function checks if the given legend is highlighted or not.
621
+ * A legend can be highlighted in 2 ways:
622
+ * 1. selection: if the user clicks on it
623
+ * 2. hovering: if there is no selected legend and the user hovers over it
624
+ */ function _legendHighlighted(legend) {
625
+ return _getHighlightedLegend().includes(legend);
626
+ }
627
+ /**
628
+ * This function checks if none of the legends is selected or hovered.
629
+ */ function _noLegendHighlighted() {
630
+ return _getHighlightedLegend().length === 0;
631
+ }
632
+ function _getHighlightedLegend() {
633
+ return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [
634
+ activeLegend
635
+ ] : [];
636
+ }
637
+ function _addDefaultColors(lineChartData) {
638
+ return lineChartData ? lineChartData.map((item, index)=>{
639
+ let color;
640
+ // isInverted property is applicable to v8 themes only
641
+ if (typeof item.color === 'undefined') {
642
+ color = getNextColor(index, 0);
643
+ } else {
644
+ color = getColorFromToken(item.color);
645
+ }
646
+ return {
647
+ ...item,
648
+ color
649
+ };
650
+ }) : [];
651
+ }
652
+ function _handleFocus(lineIndex, pointIndex, circleId) {
653
+ const { x, y, xAxisCalloutData } = props.data.lineChartData[lineIndex].data[pointIndex];
654
+ const formattedDate = x instanceof Date ? formatDate(x, props.useUTC) : x;
655
+ const modifiedXVal = x instanceof Date ? x.getTime() : x;
656
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
657
+ const found = _calloutPoints.find((e)=>e.x === modifiedXVal);
658
+ // Show details in the callout for the focused point only
659
+ found.values = found.values.filter((e)=>e.y === y);
660
+ const filteredValues = _getFilteredLegendValues(found.values);
661
+ setPopoverOpen(true);
662
+ setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);
663
+ setYValueHover(filteredValues);
664
+ setStackCalloutProps({
665
+ ...found,
666
+ values: filteredValues
667
+ });
668
+ setDataPointCalloutProps({
669
+ ...found,
670
+ values: filteredValues
671
+ });
672
+ setActivePoint(circleId);
673
+ }
674
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
675
+ function _getFilteredLegendValues(values) {
676
+ return !_noLegendHighlighted() ? values.filter((value)=>_legendHighlighted(value.legend)) : values;
677
+ }
678
+ function _handleBlur() {
679
+ setPopoverOpen(false);
680
+ setHoverXValue(undefined);
681
+ setYValueHover([]);
682
+ setStackCalloutProps(undefined);
683
+ setDataPointCalloutProps(undefined);
684
+ setActivePoint('');
685
+ }
686
+ function _getAriaLabel(lineIndex, pointIndex) {
687
+ var _point_callOutAccessibilityData;
688
+ const line = props.data.lineChartData[lineIndex];
689
+ const point = line.data[pointIndex];
690
+ const formattedDate = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;
691
+ const xValue = point.xAxisCalloutData || formattedDate;
692
+ const legend = line.legend;
693
+ const yValue = point.yAxisCalloutData || point.y;
694
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
695
+ }
696
+ function _isChartEmpty() {
697
+ return !(props.data && props.data.lineChartData && props.data.lineChartData.length > 0 && // eslint-disable-next-line @typescript-eslint/no-explicit-any
698
+ props.data.lineChartData.filter((item)=>item.data.length === 0).length === 0);
699
+ }
700
+ function _getChartTitle() {
701
+ const { chartTitle, lineChartData } = props.data;
702
+ return (chartTitle ? `${chartTitle}. ` : '') + `Area chart with ${(lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0} data series. `;
703
+ }
704
+ if (!_isChartEmpty()) {
705
+ const { lineChartData } = props.data;
706
+ const points = _addDefaultColors(lineChartData);
707
+ _createSet = _createDataSet;
708
+ const { colors, opacity, data, calloutPoints } = _createSet(points);
709
+ _calloutPoints = calloutPoints;
710
+ const isXAxisDateType = getXAxisType(points);
711
+ _colors = colors;
712
+ _opacity = opacity;
713
+ _data = data.renderData;
714
+ const legends = _getLegendData(points);
715
+ const tickParams = {
716
+ tickValues: props.tickValues,
717
+ tickFormat: props.tickFormat
718
+ };
719
+ const calloutProps = {
720
+ YValueHover: YValueHover,
721
+ hoverXValue: hoverXValue,
722
+ xAxisCalloutAccessibilityData,
723
+ ...props.calloutProps,
724
+ clickPosition,
725
+ isPopoverOpen,
726
+ isCartesian: true,
727
+ customCallout: {
728
+ customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout() : undefined,
729
+ customCalloutProps: props.calloutPropsPerDataPoint ? props.calloutPropsPerDataPoint(dataPointCalloutProps) : undefined
730
+ },
731
+ isCalloutForStack: true
732
+ };
733
+ return /*#__PURE__*/ React.createElement(CartesianChart, {
734
+ ...props,
735
+ chartTitle: _getChartTitle(),
736
+ points: points,
737
+ chartType: ChartTypes.AreaChart,
738
+ calloutProps: calloutProps,
739
+ legendBars: legends,
740
+ xAxisType: isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis,
741
+ tickParams: tickParams,
742
+ maxOfYVal: data.maxOfYVal,
743
+ getGraphData: _getGraphData,
744
+ getmargins: _getMargins,
745
+ onChartMouseLeave: _handleChartMouseLeave,
746
+ enableFirstRenderOptimization: props.enablePerfOptimization && _firstRenderOptimization,
747
+ componentRef: cartesianChartRef,
748
+ /* eslint-disable react/jsx-no-bind */ // eslint-disable-next-line react/no-children-prop, @typescript-eslint/no-shadow
749
+ children: (props)=>{
750
+ _xAxisRectScale = props.xScale;
751
+ const ticks = _xAxisRectScale.ticks();
752
+ const width1 = _xAxisRectScale(ticks[ticks.length - 1]);
753
+ const rectHeight = props.containerHeight - _margins.top;
754
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("g", null, /*#__PURE__*/ React.createElement("rect", {
755
+ id: _rectId,
756
+ width: width1,
757
+ height: rectHeight,
758
+ fill: 'transparent',
759
+ onMouseMove: (event)=>_onRectMouseMove(event),
760
+ onMouseOut: _onRectMouseOut,
761
+ onMouseOver: (event)=>_onRectMouseMove(event)
762
+ })), /*#__PURE__*/ React.createElement("g", null, _chart));
763
+ }
764
+ });
765
+ }
766
+ return /*#__PURE__*/ React.createElement("div", {
767
+ id: _emptyChartId,
768
+ role: 'alert',
769
+ style: {
770
+ opacity: '0'
771
+ },
772
+ "aria-label": 'Graph has no data to display'
773
+ });
774
+ });
775
+ AreaChart.displayName = 'AreaChart';