@fluentui/react-charts 0.0.0-nightly-20250423-0405.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 @@
1
+ {"version":3,"sources":["HeatMapChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { HeatMapChartProps } from './HeatMapChart.types';\nimport { AccessibilityProps, Chart, HeatMapChartData, HeatMapChartDataPoint, Margins } from '../../types/index';\nimport {\n ChartTypes,\n convertToLocaleString,\n getAccessibleDataObject,\n getColorContrast,\n getTypeOfAxis,\n resolveCSSVariables,\n XAxisTypes,\n YAxisType,\n} from '../../utilities/index';\nimport { CartesianChart, ChartPopoverProps, ChildProps } from '../CommonComponents/index';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';\nimport { Legend, Legends } from '../Legends/index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = HeatMapChartDataPoint & {\n legend: string;\n};\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\n\nexport const HeatMapChart: React.FunctionComponent<HeatMapChartProps> = React.forwardRef<\n HTMLDivElement,\n HeatMapChartProps\n>((props, forwardedRef) => {\n const classes = useHeatMapChartStyles(props);\n const _stringXAxisDataPoints = React.useRef<string[]>([]);\n const _stringYAxisDataPoints = React.useRef<string[]>([]);\n const _dataSet = React.useRef<RectanglesGraphData>({});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _colorScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale = React.useRef<any>();\n const _xAxisType = React.useRef<XAxisTypes>();\n const _yAxisType = React.useRef<YAxisType>();\n const _calloutAnchorPoint = React.useRef<FlattenData | null>(null);\n const _emptyChartId = useId('_HeatMap_empty');\n const _margins = React.useRef<Margins>({});\n const cartesianChartRef = React.useRef<Chart>(null);\n\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [calloutTextColor, setCalloutTextColor] = React.useState<string>('');\n const [calloutYValue, setCalloutYValue] = React.useState<string>('');\n const [ratio, setRatio] = React.useState<[number, number]>();\n const [descriptionMessage, setDescriptionMessage] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n props.data.forEach((item: HeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n const _getMargins = (margins: Margins) => {\n _margins.current = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n const _onRectFocus = (id: string, data: FlattenData, focusEvent: React.FocusEvent<SVGGElement>): void => {\n const boundingRect = focusEvent.currentTarget.getBoundingClientRect();\n const clientX = boundingRect.left + boundingRect.width / 2;\n const clientY = boundingRect.top + boundingRect.height / 2;\n updatePosition(clientX, clientY);\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n };\n\n const _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint.current !== data) {\n _calloutAnchorPoint.current = data;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n }\n };\n\n const _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n };\n\n const _getInvertedTextColor = (color: string): string => {\n return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n const _createRectangles = (): React.ReactNode => {\n const rectangles: JSX.Element[] = [];\n const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n _stringXAxisDataPoints.current.forEach((xAxisDataPoint: string) => {\n let rectElement: JSX.Element;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n _dataSet.current[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof _dataSet.current[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = _dataSet.current[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = tokens.colorNeutralForeground1;\n if (cartesianChartRef.current?.chartContainer) {\n styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = _getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1}\n fillOpacity={_getOpacity(dataPointObject.legend)}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill={_colorScale.current(dataPointObject.value)}\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={classes.text}\n transform={`translate(${_xAxisScale.current.bandwidth() / 2}, ${_yAxisScale.current.bandwidth() / 2})`}\n fill={foregroundColor}\n >\n {convertToLocaleString(dataPointObject.rectText, props.culture)}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_noLegendHighlighted() ? 0 : -1}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill=\"transparent\"\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n const _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (selectedLegend === legendTitle) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(legendTitle);\n }\n };\n const _createLegendBars = (): JSX.Element => {\n const { data, legendProps } = props;\n const legends: Legend[] = [];\n data.forEach((item: HeatMapChartData) => {\n const legend: Legend = {\n title: item.legend,\n color: _colorScale.current(item.value),\n action: () => {\n _onLegendClick(item.legend);\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} />;\n };\n\n const _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n const _getXIndex = (value: string | Date | number): string => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_xAxisType.current === XAxisTypes.StringAxis) {\n return value as string;\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n const _getYIndex = (value: string | Date | number): string => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_yAxisType.current === YAxisType.StringAxis) {\n return value as string;\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n const { xAxisStringFormatter } = props;\n const _getFormattedLabelForXAxisDataPoint = React.useCallback(\n (point: string): string => {\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n },\n [xAxisStringFormatter],\n );\n\n const { yAxisStringFormatter } = props;\n const _getFormattedLabelForYAxisDataPoint = React.useCallback(\n (point: string): string => {\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n },\n [yAxisStringFormatter],\n );\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n const _getXAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);\n } else {\n return _getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n },\n [_getFormattedLabelForXAxisDataPoint, props.sortOrder, props.xAxisDateFormatString, props.xAxisNumberFormatString],\n );\n\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n const _getYAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = Object.keys(points).sort((a: string, b: string) => {\n if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);\n } else {\n return _getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n },\n [_getFormattedLabelForYAxisDataPoint, props.sortOrder, props.yAxisDateFormatString, props.yAxisNumberFormatString],\n );\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n const _createNewDataSet = React.useCallback(\n (\n data: HeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: HeatMapChartData) => {\n item.data.forEach((point: HeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = _getXIndex(item.x);\n const posY = _getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item]\n .sort((a: HeatMapChartDataPoint, b: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n return props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (_xAxisType.current === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n })\n .forEach((datapoint: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n datapoint.x = _getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (_xAxisType.current === XAxisTypes.NumericAxis) {\n datapoint.x = _getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (_yAxisType.current === YAxisType.DateAxis) {\n datapoint.y = _getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (_yAxisType.current === YAxisType.NumericAxis) {\n datapoint.y = _getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (_yAxisType.current === YAxisType.StringAxis) {\n datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable this._stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `this._createRectangles` should work perfetcly while looping, and if we don't change\n * then `this._createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n _getFormattedLabelForYAxisDataPoint,\n _getXAxisDataPoints,\n _getYAxisDataPoints,\n props.sortOrder,\n ],\n );\n\n const _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n const _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = (legendTitle: string) => {\n return selectedLegend === legendTitle || (selectedLegend === '' && activeLegend === legendTitle);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return selectedLegend === '' && activeLegend === '';\n };\n\n const _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n const numDataPoints = props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n const updatePosition = (newX: number, newY: number) => {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n }\n };\n\n const { x, y } = _getXandY();\n _xAxisType.current = getTypeOfAxis(x, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n props;\n _colorScale.current = _getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(\n () =>\n _createNewDataSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ),\n [\n _createNewDataSet,\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ],\n );\n _dataSet.current = dataSet;\n _stringYAxisDataPoints.current = yAxisPoints;\n _stringXAxisDataPoints.current = xAxisPoints;\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n isPopoverOpen,\n YValue: calloutYValue,\n legend: calloutLegend,\n color: calloutTextColor,\n ratio,\n descriptionMessage,\n clickPosition,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n datasetForXAxisDomain={_stringXAxisDataPoints.current}\n stringDatasetForYAxisDomain={_stringYAxisDataPoints.current}\n getmargins={_getMargins}\n xAxisTickCount={_stringXAxisDataPoints.current.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n legendBars={_createLegendBars()}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n children={(p: ChildProps) => {\n _xAxisScale.current = p.xScale;\n _yAxisScale.current = p.yScale;\n return _createRectangles();\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\n"],"names":["HeatMapChart","React","forwardRef","props","forwardedRef","classes","useHeatMapChartStyles","_stringXAxisDataPoints","useRef","_stringYAxisDataPoints","_dataSet","_colorScale","_xAxisScale","_yAxisScale","_xAxisType","_yAxisType","_calloutAnchorPoint","_emptyChartId","useId","_margins","cartesianChartRef","selectedLegend","setSelectedLegend","useState","activeLegend","setActiveLegend","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","calloutTextColor","setCalloutTextColor","calloutYValue","setCalloutYValue","ratio","setRatio","descriptionMessage","setDescriptionMessage","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","useImperativeHandle","componentRef","chartContainer","current","_getXandY","data","forEach","item","length","_getMargins","margins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","_onRectFocus","id","focusEvent","boundingRect","currentTarget","getBoundingClientRect","clientX","left","width","clientY","top","height","updatePosition","legend","rectText","Number","isNaN","value","tokens","colorNeutralForeground1","_onRectMouseOver","mouseEvent","persist","_onRectBlurOrMouseOut","_handleChartMouseLeave","_getInvertedTextColor","color","colorNeutralBackground1","_createRectangles","rectangles","yAxisDataPoints","slice","reverse","yAxisDataPoint","index","xAxisDataPoint","rectElement","dataPointObject","styleRules","foregroundColor","resolveCSSVariables","contrastRatio","getColorContrast","createElement","g","key","role","aria-label","_getAriaLabel","tabIndex","fillOpacity","transform","onFocus","e","onBlur","onMouseOver","onMouseOut","rect","fill","bandwidth","onClick","text","dominantBaseline","textAnchor","className","convertToLocaleString","culture","NaN","push","_onLegendHover","_onLegendLeave","_onLegendClick","_createLegendBars","legendProps","legends","title","action","hoverAction","onMouseOutAction","Legends","_getColorScale","domainValuesForColorScale","rangeValuesForColorScale","d3ScaleLinear","domain","range","_getXIndex","XAxisTypes","DateAxis","getTime","StringAxis","NumericAxis","_getYIndex","YAxisType","xAxisStringFormatter","_getFormattedLabelForXAxisDataPoint","useCallback","point","yAxisStringFormatter","_getFormattedLabelForYAxisDataPoint","_getXAxisDataPoints","points","xAxisPoints","unFormattedXAxisDataPoints","Object","keys","sort","a","b","sortOrder","toLowerCase","map","xPoint","_getStringFormattedDate","xAxisDateFormatString","_getStringFormattedNumber","xAxisNumberFormatString","_getYAxisDataPoints","yAxisPoints","unFormattedYAxisDataPoints","yPoint","yAxisDateFormatString","yAxisNumberFormatString","_createNewDataSet","flattenData","yPoints","uniqueYPoints","uniqueXPoints","posX","posY","datapoint","dataSet","formatString","date","Date","setTime","d3TimeFormat","d3Format","xValue","yValue","zValue","description","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","numDataPoints","reduce","acc","curr","newX","newY","threshold","distance","Math","sqrt","pow","getTypeOfAxis","useMemo","calloutProps","YValue","getAccessibleDataObject","tickParams","tickValues","tickFormat","CartesianChart","chartType","ChartTypes","xAxisType","yAxisType","datasetForXAxisDomain","stringDatasetForYAxisDomain","getmargins","xAxisTickCount","xAxistickSize","xAxisPadding","yAxisPadding","legendBars","onChartMouseLeave","children","p","xScale","yScale","div","style"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,GAAGiM,EAAEC,MAAM;YAC9BpO,YAAYkC,OAAO,GAAGiM,EAAEE,MAAM;YAC9B,OAAO1J;QACT;uBAGFvF,OAAAsG,aAAA,CAAC4I,OAAAA;QAAItL,IAAI5C;QAAeyF,MAAM;QAAS0I,OAAO;YAAE3L,SAAS;QAAI;QAAGkD,cAAY;;AAEhF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Heat Map Chart styles
3
+ * {@docCategory HeatMapChart}
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["HeatMapChart.types.ts"],"sourcesContent":["import type { CartesianChartProps, CartesianChartStyles } from '../CommonComponents/CartesianChart.types';\nimport type { HeatMapChartData } from '../../types/DataPoint';\n\n/**\n * Heat Map Chart properties\n * {@docCategory HeatMapChart}\n */\nexport interface HeatMapChartProps extends CartesianChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n /**\n * data to provide for Heat Map\n */\n data: HeatMapChartData[];\n /**\n * The domain value for the color scale,\n *\n */\n domainValuesForColorScale: number[];\n /**\n * The range values for the color scale,\n * fill the array with colors in hex format\n * note:- it should contain values exactly as many as values in the array\n * `domainValuesForColorScale`\n */\n rangeValuesForColorScale: string[];\n /**\n * date formatter of x axis,\n * if the x-axis data point are of date type then user can use this\n * prop to format the date\n * refer to https://github.com/d3/d3-time-format for string values\n * @default '%b/%d'\n */\n xAxisDateFormatString?: string;\n /**\n * date formatter of y axis,\n * if the y-axis data point are or date type then user can use this\n * prop to format the date\n * refer to https://github.com/d3/d3-time-format for string values\n * @default '%b/%d'\n */\n yAxisDateFormatString?: string;\n /**\n * number formatter of x axis\n * if the x-axis data pints are of number type then user can\n * use this prop to format the number\n * refer to https://github.com/d3/d3-format for string values\n * @default '.2~s'\n */\n xAxisNumberFormatString?: string;\n /**\n * number formatter of y axis\n * if the y-axis data pints are of number type then user can\n * use this prop to format the number\n * refer to https://github.com/d3/d3-format for string values\n * @default '.2~s'\n */\n yAxisNumberFormatString?: string;\n /**\n * string formatter for x-axis.\n * This prop only applies if the x-axis is of string type\n *\n * For the accessiblity reason we sort the x-axis data point given by the consumer in ascending\n * order and then render in the x-axis. this behaviour would force the order of the data points.\n * to overcome , user can give x-axis point names as p1 p2...etc and map those p1 and p2 to custom name.\n * behind the scene the charting will actually sort the p1 and p2 and then we can attach the custom\n * name to that point by using this prop, hence giving the us the flexiblity of the order in which\n * label should render\n *\n * see the example file for the usage of the prop\n */\n xAxisStringFormatter?: (point: string) => string;\n\n /**\n * string formatter for y-axis.\n * This prop only applies if the y-axis is of string type\n *\n * For the accessiblity reason we sort the x-axis data point given by the consumer in ascending\n * order and then render in the y-axis. this behaviour would force the order of the data points.\n * to overcome , user can give y-axis point names as p1 p2...etc and map those p1 and p2 to custom name.\n * behind the scene the charting will actually sort the p1 and p2 and then we can attach the custom\n * name to that point by using this prop, hence giving the us the flexiblity of the order in which\n * label should render\n *\n * see the exaple file for the usage of the prop\n */\n yAxisStringFormatter?: (point: string) => string;\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HeatMapChartStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default alphabetical\n * The prop used to decide order of string axis labels */\n sortOrder?: 'none' | 'alphabetical';\n}\n\n/**\n * Heat Map Chart styles\n * {@docCategory HeatMapChart}\n */\nexport interface HeatMapChartStyles extends CartesianChartStyles {\n root?: string;\n text?: string;\n}\n"],"names":[],"rangeMappings":";;;","mappings":"AA8GA;;;CAGC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./HeatMapChart"), exports);
7
+ _export_star._(require("./HeatMapChart.types"), exports);
8
+ _export_star._(require("../../types/index"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './HeatMapChart';\nexport * from './HeatMapChart.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ heatmapChartClassNames: function() {
13
+ return heatmapChartClassNames;
14
+ },
15
+ useHeatMapChartStyles: function() {
16
+ return useHeatMapChartStyles;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const heatmapChartClassNames = {
21
+ root: 'fui-hmc__root',
22
+ text: 'fui-hmc__text',
23
+ xAxis: '',
24
+ yAxis: '',
25
+ legendContainer: '',
26
+ hover: '',
27
+ calloutContentRoot: '',
28
+ calloutContentX: '',
29
+ calloutContentY: '',
30
+ descriptionMessage: '',
31
+ calloutDateTimeContainer: '',
32
+ calloutInfoContainer: '',
33
+ calloutBlockContainer: '',
34
+ calloutBlockContainertoDrawShapefalse: '',
35
+ calloutBlockContainertoDrawShapetrue: '',
36
+ calloutlegendText: '',
37
+ tooltip: '',
38
+ axisTitle: '',
39
+ chartTitle: '',
40
+ opacityChangeOnHover: '',
41
+ shapeStyles: '',
42
+ chartWrapper: ''
43
+ };
44
+ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
45
+ root: {},
46
+ text: {
47
+ Bahqtrf: "fk6fouc",
48
+ Be2twd7: "fkhj508",
49
+ Bhrd7zp: "fl43uef",
50
+ Bg96gwp: "f1i3iumi",
51
+ Bkecrkj: "f1aehjj5"
52
+ }
53
+ }, {
54
+ d: [
55
+ ".fk6fouc{font-family:var(--fontFamilyBase);}",
56
+ ".fkhj508{font-size:var(--fontSizeBase300);}",
57
+ ".fl43uef{font-weight:var(--fontWeightSemibold);}",
58
+ ".f1i3iumi{line-height:var(--lineHeightBase300);}",
59
+ ".f1aehjj5{pointer-events:none;}"
60
+ ]
61
+ });
62
+ const useHeatMapChartStyles = (props)=>{
63
+ const baseStyles = useStyles();
64
+ return {
65
+ root: (0, _react.mergeClasses)(heatmapChartClassNames.root, baseStyles.root /*, props.styles?.root*/ ),
66
+ text: (0, _react.mergeClasses)(heatmapChartClassNames.text, baseStyles.text /*, props.styles?.text*/ )
67
+ };
68
+ }; //# sourceMappingURL=useHeatMapChartStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useHeatMapChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles } from '@fluentui/react-theme';\nexport const heatmapChartClassNames = {\n root: 'fui-hmc__root',\n text: 'fui-hmc__text',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n calloutContentRoot: '',\n calloutContentX: '',\n calloutContentY: '',\n descriptionMessage: '',\n calloutDateTimeContainer: '',\n calloutInfoContainer: '',\n calloutBlockContainer: '',\n calloutBlockContainertoDrawShapefalse: '',\n calloutBlockContainertoDrawShapetrue: '',\n calloutlegendText: '',\n tooltip: '',\n axisTitle: '',\n chartTitle: '',\n opacityChangeOnHover: '',\n shapeStyles: '',\n chartWrapper: ''\n};\nconst useStyles = makeStyles({\n root: {},\n text: {\n ...typographyStyles.body1Strong,\n pointerEvents: 'none'\n }\n});\nexport const useHeatMapChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n root: mergeClasses(heatmapChartClassNames.root, baseStyles.root /*, props.styles?.root*/ ),\n text: mergeClasses(heatmapChartClassNames.text, baseStyles.text /*, props.styles?.text*/ )\n };\n};\n"],"names":["heatmapChartClassNames","useHeatMapChartStyles","root","text","xAxis","yAxis","legendContainer","hover","calloutContentRoot","calloutContentX","calloutContentY","descriptionMessage","calloutDateTimeContainer","calloutInfoContainer","calloutBlockContainer","calloutBlockContainertoDrawShapefalse","calloutBlockContainertoDrawShapetrue","calloutlegendText","tooltip","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","useStyles","__styles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkecrkj","d","props","baseStyles","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,sBAAsB;eAAtBA;;IA+BAC,qBAAqB;eAArBA;;;uBAjC4B;AAElC,MAAMD,yBAAyB;IAClCE,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,iBAAiB;IACjBC,OAAO;IACPC,oBAAoB;IACpBC,iBAAiB;IACjBC,iBAAiB;IACjBC,oBAAoB;IACpBC,0BAA0B;IAC1BC,sBAAsB;IACtBC,uBAAuB;IACvBC,uCAAuC;IACvCC,sCAAsC;IACtCC,mBAAmB;IACnBC,SAAS;IACTC,WAAW;IACXC,YAAY;IACZC,sBAAsB;IACtBC,aAAa;IACbC,cAAc;AAClB;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAvB,MAAA,CAAA;IAAAC,MAAA;QAAAuB,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAOX,MAAM9B,wBAAyB+B,CAAAA;IAClC,MAAMC,aAAaT;IACnB,OAAO;QACHtB,MAAMgC,IAAAA,mBAAY,EAAClC,uBAAuBE,IAAI,EAAE+B,WAAW/B,IAAI,CAAC,sBAAA;QAChEC,MAAM+B,IAAAA,mBAAY,EAAClC,uBAAuBG,IAAI,EAAE8B,WAAW9B,IAAI,CAAC,sBAAA;IACpE;AACJ"}
@@ -0,0 +1,408 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "HorizontalBarChart", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return HorizontalBarChart;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _useHorizontalBarChartStylesstyles = require("./useHorizontalBarChartStyles.styles");
14
+ const _index = require("./index");
15
+ const _localeutil = require("../../utilities/locale-util");
16
+ const _index1 = require("../../utilities/index");
17
+ const _reactutilities = require("@fluentui/react-utilities");
18
+ const _reacttheme = require("@fluentui/react-theme");
19
+ const _reacttabster = require("@fluentui/react-tabster");
20
+ const _ChartPopover = require("../CommonComponents/ChartPopover");
21
+ const _FocusableTooltipText = require("../../utilities/FocusableTooltipText");
22
+ const _index2 = require("../../index");
23
+ const HorizontalBarChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
24
+ const legendContainer = _react.useRef(null);
25
+ const _uniqLineText = '_HorizontalLine_' + Math.random().toString(36).substring(7);
26
+ const _refArray = [];
27
+ const _isRTL = (0, _index1.useRtl)();
28
+ const barChartSvgRef = /*#__PURE__*/ _react.createRef();
29
+ const _emptyChartId = (0, _reactutilities.useId)('_HBC_empty');
30
+ let _barHeight;
31
+ let _calloutAnchorPoint;
32
+ let isSingleBar = true;
33
+ const [hoverValue, setHoverValue] = _react.useState('');
34
+ const [lineColor, setLineColor] = _react.useState('');
35
+ const [legend, setLegend] = _react.useState('');
36
+ const [xCalloutValue, setXCalloutValue] = _react.useState('');
37
+ const [yCalloutValue, setYCalloutValue] = _react.useState('');
38
+ const [barCalloutProps, setBarCalloutProps] = _react.useState();
39
+ const [barSpacingInPercent, setBarSpacingInPercent] = _react.useState(0);
40
+ const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
41
+ const [clickPosition, setClickPosition] = _react.useState({
42
+ x: 0,
43
+ y: 0
44
+ });
45
+ const [selectedLegend, setSelectedLegend] = _react.useState('');
46
+ const [activeLegend, setActiveLegend] = _react.useState('');
47
+ function _refCallback(element, legendTitle) {
48
+ _refArray.push({
49
+ index: legendTitle,
50
+ refElement: element
51
+ });
52
+ }
53
+ function _hoverOn(event, hoverVal, point) {
54
+ if ((!isPopoverOpen || legend !== point.legend) && _calloutAnchorPoint !== point && (_legendHighlighted(point.legend) || _noLegendHighlighted())) {
55
+ _calloutAnchorPoint = point;
56
+ updatePosition(event.clientX, event.clientY);
57
+ setHoverValue(hoverVal);
58
+ setLineColor(point.color);
59
+ setLegend(point.legend);
60
+ setXCalloutValue(point.xAxisCalloutData);
61
+ setYCalloutValue(point.yAxisCalloutData);
62
+ setBarCalloutProps(point);
63
+ // ToDo - Confirm setting multiple state variables like this is performant.
64
+ }
65
+ }
66
+ function _hoverOff() {
67
+ /*ToDo. To fix*/ }
68
+ const _handleChartMouseLeave = ()=>{
69
+ _calloutAnchorPoint = null;
70
+ if (isPopoverOpen) {
71
+ setPopoverOpen(false);
72
+ setHoverValue('');
73
+ setLineColor('');
74
+ setLegend('');
75
+ }
76
+ };
77
+ const _adjustProps = ()=>{
78
+ _barHeight = props.barHeight || 12;
79
+ };
80
+ const _getChartDataText = (data)=>{
81
+ /* return props.barChartCustomData ? (
82
+ <div role="text">{props.barChartCustomData(data)}</div>
83
+ ) : ( */ return _getDefaultTextData(data);
84
+ //)
85
+ };
86
+ function _createLegends(chartProps) {
87
+ const legendItems = [];
88
+ chartProps.forEach((point)=>{
89
+ point.chartData.forEach((dataPoint)=>{
90
+ const color = dataPoint.color;
91
+ // mapping data to the format Legends component needs
92
+ const legendItem = {
93
+ title: dataPoint.legend,
94
+ color,
95
+ action: ()=>{
96
+ if (selectedLegend === dataPoint.legend) {
97
+ setSelectedLegend('');
98
+ } else {
99
+ setSelectedLegend(dataPoint.legend);
100
+ }
101
+ },
102
+ hoverAction: ()=>{
103
+ _handleChartMouseLeave();
104
+ setActiveLegend(dataPoint.legend);
105
+ },
106
+ onMouseOutAction: ()=>{
107
+ setActiveLegend('');
108
+ }
109
+ };
110
+ legendItems.push(legendItem);
111
+ });
112
+ });
113
+ const legends = /*#__PURE__*/ _react.createElement(_index2.Legends, {
114
+ legends: legendItems,
115
+ centerLegends: true,
116
+ overflowText: props.legendsOverflowText,
117
+ ...props.legendProps
118
+ });
119
+ return legends;
120
+ }
121
+ function _getDefaultTextData(data) {
122
+ const { culture } = props;
123
+ const accessibilityData = (0, _index1.getAccessibleDataObject)(data.chartDataAccessibilityData, 'text', false);
124
+ if (!isSingleBar) {
125
+ const total = data.chartData.reduce((acc, point)=>acc + (point.horizontalBarChartdata.x ? point.horizontalBarChartdata.x : 0), 0);
126
+ return /*#__PURE__*/ _react.createElement("div", {
127
+ className: classes.chartTitleRight,
128
+ ...accessibilityData
129
+ }, (0, _localeutil.convertToLocaleString)(total, culture));
130
+ }
131
+ const chartDataMode = props.chartDataMode || 'default';
132
+ const chartData = data.chartData[0];
133
+ const x = chartData.horizontalBarChartdata.x;
134
+ const y = chartData.horizontalBarChartdata.total;
135
+ switch(chartDataMode){
136
+ case 'default':
137
+ return /*#__PURE__*/ _react.createElement("div", {
138
+ className: classes.chartTitleRight,
139
+ ...accessibilityData
140
+ }, (0, _localeutil.convertToLocaleString)(x, culture));
141
+ case 'fraction':
142
+ return /*#__PURE__*/ _react.createElement("div", accessibilityData, /*#__PURE__*/ _react.createElement("span", {
143
+ className: classes.chartTitleRight
144
+ }, (0, _localeutil.convertToLocaleString)(x, culture)), /*#__PURE__*/ _react.createElement("span", {
145
+ className: classes.chartDataTextDenominator
146
+ }, ' / ' + (0, _localeutil.convertToLocaleString)(y, culture)));
147
+ case 'percentage':
148
+ const dataRatioPercentage = `${(0, _localeutil.convertToLocaleString)(Math.round(x / y * 100), culture)}%`;
149
+ return /*#__PURE__*/ _react.createElement("div", {
150
+ className: classes.chartTitleRight,
151
+ ...accessibilityData
152
+ }, dataRatioPercentage);
153
+ }
154
+ }
155
+ function _createBenchmark(data) {
156
+ if (data.chartData[0].horizontalBarChartdata.total === undefined) {
157
+ return /*#__PURE__*/ _react.createElement(_react.Fragment, null);
158
+ }
159
+ const totalData = data.chartData[0].horizontalBarChartdata.total;
160
+ const benchmarkData = data.chartData[0].data;
161
+ const benchmarkRatio = Math.round((benchmarkData ? benchmarkData : 0) / totalData * 100);
162
+ const benchmarkStyles = {
163
+ left: 'calc(' + benchmarkRatio + '% - 4px)'
164
+ };
165
+ return /*#__PURE__*/ _react.createElement("div", {
166
+ className: classes.benchmarkContainer
167
+ }, /*#__PURE__*/ _react.createElement("div", {
168
+ className: classes.triangle,
169
+ style: benchmarkStyles
170
+ }));
171
+ }
172
+ /**
173
+ * This functions returns an array of <rect> elements, which form the bars
174
+ * For each bar an x value, and a width needs to be specified
175
+ * The computations are done based on percentages
176
+ * Extra margin is also provided, in the x value to provide some spacing in between the bars
177
+ */ function _createBars(data) {
178
+ var _data_chartData;
179
+ const noOfBars = ((_data_chartData = data.chartData) === null || _data_chartData === void 0 ? void 0 : _data_chartData.reduce((count, point)=>count += (point.data || 0) > 0 ? 1 : 0, 0)) || 1;
180
+ const totalMarginPercent = barSpacingInPercent * (noOfBars - 1);
181
+ const defaultColors = [
182
+ _reacttheme.tokens.colorPaletteBlueForeground2,
183
+ _reacttheme.tokens.colorPaletteCornflowerForeground2,
184
+ _reacttheme.tokens.colorPaletteDarkGreenForeground2,
185
+ _reacttheme.tokens.colorPaletteNavyForeground2,
186
+ _reacttheme.tokens.colorPaletteDarkOrangeForeground2
187
+ ];
188
+ // calculating starting point of each bar and it's range
189
+ const startingPoint = [];
190
+ const total = data.chartData.reduce((acc, point)=>acc + (point.horizontalBarChartdata.x ? point.horizontalBarChartdata.x : 0), 0);
191
+ let prevPosition = 0;
192
+ let value = 0;
193
+ let sumOfPercent = 0;
194
+ data.chartData.map((point, index)=>{
195
+ const pointData = point.horizontalBarChartdata.x ? point.horizontalBarChartdata.x : 0;
196
+ value = pointData / total * 100;
197
+ if (value < 0) {
198
+ value = 0;
199
+ } else if (value < 1 && value !== 0) {
200
+ value = 1;
201
+ }
202
+ sumOfPercent += value;
203
+ return sumOfPercent;
204
+ });
205
+ /**
206
+ * The %age of the space occupied by the margin needs to subtracted
207
+ * while computing the scaling ratio, since the margins are not being
208
+ * scaled down, only the data is being scaled down from a higher percentage to lower percentage
209
+ * Eg: 95% of the space is taken by the bars, 5% by the margins
210
+ * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%
211
+ * since that's only space available to the bars
212
+ */ const scalingRatio = sumOfPercent !== 0 ? (sumOfPercent - totalMarginPercent) / 100 : 1;
213
+ const bars = data.chartData.map((point, index)=>{
214
+ const color = point.color ? point.color : defaultColors[Math.floor(Math.random() * 4 + 1)];
215
+ const pointData = point.horizontalBarChartdata.x ? point.horizontalBarChartdata.x : 0;
216
+ if (index > 0) {
217
+ prevPosition += value;
218
+ }
219
+ value = pointData / total * 100;
220
+ if (value < 0) {
221
+ value = 0;
222
+ } else if (value < 1 && value !== 0) {
223
+ value = 1 / scalingRatio;
224
+ } else {
225
+ value = value / scalingRatio;
226
+ }
227
+ startingPoint.push(prevPosition);
228
+ const xValue = point.horizontalBarChartdata.x;
229
+ const placeholderIndex = 1;
230
+ const isLegendSelected = _legendHighlighted(point.legend) || _noLegendHighlighted();
231
+ // Render bar label instead of placeholder bar for absolute-scale variant
232
+ if (index === placeholderIndex && props.variant === _index.HorizontalBarChartVariant.AbsoluteScale) {
233
+ if (props.hideLabels) {
234
+ return /*#__PURE__*/ _react.createElement("text", {
235
+ key: index
236
+ });
237
+ }
238
+ const barValue = data.chartData[0].horizontalBarChartdata.x;
239
+ return /*#__PURE__*/ _react.createElement("text", {
240
+ key: index,
241
+ x: `${_isRTL ? 100 - startingPoint[index] : startingPoint[index]}%`,
242
+ y: _barHeight / 2,
243
+ dominantBaseline: "central",
244
+ transform: `translate(${_isRTL ? -4 : 4})`,
245
+ className: classes.barLabel,
246
+ "aria-hidden": true
247
+ }, (0, _index1.formatValueWithSIPrefix)(barValue));
248
+ }
249
+ return /*#__PURE__*/ _react.createElement("rect", {
250
+ key: index,
251
+ x: `${_isRTL ? 100 - startingPoint[index] - value - index * barSpacingInPercent : startingPoint[index] + index * barSpacingInPercent}%`,
252
+ y: 0,
253
+ "data-is-focusable": point.legend !== '' ? true : false,
254
+ width: value + '%',
255
+ height: _barHeight,
256
+ fill: color,
257
+ onMouseOver: point.legend !== '' ? (event)=>_hoverOn(event, xValue, point) : undefined,
258
+ onFocus: point.legend !== '' ? (event)=>_hoverOn.bind(event, xValue, point) : undefined,
259
+ role: "img",
260
+ "aria-label": _getAriaLabel(point),
261
+ onBlur: _hoverOff,
262
+ onMouseLeave: _hoverOff,
263
+ className: classes.barWrapper,
264
+ opacity: isLegendSelected ? 1 : 0.1,
265
+ tabIndex: point.legend !== '' ? 0 : undefined
266
+ });
267
+ });
268
+ return bars;
269
+ }
270
+ const _getAriaLabel = (point)=>{
271
+ var _point_callOutAccessibilityData;
272
+ const legend = point.xAxisCalloutData || point.legend;
273
+ var _point_horizontalBarChartdata_total;
274
+ const yValue = point.yAxisCalloutData || (point.horizontalBarChartdata ? `${point.horizontalBarChartdata.x}/${(_point_horizontalBarChartdata_total = point.horizontalBarChartdata.total) !== null && _point_horizontalBarChartdata_total !== void 0 ? _point_horizontalBarChartdata_total : ''}` : 0);
275
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || (legend ? `${legend}, ` : '') + `${yValue}.`;
276
+ };
277
+ function _isChartEmpty() {
278
+ return !(props.data && props.data.length > 0);
279
+ }
280
+ function updatePosition(newX, newY) {
281
+ const threshold = 1; // Set a threshold for movement
282
+ const { x, y } = clickPosition;
283
+ // Calculate the distance moved
284
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
285
+ // Update the position only if the distance moved is greater than the threshold
286
+ if (distance > threshold) {
287
+ setClickPosition({
288
+ x: newX,
289
+ y: newY
290
+ });
291
+ setPopoverOpen(true);
292
+ }
293
+ }
294
+ _react.useEffect(()=>{
295
+ var _barChartSvgRef_current;
296
+ const svgWidth = (barChartSvgRef === null || barChartSvgRef === void 0 ? void 0 : (_barChartSvgRef_current = barChartSvgRef.current) === null || _barChartSvgRef_current === void 0 ? void 0 : _barChartSvgRef_current.getBoundingClientRect().width) || 0;
297
+ const MARGIN_WIDTH_IN_PX = 3;
298
+ if (svgWidth) {
299
+ const currentBarSpacing = MARGIN_WIDTH_IN_PX / svgWidth * 100;
300
+ setBarSpacingInPercent(currentBarSpacing);
301
+ }
302
+ }, [
303
+ barChartSvgRef
304
+ ]);
305
+ function _legendHighlighted(barLegend) {
306
+ if (barLegend === undefined) {
307
+ return false;
308
+ }
309
+ return selectedLegend === barLegend || selectedLegend === '' && activeLegend === barLegend;
310
+ }
311
+ /**
312
+ * This function checks if none of the legends is selected or hovered.*/ function _noLegendHighlighted() {
313
+ return selectedLegend === '' && activeLegend === '';
314
+ }
315
+ const { data } = props;
316
+ _adjustProps();
317
+ const classes = (0, _useHorizontalBarChartStylesstyles.useHorizontalBarChartStyles)(props);
318
+ const focusAttributes = (0, _reacttabster.useFocusableGroup)();
319
+ const legendButtons = _createLegends(data);
320
+ let datapoint = 0;
321
+ var _props_culture;
322
+ return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement("div", {
323
+ className: classes.root,
324
+ onMouseLeave: _handleChartMouseLeave
325
+ }, data.map((points, index)=>{
326
+ if (points.chartData && points.chartData[0] && points.chartData[0].horizontalBarChartdata.x) {
327
+ datapoint = points.chartData[0].horizontalBarChartdata.x;
328
+ } else {
329
+ datapoint = 0;
330
+ }
331
+ isSingleBar = points.chartData.length === 1 || points.chartData.length > 1 && points.chartData[1].legend === '';
332
+ if (isSingleBar) {
333
+ points.chartData[1] = {
334
+ legend: '',
335
+ horizontalBarChartdata: {
336
+ x: points.chartData[0].horizontalBarChartdata.total - datapoint,
337
+ total: points.chartData[0].horizontalBarChartdata.total
338
+ },
339
+ color: _reacttheme.tokens.colorBackgroundOverlay
340
+ };
341
+ }
342
+ // Hide right side text of chart title for absolute-scale variant
343
+ const chartDataText = props.variant === _index.HorizontalBarChartVariant.AbsoluteScale ? null : _getChartDataText(points);
344
+ const bars = _createBars(points);
345
+ const keyVal = _uniqLineText + '_' + index;
346
+ // ToDo - Showtriangle property is per data series. How to account for it in the new stylesheet
347
+ /* const classes = useHorizontalBarChartStyles(props.styles!, {
348
+ width: props.width,
349
+ showTriangle: !!points!.chartData![0].data,
350
+ variant: props.variant,
351
+ }); */ return /*#__PURE__*/ _react.createElement("div", {
352
+ key: index
353
+ }, /*#__PURE__*/ _react.createElement("div", {
354
+ className: classes.items,
355
+ ...focusAttributes
356
+ }, /*#__PURE__*/ _react.createElement("div", {
357
+ className: classes.chartTitle
358
+ }, points.chartTitle && /*#__PURE__*/ _react.createElement(_FocusableTooltipText.FocusableTooltipText, {
359
+ className: classes.chartTitleLeft,
360
+ content: points.chartTitle,
361
+ accessibilityData: points.chartTitleAccessibilityData
362
+ }), chartDataText), points.chartData[0].data && _createBenchmark(points), /*#__PURE__*/ _react.createElement("svg", {
363
+ ref: barChartSvgRef,
364
+ className: classes.chart,
365
+ "aria-label": points.chartTitle
366
+ }, /*#__PURE__*/ _react.createElement("g", {
367
+ id: keyVal,
368
+ key: keyVal,
369
+ ref: (e)=>{
370
+ _refCallback(e, points.chartData[0].legend);
371
+ },
372
+ // NOTE: points.chartData![0] contains current data value
373
+ onClick: ()=>{
374
+ const p = points.chartData[0];
375
+ if (p && p.onClick) {
376
+ p.onClick();
377
+ }
378
+ }
379
+ }, bars))));
380
+ }), /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
381
+ xCalloutValue: xCalloutValue,
382
+ yCalloutValue: yCalloutValue,
383
+ culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
384
+ clickPosition: clickPosition,
385
+ isPopoverOpen: isPopoverOpen,
386
+ legend: legend,
387
+ YValue: hoverValue,
388
+ color: lineColor,
389
+ isCalloutForStack: false,
390
+ customCallout: {
391
+ customizedCallout: props.onRenderCalloutPerHorizontalBar ? props.onRenderCalloutPerHorizontalBar(barCalloutProps) : undefined,
392
+ customCalloutProps: props.calloutPropsPerDataPoint ? props.calloutPropsPerDataPoint(barCalloutProps) : undefined
393
+ },
394
+ isCartesian: false
395
+ }), !isSingleBar && /*#__PURE__*/ _react.createElement("div", {
396
+ ref: (e)=>legendContainer.current = e,
397
+ className: classes.legendContainer
398
+ }, legendButtons)) : /*#__PURE__*/ _react.createElement("div", {
399
+ id: _emptyChartId,
400
+ role: 'alert',
401
+ style: {
402
+ opacity: '0'
403
+ },
404
+ "aria-label": 'Graph has no data to display'
405
+ });
406
+ //TODO validate and fix focus border for issue for popover
407
+ });
408
+ HorizontalBarChart.displayName = 'HorizontalBarChart';