@fluentui/react-charts 0.0.0-nightly-20250423-1342.1 → 0.0.0-nightly-20250423-1415.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 +3337 -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 +64 -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 +229 -0
  58. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  59. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -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 +44 -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 +174 -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 +90 -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 +46 -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 +163 -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 +76 -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 +147 -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 +65 -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 +1022 -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 +65 -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 +74 -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 +73 -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 +104 -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 +356 -0
  298. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  299. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -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 +61 -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 +252 -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 +139 -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 +68 -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 +251 -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 +116 -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 +96 -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 +1038 -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 +96 -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 +117 -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 +120 -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,599 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "HeatMapChart", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return HeatMapChart;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _index = require("../../utilities/index");
14
+ const _index1 = require("../CommonComponents/index");
15
+ const _reactutilities = require("@fluentui/react-utilities");
16
+ const _reacttheme = require("@fluentui/react-theme");
17
+ const _useHeatMapChartStylesstyles = require("./useHeatMapChartStyles.styles");
18
+ const _index2 = require("../Legends/index");
19
+ const _d3scale = require("d3-scale");
20
+ const _d3format = require("d3-format");
21
+ const _d3timeformat = require("d3-time-format");
22
+ const HeatMapChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
23
+ const classes = (0, _useHeatMapChartStylesstyles.useHeatMapChartStyles)(props);
24
+ const _stringXAxisDataPoints = _react.useRef([]);
25
+ const _stringYAxisDataPoints = _react.useRef([]);
26
+ const _dataSet = _react.useRef({});
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ const _colorScale = _react.useRef();
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ const _xAxisScale = _react.useRef();
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ const _yAxisScale = _react.useRef();
33
+ const _xAxisType = _react.useRef();
34
+ const _yAxisType = _react.useRef();
35
+ const _calloutAnchorPoint = _react.useRef(null);
36
+ const _emptyChartId = (0, _reactutilities.useId)('_HeatMap_empty');
37
+ const _margins = _react.useRef({});
38
+ const cartesianChartRef = _react.useRef(null);
39
+ const [selectedLegend, setSelectedLegend] = _react.useState('');
40
+ const [activeLegend, setActiveLegend] = _react.useState('');
41
+ const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
42
+ const [calloutLegend, setCalloutLegend] = _react.useState('');
43
+ const [calloutTextColor, setCalloutTextColor] = _react.useState('');
44
+ const [calloutYValue, setCalloutYValue] = _react.useState('');
45
+ const [ratio, setRatio] = _react.useState();
46
+ const [descriptionMessage, setDescriptionMessage] = _react.useState('');
47
+ const [callOutAccessibilityData, setCallOutAccessibilityData] = _react.useState();
48
+ const [clickPosition, setClickPosition] = _react.useState({
49
+ x: 0,
50
+ y: 0
51
+ });
52
+ _react.useImperativeHandle(props.componentRef, ()=>{
53
+ var _cartesianChartRef_current;
54
+ var _cartesianChartRef_current_chartContainer;
55
+ return {
56
+ 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
57
+ };
58
+ }, []);
59
+ const _getXandY = ()=>{
60
+ let x = '';
61
+ let y = '';
62
+ props.data.forEach((item)=>{
63
+ if (item.data && item.data.length > 0) {
64
+ x = item.data[0].x;
65
+ y = item.data[0].y;
66
+ return {
67
+ x,
68
+ y
69
+ };
70
+ }
71
+ });
72
+ return {
73
+ x,
74
+ y
75
+ };
76
+ };
77
+ const _getMargins = (margins)=>{
78
+ _margins.current = margins;
79
+ };
80
+ const _getOpacity = (legendTitle)=>{
81
+ const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';
82
+ return opacity;
83
+ };
84
+ const _onRectFocus = (id, data, focusEvent)=>{
85
+ const boundingRect = focusEvent.currentTarget.getBoundingClientRect();
86
+ const clientX = boundingRect.left + boundingRect.width / 2;
87
+ const clientY = boundingRect.top + boundingRect.height / 2;
88
+ updatePosition(clientX, clientY);
89
+ /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */ setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);
90
+ setCalloutYValue(`${data.rectText}`);
91
+ setCalloutTextColor(Number.isNaN(data.value) ? _reacttheme.tokens.colorNeutralForeground1 : _colorScale.current(data.value));
92
+ setCalloutLegend(data.legend);
93
+ setRatio(data.ratio);
94
+ setDescriptionMessage(data.descriptionMessage || '');
95
+ setCallOutAccessibilityData(data.callOutAccessibilityData);
96
+ };
97
+ const _onRectMouseOver = (id, data, mouseEvent)=>{
98
+ mouseEvent.persist();
99
+ if (_calloutAnchorPoint.current !== data) {
100
+ _calloutAnchorPoint.current = data;
101
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
102
+ /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */ setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);
103
+ setCalloutYValue(`${data.rectText}`);
104
+ setCalloutTextColor(Number.isNaN(data.value) ? _reacttheme.tokens.colorNeutralForeground1 : _colorScale.current(data.value));
105
+ setCalloutLegend(data.legend);
106
+ setRatio(data.ratio);
107
+ setDescriptionMessage(data.descriptionMessage || '');
108
+ setCallOutAccessibilityData(data.callOutAccessibilityData);
109
+ }
110
+ };
111
+ const _onRectBlurOrMouseOut = ()=>{
112
+ /**/ };
113
+ const _handleChartMouseLeave = ()=>{
114
+ _calloutAnchorPoint.current = null;
115
+ setPopoverOpen(false);
116
+ };
117
+ const _getInvertedTextColor = (color)=>{
118
+ return color === _reacttheme.tokens.colorNeutralForeground1 ? _reacttheme.tokens.colorNeutralBackground1 : _reacttheme.tokens.colorNeutralForeground1;
119
+ };
120
+ /**
121
+ * This is the function which is responsible for
122
+ * drawing the rectangle in the graph and also
123
+ * attaching dom events to that rectangles
124
+ */ const _createRectangles = ()=>{
125
+ const rectangles = [];
126
+ const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();
127
+ /**
128
+ * yAxisDataPoint is noting but the DataPoint
129
+ * which will be rendered on the y-axis
130
+ */ yAxisDataPoints.forEach((yAxisDataPoint)=>{
131
+ let index = 0;
132
+ _stringXAxisDataPoints.current.forEach((xAxisDataPoint)=>{
133
+ var _dataSet_current_yAxisDataPoint_index, _dataSet_current_yAxisDataPoint_index1;
134
+ let rectElement;
135
+ const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;
136
+ if (((_dataSet_current_yAxisDataPoint_index = _dataSet.current[yAxisDataPoint][index]) === null || _dataSet_current_yAxisDataPoint_index === void 0 ? void 0 : _dataSet_current_yAxisDataPoint_index.x) === xAxisDataPoint && typeof ((_dataSet_current_yAxisDataPoint_index1 = _dataSet.current[yAxisDataPoint][index]) === null || _dataSet_current_yAxisDataPoint_index1 === void 0 ? void 0 : _dataSet_current_yAxisDataPoint_index1.value) === 'number') {
137
+ var _cartesianChartRef_current;
138
+ /**
139
+ * dataPointObject is an object where it contains information on single
140
+ * data point such as x, y , value, rectText property of the rectangle
141
+ */ const dataPointObject = _dataSet.current[yAxisDataPoint][index];
142
+ let styleRules = '';
143
+ let foregroundColor = _reacttheme.tokens.colorNeutralForeground1;
144
+ if ((_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer) {
145
+ styleRules = (0, _index.resolveCSSVariables)(cartesianChartRef.current.chartContainer, foregroundColor);
146
+ }
147
+ const contrastRatio = (0, _index.getColorContrast)(styleRules, _colorScale.current(dataPointObject.value));
148
+ if (contrastRatio < 3) {
149
+ foregroundColor = _getInvertedTextColor(foregroundColor);
150
+ }
151
+ rectElement = /*#__PURE__*/ _react.createElement("g", {
152
+ key: id,
153
+ role: "img",
154
+ "aria-label": _getAriaLabel(dataPointObject),
155
+ tabIndex: _legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1,
156
+ fillOpacity: _getOpacity(dataPointObject.legend),
157
+ transform: `translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(dataPointObject.y)})`,
158
+ onFocus: (e)=>_onRectFocus(id, dataPointObject, e),
159
+ onBlur: _onRectBlurOrMouseOut,
160
+ onMouseOver: (e)=>_onRectMouseOver(id, dataPointObject, e),
161
+ onMouseOut: _onRectBlurOrMouseOut
162
+ }, /*#__PURE__*/ _react.createElement("rect", {
163
+ fill: _colorScale.current(dataPointObject.value),
164
+ width: _xAxisScale.current.bandwidth(),
165
+ height: _yAxisScale.current.bandwidth(),
166
+ onClick: dataPointObject.onClick
167
+ }), /*#__PURE__*/ _react.createElement("text", {
168
+ dominantBaseline: 'middle',
169
+ textAnchor: 'middle',
170
+ className: classes.text,
171
+ transform: `translate(${_xAxisScale.current.bandwidth() / 2}, ${_yAxisScale.current.bandwidth() / 2})`,
172
+ fill: foregroundColor
173
+ }, (0, _index.convertToLocaleString)(dataPointObject.rectText, props.culture)));
174
+ index++;
175
+ } else {
176
+ const dataPointObject = {
177
+ x: xAxisDataPoint,
178
+ y: yAxisDataPoint,
179
+ value: NaN,
180
+ rectText: 'No data available',
181
+ legend: ''
182
+ };
183
+ rectElement = /*#__PURE__*/ _react.createElement("g", {
184
+ key: id,
185
+ role: "img",
186
+ "aria-label": _getAriaLabel(dataPointObject),
187
+ tabIndex: _noLegendHighlighted() ? 0 : -1,
188
+ transform: `translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(dataPointObject.y)})`,
189
+ onFocus: (e)=>_onRectFocus(id, dataPointObject, e),
190
+ onBlur: _onRectBlurOrMouseOut,
191
+ onMouseOver: (e)=>_onRectMouseOver(id, dataPointObject, e),
192
+ onMouseOut: _onRectBlurOrMouseOut
193
+ }, /*#__PURE__*/ _react.createElement("rect", {
194
+ fill: "transparent",
195
+ width: _xAxisScale.current.bandwidth(),
196
+ height: _yAxisScale.current.bandwidth()
197
+ }));
198
+ }
199
+ rectangles.push(rectElement);
200
+ });
201
+ });
202
+ return rectangles;
203
+ };
204
+ /**
205
+ * when the legend is hovered we need to highlight
206
+ * all the rectangles which fall under that category
207
+ * and un-highlight the rest of them
208
+ * @param legendTitle
209
+ */ const _onLegendHover = (legendTitle)=>{
210
+ setActiveLegend(legendTitle);
211
+ };
212
+ /**
213
+ * when the mouse is out from the legend , we need
214
+ * to show the graph in initial mode.
215
+ */ const _onLegendLeave = ()=>{
216
+ setActiveLegend('');
217
+ };
218
+ /**
219
+ * @param legendTitle
220
+ * when the legend is clicked we need to highlight
221
+ * all the rectangles which fall under that category
222
+ * and un highlight the rest of them
223
+ */ const _onLegendClick = (legendTitle)=>{
224
+ /**
225
+ * check if the legend is already selceted,
226
+ * if yes, un-select the legend, else
227
+ * set the selected legend state to legendTitle
228
+ */ if (selectedLegend === legendTitle) {
229
+ setSelectedLegend('');
230
+ } else {
231
+ setSelectedLegend(legendTitle);
232
+ }
233
+ };
234
+ const _createLegendBars = ()=>{
235
+ const { data, legendProps } = props;
236
+ const legends = [];
237
+ data.forEach((item)=>{
238
+ const legend = {
239
+ title: item.legend,
240
+ color: _colorScale.current(item.value),
241
+ action: ()=>{
242
+ _onLegendClick(item.legend);
243
+ },
244
+ hoverAction: ()=>{
245
+ _handleChartMouseLeave();
246
+ _onLegendHover(item.legend);
247
+ },
248
+ onMouseOutAction: ()=>{
249
+ _onLegendLeave();
250
+ }
251
+ };
252
+ legends.push(legend);
253
+ });
254
+ return /*#__PURE__*/ _react.createElement(_index2.Legends, {
255
+ ...legendProps,
256
+ legends: legends
257
+ });
258
+ };
259
+ const _getColorScale = ()=>{
260
+ const { domainValuesForColorScale, rangeValuesForColorScale } = props;
261
+ return (0, _d3scale.scaleLinear)().domain(domainValuesForColorScale).range(rangeValuesForColorScale);
262
+ };
263
+ const _getXIndex = (value)=>{
264
+ if (_xAxisType.current === _index.XAxisTypes.DateAxis) {
265
+ return `${value.getTime()}`;
266
+ } else if (_xAxisType.current === _index.XAxisTypes.StringAxis) {
267
+ return value;
268
+ } else if (_xAxisType.current === _index.XAxisTypes.NumericAxis) {
269
+ return `${value}`;
270
+ } else {
271
+ return '';
272
+ }
273
+ };
274
+ const _getYIndex = (value)=>{
275
+ if (_yAxisType.current === _index.YAxisType.DateAxis) {
276
+ return `${value.getTime()}`;
277
+ } else if (_yAxisType.current === _index.YAxisType.StringAxis) {
278
+ return value;
279
+ } else if (_yAxisType.current === _index.YAxisType.NumericAxis) {
280
+ return `${value}`;
281
+ } else {
282
+ return '';
283
+ }
284
+ };
285
+ const { xAxisStringFormatter } = props;
286
+ const _getFormattedLabelForXAxisDataPoint = _react.useCallback((point)=>{
287
+ return xAxisStringFormatter ? xAxisStringFormatter(point) : point;
288
+ }, [
289
+ xAxisStringFormatter
290
+ ]);
291
+ const { yAxisStringFormatter } = props;
292
+ const _getFormattedLabelForYAxisDataPoint = _react.useCallback((point)=>{
293
+ return yAxisStringFormatter ? yAxisStringFormatter(point) : point;
294
+ }, [
295
+ yAxisStringFormatter
296
+ ]);
297
+ /**
298
+ * This function will return the final sorted and formatted x-axis points
299
+ * which will be rendered on the x-axis
300
+ * @param points
301
+ * @returns x-axis points
302
+ */ const _getXAxisDataPoints = _react.useCallback((points)=>{
303
+ let xAxisPoints = [];
304
+ const unFormattedXAxisDataPoints = Object.keys(points).sort((a, b)=>{
305
+ if (_xAxisType.current === _index.XAxisTypes.DateAxis || _xAxisType.current === _index.XAxisTypes.NumericAxis) {
306
+ return +a - +b;
307
+ } else {
308
+ return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;
309
+ }
310
+ });
311
+ xAxisPoints = unFormattedXAxisDataPoints.map((xPoint)=>{
312
+ if (_xAxisType.current === _index.XAxisTypes.DateAxis) {
313
+ return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);
314
+ } else if (_xAxisType.current === _index.XAxisTypes.NumericAxis) {
315
+ return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);
316
+ } else {
317
+ return _getFormattedLabelForXAxisDataPoint(xPoint);
318
+ }
319
+ });
320
+ return xAxisPoints;
321
+ }, [
322
+ _getFormattedLabelForXAxisDataPoint,
323
+ props.sortOrder,
324
+ props.xAxisDateFormatString,
325
+ props.xAxisNumberFormatString
326
+ ]);
327
+ /**
328
+ * This function will return the final sorted and formatted y-axis points
329
+ * which will be rendered on the y-axis
330
+ * @param points
331
+ * @returns yaxis points
332
+ */ const _getYAxisDataPoints = _react.useCallback((points)=>{
333
+ let yAxisPoints = [];
334
+ const unFormattedYAxisDataPoints = Object.keys(points).sort((a, b)=>{
335
+ if (_yAxisType.current === _index.YAxisType.DateAxis || _yAxisType.current === _index.YAxisType.NumericAxis) {
336
+ return +a - +b;
337
+ } else {
338
+ return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;
339
+ }
340
+ });
341
+ yAxisPoints = unFormattedYAxisDataPoints.map((yPoint)=>{
342
+ if (_yAxisType.current === _index.YAxisType.DateAxis) {
343
+ return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);
344
+ } else if (_yAxisType.current === _index.YAxisType.NumericAxis) {
345
+ return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);
346
+ } else {
347
+ return _getFormattedLabelForYAxisDataPoint(yPoint);
348
+ }
349
+ });
350
+ return yAxisPoints;
351
+ }, [
352
+ _getFormattedLabelForYAxisDataPoint,
353
+ props.sortOrder,
354
+ props.yAxisDateFormatString,
355
+ props.yAxisNumberFormatString
356
+ ]);
357
+ /**
358
+ * This will create a new data set based on the prop
359
+ * @data
360
+ * We will be using This data set to contsruct our rectangles
361
+ * in the chart, we use this data set becuase, when we loop in this
362
+ * data and build the heat map, it will support accessibility as
363
+ * specified in the figma
364
+ */ const _createNewDataSet = _react.useCallback((data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString)=>{
365
+ /**
366
+ * please do not destructure any of the props here,
367
+ * instead send them as parameter to this functions so that
368
+ * this functions get called whenever the prop changes
369
+ */ const flattenData = [];
370
+ /**
371
+ * below for each loop will store all the datapoints in the one array.
372
+ * basically it will flatten the nestesd array (data prop) into single array
373
+ * of object. where each object contains x, y, rectText , value and legend propety of single
374
+ * data point.
375
+ */ data.forEach((item)=>{
376
+ item.data.forEach((point)=>{
377
+ flattenData.push({
378
+ ...point,
379
+ legend: item.legend
380
+ });
381
+ });
382
+ });
383
+ const yPoints = {};
384
+ const uniqueYPoints = {};
385
+ const uniqueXPoints = {};
386
+ flattenData.forEach((item)=>{
387
+ const posX = _getXIndex(item.x);
388
+ const posY = _getYIndex(item.y);
389
+ uniqueXPoints[posX] = '1';
390
+ uniqueYPoints[posY] = '1';
391
+ /** we will check if the property(posY) is already there in object, if Yes,
392
+ * then we will append the item in the Array related to the pos, if not
393
+ * then we will simply append the item in the new Array and
394
+ * assign that array to the property (posY) in the Object
395
+ * and finally we will get the array of Objects associated to each
396
+ * property (which is nothing but y data point) and object in the
397
+ * array are noting but x data points associated to the property y
398
+ */ if (yPoints[posY]) {
399
+ yPoints[posY] = [
400
+ ...yPoints[posY],
401
+ item
402
+ ];
403
+ } else {
404
+ yPoints[posY] = [
405
+ item
406
+ ];
407
+ }
408
+ });
409
+ /**
410
+ * we will now sort(ascending) the array's of y data point based on the x value
411
+ * sorting is important to achive the accessibility order of the
412
+ * rectangles and then format the x and y datapoints respectively
413
+ */ Object.keys(yPoints).forEach((item)=>{
414
+ yPoints[item].sort((a, b)=>{
415
+ if (_xAxisType.current === _index.XAxisTypes.StringAxis) {
416
+ return props.sortOrder === 'none' ? 0 : a.x.toLowerCase() > b.x.toLowerCase() ? 1 : -1;
417
+ } else if (_xAxisType.current === _index.XAxisTypes.DateAxis) {
418
+ return a.x.getTime() - b.x.getTime();
419
+ } else if (_xAxisType.current === _index.XAxisTypes.NumericAxis) {
420
+ return +a.x > +b.x ? 1 : -1;
421
+ } else {
422
+ return a.x > b.x ? 1 : -1;
423
+ }
424
+ }).forEach((datapoint)=>{
425
+ if (_xAxisType.current === _index.XAxisTypes.DateAxis) {
426
+ datapoint.x = _getStringFormattedDate(datapoint.x, xAxisDateFormatString);
427
+ }
428
+ if (_xAxisType.current === _index.XAxisTypes.NumericAxis) {
429
+ datapoint.x = _getStringFormattedNumber(datapoint.x, xAxisNumberFormatString);
430
+ }
431
+ if (_xAxisType.current === _index.XAxisTypes.StringAxis) {
432
+ datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x);
433
+ }
434
+ if (_yAxisType.current === _index.YAxisType.DateAxis) {
435
+ datapoint.y = _getStringFormattedDate(datapoint.y, yAxisDateFormatString);
436
+ }
437
+ if (_yAxisType.current === _index.YAxisType.NumericAxis) {
438
+ datapoint.y = _getStringFormattedNumber(datapoint.y, yAxisNumberFormatString);
439
+ }
440
+ if (_yAxisType.current === _index.YAxisType.StringAxis) {
441
+ datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y);
442
+ }
443
+ });
444
+ });
445
+ /**
446
+ * if y-axis data points are of type date or number or if we have string formatter,
447
+ * then we need to change data points to their respective string
448
+ * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in
449
+ * string format. and in here `yPoint` are not so we need to change, so that
450
+ * function `this._createRectangles` should work perfetcly while looping, and if we don't change
451
+ * then `this._createRectangles` will fail while looping, causing the error
452
+ * Cannot read property 'forEach' of undefined
453
+ */ Object.keys(yPoints).forEach((yPoint)=>{
454
+ if (_yAxisType.current === _index.YAxisType.DateAxis) {
455
+ yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];
456
+ } else if (_yAxisType.current === _index.YAxisType.NumericAxis) {
457
+ yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];
458
+ } else {
459
+ yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];
460
+ }
461
+ });
462
+ /**
463
+ * assigning new data set
464
+ */ const dataSet = yPoints;
465
+ /**
466
+ * These are the Y axis data points which will get rendered in the
467
+ * Y axis in graph
468
+ */ const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);
469
+ /**
470
+ * These are the x axis data points which will get rendered in the
471
+ * x axis in the graph
472
+ */ const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);
473
+ return {
474
+ dataSet,
475
+ yAxisPoints,
476
+ xAxisPoints
477
+ };
478
+ }, [
479
+ _getFormattedLabelForXAxisDataPoint,
480
+ _getFormattedLabelForYAxisDataPoint,
481
+ _getXAxisDataPoints,
482
+ _getYAxisDataPoints,
483
+ props.sortOrder
484
+ ]);
485
+ const _getStringFormattedDate = (point, formatString)=>{
486
+ const date = new Date();
487
+ date.setTime(+point);
488
+ return (0, _d3timeformat.timeFormat)(formatString || '%b/%d')(date);
489
+ };
490
+ const _getStringFormattedNumber = (point, formatString)=>{
491
+ return (0, _d3format.format)(formatString || '.2~s')(+point);
492
+ };
493
+ /**
494
+ * This function checks if the given legend is highlighted or not.
495
+ * A legend can be highlighted in 2 ways:
496
+ * 1. selection: if the user clicks on it
497
+ * 2. hovering: if there is no selected legend and the user hovers over it
498
+ */ const _legendHighlighted = (legendTitle)=>{
499
+ return selectedLegend === legendTitle || selectedLegend === '' && activeLegend === legendTitle;
500
+ };
501
+ /**
502
+ * This function checks if none of the legends is selected or hovered.
503
+ */ const _noLegendHighlighted = ()=>{
504
+ return selectedLegend === '' && activeLegend === '';
505
+ };
506
+ const _getAriaLabel = (point)=>{
507
+ var _point_callOutAccessibilityData;
508
+ const xValue = point.x;
509
+ const yValue = point.y;
510
+ const legend = point.legend;
511
+ const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;
512
+ const description = point.descriptionMessage;
513
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '');
514
+ };
515
+ const _isChartEmpty = ()=>{
516
+ return !(props.data && props.data.length > 0);
517
+ };
518
+ const _getChartTitle = ()=>{
519
+ const { chartTitle } = props;
520
+ const numDataPoints = props.data.reduce((acc, curr)=>acc + curr.data.length, 0);
521
+ return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;
522
+ };
523
+ const updatePosition = (newX, newY)=>{
524
+ const threshold = 1; // Set a threshold for movement
525
+ const { x, y } = clickPosition;
526
+ // Calculate the distance moved
527
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
528
+ // Update the position only if the distance moved is greater than the threshold
529
+ if (distance > threshold) {
530
+ setClickPosition({
531
+ x: newX,
532
+ y: newY
533
+ });
534
+ }
535
+ };
536
+ const { x, y } = _getXandY();
537
+ _xAxisType.current = (0, _index.getTypeOfAxis)(x, true);
538
+ _yAxisType.current = (0, _index.getTypeOfAxis)(y, false);
539
+ const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } = props;
540
+ _colorScale.current = _getColorScale();
541
+ const { dataSet, xAxisPoints, yAxisPoints } = _react.useMemo(()=>_createNewDataSet(data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString), [
542
+ _createNewDataSet,
543
+ data,
544
+ xAxisDateFormatString,
545
+ xAxisNumberFormatString,
546
+ yAxisDateFormatString,
547
+ yAxisNumberFormatString
548
+ ]);
549
+ _dataSet.current = dataSet;
550
+ _stringYAxisDataPoints.current = yAxisPoints;
551
+ _stringXAxisDataPoints.current = xAxisPoints;
552
+ const calloutProps = {
553
+ ...props.calloutProps,
554
+ isPopoverOpen,
555
+ YValue: calloutYValue,
556
+ legend: calloutLegend,
557
+ color: calloutTextColor,
558
+ ratio,
559
+ descriptionMessage,
560
+ clickPosition,
561
+ ...(0, _index.getAccessibleDataObject)(callOutAccessibilityData, 'text', false)
562
+ };
563
+ const tickParams = {
564
+ tickValues: props.tickValues,
565
+ tickFormat: props.tickFormat
566
+ };
567
+ return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement(_index1.CartesianChart, {
568
+ ...props,
569
+ chartTitle: _getChartTitle(),
570
+ points: data,
571
+ chartType: _index.ChartTypes.HeatMapChart,
572
+ xAxisType: _index.XAxisTypes.StringAxis,
573
+ yAxisType: _index.YAxisType.StringAxis,
574
+ calloutProps: calloutProps,
575
+ datasetForXAxisDomain: _stringXAxisDataPoints.current,
576
+ stringDatasetForYAxisDomain: _stringYAxisDataPoints.current,
577
+ getmargins: _getMargins,
578
+ xAxisTickCount: _stringXAxisDataPoints.current.length,
579
+ xAxistickSize: 0,
580
+ xAxisPadding: 0.02,
581
+ yAxisPadding: 0.02,
582
+ legendBars: _createLegendBars(),
583
+ onChartMouseLeave: _handleChartMouseLeave,
584
+ componentRef: cartesianChartRef,
585
+ tickParams: tickParams,
586
+ /* eslint-disable react/jsx-no-bind */ children: (p)=>{
587
+ _xAxisScale.current = p.xScale;
588
+ _yAxisScale.current = p.yScale;
589
+ return _createRectangles();
590
+ }
591
+ }) : /*#__PURE__*/ _react.createElement("div", {
592
+ id: _emptyChartId,
593
+ role: 'alert',
594
+ style: {
595
+ opacity: '0'
596
+ },
597
+ "aria-label": 'Graph has no data to display'
598
+ });
599
+ });