@fluentui/react-charts 9.1.10 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/dist/index.d.ts +39 -3
  3. package/lib/AreaChart.js.map +1 -1
  4. package/lib/CartesianChart.js.map +1 -1
  5. package/lib/DeclarativeChart.js.map +1 -1
  6. package/lib/DonutChart.js.map +1 -1
  7. package/lib/FunnelChart.js.map +1 -1
  8. package/lib/GanttChart.js.map +1 -1
  9. package/lib/GaugeChart.js.map +1 -1
  10. package/lib/GroupedVerticalBarChart.js.map +1 -1
  11. package/lib/HeatMapChart.js.map +1 -1
  12. package/lib/HorizontalBarChart.js.map +1 -1
  13. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  14. package/lib/Legends.js.map +1 -1
  15. package/lib/LineChart.js.map +1 -1
  16. package/lib/Popover.js.map +1 -1
  17. package/lib/ResponsiveContainer.js.map +1 -1
  18. package/lib/SankeyChart.js.map +1 -1
  19. package/lib/ScatterChart.js.map +1 -1
  20. package/lib/Sparkline.js.map +1 -1
  21. package/lib/VerticalBarChart.js.map +1 -1
  22. package/lib/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/components/AreaChart/AreaChart.js +11 -3
  24. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  25. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  26. package/lib/components/AreaChart/index.js.map +1 -1
  27. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  28. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
  29. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  30. package/lib/components/CommonComponents/CartesianChart.js +2 -1
  31. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  33. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  34. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  35. package/lib/components/CommonComponents/index.js.map +1 -1
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
  37. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
  38. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  39. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
  40. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
  41. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  42. package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -7
  43. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +44 -13
  45. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  46. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  47. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  48. package/lib/components/DeclarativeChart/index.js.map +1 -1
  49. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  50. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  51. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  52. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
  53. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
  54. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  55. package/lib/components/DonutChart/DonutChart.js +11 -3
  56. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  57. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  58. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  59. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  60. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  61. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
  62. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
  63. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  64. package/lib/components/DonutChart/index.js.map +1 -1
  65. package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
  66. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
  67. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  68. package/lib/components/FunnelChart/FunnelChart.js +10 -1
  69. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  71. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  72. package/lib/components/FunnelChart/index.js.map +1 -1
  73. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
  74. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
  75. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  76. package/lib/components/GanttChart/GanttChart.js +19 -2
  77. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  78. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  79. package/lib/components/GanttChart/index.js.map +1 -1
  80. package/lib/components/GanttChart/useGanttChartStyles.styles.js +1 -2
  81. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
  82. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  83. package/lib/components/GaugeChart/GaugeChart.js +9 -2
  84. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  85. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  86. package/lib/components/GaugeChart/index.js.map +1 -1
  87. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
  88. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
  89. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  90. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  91. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  92. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  93. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  94. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  95. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
  96. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  97. package/lib/components/HeatMapChart/HeatMapChart.js +11 -3
  98. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  99. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  100. package/lib/components/HeatMapChart/index.js.map +1 -1
  101. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
  102. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
  103. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  104. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  105. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  106. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  107. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  108. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
  109. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
  110. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  111. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  112. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  113. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  114. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  115. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
  116. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
  117. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  118. package/lib/components/Legends/Legends.js +28 -10
  119. package/lib/components/Legends/Legends.js.map +1 -1
  120. package/lib/components/Legends/Legends.types.js.map +1 -1
  121. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  122. package/lib/components/Legends/index.js.map +1 -1
  123. package/lib/components/Legends/shape.js.map +1 -1
  124. package/lib/components/Legends/useLegendsStyles.styles.js +57 -14
  125. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  126. package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
  127. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  128. package/lib/components/LineChart/LineChart.js +9 -2
  129. package/lib/components/LineChart/LineChart.js.map +1 -1
  130. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  131. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  132. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  133. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  134. package/lib/components/LineChart/index.js.map +1 -1
  135. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  136. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
  137. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  138. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  139. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  140. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  141. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
  142. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
  143. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  144. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  145. package/lib/components/SankeyChart/SankeyChart.js +5 -1
  146. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  147. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  148. package/lib/components/SankeyChart/index.js.map +1 -1
  149. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  150. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
  151. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  152. package/lib/components/ScatterChart/ScatterChart.js +11 -3
  153. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  154. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  155. package/lib/components/ScatterChart/index.js.map +1 -1
  156. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  157. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
  158. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  159. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  160. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  161. package/lib/components/Sparkline/index.js.map +1 -1
  162. package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
  163. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
  164. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  165. package/lib/components/VerticalBarChart/VerticalBarChart.js +62 -28
  166. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  167. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  168. package/lib/components/VerticalBarChart/index.js.map +1 -1
  169. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  170. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
  171. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  172. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  173. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  174. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  175. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  176. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  177. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
  178. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  179. package/lib/index.js.map +1 -1
  180. package/lib/types/DataPoint.js.map +1 -1
  181. package/lib/types/EventAnnotation.js.map +1 -1
  182. package/lib/types/LegendDataItem.js.map +1 -1
  183. package/lib/types/index.js.map +1 -1
  184. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  185. package/lib/utilities/KeyCodes.js.map +1 -1
  186. package/lib/utilities/SVGTooltipText.js +2 -0
  187. package/lib/utilities/SVGTooltipText.js.map +1 -1
  188. package/lib/utilities/async-utils.js.map +1 -1
  189. package/lib/utilities/colors.js.map +1 -1
  190. package/lib/utilities/getWindow.js.map +1 -1
  191. package/lib/utilities/image-export-utils.js +256 -0
  192. package/lib/utilities/image-export-utils.js.map +1 -0
  193. package/lib/utilities/index.js.map +1 -1
  194. package/lib/utilities/overflow-utils.js.map +1 -1
  195. package/lib/utilities/string.js.map +1 -1
  196. package/lib/utilities/test-data.js.map +1 -1
  197. package/lib/utilities/utilities.js +50 -5
  198. package/lib/utilities/utilities.js.map +1 -1
  199. package/lib/utilities/vbc-utils.js.map +1 -1
  200. package/lib-commonjs/AreaChart.js.map +1 -1
  201. package/lib-commonjs/CartesianChart.js.map +1 -1
  202. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  203. package/lib-commonjs/DonutChart.js.map +1 -1
  204. package/lib-commonjs/FunnelChart.js.map +1 -1
  205. package/lib-commonjs/GanttChart.js.map +1 -1
  206. package/lib-commonjs/GaugeChart.js.map +1 -1
  207. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  208. package/lib-commonjs/HeatMapChart.js.map +1 -1
  209. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  210. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  211. package/lib-commonjs/Legends.js.map +1 -1
  212. package/lib-commonjs/LineChart.js.map +1 -1
  213. package/lib-commonjs/Popover.js.map +1 -1
  214. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  215. package/lib-commonjs/SankeyChart.js.map +1 -1
  216. package/lib-commonjs/ScatterChart.js.map +1 -1
  217. package/lib-commonjs/Sparkline.js.map +1 -1
  218. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  219. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  220. package/lib-commonjs/components/AreaChart/AreaChart.js +10 -2
  221. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  222. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  223. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  224. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
  225. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  226. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
  227. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  228. package/lib-commonjs/components/CommonComponents/CartesianChart.js +2 -1
  229. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  230. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  231. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  232. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  233. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  234. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
  235. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  236. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
  237. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  238. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
  239. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  240. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
  241. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  242. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -6
  243. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  244. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +47 -13
  245. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  246. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  247. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  248. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  249. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  250. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  251. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  252. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
  253. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
  255. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  256. package/lib-commonjs/components/DonutChart/DonutChart.js +10 -2
  257. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  258. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  259. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  260. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  261. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  262. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
  263. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
  264. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  265. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  266. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
  267. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
  268. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  269. package/lib-commonjs/components/FunnelChart/FunnelChart.js +10 -1
  270. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  271. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  272. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  273. package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
  274. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
  275. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
  277. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  278. package/lib-commonjs/components/GanttChart/GanttChart.js +18 -1
  279. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  280. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  281. package/lib-commonjs/components/GanttChart/index.js.map +1 -1
  282. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +1 -1
  283. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
  284. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  285. package/lib-commonjs/components/GaugeChart/GaugeChart.js +9 -2
  286. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  287. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  288. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  289. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
  290. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  291. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
  292. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  293. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  294. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  295. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  296. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  297. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
  298. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
  299. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  300. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +10 -2
  301. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  302. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  303. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  304. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
  305. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
  306. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  307. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  308. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  309. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  310. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  311. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  312. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
  313. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  314. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  315. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  316. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  317. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  318. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
  319. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
  320. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  321. package/lib-commonjs/components/Legends/Legends.js +28 -10
  322. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  323. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  324. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  325. package/lib-commonjs/components/Legends/index.js.map +1 -1
  326. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  327. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +101 -28
  328. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  329. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
  330. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  331. package/lib-commonjs/components/LineChart/LineChart.js +9 -2
  332. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  333. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  334. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  335. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  336. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  337. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  338. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
  339. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
  340. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  341. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  342. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  343. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  344. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
  345. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
  346. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  347. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  348. package/lib-commonjs/components/SankeyChart/SankeyChart.js +5 -1
  349. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  350. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  351. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  352. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
  353. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  354. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
  355. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  356. package/lib-commonjs/components/ScatterChart/ScatterChart.js +10 -2
  357. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  358. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  359. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  360. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  361. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
  362. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  363. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  364. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  365. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  366. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
  367. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
  368. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  369. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +62 -28
  370. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  371. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  372. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  373. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
  374. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
  375. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  376. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  377. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  378. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  379. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  380. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
  381. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  382. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
  383. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  384. package/lib-commonjs/index.js.map +1 -1
  385. package/lib-commonjs/types/DataPoint.js.map +1 -1
  386. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  387. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  388. package/lib-commonjs/types/index.js.map +1 -1
  389. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  390. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  391. package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
  392. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  393. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  394. package/lib-commonjs/utilities/colors.js.map +1 -1
  395. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  396. package/lib-commonjs/utilities/image-export-utils.js +274 -0
  397. package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
  398. package/lib-commonjs/utilities/index.js.map +1 -1
  399. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  400. package/lib-commonjs/utilities/string.js.map +1 -1
  401. package/lib-commonjs/utilities/test-data.js.map +1 -1
  402. package/lib-commonjs/utilities/utilities.js +56 -5
  403. package/lib-commonjs/utilities/utilities.js.map +1 -1
  404. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  405. package/package.json +12 -22
