@fluentui/react-charts 0.0.0-nightly-20250423-0405.1 → 0.0.0-nightly-20250423-1415.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/CHANGELOG.md +16 -16
  2. package/dist/index.d.ts +3337 -0
  3. package/lib/AreaChart.js +1 -0
  4. package/lib/AreaChart.js.map +1 -0
  5. package/lib/CartesianChart.js +1 -0
  6. package/lib/CartesianChart.js.map +1 -0
  7. package/lib/DeclarativeChart.js +1 -0
  8. package/lib/DeclarativeChart.js.map +1 -0
  9. package/lib/DonutChart.js +1 -0
  10. package/lib/DonutChart.js.map +1 -0
  11. package/lib/GaugeChart.js +1 -0
  12. package/lib/GaugeChart.js.map +1 -0
  13. package/lib/GroupedVerticalBarChart.js +1 -0
  14. package/lib/GroupedVerticalBarChart.js.map +1 -0
  15. package/lib/HeatMapChart.js +1 -0
  16. package/lib/HeatMapChart.js.map +1 -0
  17. package/lib/HorizontalBarChart.js +1 -0
  18. package/lib/HorizontalBarChart.js.map +1 -0
  19. package/lib/HorizontalBarChartWithAxis.js +1 -0
  20. package/lib/HorizontalBarChartWithAxis.js.map +1 -0
  21. package/lib/Legends.js +1 -0
  22. package/lib/Legends.js.map +1 -0
  23. package/lib/LineChart.js +1 -0
  24. package/lib/LineChart.js.map +1 -0
  25. package/lib/Popover.js +1 -0
  26. package/lib/Popover.js.map +1 -0
  27. package/lib/ResponsiveContainer.js +1 -0
  28. package/lib/ResponsiveContainer.js.map +1 -0
  29. package/lib/SankeyChart.js +1 -0
  30. package/lib/SankeyChart.js.map +1 -0
  31. package/lib/ScatterChart.js +1 -0
  32. package/lib/ScatterChart.js.map +1 -0
  33. package/lib/Sparkline.js +1 -0
  34. package/lib/Sparkline.js.map +1 -0
  35. package/lib/VerticalBarChart.js +1 -0
  36. package/lib/VerticalBarChart.js.map +1 -0
  37. package/lib/VerticalStackedBarChart.js +1 -0
  38. package/lib/VerticalStackedBarChart.js.map +1 -0
  39. package/lib/components/AreaChart/AreaChart.js +775 -0
  40. package/lib/components/AreaChart/AreaChart.js.map +1 -0
  41. package/lib/components/AreaChart/AreaChart.types.js +4 -0
  42. package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
  43. package/lib/components/AreaChart/index.js +3 -0
  44. package/lib/components/AreaChart/index.js.map +1 -0
  45. package/lib/components/AreaChart/useAreaChartStyles.styles.js +64 -0
  46. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
  47. package/lib/components/CommonComponents/CartesianChart.js +478 -0
  48. package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
  49. package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
  50. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
  51. package/lib/components/CommonComponents/ChartPopover.js +187 -0
  52. package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
  53. package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
  54. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
  55. package/lib/components/CommonComponents/index.js +4 -0
  56. package/lib/components/CommonComponents/index.js.map +1 -0
  57. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +229 -0
  58. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  59. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -0
  60. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  61. package/lib/components/DeclarativeChart/DeclarativeChart.js +197 -0
  62. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  63. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +811 -0
  64. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  65. package/lib/components/DeclarativeChart/imageExporter.js +221 -0
  66. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
  67. package/lib/components/DeclarativeChart/index.js +1 -0
  68. package/lib/components/DeclarativeChart/index.js.map +1 -0
  69. package/lib/components/DonutChart/Arc/Arc.js +110 -0
  70. package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
  71. package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
  72. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
  73. package/lib/components/DonutChart/Arc/index.js +2 -0
  74. package/lib/components/DonutChart/Arc/index.js.map +1 -0
  75. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
  76. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  77. package/lib/components/DonutChart/DonutChart.js +291 -0
  78. package/lib/components/DonutChart/DonutChart.js.map +1 -0
  79. package/lib/components/DonutChart/DonutChart.types.js +1 -0
  80. package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
  81. package/lib/components/DonutChart/Pie/Pie.js +72 -0
  82. package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
  83. package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
  84. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
  85. package/lib/components/DonutChart/Pie/index.js +2 -0
  86. package/lib/components/DonutChart/Pie/index.js.map +1 -0
  87. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +44 -0
  88. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  89. package/lib/components/DonutChart/index.js +3 -0
  90. package/lib/components/DonutChart/index.js.map +1 -0
  91. package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
  92. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  93. package/lib/components/GaugeChart/GaugeChart.js +592 -0
  94. package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
  95. package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
  96. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
  97. package/lib/components/GaugeChart/index.js +3 -0
  98. package/lib/components/GaugeChart/index.js.map +1 -0
  99. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +174 -0
  100. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  101. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
  102. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  103. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
  104. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  105. package/lib/components/GroupedVerticalBarChart/index.js +3 -0
  106. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
  107. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +90 -0
  108. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  109. package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
  110. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
  111. package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
  112. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  113. package/lib/components/HeatMapChart/index.js +3 -0
  114. package/lib/components/HeatMapChart/index.js.map +1 -0
  115. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +46 -0
  116. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
  117. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
  118. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  119. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
  120. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  121. package/lib/components/HorizontalBarChart/index.js +3 -0
  122. package/lib/components/HorizontalBarChart/index.js.map +1 -0
  123. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +163 -0
  124. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  125. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
  126. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
  127. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
  128. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
  129. package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
  130. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
  131. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +76 -0
  132. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
  133. package/lib/components/Legends/Legends.js +303 -0
  134. package/lib/components/Legends/Legends.js.map +1 -0
  135. package/lib/components/Legends/Legends.types.js +1 -0
  136. package/lib/components/Legends/Legends.types.js.map +1 -0
  137. package/lib/components/Legends/OverflowMenu.js +25 -0
  138. package/lib/components/Legends/OverflowMenu.js.map +1 -0
  139. package/lib/components/Legends/index.js +3 -0
  140. package/lib/components/Legends/index.js.map +1 -0
  141. package/lib/components/Legends/shape.js +35 -0
  142. package/lib/components/Legends/shape.js.map +1 -0
  143. package/lib/components/Legends/useLegendsStyles.styles.js +147 -0
  144. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
  145. package/lib/components/LineChart/LineChart.js +1034 -0
  146. package/lib/components/LineChart/LineChart.js.map +1 -0
  147. package/lib/components/LineChart/LineChart.types.js +3 -0
  148. package/lib/components/LineChart/LineChart.types.js.map +1 -0
  149. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
  150. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  151. package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
  152. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  153. package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
  154. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  155. package/lib/components/LineChart/index.js +4 -0
  156. package/lib/components/LineChart/index.js.map +1 -0
  157. package/lib/components/LineChart/useLineChartStyles.styles.js +65 -0
  158. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  159. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
  160. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  161. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
  162. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  163. package/lib/components/ResponsiveContainer/index.js +1 -0
  164. package/lib/components/ResponsiveContainer/index.js.map +1 -0
  165. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
  166. package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  167. package/lib/components/SankeyChart/SankeyChart.js +1022 -0
  168. package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
  169. package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
  170. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
  171. package/lib/components/SankeyChart/index.js +3 -0
  172. package/lib/components/SankeyChart/index.js.map +1 -0
  173. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
  174. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
  175. package/lib/components/ScatterChart/ScatterChart.js +465 -0
  176. package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
  177. package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
  178. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
  179. package/lib/components/ScatterChart/index.js +3 -0
  180. package/lib/components/ScatterChart/index.js.map +1 -0
  181. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +65 -0
  182. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  183. package/lib/components/Sparkline/Sparkline.js +119 -0
  184. package/lib/components/Sparkline/Sparkline.js.map +1 -0
  185. package/lib/components/Sparkline/Sparkline.types.js +4 -0
  186. package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
  187. package/lib/components/Sparkline/index.js +3 -0
  188. package/lib/components/Sparkline/index.js.map +1 -0
  189. package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
  190. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  191. package/lib/components/VerticalBarChart/VerticalBarChart.js +926 -0
  192. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  193. package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
  194. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  195. package/lib/components/VerticalBarChart/index.js +3 -0
  196. package/lib/components/VerticalBarChart/index.js.map +1 -0
  197. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +74 -0
  198. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  199. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
  200. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  201. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
  202. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  203. package/lib/components/VerticalStackedBarChart/index.js +3 -0
  204. package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
  205. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +73 -0
  206. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
  207. package/lib/index.js +20 -0
  208. package/lib/index.js.map +1 -0
  209. package/lib/types/DataPoint.js +1 -0
  210. package/lib/types/DataPoint.js.map +1 -0
  211. package/lib/types/EventAnnotation.js +1 -0
  212. package/lib/types/EventAnnotation.js.map +1 -0
  213. package/lib/types/LegendDataItem.js +1 -0
  214. package/lib/types/LegendDataItem.js.map +1 -0
  215. package/lib/types/index.js +2 -0
  216. package/lib/types/index.js.map +1 -0
  217. package/lib/utilities/FocusableTooltipText.js +65 -0
  218. package/lib/utilities/FocusableTooltipText.js.map +1 -0
  219. package/lib/utilities/KeyCodes.js +8 -0
  220. package/lib/utilities/KeyCodes.js.map +1 -0
  221. package/lib/utilities/SVGTooltipText.js +183 -0
  222. package/lib/utilities/SVGTooltipText.js.map +1 -0
  223. package/lib/utilities/async-utils.js +380 -0
  224. package/lib/utilities/async-utils.js.map +1 -0
  225. package/lib/utilities/colors.js +269 -0
  226. package/lib/utilities/colors.js.map +1 -0
  227. package/lib/utilities/getWindow.js +25 -0
  228. package/lib/utilities/getWindow.js.map +1 -0
  229. package/lib/utilities/index.js +3 -0
  230. package/lib/utilities/index.js.map +1 -0
  231. package/lib/utilities/locale-util.js +15 -0
  232. package/lib/utilities/locale-util.js.map +1 -0
  233. package/lib/utilities/overflow-utils.js +27 -0
  234. package/lib/utilities/overflow-utils.js.map +1 -0
  235. package/lib/utilities/string.js +32 -0
  236. package/lib/utilities/string.js.map +1 -0
  237. package/lib/utilities/test-data.js +329 -0
  238. package/lib/utilities/test-data.js.map +1 -0
  239. package/lib/utilities/utilities.js +1405 -0
  240. package/lib/utilities/utilities.js.map +1 -0
  241. package/lib/utilities/vbc-utils.js +27 -0
  242. package/lib/utilities/vbc-utils.js.map +1 -0
  243. package/lib-commonjs/AreaChart.js +6 -0
  244. package/lib-commonjs/AreaChart.js.map +1 -0
  245. package/lib-commonjs/CartesianChart.js +6 -0
  246. package/lib-commonjs/CartesianChart.js.map +1 -0
  247. package/lib-commonjs/DeclarativeChart.js +6 -0
  248. package/lib-commonjs/DeclarativeChart.js.map +1 -0
  249. package/lib-commonjs/DonutChart.js +6 -0
  250. package/lib-commonjs/DonutChart.js.map +1 -0
  251. package/lib-commonjs/GaugeChart.js +6 -0
  252. package/lib-commonjs/GaugeChart.js.map +1 -0
  253. package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
  254. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
  255. package/lib-commonjs/HeatMapChart.js +6 -0
  256. package/lib-commonjs/HeatMapChart.js.map +1 -0
  257. package/lib-commonjs/HorizontalBarChart.js +6 -0
  258. package/lib-commonjs/HorizontalBarChart.js.map +1 -0
  259. package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
  260. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
  261. package/lib-commonjs/Legends.js +6 -0
  262. package/lib-commonjs/Legends.js.map +1 -0
  263. package/lib-commonjs/LineChart.js +6 -0
  264. package/lib-commonjs/LineChart.js.map +1 -0
  265. package/lib-commonjs/Popover.js +6 -0
  266. package/lib-commonjs/Popover.js.map +1 -0
  267. package/lib-commonjs/ResponsiveContainer.js +6 -0
  268. package/lib-commonjs/ResponsiveContainer.js.map +1 -0
  269. package/lib-commonjs/SankeyChart.js +6 -0
  270. package/lib-commonjs/SankeyChart.js.map +1 -0
  271. package/lib-commonjs/ScatterChart.js +6 -0
  272. package/lib-commonjs/ScatterChart.js.map +1 -0
  273. package/lib-commonjs/Sparkline.js +6 -0
  274. package/lib-commonjs/Sparkline.js.map +1 -0
  275. package/lib-commonjs/VerticalBarChart.js +6 -0
  276. package/lib-commonjs/VerticalBarChart.js.map +1 -0
  277. package/lib-commonjs/VerticalStackedBarChart.js +6 -0
  278. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
  279. package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
  280. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
  281. package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
  282. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
  283. package/lib-commonjs/components/AreaChart/index.js +8 -0
  284. package/lib-commonjs/components/AreaChart/index.js.map +1 -0
  285. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +104 -0
  286. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
  287. package/lib-commonjs/components/CommonComponents/CartesianChart.js +484 -0
  288. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
  289. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
  290. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
  291. package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
  292. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
  293. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
  294. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
  295. package/lib-commonjs/components/CommonComponents/index.js +9 -0
  296. package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
  297. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +356 -0
  298. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
  299. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -0
  300. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
  301. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +205 -0
  302. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
  303. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +859 -0
  304. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
  305. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
  306. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
  307. package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
  308. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
  309. package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
  310. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
  311. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
  312. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
  313. package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
  314. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
  315. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
  316. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
  317. package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
  318. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
  319. package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
  320. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
  321. package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
  322. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
  323. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
  324. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
  325. package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
  326. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
  327. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +61 -0
  328. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
  329. package/lib-commonjs/components/DonutChart/index.js +8 -0
  330. package/lib-commonjs/components/DonutChart/index.js.map +1 -0
  331. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
  332. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
  333. package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
  334. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
  335. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
  336. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
  337. package/lib-commonjs/components/GaugeChart/index.js +8 -0
  338. package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
  339. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +252 -0
  340. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  341. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
  342. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  343. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
  344. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  345. package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
  346. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
  347. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +139 -0
  348. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  349. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
  350. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
  351. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
  352. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
  353. package/lib-commonjs/components/HeatMapChart/index.js +8 -0
  354. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
  355. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +68 -0
  356. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
  357. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
  358. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
  359. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
  360. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
  361. package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
  362. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
  363. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +251 -0
  364. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
  365. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
  366. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
  367. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
  368. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
  369. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
  370. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
  371. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +116 -0
  372. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
  373. package/lib-commonjs/components/Legends/Legends.js +313 -0
  374. package/lib-commonjs/components/Legends/Legends.js.map +1 -0
  375. package/lib-commonjs/components/Legends/Legends.types.js +6 -0
  376. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
  377. package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
  378. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
  379. package/lib-commonjs/components/Legends/index.js +8 -0
  380. package/lib-commonjs/components/Legends/index.js.map +1 -0
  381. package/lib-commonjs/components/Legends/shape.js +46 -0
  382. package/lib-commonjs/components/Legends/shape.js.map +1 -0
  383. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
  384. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
  385. package/lib-commonjs/components/LineChart/LineChart.js +1040 -0
  386. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
  387. package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
  388. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
  389. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
  390. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
  391. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
  392. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
  393. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
  394. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
  395. package/lib-commonjs/components/LineChart/index.js +9 -0
  396. package/lib-commonjs/components/LineChart/index.js.map +1 -0
  397. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +96 -0
  398. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
  399. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
  400. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
  401. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
  402. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
  403. package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
  404. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
  405. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
  406. package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
  407. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1038 -0
  408. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
  409. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
  410. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
  411. package/lib-commonjs/components/SankeyChart/index.js +8 -0
  412. package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
  413. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
  414. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
  415. package/lib-commonjs/components/ScatterChart/ScatterChart.js +471 -0
  416. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
  417. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
  418. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
  419. package/lib-commonjs/components/ScatterChart/index.js +8 -0
  420. package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
  421. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +96 -0
  422. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  423. package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
  424. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
  425. package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
  426. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
  427. package/lib-commonjs/components/Sparkline/index.js +8 -0
  428. package/lib-commonjs/components/Sparkline/index.js.map +1 -0
  429. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
  430. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
  431. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +928 -0
  432. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
  433. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
  434. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
  435. package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
  436. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
  437. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +117 -0
  438. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
  439. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
  440. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
  441. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
  442. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
  443. package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
  444. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
  445. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +120 -0
  446. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
  447. package/lib-commonjs/index.js +25 -0
  448. package/lib-commonjs/index.js.map +1 -0
  449. package/lib-commonjs/types/DataPoint.js +4 -0
  450. package/lib-commonjs/types/DataPoint.js.map +1 -0
  451. package/lib-commonjs/types/EventAnnotation.js +6 -0
  452. package/lib-commonjs/types/EventAnnotation.js.map +1 -0
  453. package/lib-commonjs/types/LegendDataItem.js +4 -0
  454. package/lib-commonjs/types/LegendDataItem.js.map +1 -0
  455. package/lib-commonjs/types/index.js +7 -0
  456. package/lib-commonjs/types/index.js.map +1 -0
  457. package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
  458. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
  459. package/lib-commonjs/utilities/KeyCodes.js +18 -0
  460. package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
  461. package/lib-commonjs/utilities/SVGTooltipText.js +193 -0
  462. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
  463. package/lib-commonjs/utilities/async-utils.js +382 -0
  464. package/lib-commonjs/utilities/async-utils.js.map +1 -0
  465. package/lib-commonjs/utilities/colors.js +293 -0
  466. package/lib-commonjs/utilities/colors.js.map +1 -0
  467. package/lib-commonjs/utilities/getWindow.js +28 -0
  468. package/lib-commonjs/utilities/getWindow.js.map +1 -0
  469. package/lib-commonjs/utilities/index.js +8 -0
  470. package/lib-commonjs/utilities/index.js.map +1 -0
  471. package/lib-commonjs/utilities/locale-util.js +25 -0
  472. package/lib-commonjs/utilities/locale-util.js.map +1 -0
  473. package/lib-commonjs/utilities/overflow-utils.js +36 -0
  474. package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
  475. package/lib-commonjs/utilities/string.js +29 -0
  476. package/lib-commonjs/utilities/string.js.map +1 -0
  477. package/lib-commonjs/utilities/test-data.js +383 -0
  478. package/lib-commonjs/utilities/test-data.js.map +1 -0
  479. package/lib-commonjs/utilities/utilities.js +1371 -0
  480. package/lib-commonjs/utilities/utilities.js.map +1 -0
  481. package/lib-commonjs/utilities/vbc-utils.js +45 -0
  482. package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
  483. package/package.json +13 -13