@@ -1 +1 @@
1
- {"version":3,"sources":["HorizontalBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { ChartDataPoint, ChartProps } from './index';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Horizontal Bar Chart properties\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * An array of chart data points for the Horizontal bar chart\n */\n data?: ChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * This property tells how to show data text on top right of bar chart.\n * If barChartCustomData props added, then this props will be overrided.\n * @default 'default'\n */\n chartDataMode?: ChartDataMode;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartStyles;\n\n /**\n * Define a custom callout renderer for a horizontal bar\n */\n // onRenderCalloutPerHorizontalBar?: IRenderFunction<IChartDataPoint>; ToDo - Need to use slots here.\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Custom text to the chart (right side of the chart)\n * IChartProps will be available as props to the method prop.\n * If this method not given, default values (IHorizontalDataPoint \\{x,y\\})\n * will be used to display the data/text based on given chartModeData prop.\n */\n // barChartCustomData?: IRenderFunction<IChartProps>; ToDo - Need to use slots here.\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of HorizontalBarChart to render\n * @default HorizontalBarChartVariant.PartToWhole\n */\n variant?: HorizontalBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * line color for callout\n */\n color?: string;\n\n /**\n * prop to check if benchmark data is provided\n */\n showTriangle?: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * prop to render the custom callout\n */\n onRenderCalloutPerHorizontalBar?: (props: ChartDataPoint) => JSX.Element | undefined;\n\n /**\n * Define a custom callout props override\n */\n calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;\n}\n\n/**\n * Horizontal Bar Chart styles\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartStyles {\n /**\n * Styling for the root container\n */\n root: string;\n\n /**\n * Styling for each item in the container\n */\n items: string;\n\n /**\n * Style for the chart.\n */\n chart: string;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: string;\n\n /**\n * Style for the bars.\n */\n barWrapper: string;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: string;\n\n /**\n * Style for right side text of the chart title\n */\n chartTitleRight: string;\n\n /**\n * Style for the chart data text denominator.\n */\n chartDataTextDenominator: string;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: string;\n\n /**\n * Style for the benchmark triangle\n */\n triangle: string;\n\n /**\n * Style for the bar labels\n */\n barLabel: string;\n\n /**\n * Style for the div containing the chart\n */\n chartWrapper: string;\n\n /**\n * Style for the legend container.\n */\n legendContainer: string;\n}\n\n/**\n * Chart data mode for chart data text\n * default: show the datapoint.x value\n * fraction: show the fraction of datapoint.x/datapoint.y\n * percentage: show the percentage of (datapoint.x/datapoint.y)%\n * {@docCategory HorizontalBarChart}\n */\nexport type ChartDataMode = 'default' | 'fraction' | 'percentage';\n\n/**\n * {@docCategory HorizontalBarChart}\n */\nexport enum HorizontalBarChartVariant {\n PartToWhole = 'part-to-whole',\n AbsoluteScale = 'absolute-scale',\n}\n"],"names":["React","HorizontalBarChartVariant"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAuM/B;;CAEC,GACD,OAAO,IAAA,AAAKC,mDAAAA;;;WAAAA;MAGX"}
1
+ {"version":3,"sources":["../src/components/HorizontalBarChart/HorizontalBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { ChartDataPoint, ChartProps } from './index';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Horizontal Bar Chart properties\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * An array of chart data points for the Horizontal bar chart\n */\n data?: ChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * This property tells how to show data text on top right of bar chart.\n * If barChartCustomData props added, then this props will be overrided.\n * @default 'default'\n */\n chartDataMode?: ChartDataMode;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartStyles;\n\n /**\n * Define a custom callout renderer for a horizontal bar\n */\n // onRenderCalloutPerHorizontalBar?: IRenderFunction<IChartDataPoint>; ToDo - Need to use slots here.\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Custom text to the chart (right side of the chart)\n * IChartProps will be available as props to the method prop.\n * If this method not given, default values (IHorizontalDataPoint \\{x,y\\})\n * will be used to display the data/text based on given chartModeData prop.\n */\n // barChartCustomData?: IRenderFunction<IChartProps>; ToDo - Need to use slots here.\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of HorizontalBarChart to render\n * @default HorizontalBarChartVariant.PartToWhole\n */\n variant?: HorizontalBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * line color for callout\n */\n color?: string;\n\n /**\n * prop to check if benchmark data is provided\n */\n showTriangle?: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * prop to render the custom callout\n */\n onRenderCalloutPerHorizontalBar?: (props: ChartDataPoint) => JSX.Element | undefined;\n\n /**\n * Define a custom callout props override\n */\n calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;\n\n /**\n * When true, chart will display legends even if a bar ( row ) has only one data point.\n * @default false\n */\n showLegendForSinglePointBar?: boolean;\n}\n\n/**\n * Horizontal Bar Chart styles\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartStyles {\n /**\n * Styling for the root container\n */\n root: string;\n\n /**\n * Styling for each item in the container\n */\n items: string;\n\n /**\n * Style for the chart.\n */\n chart: string;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: string;\n\n /**\n * Style for the bars.\n */\n barWrapper: string;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: string;\n\n /**\n * Style for right side text of the chart title\n */\n chartTitleRight: string;\n\n /**\n * Style for the chart data text denominator.\n */\n chartDataTextDenominator: string;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: string;\n\n /**\n * Style for the benchmark triangle\n */\n triangle: string;\n\n /**\n * Style for the bar labels\n */\n barLabel: string;\n\n /**\n * Style for the div containing the chart\n */\n chartWrapper: string;\n\n /**\n * Style for the legend container.\n */\n legendContainer: string;\n}\n\n/**\n * Chart data mode for chart data text\n * default: show the datapoint.x value\n * fraction: show the fraction of datapoint.x/datapoint.y\n * percentage: show the percentage of (datapoint.x/datapoint.y)%\n * hidden: do not show any data text\n * {@docCategory HorizontalBarChart}\n */\nexport type ChartDataMode = 'default' | 'fraction' | 'percentage' | 'hidden';\n\n/**\n * {@docCategory HorizontalBarChart}\n */\nexport enum HorizontalBarChartVariant {\n PartToWhole = 'part-to-whole',\n AbsoluteScale = 'absolute-scale',\n}\n"],"names":["React","HorizontalBarChartVariant"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AA8M/B;;CAEC,GACD,OAAO,IAAA,AAAKC,mDAAAA;;;WAAAA;MAGX"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './HorizontalBarChart';\nexport * from './HorizontalBarChart.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,oBAAoB"}
1
+ {"version":3,"sources":["../src/components/HorizontalBarChart/index.ts"],"sourcesContent":["export * from './HorizontalBarChart';\nexport * from './HorizontalBarChart.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,oBAAoB"}
@@ -152,5 +152,4 @@ export const useHorizontalBarChartStyles = props => {
152
152
  chartWrapper: mergeClasses(hbcClassNames.chartWrapper, variant === HorizontalBarChartVariant.AbsoluteScale && !hideLabels ? baseStyles.chartWrapper40ppadding : baseStyles.chartWrapper0ppadding, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.chartWrapper),
153
153
  legendContainer: mergeClasses(hbcClassNames.legendContainer, baseStyles.legendContainer, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.legendContainer)
154
154
  };
155
- };
156
- //# sourceMappingURL=useHorizontalBarChartStyles.styles.js.map
155
+ };
@@ -0,0 +1,120 @@
1
+ import { makeStyles, mergeClasses, shorthands } from '@griffel/react';
2
+ import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ import { HorizontalBarChartVariant } from './index';
4
+ /**
5
+ * @internal
6
+ */ export const hbcClassNames = {
7
+ root: 'fui-hbc__root',
8
+ items: 'fui-hbc__items',
9
+ chart: 'fui-hbc__chart',
10
+ chartTitle: 'fui-hbc__chartTitle',
11
+ barWrapper: 'fui-hbc__barWrapper',
12
+ chartTitleLeft: 'fui-hbc__chartTitleLeft',
13
+ chartTitleRight: 'fui-hbc__chartTitleRight',
14
+ chartDataTextDenominator: 'fui-hbc__textDenom',
15
+ benchmarkContainer: 'fui-hbc__benchmark',
16
+ triangle: 'fui-hbc__triangle',
17
+ barLabel: 'fui-hbc__barLabel',
18
+ chartWrapper: 'fui-hbc__chartWrapper',
19
+ legendContainer: 'fui-hbc__legendContainer'
20
+ };
21
+ /**
22
+ * Base Styles
23
+ */ const useStyles = makeStyles({
24
+ root: {
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ width: '100%'
28
+ },
29
+ items10pMargin: {
30
+ marginBottom: tokens.spacingVerticalMNudge
31
+ },
32
+ items16pMargin: {
33
+ marginBottom: tokens.spacingVerticalL
34
+ },
35
+ chart: {
36
+ width: '100%',
37
+ height: '12px',
38
+ display: 'block',
39
+ overflow: 'visible'
40
+ },
41
+ barWrapper: {},
42
+ chartTitle: {
43
+ ...typographyStyles.caption1,
44
+ display: 'flex',
45
+ justifyContent: 'space-between'
46
+ },
47
+ chartTitleLeft: {
48
+ textOverflow: 'ellipsis',
49
+ overflow: 'hidden',
50
+ whiteSpace: 'nowrap',
51
+ display: 'block',
52
+ color: tokens.colorNeutralForeground1
53
+ },
54
+ chartTitleLeft4pMargin: {
55
+ marginBottom: '4px'
56
+ },
57
+ chartTitleLeft5pMargin: {
58
+ marginBottom: '5px'
59
+ },
60
+ chartTitleRight: {
61
+ ...typographyStyles.body1Strong,
62
+ color: tokens.colorNeutralForeground1
63
+ },
64
+ chartDataTextDenominator: {
65
+ ...typographyStyles.body1,
66
+ color: tokens.colorNeutralForeground1
67
+ },
68
+ benchmarkContainer: {
69
+ position: 'relative',
70
+ height: '7px',
71
+ marginTop: '-3px',
72
+ marginBottom: '-1px'
73
+ },
74
+ triangle: {
75
+ width: '0',
76
+ height: '0',
77
+ ...shorthands.borderLeft('4px', 'solid', 'transparent'),
78
+ ...shorthands.borderRight('4px', 'solid', 'transparent'),
79
+ ...shorthands.borderTop('7px', 'solid'),
80
+ borderTopColor: tokens.colorPaletteBlueBorderActive,
81
+ marginBottom: tokens.spacingVerticalXS,
82
+ position: 'absolute'
83
+ },
84
+ barLabel: {
85
+ ...typographyStyles.caption1Strong,
86
+ fill: tokens.colorNeutralForeground1,
87
+ forcedColorAdjust: 'none'
88
+ },
89
+ chartWrapper40ppadding: {
90
+ paddingRight: '40p'
91
+ },
92
+ chartWrapper0ppadding: {
93
+ paddingRight: tokens.spacingHorizontalNone
94
+ },
95
+ legendContainer: {
96
+ paddingTop: tokens.spacingVerticalL
97
+ }
98
+ });
99
+ /**
100
+ * Apply styling to the Carousel slots based on the state
101
+ */ export const useHorizontalBarChartStyles = (props)=>{
102
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9, _props_styles10, _props_styles11, _props_styles12;
103
+ const { className, showTriangle, variant, hideLabels } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.
104
+ const baseStyles = useStyles();
105
+ return {
106
+ root: mergeClasses(hbcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
107
+ items: mergeClasses(hbcClassNames.items, showTriangle || variant === HorizontalBarChartVariant.AbsoluteScale ? baseStyles.items16pMargin : baseStyles.items10pMargin, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.items),
108
+ chart: mergeClasses(hbcClassNames.chart, baseStyles.chart, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.chart),
109
+ chartTitle: mergeClasses(hbcClassNames.chartTitle, baseStyles.chartTitle, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartTitle),
110
+ barWrapper: mergeClasses(hbcClassNames.barWrapper, baseStyles.barWrapper, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.barWrapper),
111
+ chartTitleLeft: mergeClasses(hbcClassNames.chartTitleLeft, baseStyles.chartTitleLeft, variant === HorizontalBarChartVariant.AbsoluteScale ? baseStyles.chartTitleLeft4pMargin : baseStyles.chartTitleLeft5pMargin, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.chartTitleLeft),
112
+ chartTitleRight: mergeClasses(hbcClassNames.chartTitleRight, baseStyles.chartTitleRight, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.chartTitleRight),
113
+ chartDataTextDenominator: mergeClasses(hbcClassNames.chartDataTextDenominator, baseStyles.chartDataTextDenominator, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.chartDataTextDenominator),
114
+ benchmarkContainer: mergeClasses(hbcClassNames.benchmarkContainer, baseStyles.benchmarkContainer, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.benchmarkContainer),
115
+ triangle: mergeClasses(hbcClassNames.triangle, baseStyles.triangle, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.triangle),
116
+ barLabel: mergeClasses(hbcClassNames.barLabel, baseStyles.barLabel, (_props_styles10 = props.styles) === null || _props_styles10 === void 0 ? void 0 : _props_styles10.barLabel),
117
+ chartWrapper: mergeClasses(hbcClassNames.chartWrapper, variant === HorizontalBarChartVariant.AbsoluteScale && !hideLabels ? baseStyles.chartWrapper40ppadding : baseStyles.chartWrapper0ppadding, (_props_styles11 = props.styles) === null || _props_styles11 === void 0 ? void 0 : _props_styles11.chartWrapper),
118
+ legendContainer: mergeClasses(hbcClassNames.legendContainer, baseStyles.legendContainer, (_props_styles12 = props.styles) === null || _props_styles12 === void 0 ? void 0 : _props_styles12.legendContainer)
119
+ };
120
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HorizontalBarChartProps, HorizontalBarChartStyles, HorizontalBarChartVariant } from './index';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const hbcClassNames: SlotClassNames<HorizontalBarChartStyles> = {\n root: 'fui-hbc__root',\n items: 'fui-hbc__items',\n chart: 'fui-hbc__chart',\n chartTitle: 'fui-hbc__chartTitle',\n barWrapper: 'fui-hbc__barWrapper',\n chartTitleLeft: 'fui-hbc__chartTitleLeft',\n chartTitleRight: 'fui-hbc__chartTitleRight',\n chartDataTextDenominator: 'fui-hbc__textDenom',\n benchmarkContainer: 'fui-hbc__benchmark',\n triangle: 'fui-hbc__triangle',\n barLabel: 'fui-hbc__barLabel',\n chartWrapper: 'fui-hbc__chartWrapper',\n legendContainer: 'fui-hbc__legendContainer',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%', // Support custom width\n },\n items10pMargin: {\n marginBottom: tokens.spacingVerticalMNudge,\n },\n items16pMargin: {\n marginBottom: tokens.spacingVerticalL,\n },\n chart: {\n width: '100%',\n height: '12px', // Support custom bar height\n display: 'block',\n overflow: 'visible',\n },\n barWrapper: {},\n chartTitle: {\n ...typographyStyles.caption1,\n display: 'flex',\n justifyContent: 'space-between',\n },\n chartTitleLeft: {\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n display: 'block',\n color: tokens.colorNeutralForeground1,\n },\n chartTitleLeft4pMargin: {\n marginBottom: '4px',\n },\n chartTitleLeft5pMargin: {\n marginBottom: '5px',\n },\n chartTitleRight: {\n ...typographyStyles.body1Strong,\n color: tokens.colorNeutralForeground1,\n },\n chartDataTextDenominator: {\n ...typographyStyles.body1,\n color: tokens.colorNeutralForeground1,\n },\n benchmarkContainer: {\n position: 'relative',\n height: '7px',\n marginTop: '-3px',\n marginBottom: '-1px',\n },\n triangle: {\n width: '0',\n height: '0',\n ...shorthands.borderLeft('4px', 'solid', 'transparent'),\n ...shorthands.borderRight('4px', 'solid', 'transparent'),\n ...shorthands.borderTop('7px', 'solid'),\n borderTopColor: tokens.colorPaletteBlueBorderActive,\n marginBottom: tokens.spacingVerticalXS,\n position: 'absolute',\n },\n barLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'none',\n },\n chartWrapper40ppadding: {\n paddingRight: '40p',\n },\n chartWrapper0ppadding: {\n paddingRight: tokens.spacingHorizontalNone,\n },\n legendContainer: { paddingTop: tokens.spacingVerticalL },\n});\n\n/**\n * Apply styling to the Carousel slots based on the state\n */\nexport const useHorizontalBarChartStyles = (props: HorizontalBarChartProps): HorizontalBarChartStyles => {\n const { className, showTriangle, variant, hideLabels } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(hbcClassNames.root, baseStyles.root, className, props.styles?.root),\n items: mergeClasses(\n hbcClassNames.items,\n showTriangle || variant === HorizontalBarChartVariant.AbsoluteScale\n ? baseStyles.items16pMargin\n : baseStyles.items10pMargin,\n props.styles?.items,\n ),\n chart: mergeClasses(hbcClassNames.chart, baseStyles.chart, props.styles?.chart),\n chartTitle: mergeClasses(hbcClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n barWrapper: mergeClasses(hbcClassNames.barWrapper, baseStyles.barWrapper, props.styles?.barWrapper),\n chartTitleLeft: mergeClasses(\n hbcClassNames.chartTitleLeft,\n baseStyles.chartTitleLeft,\n variant === HorizontalBarChartVariant.AbsoluteScale\n ? baseStyles.chartTitleLeft4pMargin\n : baseStyles.chartTitleLeft5pMargin,\n props.styles?.chartTitleLeft,\n ),\n chartTitleRight: mergeClasses(\n hbcClassNames.chartTitleRight,\n baseStyles.chartTitleRight,\n props.styles?.chartTitleRight,\n ),\n chartDataTextDenominator: mergeClasses(\n hbcClassNames.chartDataTextDenominator,\n baseStyles.chartDataTextDenominator,\n props.styles?.chartDataTextDenominator,\n ),\n benchmarkContainer: mergeClasses(\n hbcClassNames.benchmarkContainer,\n baseStyles.benchmarkContainer,\n props.styles?.benchmarkContainer,\n ),\n triangle: mergeClasses(hbcClassNames.triangle, baseStyles.triangle, props.styles?.triangle),\n barLabel: mergeClasses(hbcClassNames.barLabel, baseStyles.barLabel, props.styles?.barLabel),\n chartWrapper: mergeClasses(\n hbcClassNames.chartWrapper,\n variant === HorizontalBarChartVariant.AbsoluteScale && !hideLabels\n ? baseStyles.chartWrapper40ppadding\n : baseStyles.chartWrapper0ppadding,\n props.styles?.chartWrapper,\n ),\n legendContainer: mergeClasses(\n hbcClassNames.legendContainer,\n baseStyles.legendContainer,\n props.styles?.legendContainer,\n ),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","HorizontalBarChartVariant","hbcClassNames","root","items","chart","chartTitle","barWrapper","chartTitleLeft","chartTitleRight","chartDataTextDenominator","benchmarkContainer","triangle","barLabel","chartWrapper","legendContainer","useStyles","display","flexDirection","width","items10pMargin","marginBottom","spacingVerticalMNudge","items16pMargin","spacingVerticalL","height","overflow","caption1","justifyContent","textOverflow","whiteSpace","color","colorNeutralForeground1","chartTitleLeft4pMargin","chartTitleLeft5pMargin","body1Strong","body1","position","marginTop","borderLeft","borderRight","borderTop","borderTopColor","colorPaletteBlueBorderActive","spacingVerticalXS","caption1Strong","fill","forcedColorAdjust","chartWrapper40ppadding","paddingRight","chartWrapper0ppadding","spacingHorizontalNone","paddingTop","useHorizontalBarChartStyles","props","className","showTriangle","variant","hideLabels","baseStyles","styles","AbsoluteScale"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACtE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAA4DC,yBAAyB,QAAQ,UAAU;AAGvG;;CAEC,GACD,OAAO,MAAMC,gBAA0D;IACrEC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAChBC,iBAAiB;IACjBC,0BAA0B;IAC1BC,oBAAoB;IACp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AAMM,MAAM,cAAZN,qCAAAA,eAAc9C,cAAc;QAE9BC,iBAAiBZ,aACfK,cAAcO,eAAe,EAC7BkD,WAAWlD,eAAe,GAC1B6C,iBAAAA,MAAMM,MAAM,cAAZN,qCAAAA,eAAc7C,eAAe;QAE/BC,0BAA0Bb,aACxBK,cAAcQ,wBAAwB,EACtCiD,WAAWjD,wBAAwB,GACnC4C,iBAAAA,MAAMM,MAAM,cAAZN,qCAAAA,eAAc5C,wBAAwB;QAExCC,oBAAoBd,aAClBK,cAAcS,kBAAkB,EAChCgD,WAAWhD,kBAAkB,GAC7B2C,iBAAAA,MAAMM,MAAM,cAAZN,qCAAAA,eAAc3C,kBAAkB;QAElCC,UAAUf,aAAaK,cAAcU,QAAQ,EAAE+C,WAAW/C,QAAQ,GAAE0C,iBAAAA,MAAMM,MAAM,cAAZN,qCAAAA,eAAc1C,QAAQ;QAC1FC,UAAUhB,aAAaK,cAAcW,QAAQ,EAAE8C,WAAW9C,QAAQ,GAAEyC,kBAAAA,MAAMM,MAAM,cAAZN,sCAAAA,gBAAczC,QAAQ;QAC1FC,cAAcjB,aACZK,cAAcY,YAAY,EAC1B2C,YAAYxD,0BAA0B4D,aAAa,IAAI,CAACH,aACpDC,WAAWX,sBAAsB,GACjCW,WAAWT,qBAAqB,GACpCI,kBAAAA,MAAMM,MAAM,cAAZN,sCAAAA,gBAAcxC,YAAY;QAE5BC,iBAAiBlB,aACfK,cAAca,eAAe,EAC7B4C,WAAW5C,eAAe,GAC1BuC,kBAAAA,MAAMM,MAAM,cAAZN,sCAAAA,gBAAcvC,eAAe;IAEjC;AACF,EAAE"}
@@ -7,6 +7,7 @@ import { CartesianChart } from '../CommonComponents/CartesianChart';
7
7
  import { ChartPopover } from '../CommonComponents/ChartPopover';
8
8
  import { ChartTypes, getAccessibleDataObject, YAxisType, XAxisTypes, getTypeOfAxis, getNextColor, findHBCWANumericMinMaxOfY, createYAxisForHorizontalBarChartWithAxis, domainRangeOfNumericForHorizontalBarChartWithAxis, createStringYAxisForHorizontalBarChartWithAxis, areArraysEqual, useRtl, DataVizPalette, getColorFromToken, computeLongestBars, groupChartDataByYValue, MIN_DOMAIN_MARGIN } from '../../utilities/index';
9
9
  import { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';
10
+ import { toImage } from '../../utilities/image-export-utils';
10
11
  export const HorizontalBarChartWithAxis = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
11
12
  var _props_legendProps, _props_legendProps1, _props_legendProps2, _props_legendProps3;
12
13
  const _refArray = [];
@@ -31,6 +32,7 @@ export const HorizontalBarChartWithAxis = /*#__PURE__*/ React.forwardRef((props,
31
32
  let _yAxisPadding = (_props_yAxisPadding = props.yAxisPadding) !== null && _props_yAxisPadding !== void 0 ? _props_yAxisPadding : 0.5;
32
33
  const cartesianChartRef = React.useRef(null);
33
34
  const X_ORIGIN = 0;
35
+ const _legendsRef = React.useRef(null);
34
36
  const [color, setColor] = React.useState('');
35
37
  const [dataForHoverCard, setDataForHoverCard] = React.useState(0);
36
38
  const [isLegendSelected, setIsLegendSelected] = React.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) && props.legendProps.selectedLegends.length > 0 || ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegend) !== undefined);
@@ -65,7 +67,11 @@ export const HorizontalBarChartWithAxis = /*#__PURE__*/ React.forwardRef((props,
65
67
  var _cartesianChartRef_current;
66
68
  var _cartesianChartRef_current_chartContainer;
67
69
  return {
68
- 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
70
+ 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,
71
+ toImage: (opts)=>{
72
+ var _cartesianChartRef_current, _legendsRef_current;
73
+ return toImage((_cartesianChartRef_current = cartesianChartRef.current) === null || _cartesianChartRef_current === void 0 ? void 0 : _cartesianChartRef_current.chartContainer, (_legendsRef_current = _legendsRef.current) === null || _legendsRef_current === void 0 ? void 0 : _legendsRef_current.toSVG, _isRtl, opts);
74
+ }
69
75
  };
70
76
  }, []);
71
77
  function _adjustProps() {
@@ -510,7 +516,8 @@ export const HorizontalBarChartWithAxis = /*#__PURE__*/ React.forwardRef((props,
510
516
  enabledWrapLines: props.enabledLegendsWrapLines,
511
517
  overflowText: props.legendsOverflowText,
512
518
  ...props.legendProps,
513
- onChange: _onLegendSelectionChange
519
+ onChange: _onLegendSelectionChange,
520
+ legendRef: _legendsRef
514
521
  });
515
522
  return legends;
516
523
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["HorizontalBarChartWithAxis.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear, ScaleLinear as D3ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\nimport { Legend } from '../../components/Legends/Legends.types';\nimport { Legends } from '../../components/Legends/Legends';\nimport { useId } from '@fluentui/react-utilities';\nimport {\n AccessibilityProps,\n HorizontalBarChartWithAxisDataPoint,\n RefArrayData,\n Margins,\n ChartPopoverProps,\n Chart,\n} from '../../index';\nimport { ChildProps } from '../CommonComponents/CartesianChart.types';\nimport { CartesianChart } from '../CommonComponents/CartesianChart';\nimport { HorizontalBarChartWithAxisProps } from './HorizontalBarChartWithAxis.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n YAxisType,\n XAxisTypes,\n NumericAxis,\n StringAxis,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n domainRangeOfNumericForHorizontalBarChartWithAxis,\n createStringYAxisForHorizontalBarChartWithAxis,\n areArraysEqual,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n computeLongestBars,\n groupChartDataByYValue,\n MIN_DOMAIN_MARGIN,\n} from '../../utilities/index';\nimport { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';\ntype ColorScale = (_p?: number) => string;\n\nexport const HorizontalBarChartWithAxis: React.FunctionComponent<HorizontalBarChartWithAxisProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartWithAxisProps\n>((props, forwardedRef) => {\n const _refArray: RefArrayData[] = [];\n const _calloutId: string = useId('callout');\n const _isRtl: boolean = useRtl();\n const _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].x, true) as XAxisTypes)\n : XAxisTypes.NumericAxis;\n const _yAxisType: YAxisType =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].y, false) as YAxisType)\n : YAxisType.StringAxis;\n const _emptyChartId: string = useId('_HBCWithAxis_empty');\n let _points: HorizontalBarChartWithAxisDataPoint[] = [];\n let _barHeight: number = 0;\n let _colors: string[] = [];\n let _margins: Margins;\n let _bars: JSX.Element[];\n let _yAxisLabels: string[];\n let _xMax: number;\n let _calloutAnchorPoint: HorizontalBarChartWithAxisDataPoint | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _longestBarPositiveTotalValue: number;\n let _longestBarNegativeTotalValue: number;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _yAxisPadding: number = props.yAxisPadding ?? 0.5;\n const cartesianChartRef = React.useRef<Chart>(null);\n const X_ORIGIN: number = 0;\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [isLegendSelected, setIsLegendSelected] = React.useState<boolean>(\n (props.legendProps?.selectedLegends && props.legendProps.selectedLegends.length > 0) ||\n props.legendProps?.selectedLegend !== undefined,\n );\n const [isLegendHovered, setIsLegendHovered] = React.useState<boolean>(false);\n const [selectedLegendTitle, setSelectedLegendTitle] = React.useState<string>(props.legendProps?.selectedLegend ?? '');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<HorizontalBarChartWithAxisDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const prevPropsRef = React.useRef<HorizontalBarChartWithAxisProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barHeight = props.barHeight || 32;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n ];\n _colors = props.colors! || defaultPalette;\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _renderContentForOnlyBars(point: HorizontalBarChartWithAxisDataPoint): JSX.Element {\n const { useSingleColor = false } = props;\n let selectedPointIndex = 0;\n props.data!.forEach((yDataPoint: HorizontalBarChartWithAxisDataPoint, index: number) => {\n if (yDataPoint.y === point.y) {\n selectedPointIndex = index;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let color: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n color = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n color = point.color ? point.color : props.colors ? _createColors()(point.x) : getNextColor(selectedPointIndex, 0);\n }\n return (\n <>\n <ChartPopover\n XValue={point.xAxisCalloutData || point.x.toString()}\n legend={point.legend}\n YValue={point.yAxisCalloutData || point.y}\n color={color}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n />\n </>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _renderCallout(props?: HorizontalBarChartWithAxisDataPoint): JSX.Element | null {\n return props ? _renderContentForOnlyBars(props) : null;\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _getGraphData(\n xScale: NumericAxis,\n yScale: NumericAxis | StringAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yElement?: SVGElement | null,\n ) {\n const stackedChartData = groupChartDataByYValue(_points);\n const longestBars = computeLongestBars(stackedChartData, X_ORIGIN);\n _longestBarPositiveTotalValue = longestBars.longestPositiveBar;\n _longestBarNegativeTotalValue = longestBars.longestNegativeBar;\n\n const { xBarScale, yBarScale } =\n _yAxisType === YAxisType.NumericAxis\n ? _getScales(containerHeight, containerWidth, true)\n : _getScales(containerHeight, containerWidth, false);\n const xRange = xBarScale.range();\n let allBars: JSX.Element[] = [];\n // when the chart mounts, the xRange[1] is sometimes seen to be < 0 (like -40) while xRange[0] > 0.\n if (xRange[0] < xRange[1]) {\n allBars = stackedChartData\n .map(singleBarData =>\n _yAxisType === YAxisType.NumericAxis\n ? _createNumericBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n )\n : _createStringBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n ),\n )\n .flat();\n }\n\n return (_bars = allBars);\n }\n\n function _createColors(): D3ScaleLinear<string, string> | ColorScale {\n const increment = _colors.length <= 1 ? 1 : 1 / (_colors.length - 1);\n const { useSingleColor = false } = props;\n if (useSingleColor) {\n return (_p?: number) => {\n const { colors } = props;\n return colors && colors.length > 0 ? colors[0] : getColorFromToken(DataVizPalette.color16);\n };\n }\n const domainValues = [];\n for (let i = 0; i < _colors.length; i++) {\n domainValues.push(increment * i * _xMax);\n }\n const colorScale = d3ScaleLinear<string>().domain(domainValues).range(_colors);\n return colorScale;\n }\n\n function _refCallback(element: SVGRectElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _onBarHover(\n point: HorizontalBarChartWithAxisDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n color: string,\n mouseEvent: React.MouseEvent<SVGElement, MouseEvent>,\n ): void {\n mouseEvent.persist();\n // eslint-disable-next-line @typescript-eslint/no-shadow\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n _calloutAnchorPoint = point;\n setPopoverOpen(true);\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setDataForHoverCard(point.x);\n setSelectedLegendTitle(point.legend!);\n setColor(props.useSingleColor || props.enableGradient ? color : point.color!);\n // To display callout value, if no callout value given, taking given point.x value as a string.\n setXCalloutValue(point.yAxisCalloutData! || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _onBarLeave(): void {\n setPopoverOpen(false);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _onBarFocus(\n event: React.FocusEvent<SVGRectElement, Element>,\n point: HorizontalBarChartWithAxisDataPoint,\n refArrayIndexNumber: number,\n color: string,\n ): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (refArrayIndexNumber === index) {\n setPopoverOpen(true);\n setSelectedLegendTitle(point.legend!);\n setDataForHoverCard(point.x);\n setColor(props.useSingleColor ? color : point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n });\n }\n }\n\n function _getScales(\n containerHeight: number,\n containerWidth: number,\n isNumericScale: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): { xBarScale: any; yBarScale: any } {\n const xMax = _longestBarPositiveTotalValue;\n const xMin = _longestBarNegativeTotalValue;\n const xDomain = [Math.min(X_ORIGIN, xMin), Math.max(X_ORIGIN, xMax)];\n if (isNumericScale) {\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yMin = d3Min(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yDomainMax = Math.max(yMax, props.yMaxValue || 0);\n // Default to 0 if yMinValue is not provided.\n const yMinProp = props.yMinValue || 0;\n const yDomainMin = Math.min(yMin, yMinProp);\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n const yBarScale = d3ScaleLinear()\n .domain([yDomainMin, yDomainMax])\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin]);\n return { xBarScale, yBarScale };\n } else {\n // please note these padding default values must be consistent in here\n // and CatrtesianChartBase w for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n const yBarScale = d3ScaleBand()\n .domain(_yAxisLabels)\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin])\n .padding(_yAxisPadding);\n\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n return { xBarScale, yBarScale };\n }\n }\n\n function _createNumericBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n const sortedBars: HorizontalBarChartWithAxisDataPoint[] = [...singleBarData];\n sortedBars.sort((a, b) => {\n const aValue = typeof a.y === 'number' ? a.y : parseFloat(a.y);\n const bValue = typeof b.y === 'number' ? b.y : parseFloat(b.y);\n return bValue - aValue;\n });\n\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n\n const bars = sortedBars.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > X_ORIGIN ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n prevPoint = point.x;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n key={point.y}\n x={xStart}\n y={yBarScale(point.y) - _barHeight / 2}\n data-is-focusable={shouldHighlight}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n rx={props.roundCorners ? 3 : 0}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n aria-labelledby={`toolTip${_calloutId}`}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n onBlur={_onBarLeave}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _getUniqueYValues() {\n const mapY: Record<string, number | string> = {};\n props.data?.forEach((point: HorizontalBarChartWithAxisDataPoint) => {\n mapY[point.y] = point.y;\n });\n const uniqueY = Object.values(mapY);\n return uniqueY;\n }\n\n function _calculateAppropriateBarHeight(data: number[] | Date[], totalWidth: number, innerPadding: number) {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const closestPairDiff = result[0];\n let range = result[1];\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n // Since we are always rendering from 0 to yMax, we need to ensure that the range is at least yMax\n // to calculate the bar height correctly.\n range = Math.max(range, yMax);\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n }\n\n function _getDomainMarginsForHorizontalBarChart(containerHeight: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n const uniqueY = _getUniqueYValues();\n /** Rate at which the space between the bars changes wrt the bar height */\n _yAxisPadding = _yAxisPadding === 1 ? 0.99 : _yAxisPadding;\n const barGapRate = _yAxisPadding / (1 - _yAxisPadding);\n const numBars = uniqueY.length + (uniqueY.length - 1) * barGapRate;\n // Total height available to render the bars\n const totalHeight = containerHeight - (_margins.top! + MIN_DOMAIN_MARGIN) - (_margins.bottom! + MIN_DOMAIN_MARGIN);\n if (_yAxisType !== YAxisType.StringAxis) {\n // Calculate bar height dynamically\n _barHeight =\n props.barHeight || _calculateAppropriateBarHeight(uniqueY as number[] | Date[], totalHeight, _yAxisPadding);\n _barHeight = Math.max(_barHeight, 1);\n _domainMargin += _barHeight / 2;\n } else {\n // Calculate the appropriate bar height\n _barHeight = props.barHeight || totalHeight / numBars;\n /** Total height required to render the bars. Directly proportional to bar height */\n const reqHeight = numBars * _barHeight;\n if (totalHeight >= reqHeight) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalHeight - reqHeight) / 2;\n }\n }\n\n return {\n ..._margins,\n top: _margins.top! + _domainMargin,\n bottom: _margins.bottom! + _domainMargin,\n };\n }\n\n function _createStringBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n const bars = singleBarData.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > 0 ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n prevPoint = point.x;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n transform={`translate(0,${0.5 * (yBarScale.bandwidth() - _barHeight)})`}\n key={point.x}\n x={xStart}\n y={yBarScale(point.y)}\n rx={props.roundCorners ? 3 : 0}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n aria-labelledby={`toolTip${_calloutId}`}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n onMouseLeave={_onBarLeave}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n opacity={shouldHighlight ? 1 : 0.1}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n fill={startColor}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _onLegendHover(customMessage: string): void {\n if (!_isLegendSelected()) {\n setIsLegendHovered(true);\n setSelectedLegendTitle(customMessage);\n }\n }\n\n function _onLegendLeave(isLegendFocused?: boolean): void {\n if (!!isLegendFocused || !_isLegendSelected()) {\n setIsLegendHovered(false);\n setSelectedLegendTitle('');\n setIsLegendSelected(isLegendFocused ? false : _isLegendSelected());\n }\n }\n\n function _getLegendData(data: HorizontalBarChartWithAxisDataPoint[]): JSX.Element {\n const { useSingleColor } = props;\n const actions: Legend[] = [];\n const mapLegendToColor: Record<string, string> = {};\n\n data.forEach((point: HorizontalBarChartWithAxisDataPoint, _index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const color: string = useSingleColor ? (props.colors ? _createColors()(1) : getNextColor(1, 0)) : point.color!;\n\n mapLegendToColor[point.legend!] = color;\n });\n Object.entries(mapLegendToColor).forEach(([legendTitle, color]) => {\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: legendTitle,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n // eslint-disable-next-line @typescript-eslint/no-shadow\n onMouseOutAction: (isLegendSelected?: boolean) => {\n _onLegendLeave(isLegendSelected);\n },\n };\n actions.push(legend);\n });\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n />\n );\n return legends;\n }\n\n function _isLegendSelected(): boolean {\n return isLegendSelected!;\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 function _isLegendHighlighted(legend?: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : selectedLegendTitle ? [selectedLegendTitle] : [];\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n setSelectedLegendTitle(currentLegend?.title!);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n setSelectedLegendTitle(currentLegend?.title!);\n }\n setIsLegendSelected(selectedLegends.length > 0);\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n // For HBCWA x and y Values are swapped\n const { yAxisDomainValues: domainValue } = yAxisData;\n _xMax = Math.max(domainValue[domainValue.length - 1], props.xMaxValue || 0);\n }\n }\n function _getAriaLabel(point: HorizontalBarChartWithAxisDataPoint): string {\n const xValue = point.xAxisCalloutData || point.x;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ` + `${yValue}.`;\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Horizontal bar chart with ${data?.length || 0} bars. `;\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function _updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 setPopoverOpen(true);\n }\n }\n\n function _getDomainNRangeValues(\n points: HorizontalBarChartWithAxisDataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(\n points,\n margins,\n width,\n isRTL,\n shiftX,\n X_ORIGIN,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const calloutProps: ChartPopoverProps = {\n color: color,\n legend: selectedLegendTitle,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCartesian: true,\n isPopoverOpen,\n clickPosition,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const reversedBars = [..._points].reverse();\n _yAxisLabels = reversedBars.map((point: HorizontalBarChartWithAxisDataPoint) => point.y as string);\n _xMax = Math.max(d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x)!, props.xMaxValue || 0);\n const legendBars: JSX.Element = _getLegendData(_points);\n return (\n <CartesianChart\n yAxisPadding={_yAxisPadding}\n {...props}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.HorizontalBarChartWithAxis}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n getDomainNRangeValues={_getDomainNRangeValues}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n barwidth={_barHeight}\n getmargins={_getMargins}\n getYDomainMargins={_getDomainMarginsForHorizontalBarChart}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n </>\n );\n }}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n});\nHorizontalBarChartWithAxis.displayName = 'HorizontalBarChartWithAxis';\n"],"names":["React","max","d3Max","min","d3Min","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","Legends","useId","CartesianChart","ChartPopover","ChartTypes","getAccessibleDataObject","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","findHBCWANumericMinMaxOfY","createYAxisForHorizontalBarChartWithAxis","domainRangeOfNumericForHorizontalBarChartWithAxis","createStringYAxisForHorizontalBarChartWithAxis","areArraysEqual","useRtl","DataVizPalette","getColorFromToken","computeLongestBars","groupChartDataByYValue","MIN_DOMAIN_MARGIN","getClosestPairDiffAndRange","HorizontalBarChartWithAxis","forwardRef","props","forwardedRef","_refArray","_calloutId","_isRtl","_xAxisType","data","length","x","NumericAxis","_yAxisType","y","StringAxis","_emptyChartId","_points","_barHeight","_colors","_margins","_bars","_yAxisLabels","_xMax","_calloutAnchorPoint","_longestBarPositiveTotalValue","_longestBarNegativeTotalValue","_domainMargin","_yAxisPadding","yAxisPadding","cartesianChartRef","useRef","X_ORIGIN","color","setColor","useState","dataForHoverCard","setDataForHoverCard","isLegendSelected","setIsLegendSelected","legendProps","selectedLegends","selectedLegend","undefined","isLegendHovered","setIsLegendHovered","selectedLegendTitle","setSelectedLegendTitle","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","setSelectedLegends","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","prevPropsRef","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","_adjustProps","barHeight","defaultPalette","color6","color1","color5","color7","colors","_getMargins","margins","_renderContentForOnlyBars","point","useSingleColor","selectedPointIndex","forEach","yDataPoint","index","_createColors","XValue","xAxisCalloutData","toString","legend","YValue","yAxisCalloutData","culture","_renderCallout","_getCustomizedCallout","onRenderCalloutPerDataPoint","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","yElement","stackedChartData","longestBars","longestPositiveBar","longestNegativeBar","xBarScale","yBarScale","_getScales","xRange","range","allBars","map","singleBarData","_createNumericBars","_createStringBars","flat","increment","_p","color16","domainValues","i","push","colorScale","domain","_refCallback","element","legendTitle","refElement","_onBarHover","mouseEvent","persist","_isLegendHighlighted","_updatePosition","clientX","clientY","enableGradient","_onBarLeave","_handleChartMouseLeave","_onBarFocus","event","refArrayIndexNumber","cx","cy","targetRect","target","getBoundingClientRect","left","width","top","height","obj","isNumericScale","xMax","xMin","xDomain","Math","yMax","yMin","yDomainMax","yMaxValue","yMinProp","yMinValue","yDomainMin","nice","right","bottom","padding","sortedBars","sort","a","b","aValue","parseFloat","bValue","prevWidthPositive","prevWidthNegative","prevPoint","totalPositiveBars","filter","totalNegativeBars","currPositiveCounter","currNegativeCounter","bars","shouldHighlight","barStartX","Fragment","key","startColor","prevBarWidth","abs","currentWidth","gapWidthLTR","gapWidthRTL","xStart","rect","data-is-focusable","ref","e","rx","roundCorners","onClick","onMouseOver","aria-label","_getAriaLabel","role","aria-labelledby","onMouseLeave","onFocus","onBlur","fill","opacity","tabIndex","_getUniqueYValues","mapY","uniqueY","Object","values","_calculateAppropriateBarHeight","totalWidth","innerPadding","result","closestPairDiff","barWidth","floor","_getDomainMarginsForHorizontalBarChart","barGapRate","numBars","totalHeight","reqHeight","transform","bandwidth","_onLegendHover","customMessage","_isLegendSelected","_onLegendLeave","isLegendFocused","_getLegendData","actions","mapLegendToColor","_index","entries","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","_getHighlightedLegend","includes","currentLegend","canSelectMultipleLegends","slice","_getAxisData","yAxisData","yAxisDomainValues","domainValue","xMaxValue","xValue","yValue","ariaLabel","_getChartTitle","chartTitle","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","dStartValue","dEndValue","rStartValue","rEndValue","calloutProps","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCartesian","tickParams","tickFormat","reversedBars","reverse","legendBars","yAxisType","getDomainNRangeValues","stringDatasetForYAxisDomain","createYAxis","createStringYAxis","getMinMaxOfYAxis","barwidth","getmargins","getYDomainMargins","getGraphData","getAxisData","onChartMouseLeave","children","g","div","id","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AACtD,SAASC,eAAeC,aAAa,EAAgCC,aAAaC,WAAW,QAAQ,WAAW;AAEhH,SAASC,OAAO,QAAQ,mCAAmC;AAC3D,SAASC,KAAK,QAAQ,4BAA4B;AAUlD,SAASC,cAAc,QAAQ,qCAAqC;AAEpE,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SACEC,UAAU,EAEVC,uBAAuB,EACvBC,SAAS,EACTC,UAAU,EAGVC,aAAa,EACbC,YAAY,EACZC,yBAAyB,EACzBC,wCAAwC,EAExCC,iDAAiD,EACjDC,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xis.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear, ScaleLinear as D3ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\nimport { Legend, LegendContainer } from '../../components/Legends/Legends.types';\nimport { Legends } from '../../components/Legends/Legends';\nimport { useId } from '@fluentui/react-utilities';\nimport {\n AccessibilityProps,\n HorizontalBarChartWithAxisDataPoint,\n RefArrayData,\n Margins,\n ChartPopoverProps,\n Chart,\n ImageExportOptions,\n} from '../../index';\nimport { ChildProps } from '../CommonComponents/CartesianChart.types';\nimport { CartesianChart } from '../CommonComponents/CartesianChart';\nimport { HorizontalBarChartWithAxisProps } from './HorizontalBarChartWithAxis.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n YAxisType,\n XAxisTypes,\n NumericAxis,\n StringAxis,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n domainRangeOfNumericForHorizontalBarChartWithAxis,\n createStringYAxisForHorizontalBarChartWithAxis,\n areArraysEqual,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n computeLongestBars,\n groupChartDataByYValue,\n MIN_DOMAIN_MARGIN,\n} from '../../utilities/index';\nimport { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';\nimport { toImage } from '../../utilities/image-export-utils';\ntype ColorScale = (_p?: number) => string;\n\nexport const HorizontalBarChartWithAxis: React.FunctionComponent<HorizontalBarChartWithAxisProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartWithAxisProps\n>((props, forwardedRef) => {\n const _refArray: RefArrayData[] = [];\n const _calloutId: string = useId('callout');\n const _isRtl: boolean = useRtl();\n const _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].x, true) as XAxisTypes)\n : XAxisTypes.NumericAxis;\n const _yAxisType: YAxisType =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].y, false) as YAxisType)\n : YAxisType.StringAxis;\n const _emptyChartId: string = useId('_HBCWithAxis_empty');\n let _points: HorizontalBarChartWithAxisDataPoint[] = [];\n let _barHeight: number = 0;\n let _colors: string[] = [];\n let _margins: Margins;\n let _bars: JSX.Element[];\n let _yAxisLabels: string[];\n let _xMax: number;\n let _calloutAnchorPoint: HorizontalBarChartWithAxisDataPoint | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _longestBarPositiveTotalValue: number;\n let _longestBarNegativeTotalValue: number;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _yAxisPadding: number = props.yAxisPadding ?? 0.5;\n const cartesianChartRef = React.useRef<Chart>(null);\n const X_ORIGIN: number = 0;\n const _legendsRef = React.useRef<LegendContainer>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [isLegendSelected, setIsLegendSelected] = React.useState<boolean>(\n (props.legendProps?.selectedLegends && props.legendProps.selectedLegends.length > 0) ||\n props.legendProps?.selectedLegend !== undefined,\n );\n const [isLegendHovered, setIsLegendHovered] = React.useState<boolean>(false);\n const [selectedLegendTitle, setSelectedLegendTitle] = React.useState<string>(props.legendProps?.selectedLegend ?? '');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<HorizontalBarChartWithAxisDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const prevPropsRef = React.useRef<HorizontalBarChartWithAxisProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barHeight = props.barHeight || 32;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n ];\n _colors = props.colors! || defaultPalette;\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _renderContentForOnlyBars(point: HorizontalBarChartWithAxisDataPoint): JSX.Element {\n const { useSingleColor = false } = props;\n let selectedPointIndex = 0;\n props.data!.forEach((yDataPoint: HorizontalBarChartWithAxisDataPoint, index: number) => {\n if (yDataPoint.y === point.y) {\n selectedPointIndex = index;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let color: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n color = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n color = point.color ? point.color : props.colors ? _createColors()(point.x) : getNextColor(selectedPointIndex, 0);\n }\n return (\n <>\n <ChartPopover\n XValue={point.xAxisCalloutData || point.x.toString()}\n legend={point.legend}\n YValue={point.yAxisCalloutData || point.y}\n color={color}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n />\n </>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _renderCallout(props?: HorizontalBarChartWithAxisDataPoint): JSX.Element | null {\n return props ? _renderContentForOnlyBars(props) : null;\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _getGraphData(\n xScale: NumericAxis,\n yScale: NumericAxis | StringAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yElement?: SVGElement | null,\n ) {\n const stackedChartData = groupChartDataByYValue(_points);\n const longestBars = computeLongestBars(stackedChartData, X_ORIGIN);\n _longestBarPositiveTotalValue = longestBars.longestPositiveBar;\n _longestBarNegativeTotalValue = longestBars.longestNegativeBar;\n\n const { xBarScale, yBarScale } =\n _yAxisType === YAxisType.NumericAxis\n ? _getScales(containerHeight, containerWidth, true)\n : _getScales(containerHeight, containerWidth, false);\n const xRange = xBarScale.range();\n let allBars: JSX.Element[] = [];\n // when the chart mounts, the xRange[1] is sometimes seen to be < 0 (like -40) while xRange[0] > 0.\n if (xRange[0] < xRange[1]) {\n allBars = stackedChartData\n .map(singleBarData =>\n _yAxisType === YAxisType.NumericAxis\n ? _createNumericBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n )\n : _createStringBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n ),\n )\n .flat();\n }\n\n return (_bars = allBars);\n }\n\n function _createColors(): D3ScaleLinear<string, string> | ColorScale {\n const increment = _colors.length <= 1 ? 1 : 1 / (_colors.length - 1);\n const { useSingleColor = false } = props;\n if (useSingleColor) {\n return (_p?: number) => {\n const { colors } = props;\n return colors && colors.length > 0 ? colors[0] : getColorFromToken(DataVizPalette.color16);\n };\n }\n const domainValues = [];\n for (let i = 0; i < _colors.length; i++) {\n domainValues.push(increment * i * _xMax);\n }\n const colorScale = d3ScaleLinear<string>().domain(domainValues).range(_colors);\n return colorScale;\n }\n\n function _refCallback(element: SVGRectElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _onBarHover(\n point: HorizontalBarChartWithAxisDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n color: string,\n mouseEvent: React.MouseEvent<SVGElement, MouseEvent>,\n ): void {\n mouseEvent.persist();\n // eslint-disable-next-line @typescript-eslint/no-shadow\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n _calloutAnchorPoint = point;\n setPopoverOpen(true);\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setDataForHoverCard(point.x);\n setSelectedLegendTitle(point.legend!);\n setColor(props.useSingleColor || props.enableGradient ? color : point.color!);\n // To display callout value, if no callout value given, taking given point.x value as a string.\n setXCalloutValue(point.yAxisCalloutData! || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _onBarLeave(): void {\n setPopoverOpen(false);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _onBarFocus(\n event: React.FocusEvent<SVGRectElement, Element>,\n point: HorizontalBarChartWithAxisDataPoint,\n refArrayIndexNumber: number,\n color: string,\n ): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (refArrayIndexNumber === index) {\n setPopoverOpen(true);\n setSelectedLegendTitle(point.legend!);\n setDataForHoverCard(point.x);\n setColor(props.useSingleColor ? color : point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n });\n }\n }\n\n function _getScales(\n containerHeight: number,\n containerWidth: number,\n isNumericScale: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): { xBarScale: any; yBarScale: any } {\n const xMax = _longestBarPositiveTotalValue;\n const xMin = _longestBarNegativeTotalValue;\n const xDomain = [Math.min(X_ORIGIN, xMin), Math.max(X_ORIGIN, xMax)];\n if (isNumericScale) {\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yMin = d3Min(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yDomainMax = Math.max(yMax, props.yMaxValue || 0);\n // Default to 0 if yMinValue is not provided.\n const yMinProp = props.yMinValue || 0;\n const yDomainMin = Math.min(yMin, yMinProp);\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n const yBarScale = d3ScaleLinear()\n .domain([yDomainMin, yDomainMax])\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin]);\n return { xBarScale, yBarScale };\n } else {\n // please note these padding default values must be consistent in here\n // and CatrtesianChartBase w for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n const yBarScale = d3ScaleBand()\n .domain(_yAxisLabels)\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin])\n .padding(_yAxisPadding);\n\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n return { xBarScale, yBarScale };\n }\n }\n\n function _createNumericBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n const sortedBars: HorizontalBarChartWithAxisDataPoint[] = [...singleBarData];\n sortedBars.sort((a, b) => {\n const aValue = typeof a.y === 'number' ? a.y : parseFloat(a.y);\n const bValue = typeof b.y === 'number' ? b.y : parseFloat(b.y);\n return bValue - aValue;\n });\n\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n\n const bars = sortedBars.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > X_ORIGIN ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n prevPoint = point.x;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n key={point.y}\n x={xStart}\n y={yBarScale(point.y) - _barHeight / 2}\n data-is-focusable={shouldHighlight}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n rx={props.roundCorners ? 3 : 0}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n aria-labelledby={`toolTip${_calloutId}`}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n onBlur={_onBarLeave}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _getUniqueYValues() {\n const mapY: Record<string, number | string> = {};\n props.data?.forEach((point: HorizontalBarChartWithAxisDataPoint) => {\n mapY[point.y] = point.y;\n });\n const uniqueY = Object.values(mapY);\n return uniqueY;\n }\n\n function _calculateAppropriateBarHeight(data: number[] | Date[], totalWidth: number, innerPadding: number) {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const closestPairDiff = result[0];\n let range = result[1];\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n // Since we are always rendering from 0 to yMax, we need to ensure that the range is at least yMax\n // to calculate the bar height correctly.\n range = Math.max(range, yMax);\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n }\n\n function _getDomainMarginsForHorizontalBarChart(containerHeight: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n const uniqueY = _getUniqueYValues();\n /** Rate at which the space between the bars changes wrt the bar height */\n _yAxisPadding = _yAxisPadding === 1 ? 0.99 : _yAxisPadding;\n const barGapRate = _yAxisPadding / (1 - _yAxisPadding);\n const numBars = uniqueY.length + (uniqueY.length - 1) * barGapRate;\n // Total height available to render the bars\n const totalHeight = containerHeight - (_margins.top! + MIN_DOMAIN_MARGIN) - (_margins.bottom! + MIN_DOMAIN_MARGIN);\n if (_yAxisType !== YAxisType.StringAxis) {\n // Calculate bar height dynamically\n _barHeight =\n props.barHeight || _calculateAppropriateBarHeight(uniqueY as number[] | Date[], totalHeight, _yAxisPadding);\n _barHeight = Math.max(_barHeight, 1);\n _domainMargin += _barHeight / 2;\n } else {\n // Calculate the appropriate bar height\n _barHeight = props.barHeight || totalHeight / numBars;\n /** Total height required to render the bars. Directly proportional to bar height */\n const reqHeight = numBars * _barHeight;\n if (totalHeight >= reqHeight) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalHeight - reqHeight) / 2;\n }\n }\n\n return {\n ..._margins,\n top: _margins.top! + _domainMargin,\n bottom: _margins.bottom! + _domainMargin,\n };\n }\n\n function _createStringBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n const bars = singleBarData.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > 0 ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n prevPoint = point.x;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n transform={`translate(0,${0.5 * (yBarScale.bandwidth() - _barHeight)})`}\n key={point.x}\n x={xStart}\n y={yBarScale(point.y)}\n rx={props.roundCorners ? 3 : 0}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n aria-labelledby={`toolTip${_calloutId}`}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n onMouseLeave={_onBarLeave}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n opacity={shouldHighlight ? 1 : 0.1}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n fill={startColor}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _onLegendHover(customMessage: string): void {\n if (!_isLegendSelected()) {\n setIsLegendHovered(true);\n setSelectedLegendTitle(customMessage);\n }\n }\n\n function _onLegendLeave(isLegendFocused?: boolean): void {\n if (!!isLegendFocused || !_isLegendSelected()) {\n setIsLegendHovered(false);\n setSelectedLegendTitle('');\n setIsLegendSelected(isLegendFocused ? false : _isLegendSelected());\n }\n }\n\n function _getLegendData(data: HorizontalBarChartWithAxisDataPoint[]): JSX.Element {\n const { useSingleColor } = props;\n const actions: Legend[] = [];\n const mapLegendToColor: Record<string, string> = {};\n\n data.forEach((point: HorizontalBarChartWithAxisDataPoint, _index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const color: string = useSingleColor ? (props.colors ? _createColors()(1) : getNextColor(1, 0)) : point.color!;\n\n mapLegendToColor[point.legend!] = color;\n });\n Object.entries(mapLegendToColor).forEach(([legendTitle, color]) => {\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: legendTitle,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n // eslint-disable-next-line @typescript-eslint/no-shadow\n onMouseOutAction: (isLegendSelected?: boolean) => {\n _onLegendLeave(isLegendSelected);\n },\n };\n actions.push(legend);\n });\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n\n function _isLegendSelected(): boolean {\n return isLegendSelected!;\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 function _isLegendHighlighted(legend?: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : selectedLegendTitle ? [selectedLegendTitle] : [];\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n setSelectedLegendTitle(currentLegend?.title!);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n setSelectedLegendTitle(currentLegend?.title!);\n }\n setIsLegendSelected(selectedLegends.length > 0);\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n // For HBCWA x and y Values are swapped\n const { yAxisDomainValues: domainValue } = yAxisData;\n _xMax = Math.max(domainValue[domainValue.length - 1], props.xMaxValue || 0);\n }\n }\n function _getAriaLabel(point: HorizontalBarChartWithAxisDataPoint): string {\n const xValue = point.xAxisCalloutData || point.x;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ` + `${yValue}.`;\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Horizontal bar chart with ${data?.length || 0} bars. `;\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function _updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 setPopoverOpen(true);\n }\n }\n\n function _getDomainNRangeValues(\n points: HorizontalBarChartWithAxisDataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(\n points,\n margins,\n width,\n isRTL,\n shiftX,\n X_ORIGIN,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const calloutProps: ChartPopoverProps = {\n color: color,\n legend: selectedLegendTitle,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCartesian: true,\n isPopoverOpen,\n clickPosition,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const reversedBars = [..._points].reverse();\n _yAxisLabels = reversedBars.map((point: HorizontalBarChartWithAxisDataPoint) => point.y as string);\n _xMax = Math.max(d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x)!, props.xMaxValue || 0);\n const legendBars: JSX.Element = _getLegendData(_points);\n return (\n <CartesianChart\n yAxisPadding={_yAxisPadding}\n {...props}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.HorizontalBarChartWithAxis}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n getDomainNRangeValues={_getDomainNRangeValues}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n barwidth={_barHeight}\n getmargins={_getMargins}\n getYDomainMargins={_getDomainMarginsForHorizontalBarChart}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n </>\n );\n }}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n});\nHorizontalBarChartWithAxis.displayName = 'HorizontalBarChartWithAxis';\n"],"names":["React","max","d3Max","min","d3Min","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","Legends","useId","CartesianChart","ChartPopover","ChartTypes","getAccessibleDataObject","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","findHBCWANumericMinMaxOfY","createYAxisForHorizontalBarChartWithAxis","domainRangeOfNumericForHorizontalBarChartWithAxis","createStringYAxisForHorizontalBarChartWithAxis","areArraysEqual","useRtl","DataVizPalette","getColorFromToken","computeLongestBars","groupChartDataByYValue","MIN_DOMAIN_MARGIN","getClosestPairDiffAndRange","toImage","HorizontalBarChartWithAxis","forwardRef","props","forwardedRef","_refArray","_calloutId","_isRtl","_xAxisType","data","length","x","NumericAxis","_yAxisType","y","StringAxis","_emptyChartId","_points","_barHeight","_colors","_margins","_bars","_yAxisLabels","_xMax","_calloutAnchorPoint","_longestBarPositiveTotalValue","_longestBarNegativeTotalValue","_domainMargin","_yAxisPadding","yAxisPadding","cartesianChartRef","useRef","X_ORIGIN","_legendsRef","color","setColor","useState","dataForHoverCard","setDataForHoverCard","isLegendSelected","setIsLegendSelected","legendProps","selectedLegends","selectedLegend","undefined","isLegendHovered","setIsLegendHovered","selectedLegendTitle","setSelectedLegendTitle","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","setSelectedLegends","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","prevPropsRef","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_adjustProps","barHeight","defaultPalette","color6","color1","color5","color7","colors","_getMargins","margins","_renderContentForOnlyBars","point","useSingleColor","selectedPointIndex","forEach","yDataPoint","index","_createColors","XValue","xAxisCalloutData","toString","legend","YValue","yAxisCalloutData","culture","_renderCallout","_getCustomizedCallout","onRenderCalloutPerDataPoint","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","yElement","stackedChartData","longestBars","longestPositiveBar","longestNegativeBar","xBarScale","yBarScale","_getScales","xRange","range","allBars","map","singleBarData","_createNumericBars","_createStringBars","flat","increment","_p","color16","domainValues","i","push","colorScale","domain","_refCallback","element","legendTitle","refElement","_onBarHover","mouseEvent","persist","_isLegendHighlighted","_updatePosition","clientX","clientY","enableGradient","_onBarLeave","_handleChartMouseLeave","_onBarFocus","event","refArrayIndexNumber","cx","cy","targetRect","target","getBoundingClientRect","left","width","top","height","obj","isNumericScale","xMax","xMin","xDomain","Math","yMax","yMin","yDomainMax","yMaxValue","yMinProp","yMinValue","yDomainMin","nice","right","bottom","padding","sortedBars","sort","a","b","aValue","parseFloat","bValue","prevWidthPositive","prevWidthNegative","prevPoint","totalPositiveBars","filter","totalNegativeBars","currPositiveCounter","currNegativeCounter","bars","shouldHighlight","barStartX","Fragment","key","startColor","prevBarWidth","abs","currentWidth","gapWidthLTR","gapWidthRTL","xStart","rect","data-is-focusable","ref","e","rx","roundCorners","onClick","onMouseOver","aria-label","_getAriaLabel","role","aria-labelledby","onMouseLeave","onFocus","onBlur","fill","opacity","tabIndex","_getUniqueYValues","mapY","uniqueY","Object","values","_calculateAppropriateBarHeight","totalWidth","innerPadding","result","closestPairDiff","barWidth","floor","_getDomainMarginsForHorizontalBarChart","barGapRate","numBars","totalHeight","reqHeight","transform","bandwidth","_onLegendHover","customMessage","_isLegendSelected","_onLegendLeave","isLegendFocused","_getLegendData","actions","mapLegendToColor","_index","entries","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","_getHighlightedLegend","includes","currentLegend","canSelectMultipleLegends","slice","_getAxisData","yAxisData","yAxisDomainValues","domainValue","xMaxValue","xValue","yValue","ariaLabel","_getChartTitle","chartTitle","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","dStartValue","dEndValue","rStartValue","rEndValue","calloutProps","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCartesian","tickParams","tickFormat","reversedBars","reverse","legendBars","yAxisType","getDomainNRangeValues","stringDatasetForYAxisDomain","createYAxis","createStringYAxis","getMinMaxOfYAxis","barwidth","getmargins","getYDomainMargins","getGraphData","getAxisData","onChartMouseLeave","children","g","div","id","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AACtD,SAASC,eAAeC,aAAa,EAAgCC,aAAaC,WAAW,QAAQ,WAAW;AAEhH,SAASC,OAAO,QAAQ,mCAAmC;AAC3D,SAASC,KAAK,QAAQ,4BAA4B;AAWlD,SAASC,cAAc,QAAQ,qCAAqC;AAEpE,SAASC,YAAY,QAAQ,mCAAmC;AAChE,SACEC,UAAU,EAEVC,uBAAuB,EACvBC,SAAS,EACTC,UAAU,EAGVC,aAAa,EACbC,YAAY,EACZC,yBAAyB,EACzBC,wCAAwC,EAExCC,iDAAiD,EACjDC,8CAA8C,EAC9CC,cAAc,EACdC,MAAM,EACNC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB,EAClBC,sBAAsB,EACtBC,iBAAiB,QACZ,wBAAwB;AAC/B,SAASC,0BAA0B,QAAQ,4BAA4B;AACvE,SAASC,OAAO,QAAQ,qCAAqC;AAG7D,OAAO,MAAMC,2CAAuFhC,MAAMiC,UAAU,CAGlH,CAACC,OAAOC;QAiCLD,oBACCA,qBAGyEA,qBAGNA;IAvCvE,MAAME,YAA4B,EAAE;IACpC,MAAMC,aAAqB3B,MAAM;IACjC,MAAM4B,SAAkBd;IACxB,MAAMe,aACJL,MAAMM,IAAI,IAAKN,MAAMM,IA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yBAC/BV;YACN;YACA4P,aAAa;YACb9O;YACAE;QACF;QACA,MAAM6O,aAAa;YACjBb,YAAYzR,MAAMyR,UAAU;YAC5Bc,YAAYvS,MAAMuS,UAAU;QAC9B;QAEA,MAAMC,eAAe;eAAI1R;SAAQ,CAAC2R,OAAO;QACzCtR,eAAeqR,aAAavL,GAAG,CAAC,CAAClC,QAA+CA,MAAMpE,CAAC;QACvFS,QAAQyI,KAAK9L,GAAG,CAACC,MAAM8C,SAAS,CAACiE,QAA+CA,MAAMvE,CAAC,GAAIR,MAAMuQ,SAAS,IAAI;QAC9G,MAAMmC,aAA0B5D,eAAehO;QAC/C,qBACE,oBAACrC;YACCiD,cAAcD;YACb,GAAGzB,KAAK;YACT4Q,YAAYD;YACZU,QAAQvQ;YACRwQ,WAAW3S,WAAWmB,0BAA0B;YAChD0R,WAAWnR;YACXsS,WAAWjS;YACXkS,uBAAuBxB;YACvByB,6BAA6B1R;YAC7B6Q,cAAcA;YACdM,YAAYA;YACZI,YAAYA;YACZI,aAAa5T;YACb6T,mBAAmB3T;YACnB4T,kBAAkB/T;YAClBgU,UAAUlS;YACVmS,YAAYtO;YACZuO,mBAAmBjF;YACnBkF,cAAcpN;YACdqN,aAAalD;YACbmD,mBAAmB3K;YACnB3E,cAAcrC;YACd,oCAAoC,GACpC,wDAAwD;YACxD4R,UAAU,CAACvT;gBACT,qBACE,wDACE,oBAACwT,WAAGtS;YAGV;;IAGN,OAAO;QACL,qBACE,oBAACuS;YAAIC,IAAI7S;YAAeiM,MAAM;YAAS6G,OAAO;gBAAEvG,SAAS;YAAI;YAAGR,cAAY;;IAEhF;AACF,GAAG;AACH9M,2BAA2B8T,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["HorizontalBarChartWithAxis.types.ts"],"sourcesContent":["import { RenderFunction } from '../../utilities/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n HorizontalBarChartWithAxisDataPoint,\n} from '../../index';\n\n/**\n * Horizontal Bar Chart with Axis properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: HorizontalBarChartWithAxisDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: RenderFunction<HorizontalBarChartWithAxisDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartWithAxisStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the bars.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Horizontal Bar Chart with Axis style properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyleProps extends CartesianChartStyleProps {\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n}\n\n/**\n * Horizontal Bar Chart with Axis styles\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyles extends CartesianChartStyles {\n /**\n * Style for the chart label.\n *\n */\n chartLabel?: string;\n\n /**\n * Style for the line representing the domain of the x-axis.\n *\n */\n xAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the x-axis.\n *\n */\n xAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the x-axis.\n *\n */\n xAxisText?: string;\n\n /**\n * Style for the line representing the domain of the y-axis.\n *\n */\n yAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the y-axis.\n *\n */\n yAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the y-axis.\n *\n */\n yAxisText?: string;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: string;\n}\n"],"names":[],"mappings":"AAgGA;;;CAGC,GACD,WA+CC"}
1
+ {"version":3,"sources":["../src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts"],"sourcesContent":["import { RenderFunction } from '../../utilities/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n HorizontalBarChartWithAxisDataPoint,\n} from '../../index';\n\n/**\n * Horizontal Bar Chart with Axis properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: HorizontalBarChartWithAxisDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: RenderFunction<HorizontalBarChartWithAxisDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartWithAxisStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the bars.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Horizontal Bar Chart with Axis style properties\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyleProps extends CartesianChartStyleProps {\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n}\n\n/**\n * Horizontal Bar Chart with Axis styles\n * {@docCategory HorizontalBarChartWithAxis}\n */\nexport interface HorizontalBarChartWithAxisStyles extends CartesianChartStyles {\n /**\n * Style for the chart label.\n *\n */\n chartLabel?: string;\n\n /**\n * Style for the line representing the domain of the x-axis.\n *\n */\n xAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the x-axis.\n *\n */\n xAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the x-axis.\n *\n */\n xAxisText?: string;\n\n /**\n * Style for the line representing the domain of the y-axis.\n *\n */\n yAxisDomain?: string;\n\n /**\n * Style for the lines representing the ticks along the y-axis.\n *\n */\n yAxisTicks?: string;\n\n /**\n * Style for the text labeling each tick along the y-axis.\n *\n */\n yAxisText?: string;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: string;\n}\n"],"names":[],"mappings":"AAgGA;;;CAGC,GACD,WA+CC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './HorizontalBarChartWithAxis';\nexport * from './HorizontalBarChartWithAxis.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,oBAAoB"}
1
+ {"version":3,"sources":["../src/components/HorizontalBarChartWithAxis/index.ts"],"sourcesContent":["export * from './HorizontalBarChartWithAxis';\nexport * from './HorizontalBarChartWithAxis.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,oBAAoB"}
@@ -39,5 +39,4 @@ export const useHorizontalBarChartWithAxisStyles = props => {
39
39
  opacityChangeOnHover: mergeClasses(hbcWithAxisClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover),
40
40
  xAxisTicks: mergeClasses(hbcWithAxisClassNames.xAxisTicks, baseStyles.xAxisTicks)
41
41
  };
42
- };
43
- //# sourceMappingURL=useHorizontalBarChartWithAxisStyles.styles.js.map
42
+ };
@@ -0,0 +1,39 @@
1
+ import { makeStyles, mergeClasses } from '@griffel/react';
2
+ export const hbcWithAxisClassNames = {
3
+ opacityChangeOnHover: 'fui-hbcwa__opacityChangeOnHover',
4
+ xAxisTicks: 'fui-hbcwa__xAxisTicks',
5
+ tooltip: 'fui-hbcwa__tooltip',
6
+ chartLabel: '',
7
+ xAxisDomain: '',
8
+ xAxisText: '',
9
+ yAxisDomain: '',
10
+ yAxisTicks: '',
11
+ yAxisText: '',
12
+ root: '',
13
+ xAxis: '',
14
+ yAxis: '',
15
+ legendContainer: '',
16
+ hover: '',
17
+ descriptionMessage: '',
18
+ axisTitle: '',
19
+ chartTitle: '',
20
+ shapeStyles: '',
21
+ chartWrapper: '',
22
+ svgTooltip: '',
23
+ chart: ''
24
+ };
25
+ const useStyles = makeStyles({
26
+ opacityChangeOnHover: {
27
+ opacity: 0.1
28
+ },
29
+ xAxisTicks: {}
30
+ });
31
+ /**
32
+ * Apply styling to the HorizontalBarChartWithAxis slots based on the state
33
+ */ export const useHorizontalBarChartWithAxisStyles = (props)=>{
34
+ const baseStyles = useStyles();
35
+ return {
36
+ opacityChangeOnHover: mergeClasses(hbcWithAxisClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover),
37
+ xAxisTicks: mergeClasses(hbcWithAxisClassNames.xAxisTicks, baseStyles.xAxisTicks)
38
+ };
39
+ };