@@ -0,0 +1,621 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ ARC_PADDING: function() {
13
+ return ARC_PADDING;
14
+ },
15
+ BREAKPOINTS: function() {
16
+ return BREAKPOINTS;
17
+ },
18
+ GaugeChart: function() {
19
+ return GaugeChart;
20
+ },
21
+ calcNeedleRotation: function() {
22
+ return calcNeedleRotation;
23
+ },
24
+ getChartValueLabel: function() {
25
+ return getChartValueLabel;
26
+ },
27
+ getSegmentLabel: function() {
28
+ return getSegmentLabel;
29
+ }
30
+ });
31
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
32
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
33
+ const _useGaugeChartStylesstyles = require("./useGaugeChartStyles.styles");
34
+ const _d3selection = require("d3-selection");
35
+ const _d3shape = require("d3-shape");
36
+ const _index = require("../../utilities/index");
37
+ const _localeutil = require("../../utilities/locale-util");
38
+ const _SVGTooltipText = require("../../utilities/SVGTooltipText");
39
+ const _index1 = require("../Legends/index");
40
+ const _reacttabster = require("@fluentui/react-tabster");
41
+ const _ChartPopover = require("../CommonComponents/ChartPopover");
42
+ const GAUGE_MARGIN = 16;
43
+ const LABEL_WIDTH = 36;
44
+ const LABEL_HEIGHT = 16;
45
+ const LABEL_OFFSET = 4;
46
+ const TITLE_OFFSET = 11;
47
+ const EXTRA_NEEDLE_LENGTH = 4;
48
+ const ARC_PADDING = 2;
49
+ const BREAKPOINTS = [
50
+ {
51
+ minRadius: 52,
52
+ arcWidth: 12,
53
+ fontSize: 20
54
+ },
55
+ {
56
+ minRadius: 70,
57
+ arcWidth: 16,
58
+ fontSize: 24
59
+ },
60
+ {
61
+ minRadius: 88,
62
+ arcWidth: 20,
63
+ fontSize: 32
64
+ },
65
+ {
66
+ minRadius: 106,
67
+ arcWidth: 24,
68
+ fontSize: 32
69
+ },
70
+ {
71
+ minRadius: 124,
72
+ arcWidth: 28,
73
+ fontSize: 40
74
+ },
75
+ {
76
+ minRadius: 142,
77
+ arcWidth: 32,
78
+ fontSize: 40
79
+ }
80
+ ];
81
+ const calcNeedleRotation = (chartValue, minValue, maxValue)=>{
82
+ let needleRotation = (chartValue - minValue) / (maxValue - minValue) * 180;
83
+ if (needleRotation < 0) {
84
+ needleRotation = 0;
85
+ } else if (needleRotation > 180) {
86
+ needleRotation = 180;
87
+ }
88
+ return needleRotation;
89
+ };
90
+ const getSegmentLabel = (segment, minValue, maxValue, variant, isAriaLabel = false)=>{
91
+ if (isAriaLabel) {
92
+ return minValue === 0 && variant === 'single-segment' ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${(segment.size / maxValue * 100).toFixed()}%` : `${segment.legend}, ${segment.start} to ${segment.end}`;
93
+ }
94
+ return minValue === 0 && variant === 'single-segment' ? `${segment.size} (${(segment.size / maxValue * 100).toFixed()}%)` : `${segment.start} - ${segment.end}`;
95
+ };
96
+ const getChartValueLabel = (chartValue, minValue, maxValue, chartValueFormat, forCallout = false)=>{
97
+ if (forCallout) {
98
+ // When displaying the chart value as a percentage, use fractions in the callout, and vice versa.
99
+ // This helps clarify the actual value and avoid repetition.
100
+ return minValue !== 0 ? chartValue.toString() : chartValueFormat === 'fraction' ? `${(chartValue / maxValue * 100).toFixed()}%` : `${chartValue}/${maxValue}`;
101
+ }
102
+ return typeof chartValueFormat === 'function' ? chartValueFormat([
103
+ chartValue - minValue,
104
+ maxValue - minValue
105
+ ]) : minValue !== 0 ? chartValue.toString() : chartValueFormat === 'fraction' ? `${chartValue}/${maxValue}` : `${(chartValue / maxValue * 100).toFixed()}%`;
106
+ };
107
+ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
108
+ var _props_legendProps;
109
+ const _getMargins = ()=>{
110
+ const { hideMinMax, chartTitle, sublabel } = props;
111
+ return {
112
+ left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,
113
+ right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,
114
+ top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,
115
+ bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN
116
+ };
117
+ };
118
+ const _margins = _getMargins();
119
+ const _legendsHeight = !props.hideLegend ? 24 : 0;
120
+ const _rootElem = _react.useRef(null);
121
+ const _isRTL = (0, _index.useRtl)();
122
+ const [width, setWidth] = _react.useState(140 + _getMargins().left + _getMargins().right);
123
+ const [height, setHeight] = _react.useState(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);
124
+ const [hoveredLegend, setHoveredLegend] = _react.useState('');
125
+ const [selectedLegends, setSelectedLegends] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
126
+ const [focusedElement, setFocusedElement] = _react.useState('');
127
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
+ const [clickPosition, setClickPosition] = _react.useState({
129
+ x: 0,
130
+ y: 0
131
+ });
132
+ const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
133
+ const [hoverXValue, setHoverXValue] = _react.useState('');
134
+ const [hoverYValues, setHoverYValues] = _react.useState([]);
135
+ const prevPropsRef = _react.useRef(null);
136
+ const _width = props.width || width;
137
+ const _height = props.height || height;
138
+ const _outerRadius = Math.min((_width - (_margins.left + _margins.right)) / 2, _height - (_margins.top + _margins.bottom + _legendsHeight));
139
+ const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();
140
+ const _innerRadius = _outerRadius - arcWidth;
141
+ let _minValue;
142
+ let _maxValue;
143
+ let _segments;
144
+ let _calloutAnchor = '';
145
+ _react.useEffect(()=>{
146
+ if (prevPropsRef.current) {
147
+ var _prevProps_legendProps, _props_legendProps;
148
+ const prevProps = prevPropsRef.current;
149
+ if (!(0, _index.areArraysEqual)((_prevProps_legendProps = prevProps.legendProps) === null || _prevProps_legendProps === void 0 ? void 0 : _prevProps_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
150
+ var _props_legendProps1;
151
+ setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
152
+ }
153
+ if (prevProps.height !== props.height || prevProps.width !== props.width) {
154
+ setWidth(props.width);
155
+ setHeight(props.height);
156
+ }
157
+ }
158
+ prevPropsRef.current = props;
159
+ }, [
160
+ props
161
+ ]);
162
+ _react.useImperativeHandle(props.componentRef, ()=>({
163
+ chartContainer: _rootElem.current
164
+ }), []);
165
+ const classes = (0, _useGaugeChartStylesstyles.useGaugeChartStyles)(props);
166
+ function _getStylesBasedOnBreakpoint() {
167
+ for(let index = BREAKPOINTS.length - 1; index >= 0; index -= 1){
168
+ if (_outerRadius >= BREAKPOINTS[index].minRadius) {
169
+ return {
170
+ arcWidth: BREAKPOINTS[index].arcWidth,
171
+ chartValueSize: BREAKPOINTS[index].fontSize
172
+ };
173
+ }
174
+ }
175
+ return {
176
+ arcWidth: BREAKPOINTS[0].arcWidth,
177
+ chartValueSize: BREAKPOINTS[0].fontSize
178
+ };
179
+ }
180
+ function _processProps() {
181
+ const { minValue = 0, maxValue, segments, roundCorners } = props;
182
+ let total = minValue;
183
+ const processedSegments = segments.map((segment, index)=>{
184
+ const size = Math.max(segment.size, 0);
185
+ total += size;
186
+ return {
187
+ legend: segment.legend,
188
+ size,
189
+ color: typeof segment.color !== 'undefined' ? (0, _index.getColorFromToken)(segment.color, false) : (0, _index.getNextColor)(index, 0, false),
190
+ accessibilityData: segment.accessibilityData,
191
+ start: total - size,
192
+ end: total
193
+ };
194
+ });
195
+ if (typeof maxValue !== 'undefined' && total < maxValue) {
196
+ processedSegments.push({
197
+ legend: 'Unknown',
198
+ size: maxValue - total,
199
+ color: 'neutralLight',
200
+ start: total,
201
+ end: maxValue
202
+ });
203
+ total = maxValue;
204
+ }
205
+ const arcGenerator = (0, _d3shape.arc)().cornerRadius(roundCorners ? 3 : 0).padAngle(ARC_PADDING / _outerRadius).padRadius(_outerRadius);
206
+ const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;
207
+ let prevAngle = -Math.PI / 2;
208
+ // eslint-disable-next-line @typescript-eslint/no-shadow
209
+ const arcs = rtlSafeSegments.map((segment, index)=>{
210
+ const endAngle = prevAngle + segment.size / (total - minValue) * Math.PI;
211
+ const d = arcGenerator({
212
+ innerRadius: _innerRadius,
213
+ outerRadius: _outerRadius,
214
+ startAngle: prevAngle,
215
+ endAngle
216
+ });
217
+ prevAngle = endAngle;
218
+ return {
219
+ d,
220
+ segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,
221
+ startAngle: prevAngle - segment.size / (total - minValue) * Math.PI,
222
+ endAngle
223
+ };
224
+ });
225
+ _minValue = minValue;
226
+ _maxValue = total;
227
+ _segments = processedSegments;
228
+ return {
229
+ arcs
230
+ };
231
+ }
232
+ function _renderNeedle() {
233
+ const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);
234
+ const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;
235
+ const strokeWidth = 2;
236
+ const halfStrokeWidth = strokeWidth / 2;
237
+ const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;
238
+ return /*#__PURE__*/ _react.createElement("g", {
239
+ transform: `rotate(${rtlSafeNeedleRotation}, 0, 0)`
240
+ }, /*#__PURE__*/ _react.createElement("path", {
241
+ d: `
242
+ M 0,${-halfStrokeWidth - 3}
243
+ L ${-needleLength},${-halfStrokeWidth - 1}
244
+ A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}
245
+ L 0,${halfStrokeWidth + 3}
246
+ A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}
247
+ `,
248
+ strokeWidth: strokeWidth,
249
+ className: classes.needle,
250
+ transform: `translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`,
251
+ "data-is-focusable": true,
252
+ onFocus: (e)=>_handleFocus(e, 'Needle'),
253
+ onBlur: _handleBlur,
254
+ onMouseEnter: (e)=>_handleMouseOver(e, 'Needle'),
255
+ onMouseMove: (e)=>_handleMouseOver(e, 'Needle'),
256
+ role: "img",
257
+ "aria-label": 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)
258
+ }));
259
+ }
260
+ function _renderLegends() {
261
+ if (props.hideLegend) {
262
+ return null;
263
+ }
264
+ const legends = _segments.map((segment, index)=>{
265
+ const color = segment.color || (0, _index.getNextColor)(index, 0, false);
266
+ return {
267
+ title: segment.legend,
268
+ color,
269
+ hoverAction: ()=>{
270
+ setHoveredLegend(segment.legend);
271
+ },
272
+ onMouseOutAction: ()=>{
273
+ setHoveredLegend('');
274
+ }
275
+ };
276
+ });
277
+ return /*#__PURE__*/ _react.createElement("div", {
278
+ className: classes.legendsContainer,
279
+ style: {
280
+ width: props.width
281
+ }
282
+ }, /*#__PURE__*/ _react.createElement(_index1.Legends, {
283
+ legends: legends,
284
+ centerLegends: true,
285
+ ...props.legendProps,
286
+ // eslint-disable-next-line react/jsx-no-bind
287
+ onChange: _onLegendSelectionChange
288
+ }));
289
+ }
290
+ function _onLegendSelectionChange(selectedLegends, event, currentLegend) {
291
+ var _props_legendProps, _props_legendProps1;
292
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
293
+ setSelectedLegends(selectedLegends);
294
+ } else {
295
+ setSelectedLegends(selectedLegends.slice(-1));
296
+ }
297
+ if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
298
+ props.legendProps.onChange(selectedLegends, event, currentLegend);
299
+ }
300
+ }
301
+ /**
302
+ * This function checks if the given legend is highlighted or not.
303
+ * A legend can be highlighted in 2 ways:
304
+ * 1. selection: if the user clicks on it
305
+ * 2. hovering: if there is no selected legend and the user hovers over it
306
+ */ function _legendHighlighted(legend) {
307
+ return _getHighlightedLegend().includes(legend);
308
+ }
309
+ /**
310
+ * This function checks if none of the legends is selected or hovered.
311
+ */ function _noLegendHighlighted() {
312
+ return _getHighlightedLegend().length === 0;
313
+ }
314
+ function _getHighlightedLegend() {
315
+ return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [
316
+ hoveredLegend
317
+ ] : [];
318
+ }
319
+ // eslint-disable-next-line @typescript-eslint/no-shadow
320
+ function _handleFocus(focusEvent, focusedElement) {
321
+ _showCallout(focusEvent, focusedElement, true);
322
+ }
323
+ function _handleBlur() {
324
+ _hideCallout(true);
325
+ }
326
+ function _handleMouseOver(mouseEvent, hoveredElement) {
327
+ _showCallout(mouseEvent, hoveredElement, false);
328
+ }
329
+ function _handleMouseOut() {
330
+ _hideCallout(false);
331
+ }
332
+ function _handleCalloutDismiss() {
333
+ _hideCallout(false);
334
+ }
335
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
336
+ function _showCallout(event, legend, isFocusEvent) {
337
+ if (_calloutAnchor === legend) {
338
+ return;
339
+ }
340
+ let clientX = 0;
341
+ let clientY = 0;
342
+ if ('clientX' in event) {
343
+ clientX = event.clientX;
344
+ clientY = event.clientY;
345
+ } else {
346
+ // eslint-disable-next-line @typescript-eslint/no-shadow
347
+ const target = event.currentTarget;
348
+ if (target && 'getBoundingClientRect' in target) {
349
+ const boundingRect = target.getBoundingClientRect();
350
+ clientX = boundingRect.left + boundingRect.width / 2;
351
+ clientY = boundingRect.top + boundingRect.height / 2;
352
+ }
353
+ }
354
+ _calloutAnchor = legend;
355
+ // eslint-disable-next-line @typescript-eslint/no-shadow
356
+ const hoverXValue = 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);
357
+ // eslint-disable-next-line @typescript-eslint/no-shadow
358
+ const hoverYValues = _segments.map((segment)=>{
359
+ const yValue = {
360
+ legend: segment.legend,
361
+ y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),
362
+ color: segment.color
363
+ };
364
+ return yValue;
365
+ });
366
+ _updatePosition(clientX, clientY);
367
+ setPopoverOpen([
368
+ 'Needle',
369
+ 'Chart value'
370
+ ].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend));
371
+ setHoverXValue(hoverXValue);
372
+ setHoverYValues(hoverYValues);
373
+ if (isFocusEvent) {
374
+ setFocusedElement(legend);
375
+ }
376
+ }
377
+ function _hideCallout(isBlurEvent) {
378
+ _calloutAnchor = '';
379
+ setPopoverOpen(false);
380
+ setHoverXValue('');
381
+ setHoverYValues([]);
382
+ if (isBlurEvent) {
383
+ setFocusedElement('');
384
+ }
385
+ }
386
+ function _wrapContent(content, id, maxWidth) {
387
+ const textElement = (0, _d3selection.select)(`#${id}`);
388
+ textElement.text(content);
389
+ if (!textElement.node()) {
390
+ return false;
391
+ }
392
+ let isOverflowing = false;
393
+ let textLength = textElement.node().getComputedTextLength();
394
+ while(textLength > maxWidth && content.length > 0){
395
+ content = content.slice(0, -1);
396
+ textElement.text(content + '...');
397
+ isOverflowing = true;
398
+ textLength = textElement.node().getComputedTextLength();
399
+ }
400
+ return isOverflowing;
401
+ }
402
+ // TO DO: Write a common functional component for Multi value callout and divide sub count method
403
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
404
+ function _multiValueCallout(calloutProps) {
405
+ const yValueHoverSubCountsExists = _yValueHoverSubCountsExists(calloutProps.YValueHover);
406
+ return /*#__PURE__*/ _react.createElement("div", {
407
+ className: classes.calloutContentRoot
408
+ }, /*#__PURE__*/ _react.createElement("div", {
409
+ className: classes.calloutDateTimeContainer,
410
+ style: yValueHoverSubCountsExists ? {
411
+ marginBottom: '11px'
412
+ } : {}
413
+ }, /*#__PURE__*/ _react.createElement("div", {
414
+ className: classes.calloutContentX,
415
+ ...(0, _index.getAccessibleDataObject)(calloutProps.xAxisCalloutAccessibilityData, 'text', false)
416
+ }, (0, _localeutil.convertToLocaleString)(calloutProps.hoverXValue, props.culture))), /*#__PURE__*/ _react.createElement("div", {
417
+ className: classes.calloutInfoContainer,
418
+ style: yValueHoverSubCountsExists ? {
419
+ display: 'flex'
420
+ } : {}
421
+ }, calloutProps.YValueHover && calloutProps.YValueHover.map((yValue, index, yValues)=>{
422
+ const isLast = index + 1 === yValues.length;
423
+ const { shouldDrawBorderBottom = false } = yValue;
424
+ return /*#__PURE__*/ _react.createElement("div", {
425
+ ...(0, _index.getAccessibleDataObject)(yValue.callOutAccessibilityData, 'text', false),
426
+ key: `callout-content-${index}`,
427
+ style: yValueHoverSubCountsExists ? {
428
+ display: 'inline-block',
429
+ ...shouldDrawBorderBottom && {
430
+ paddingBottom: '10px'
431
+ }
432
+ } : {
433
+ ...shouldDrawBorderBottom && {
434
+ paddingBottom: '10px'
435
+ }
436
+ }
437
+ }, _getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast));
438
+ }), !!calloutProps.descriptionMessage && /*#__PURE__*/ _react.createElement("div", {
439
+ className: classes.descriptionMessage
440
+ }, calloutProps.descriptionMessage)));
441
+ }
442
+ function _yValueHoverSubCountsExists(yValueHover) {
443
+ if (yValueHover) {
444
+ return yValueHover.some((yValue)=>yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string');
445
+ }
446
+ return false;
447
+ }
448
+ function _getCalloutContent(xValue, index, yValueHoverSubCountsExists, isLast) {
449
+ const marginStyle = isLast ? {} : {
450
+ marginRight: '16px'
451
+ };
452
+ const toDrawShape = xValue.index !== undefined && xValue.index !== -1;
453
+ const { culture } = props;
454
+ const yValue = (0, _localeutil.convertToLocaleString)(xValue.y, culture);
455
+ if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {
456
+ return /*#__PURE__*/ _react.createElement("div", {
457
+ style: yValueHoverSubCountsExists ? marginStyle : {}
458
+ }, yValueHoverSubCountsExists && /*#__PURE__*/ _react.createElement("div", {
459
+ className: "ms-fontWeight-semibold",
460
+ style: {
461
+ fontSize: '12pt'
462
+ }
463
+ }, xValue.legend, " (", yValue, ")"), /*#__PURE__*/ _react.createElement("div", {
464
+ id: `${index}_${xValue.y}`,
465
+ className: classes.calloutBlockContainer,
466
+ style: {
467
+ borderLeft: `4px solid ${xValue.color}`
468
+ }
469
+ }, toDrawShape && /*#__PURE__*/ _react.createElement(_index1.Shape, {
470
+ svgProps: {
471
+ className: classes.shapeStyles
472
+ },
473
+ pathProps: {
474
+ fill: xValue.color
475
+ },
476
+ shape: _index.Points[xValue.index % Object.keys(_index.pointTypes).length],
477
+ style: {
478
+ display: 'flex'
479
+ }
480
+ }), /*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement("div", {
481
+ className: classes.calloutlegendText
482
+ }, " ", xValue.legend), /*#__PURE__*/ _react.createElement("div", {
483
+ className: classes.calloutContentY
484
+ }, (0, _localeutil.convertToLocaleString)(xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, culture)))));
485
+ } else {
486
+ const subcounts = xValue.yAxisCalloutData;
487
+ return /*#__PURE__*/ _react.createElement("div", {
488
+ style: marginStyle
489
+ }, /*#__PURE__*/ _react.createElement("div", {
490
+ className: "ms-fontWeight-semibold",
491
+ style: {
492
+ fontSize: '12pt'
493
+ }
494
+ }, xValue.legend, " (", yValue, ")"), Object.keys(subcounts).map((subcountName)=>{
495
+ return /*#__PURE__*/ _react.createElement("div", {
496
+ key: subcountName,
497
+ className: classes.calloutBlockContainer
498
+ }, /*#__PURE__*/ _react.createElement("div", {
499
+ className: classes.calloutlegendText
500
+ }, " ", (0, _localeutil.convertToLocaleString)(subcountName, culture)), /*#__PURE__*/ _react.createElement("div", {
501
+ className: classes.calloutContentY
502
+ }, (0, _localeutil.convertToLocaleString)(subcounts[subcountName], culture)));
503
+ }));
504
+ }
505
+ }
506
+ function _updatePosition(newX, newY) {
507
+ const threshold = 1; // Set a threshold for movement
508
+ const { x, y } = clickPosition;
509
+ // Calculate the distance moved
510
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
511
+ // Update the position only if the distance moved is greater than the threshold
512
+ if (distance > threshold) {
513
+ setClickPosition({
514
+ x: newX,
515
+ y: newY
516
+ });
517
+ setPopoverOpen(true);
518
+ }
519
+ }
520
+ function _getChartTitle() {
521
+ const { chartTitle } = props;
522
+ return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;
523
+ }
524
+ const { arcs } = _processProps();
525
+ const focusAttributes = (0, _reacttabster.useFocusableGroup)();
526
+ return /*#__PURE__*/ _react.createElement("div", {
527
+ className: classes.root,
528
+ ref: (el)=>_rootElem.current = el,
529
+ ...focusAttributes
530
+ }, /*#__PURE__*/ _react.createElement("svg", {
531
+ className: classes.chart,
532
+ style: {
533
+ width: props.width,
534
+ height: props.height - _legendsHeight
535
+ },
536
+ role: "region",
537
+ "aria-label": _getChartTitle(),
538
+ onMouseLeave: _handleMouseOut
539
+ }, /*#__PURE__*/ _react.createElement("g", {
540
+ transform: `translate(${width / 2}, ${height - (_margins.bottom + _legendsHeight)})`
541
+ }, props.chartTitle && /*#__PURE__*/ _react.createElement("text", {
542
+ x: 0,
543
+ y: -(_outerRadius + TITLE_OFFSET),
544
+ textAnchor: "middle",
545
+ className: classes.chartTitle,
546
+ "aria-hidden": true
547
+ }, props.chartTitle), !props.hideMinMax && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("text", {
548
+ x: (_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET),
549
+ y: 0,
550
+ textAnchor: "end",
551
+ className: classes.limits,
552
+ role: "img",
553
+ "aria-label": `Min value: ${_minValue}`
554
+ }, (0, _index.formatValueWithSIPrefix)(_minValue)), /*#__PURE__*/ _react.createElement("text", {
555
+ x: (_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET),
556
+ y: 0,
557
+ textAnchor: "start",
558
+ className: classes.limits,
559
+ role: "img",
560
+ "aria-label": `Max value: ${_maxValue}`
561
+ }, (0, _index.formatValueWithSIPrefix)(_maxValue))), arcs.map((arc, index)=>{
562
+ const segment = _segments[arc.segmentIndex];
563
+ return /*#__PURE__*/ _react.createElement(_react.Fragment, {
564
+ key: index
565
+ }, /*#__PURE__*/ _react.createElement("path", {
566
+ d: arc.d,
567
+ strokeWidth: focusedElement === segment.legend ? ARC_PADDING : 0,
568
+ className: classes.segment,
569
+ fill: segment.color,
570
+ opacity: _legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1,
571
+ ...(0, _index.getAccessibleDataObject)({
572
+ ariaLabel: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),
573
+ ...segment.accessibilityData
574
+ }, 'img', true),
575
+ onFocus: (e)=>_handleFocus(e, segment.legend),
576
+ onBlur: _handleBlur,
577
+ onMouseEnter: (e)=>_handleMouseOver(e, segment.legend),
578
+ onMouseLeave: (e)=>_handleCalloutDismiss(),
579
+ onMouseMove: (e)=>_handleMouseOver(e, segment.legend),
580
+ "data-is-focusable": _legendHighlighted(segment.legend) || _noLegendHighlighted(),
581
+ tabIndex: segment.legend !== '' ? 0 : undefined
582
+ }));
583
+ }), _renderNeedle(), /*#__PURE__*/ _react.createElement("g", {
584
+ onMouseEnter: (e)=>_handleMouseOver(e, 'Chart value'),
585
+ onMouseMove: (e)=>_handleMouseOver(e, 'Chart value')
586
+ }, /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
587
+ content: getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat),
588
+ textProps: {
589
+ x: 0,
590
+ y: 0,
591
+ textAnchor: 'middle',
592
+ className: classes.chartValue,
593
+ fontSize: chartValueSize,
594
+ 'aria-hidden': 'true'
595
+ },
596
+ maxWidth: _innerRadius * 2 - 24,
597
+ wrapContent: _wrapContent
598
+ })), props.sublabel && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
599
+ content: props.sublabel,
600
+ textProps: {
601
+ x: 0,
602
+ y: 4,
603
+ textAnchor: 'middle',
604
+ dominantBaseline: 'hanging',
605
+ className: classes.sublabel
606
+ },
607
+ maxWidth: _innerRadius * 2,
608
+ wrapContent: _wrapContent
609
+ }))), _renderLegends(), !props.hideTooltip && isPopoverOpen && /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
610
+ ...props.calloutProps,
611
+ clickPosition: clickPosition,
612
+ isPopoverOpen: isPopoverOpen,
613
+ customCallout: {
614
+ customizedCallout: _multiValueCallout({
615
+ hoverXValue: hoverXValue,
616
+ YValueHover: hoverYValues
617
+ })
618
+ }
619
+ }));
620
+ });
621
+ GaugeChart.displayName = 'GaugeChart';