@fluentui/react-charts 9.1.9 → 9.1.10

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 (306) hide show
  1. package/CHANGELOG.md +21 -2
  2. package/dist/index.d.ts +309 -8
  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 +1 -0
  8. package/lib/FunnelChart.js.map +1 -0
  9. package/lib/GanttChart.js +1 -0
  10. package/lib/GanttChart.js.map +1 -0
  11. package/lib/GaugeChart.js.map +1 -1
  12. package/lib/GroupedVerticalBarChart.js.map +1 -1
  13. package/lib/HeatMapChart.js.map +1 -1
  14. package/lib/HorizontalBarChart.js.map +1 -1
  15. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  16. package/lib/Legends.js.map +1 -1
  17. package/lib/LineChart.js.map +1 -1
  18. package/lib/Popover.js.map +1 -1
  19. package/lib/ResponsiveContainer.js.map +1 -1
  20. package/lib/SankeyChart.js.map +1 -1
  21. package/lib/ScatterChart.js.map +1 -1
  22. package/lib/Sparkline.js.map +1 -1
  23. package/lib/VerticalBarChart.js.map +1 -1
  24. package/lib/VerticalStackedBarChart.js.map +1 -1
  25. package/lib/components/AreaChart/AreaChart.js +13 -5
  26. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  27. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  28. package/lib/components/AreaChart/index.js.map +1 -1
  29. package/lib/components/CommonComponents/CartesianChart.js +10 -7
  30. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  31. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  32. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  33. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  34. package/lib/components/CommonComponents/index.js.map +1 -1
  35. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  36. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  37. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  38. package/lib/components/DeclarativeChart/index.js.map +1 -1
  39. package/lib/components/DonutChart/Arc/Arc.js +5 -5
  40. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  41. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  42. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  43. package/lib/components/DonutChart/DonutChart.js +7 -1
  44. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  45. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  46. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  47. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  48. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  49. package/lib/components/DonutChart/index.js.map +1 -1
  50. package/lib/components/FunnelChart/FunnelChart.js +391 -0
  51. package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
  52. package/lib/components/FunnelChart/FunnelChart.types.js +1 -0
  53. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
  54. package/lib/components/FunnelChart/funnelGeometry.js +220 -0
  55. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
  56. package/lib/components/FunnelChart/index.js +2 -0
  57. package/lib/components/FunnelChart/index.js.map +1 -0
  58. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +59 -0
  59. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
  60. package/lib/components/GanttChart/GanttChart.js +530 -0
  61. package/lib/components/GanttChart/GanttChart.js.map +1 -0
  62. package/lib/components/GanttChart/GanttChart.types.js +4 -0
  63. package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
  64. package/lib/components/GanttChart/index.js +2 -0
  65. package/lib/components/GanttChart/index.js.map +1 -0
  66. package/lib/components/GanttChart/useGanttChartStyles.styles.js +25 -0
  67. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
  68. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  69. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  70. package/lib/components/GaugeChart/index.js.map +1 -1
  71. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +10 -5
  72. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  73. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  74. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  75. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  76. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  77. package/lib/components/HeatMapChart/index.js.map +1 -1
  78. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  79. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +5 -3
  80. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  81. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  82. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -3
  83. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  84. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  85. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  86. package/lib/components/Legends/Legends.js.map +1 -1
  87. package/lib/components/Legends/Legends.types.js.map +1 -1
  88. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  89. package/lib/components/Legends/index.js.map +1 -1
  90. package/lib/components/Legends/shape.js +3 -3
  91. package/lib/components/Legends/shape.js.map +1 -1
  92. package/lib/components/LineChart/LineChart.js +14 -7
  93. package/lib/components/LineChart/LineChart.js.map +1 -1
  94. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  95. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  96. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  97. package/lib/components/LineChart/eventAnnotation/Textbox.js +2 -1
  98. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  99. package/lib/components/LineChart/index.js.map +1 -1
  100. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  101. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  102. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  103. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  104. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  105. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  106. package/lib/components/SankeyChart/index.js.map +1 -1
  107. package/lib/components/ScatterChart/ScatterChart.js +8 -2
  108. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  109. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  110. package/lib/components/ScatterChart/index.js.map +1 -1
  111. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  112. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  113. package/lib/components/Sparkline/index.js.map +1 -1
  114. package/lib/components/VerticalBarChart/VerticalBarChart.js +10 -4
  115. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  116. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  117. package/lib/components/VerticalBarChart/index.js.map +1 -1
  118. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -4
  119. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  120. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  121. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  122. package/lib/index.js +2 -0
  123. package/lib/index.js.map +1 -1
  124. package/lib/types/DataPoint.js +3 -1
  125. package/lib/types/DataPoint.js.map +1 -1
  126. package/lib/types/EventAnnotation.js.map +1 -1
  127. package/lib/types/LegendDataItem.js.map +1 -1
  128. package/lib/types/index.js.map +1 -1
  129. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  130. package/lib/utilities/KeyCodes.js.map +1 -1
  131. package/lib/utilities/SVGTooltipText.js.map +1 -1
  132. package/lib/utilities/async-utils.js.map +1 -1
  133. package/lib/utilities/colors.js +12 -0
  134. package/lib/utilities/colors.js.map +1 -1
  135. package/lib/utilities/getWindow.js.map +1 -1
  136. package/lib/utilities/index.js.map +1 -1
  137. package/lib/utilities/overflow-utils.js.map +1 -1
  138. package/lib/utilities/string.js.map +1 -1
  139. package/lib/utilities/test-data.js +236 -0
  140. package/lib/utilities/test-data.js.map +1 -1
  141. package/lib/utilities/utilities.js +90 -22
  142. package/lib/utilities/utilities.js.map +1 -1
  143. package/lib/utilities/vbc-utils.js +2 -2
  144. package/lib/utilities/vbc-utils.js.map +1 -1
  145. package/lib-commonjs/AreaChart.js.map +1 -1
  146. package/lib-commonjs/CartesianChart.js.map +1 -1
  147. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  148. package/lib-commonjs/DonutChart.js.map +1 -1
  149. package/lib-commonjs/FunnelChart.js +6 -0
  150. package/lib-commonjs/FunnelChart.js.map +1 -0
  151. package/lib-commonjs/GanttChart.js +6 -0
  152. package/lib-commonjs/GanttChart.js.map +1 -0
  153. package/lib-commonjs/GaugeChart.js.map +1 -1
  154. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  155. package/lib-commonjs/HeatMapChart.js.map +1 -1
  156. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  157. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  158. package/lib-commonjs/Legends.js.map +1 -1
  159. package/lib-commonjs/LineChart.js.map +1 -1
  160. package/lib-commonjs/Popover.js.map +1 -1
  161. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  162. package/lib-commonjs/SankeyChart.js.map +1 -1
  163. package/lib-commonjs/ScatterChart.js.map +1 -1
  164. package/lib-commonjs/Sparkline.js.map +1 -1
  165. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  166. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  167. package/lib-commonjs/components/AreaChart/AreaChart.js +13 -5
  168. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  169. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  170. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  171. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  172. package/lib-commonjs/components/CommonComponents/CartesianChart.js +9 -6
  173. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  174. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  175. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  176. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  177. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  178. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  179. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  180. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  181. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  182. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  183. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  184. package/lib-commonjs/components/DonutChart/Arc/Arc.js +5 -5
  185. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  186. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  187. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  188. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  189. package/lib-commonjs/components/DonutChart/DonutChart.js +7 -1
  190. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  191. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  192. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  193. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  194. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  195. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  196. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  197. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  198. package/lib-commonjs/components/FunnelChart/FunnelChart.js +402 -0
  199. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
  200. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +6 -0
  201. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
  202. package/lib-commonjs/components/FunnelChart/funnelGeometry.js +248 -0
  203. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
  204. package/lib-commonjs/components/FunnelChart/index.js +7 -0
  205. package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
  206. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +79 -0
  207. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
  208. package/lib-commonjs/components/GanttChart/GanttChart.js +541 -0
  209. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
  210. package/lib-commonjs/components/GanttChart/GanttChart.types.js +7 -0
  211. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
  212. package/lib-commonjs/components/GanttChart/index.js +7 -0
  213. package/lib-commonjs/components/GanttChart/index.js.map +1 -0
  214. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +39 -0
  215. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
  216. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  217. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  218. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  219. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  220. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +10 -5
  221. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  222. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  223. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  224. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  225. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  226. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  227. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  228. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  229. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  230. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
  231. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  232. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  233. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  234. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -3
  235. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  236. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  237. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  238. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  239. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  240. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  241. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  242. package/lib-commonjs/components/Legends/index.js.map +1 -1
  243. package/lib-commonjs/components/Legends/shape.js +2 -2
  244. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  245. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  246. package/lib-commonjs/components/LineChart/LineChart.js +14 -7
  247. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  248. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  249. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  250. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  251. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +2 -1
  252. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  253. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  254. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  255. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  256. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  257. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  258. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  259. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  260. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  261. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  262. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  263. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  264. package/lib-commonjs/components/ScatterChart/ScatterChart.js +8 -2
  265. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  266. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  267. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  268. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  269. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  270. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  271. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  272. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  273. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +10 -4
  274. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  275. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  276. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  277. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  278. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -4
  279. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  280. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  281. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  282. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  283. package/lib-commonjs/index.js +2 -0
  284. package/lib-commonjs/index.js.map +1 -1
  285. package/lib-commonjs/types/DataPoint.js +3 -1
  286. package/lib-commonjs/types/DataPoint.js.map +1 -1
  287. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  288. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  289. package/lib-commonjs/types/index.js.map +1 -1
  290. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  291. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  292. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  293. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  294. package/lib-commonjs/utilities/colors.js +18 -0
  295. package/lib-commonjs/utilities/colors.js.map +1 -1
  296. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  297. package/lib-commonjs/utilities/index.js.map +1 -1
  298. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  299. package/lib-commonjs/utilities/string.js.map +1 -1
  300. package/lib-commonjs/utilities/test-data.js +245 -0
  301. package/lib-commonjs/utilities/test-data.js.map +1 -1
  302. package/lib-commonjs/utilities/utilities.js +86 -17
  303. package/lib-commonjs/utilities/utilities.js.map +1 -1
  304. package/lib-commonjs/utilities/vbc-utils.js +2 -2
  305. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  306. package/package.json +9 -9
@@ -0,0 +1,402 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FunnelChart", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FunnelChart;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactutilities = require("@fluentui/react-utilities");
14
+ const _index = require("../../utilities/index");
15
+ const _index1 = require("../Legends/index");
16
+ const _reacttabster = require("@fluentui/react-tabster");
17
+ const _ChartPopover = require("../CommonComponents/ChartPopover");
18
+ const _chartutilities = require("@fluentui/chart-utilities");
19
+ const _colors = require("../../utilities/colors");
20
+ const _useFunnelChartStylesstyles = require("./useFunnelChartStyles.styles");
21
+ const _funnelGeometry = require("./funnelGeometry");
22
+ const FunnelChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
23
+ var _props_legendProps;
24
+ const _emptyChartId = (0, _reactutilities.useId)('_FunnelChart_empty');
25
+ const isRTL = (0, _index.useRtl)();
26
+ const [hoveredStage, setHoveredStage] = _react.useState(null);
27
+ const [calloutData, setCalloutData] = _react.useState(null);
28
+ const [selectedLegends, setSelectedLegends] = _react.useState([]);
29
+ const [clickPosition, setClickPosition] = _react.useState({
30
+ x: 0,
31
+ y: 0
32
+ });
33
+ const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
34
+ const chartContainerRef = _react.useRef(null);
35
+ const isStacked = isStackedFunnelData(props.data);
36
+ _react.useEffect(()=>{
37
+ var _props_legendProps;
38
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) {
39
+ setSelectedLegends(props.legendProps.selectedLegends);
40
+ }
41
+ }, [
42
+ (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends
43
+ ]);
44
+ function _handleHover(data, mouseEvent) {
45
+ mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.persist();
46
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
47
+ setCalloutData(data);
48
+ setPopoverOpen(true);
49
+ }
50
+ function _handleFocus(data, focusEvent) {
51
+ focusEvent === null || focusEvent === void 0 ? void 0 : focusEvent.persist();
52
+ let x = 0;
53
+ let y = 0;
54
+ const targetRect = focusEvent.target.getBoundingClientRect();
55
+ x = targetRect.left + targetRect.width / 2;
56
+ y = targetRect.top + targetRect.height / 2;
57
+ updatePosition(x, y);
58
+ setCalloutData(data);
59
+ setPopoverOpen(true);
60
+ }
61
+ function _handleStackedHover(stage, subValue, mouseEvent) {
62
+ mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.persist();
63
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
64
+ setCalloutData({
65
+ stage,
66
+ value: subValue.value,
67
+ color: subValue.color,
68
+ category: subValue.category
69
+ });
70
+ setPopoverOpen(true);
71
+ }
72
+ function _handleStackedFocus(stage, subValue, focusEvent) {
73
+ focusEvent === null || focusEvent === void 0 ? void 0 : focusEvent.persist();
74
+ let x = 0;
75
+ let y = 0;
76
+ const targetRect = focusEvent.target.getBoundingClientRect();
77
+ x = targetRect.left + targetRect.width / 2;
78
+ y = targetRect.top + targetRect.height / 2;
79
+ updatePosition(x, y);
80
+ setCalloutData({
81
+ stage,
82
+ value: subValue.value,
83
+ color: subValue.color,
84
+ category: subValue.category
85
+ });
86
+ setPopoverOpen(true);
87
+ }
88
+ function _handleMouseOut() {
89
+ setHoveredStage(null);
90
+ setPopoverOpen(false);
91
+ setCalloutData(null);
92
+ }
93
+ function _onLegendSelectionChange(legendsSelected, event, currentLegend) {
94
+ var _props_legendProps, _props_legendProps1;
95
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
96
+ setSelectedLegends(legendsSelected);
97
+ } else {
98
+ setSelectedLegends(legendsSelected.slice(-1));
99
+ }
100
+ if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
101
+ props.legendProps.onChange(legendsSelected, event, currentLegend);
102
+ }
103
+ }
104
+ const _onLegendSelectionChangeCallback = _react.useCallback(_onLegendSelectionChange, [
105
+ props.legendProps
106
+ ]);
107
+ function getHighlightedLegend() {
108
+ return selectedLegends.length > 0 ? selectedLegends : hoveredStage ? [
109
+ hoveredStage
110
+ ] : [];
111
+ }
112
+ function legendHighlighted(legend) {
113
+ return getHighlightedLegend().includes(legend);
114
+ }
115
+ function noLegendHighlighted() {
116
+ return getHighlightedLegend().length === 0;
117
+ }
118
+ function _getEventHandlerProps(data, opacity) {
119
+ if ('subValue' in data) {
120
+ return {
121
+ culture: props.culture,
122
+ onMouseOver: opacity == 1 ? (event)=>_handleStackedHover(data.stage, data.subValue, event) : undefined,
123
+ onMouseMove: opacity == 1 ? (event)=>_handleStackedHover(data.stage, data.subValue, event) : undefined,
124
+ onFocus: (event)=>_handleStackedFocus(data.stage, data.subValue, event),
125
+ onBlur: ()=>_handleMouseOut(),
126
+ onMouseOut: ()=>_handleMouseOut()
127
+ };
128
+ } else {
129
+ return {
130
+ culture: props.culture,
131
+ onMouseOver: opacity == 1 ? (event)=>_handleHover(data, event) : undefined,
132
+ onMouseMove: opacity == 1 ? (event)=>_handleHover(data, event) : undefined,
133
+ onFocus: (event)=>_handleFocus(data, event),
134
+ onBlur: ()=>_handleMouseOut(),
135
+ onMouseOut: ()=>_handleMouseOut()
136
+ };
137
+ }
138
+ }
139
+ function _renderSegmentText({ show, x, y, value, textColor }) {
140
+ if (!show) {
141
+ return null;
142
+ }
143
+ const textElement = /*#__PURE__*/ _react.createElement("text", {
144
+ x: isRTL ? funnelWidth - x : x,
145
+ y: y,
146
+ textAnchor: "middle",
147
+ alignmentBaseline: "middle",
148
+ fill: textColor
149
+ }, (0, _chartutilities.formatToLocaleString)(value.toString(), props.culture));
150
+ if (isRTL) {
151
+ return /*#__PURE__*/ _react.createElement("g", {
152
+ transform: `scale(-1,1) translate(${-funnelWidth},0)`
153
+ }, textElement);
154
+ }
155
+ return textElement;
156
+ }
157
+ function _renderFunnelSegment({ key, pathD, fill, opacity, textProps, data, tabIndex }) {
158
+ const eventHandlers = _getEventHandlerProps(data, opacity);
159
+ const textColor = (0, _colors.getContrastTextColor)(fill);
160
+ return /*#__PURE__*/ _react.createElement("g", {
161
+ key: key
162
+ }, /*#__PURE__*/ _react.createElement("path", {
163
+ d: pathD,
164
+ fill: fill,
165
+ opacity: opacity,
166
+ ...eventHandlers,
167
+ tabIndex: tabIndex
168
+ }), textProps && /*#__PURE__*/ _react.createElement("g", eventHandlers, _renderSegmentText({
169
+ ...textProps,
170
+ textColor
171
+ })));
172
+ }
173
+ function _createFunnel(containerHeight, containerWidth) {
174
+ const { data } = props;
175
+ const funnelWidth = containerWidth;
176
+ const funnelHeight = containerHeight * 0.8;
177
+ return data.map((d, i)=>{
178
+ const geometryProps = props.orientation === 'vertical' ? (0, _funnelGeometry.getVerticalFunnelSegmentGeometry)({
179
+ d,
180
+ i,
181
+ data,
182
+ funnelWidth,
183
+ funnelHeight,
184
+ isRTL
185
+ }) : (0, _funnelGeometry.getHorizontalFunnelSegmentGeometry)({
186
+ d,
187
+ i,
188
+ data,
189
+ funnelWidth,
190
+ funnelHeight,
191
+ isRTL
192
+ });
193
+ const { pathD, textX, textY, availableWidth } = geometryProps;
194
+ const minTextWidth = 16;
195
+ const eventHandlerProps = _getEventHandlerProps(d);
196
+ const textProps = (0, _funnelGeometry.getSegmentTextProps)({
197
+ availableWidth,
198
+ minTextWidth,
199
+ textX,
200
+ textY,
201
+ value: d.value,
202
+ ...eventHandlerProps
203
+ });
204
+ return _renderFunnelSegment({
205
+ key: i,
206
+ pathD,
207
+ fill: d.color,
208
+ opacity: legendHighlighted(d.stage) || noLegendHighlighted() ? 1 : 0.1,
209
+ textProps,
210
+ data: d,
211
+ tabIndex: legendHighlighted(d.stage) || noLegendHighlighted() ? 0 : undefined
212
+ });
213
+ });
214
+ }
215
+ function isStackedFunnelData(data) {
216
+ return Array.isArray(data) && data.every((stage)=>Array.isArray(stage.subValues));
217
+ }
218
+ function _renderStackedSegment(stage, subValue, stageIndex, subValueIndex, geometryParams) {
219
+ // Ensure stages have subValues for geometry functions
220
+ const stagesWithSubValues = geometryParams.stages.map((s)=>({
221
+ ...s,
222
+ subValues: s.subValues || []
223
+ }));
224
+ const geom = props.orientation === 'vertical' ? (0, _funnelGeometry.getStackedVerticalFunnelSegmentGeometry)({
225
+ ...geometryParams,
226
+ stages: stagesWithSubValues,
227
+ i: stageIndex,
228
+ k: subValueIndex
229
+ }) : (0, _funnelGeometry.getStackedHorizontalFunnelSegmentGeometry)({
230
+ ...geometryParams,
231
+ stages: stagesWithSubValues,
232
+ i: stageIndex,
233
+ k: subValueIndex
234
+ });
235
+ const minTextWidth = 16;
236
+ const eventHandlerProps = _getEventHandlerProps({
237
+ stage: stage.stage,
238
+ subValue
239
+ });
240
+ const textProps = (0, _funnelGeometry.getSegmentTextProps)({
241
+ availableWidth: geom.availableWidth,
242
+ minTextWidth,
243
+ textX: geom.textX,
244
+ textY: geom.textY,
245
+ value: subValue.value,
246
+ ...eventHandlerProps
247
+ });
248
+ return _renderFunnelSegment({
249
+ key: `${stageIndex}-${subValueIndex}`,
250
+ pathD: geom.pathD,
251
+ fill: subValue.color,
252
+ opacity: isStackedFunnelData(props.data) && legendHighlighted(subValue.category) || noLegendHighlighted() ? 1 : 0.1,
253
+ textProps,
254
+ data: {
255
+ stage: stage.stage,
256
+ subValue
257
+ },
258
+ tabIndex: legendHighlighted(subValue.category) || noLegendHighlighted() ? 0 : undefined
259
+ });
260
+ }
261
+ function _createStackedFunnel(containerHeight, containerWidth) {
262
+ const { data } = props;
263
+ const stages = data;
264
+ const totals = stages.map((s)=>{
265
+ var _s_subValues;
266
+ var _s_subValues_reduce;
267
+ return (_s_subValues_reduce = s === null || s === void 0 ? void 0 : (_s_subValues = s.subValues) === null || _s_subValues === void 0 ? void 0 : _s_subValues.reduce((sum, subValue)=>sum + subValue.value, 0)) !== null && _s_subValues_reduce !== void 0 ? _s_subValues_reduce : 0;
268
+ });
269
+ const maxTotal = Math.max(...totals);
270
+ const funnelWidth = containerWidth;
271
+ const funnelHeight = containerHeight * 0.8;
272
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
273
+ const paths = [];
274
+ const geometryParams = {
275
+ stages,
276
+ totals,
277
+ maxTotal,
278
+ funnelWidth,
279
+ funnelHeight,
280
+ isRTL
281
+ };
282
+ for(let i = 0; i < stages.length; i++){
283
+ const cur = stages[i];
284
+ var _cur_subValues;
285
+ for(let k = 0; k < ((_cur_subValues = cur.subValues) !== null && _cur_subValues !== void 0 ? _cur_subValues : []).length; k++){
286
+ var _cur_subValues1;
287
+ const v = (_cur_subValues1 = cur.subValues) === null || _cur_subValues1 === void 0 ? void 0 : _cur_subValues1[k];
288
+ if (!v) {
289
+ continue;
290
+ }
291
+ paths.push(_renderStackedSegment(cur, v, i, k, geometryParams));
292
+ }
293
+ }
294
+ return paths;
295
+ }
296
+ function _renderLegends() {
297
+ if (props.hideLegend) {
298
+ return /*#__PURE__*/ _react.createElement(_react.Fragment, null);
299
+ }
300
+ let legends;
301
+ if (isStacked) {
302
+ // Collect unique categories and their color
303
+ const categoryMap = {};
304
+ props.data.forEach((stage)=>{
305
+ (stage.subValues || []).forEach((sub)=>{
306
+ if (!(sub.category in categoryMap)) {
307
+ categoryMap[sub.category] = sub.color;
308
+ }
309
+ });
310
+ });
311
+ legends = Object.entries(categoryMap).map(([category, color])=>({
312
+ title: category,
313
+ color,
314
+ hoverAction: ()=>setHoveredStage(category),
315
+ onMouseOutAction: ()=>setHoveredStage(null)
316
+ }));
317
+ } else {
318
+ legends = props.data.map((d)=>({
319
+ title: d.stage,
320
+ color: d.color,
321
+ hoverAction: ()=>setHoveredStage(d.stage),
322
+ onMouseOutAction: ()=>setHoveredStage(null)
323
+ }));
324
+ }
325
+ return /*#__PURE__*/ _react.createElement("div", {
326
+ style: {
327
+ display: 'flex',
328
+ justifyContent: 'center'
329
+ }
330
+ }, /*#__PURE__*/ _react.createElement(_index1.Legends, {
331
+ legends: legends,
332
+ centerLegends: true,
333
+ onChange: _onLegendSelectionChangeCallback,
334
+ ...props.legendProps
335
+ }));
336
+ }
337
+ function _isChartEmpty() {
338
+ return !(props.data && props.data.length > 0);
339
+ }
340
+ function updatePosition(newX, newY) {
341
+ const threshold = 1; // Set a threshold for movement
342
+ const { x, y } = clickPosition;
343
+ // Calculate the distance moved
344
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
345
+ // Update the position only if the distance moved is greater than the threshold
346
+ if (distance > threshold) {
347
+ setClickPosition({
348
+ x: newX,
349
+ y: newY
350
+ });
351
+ setPopoverOpen(true);
352
+ }
353
+ }
354
+ const classes = (0, _useFunnelChartStylesstyles.useFunnelChartStyles)(props);
355
+ const calloutProps = {
356
+ ...props.calloutProps,
357
+ color: calloutData === null || calloutData === void 0 ? void 0 : calloutData.color,
358
+ hoverXValue: calloutData === null || calloutData === void 0 ? void 0 : calloutData.stage,
359
+ YValue: calloutData === null || calloutData === void 0 ? void 0 : calloutData.value
360
+ };
361
+ const width = props.width || 350;
362
+ const height = props.height || 500;
363
+ const funnelMarginTop = 40;
364
+ const funnelWidth = width * 0.8;
365
+ const funnelOffsetX = (width - funnelWidth) / 2;
366
+ const focusAttributes = (0, _reacttabster.useFocusableGroup)();
367
+ var _props_culture;
368
+ return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement("div", {
369
+ ref: chartContainerRef,
370
+ className: classes.root,
371
+ ...focusAttributes
372
+ }, /*#__PURE__*/ _react.createElement("svg", {
373
+ width: width,
374
+ height: height,
375
+ className: classes.chart,
376
+ role: 'img',
377
+ "aria-label": props.chartTitle
378
+ }, /*#__PURE__*/ _react.createElement("g", {
379
+ transform: isRTL ? `translate(${funnelOffsetX + funnelWidth}, ${funnelMarginTop}) scale(-1,1)` : `translate(${funnelOffsetX}, ${funnelMarginTop})`
380
+ }, isStacked ? _createStackedFunnel(height - funnelMarginTop, funnelWidth) : _createFunnel(height - funnelMarginTop, funnelWidth))), isPopoverOpen && /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
381
+ ...props.calloutProps,
382
+ XValue: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.hoverXValue,
383
+ yCalloutValue: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.YValue,
384
+ culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
385
+ clickPosition: clickPosition,
386
+ isPopoverOpen: isPopoverOpen,
387
+ color: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.color,
388
+ isCartesian: false
389
+ }), _renderLegends()) : /*#__PURE__*/ _react.createElement("div", {
390
+ id: _emptyChartId,
391
+ role: 'alert',
392
+ style: {
393
+ opacity: '0'
394
+ },
395
+ "aria-label": 'Graph has no data to display'
396
+ });
397
+ });
398
+ FunnelChart.displayName = 'FunnelChart';
399
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
400
+ FunnelChart.defaultProps = {
401
+ orientation: 'vertical'
402
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["FunnelChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from '@fluentui/react-utilities';\nimport { useRtl } from '../../utilities/index';\nimport { FunnelChartDataPoint, FunnelChartProps } from './FunnelChart.types';\nimport { Legend, Legends } from '../Legends/index';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { getContrastTextColor } from '../../utilities/colors';\nimport { useFunnelChartStyles } from './useFunnelChartStyles.styles';\nimport {\n getHorizontalFunnelSegmentGeometry,\n getVerticalFunnelSegmentGeometry,\n getSegmentTextProps,\n getStackedHorizontalFunnelSegmentGeometry,\n getStackedVerticalFunnelSegmentGeometry,\n} from './funnelGeometry';\nimport { ChartPopoverProps } from '../../index';\n\nexport const FunnelChart: React.FunctionComponent<FunnelChartProps> = React.forwardRef<\n HTMLDivElement,\n FunnelChartProps\n>((props, forwardedRef) => {\n const _emptyChartId: string = useId('_FunnelChart_empty');\n const isRTL = useRtl();\n\n const [hoveredStage, setHoveredStage] = React.useState<string | null>(null);\n const [calloutData, setCalloutData] = React.useState<FunnelChartDataPoint | null>(null);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const chartContainerRef = React.useRef<HTMLDivElement | null>(null);\n const isStacked = isStackedFunnelData(props.data);\n\n React.useEffect(() => {\n if (props.legendProps?.selectedLegends) {\n setSelectedLegends(props.legendProps.selectedLegends);\n }\n }, [props.legendProps?.selectedLegends]);\n\n function _handleHover(data: FunnelChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent?.persist();\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setCalloutData(data);\n setPopoverOpen(true);\n }\n\n function _handleFocus(data: FunnelChartDataPoint, focusEvent: React.FocusEvent<SVGPathElement>) {\n focusEvent?.persist();\n let x = 0;\n let y = 0;\n const targetRect = (focusEvent.target as SVGPathElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n\n updatePosition(x, y);\n setCalloutData(data);\n setPopoverOpen(true);\n }\n\n function _handleStackedHover(\n stage: string,\n subValue: { category: string; value: number; color: string },\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as FunnelChartDataPoint);\n setPopoverOpen(true);\n }\n\n function _handleStackedFocus(\n stage: string,\n subValue: { category: string; value: number; color: string },\n focusEvent: React.FocusEvent<SVGPathElement>,\n ) {\n focusEvent?.persist();\n let x = 0;\n let y = 0;\n const targetRect = (focusEvent.target as SVGPathElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n\n updatePosition(x, y);\n setCalloutData({\n stage,\n value: subValue.value,\n color: subValue.color,\n category: subValue.category,\n } as FunnelChartDataPoint);\n setPopoverOpen(true);\n }\n\n function _handleMouseOut() {\n setHoveredStage(null);\n setPopoverOpen(false);\n setCalloutData(null);\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _onLegendSelectionChangeCallback = React.useCallback(_onLegendSelectionChange, [props.legendProps]);\n\n function getHighlightedLegend(): string[] {\n return selectedLegends.length > 0 ? selectedLegends : hoveredStage ? [hoveredStage] : [];\n }\n\n function legendHighlighted(legend: string): boolean {\n return getHighlightedLegend().includes(legend);\n }\n\n function noLegendHighlighted(): boolean {\n return getHighlightedLegend().length === 0;\n }\n\n function _getEventHandlerProps(\n data: FunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } },\n opacity?: number,\n ) {\n if ('subValue' in data) {\n return {\n culture: props.culture,\n onMouseOver:\n opacity == 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onMouseMove:\n opacity == 1\n ? (event: React.MouseEvent<SVGElement>) => _handleStackedHover(data.stage, data.subValue, event)\n : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleStackedFocus(data.stage, data.subValue, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n } else {\n return {\n culture: props.culture,\n onMouseOver: opacity == 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onMouseMove: opacity == 1 ? (event: React.MouseEvent<SVGElement>) => _handleHover(data, event) : undefined,\n onFocus: (event: React.FocusEvent<SVGPathElement>) => _handleFocus(data, event),\n onBlur: () => _handleMouseOut(),\n onMouseOut: () => _handleMouseOut(),\n };\n }\n }\n\n function _renderSegmentText({\n show,\n x,\n y,\n value,\n textColor,\n }: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n textColor: string;\n }) {\n if (!show) {\n return null;\n }\n\n const textElement = (\n <text x={isRTL ? funnelWidth - x : x} y={y} textAnchor=\"middle\" alignmentBaseline=\"middle\" fill={textColor}>\n {formatToLocaleString(value.toString(), props.culture) as React.ReactNode}\n </text>\n );\n\n if (isRTL) {\n return <g transform={`scale(-1,1) translate(${-funnelWidth},0)`}>{textElement}</g>;\n }\n return textElement;\n }\n\n function _renderFunnelSegment({\n key,\n pathD,\n fill,\n opacity,\n textProps,\n data,\n tabIndex,\n }: {\n key: string | number;\n pathD: string;\n fill: string;\n opacity: number;\n textProps?: {\n show: boolean;\n x: number;\n y: number;\n value: number;\n };\n data: FunnelChartDataPoint | { stage: string; subValue: { category: string; value: number; color: string } };\n tabIndex?: number;\n }) {\n const eventHandlers = _getEventHandlerProps(data, opacity);\n const textColor = getContrastTextColor(fill);\n\n return (\n <g key={key}>\n <path d={pathD} fill={fill} opacity={opacity} {...eventHandlers} tabIndex={tabIndex} />\n {textProps && <g {...eventHandlers}>{_renderSegmentText({ ...textProps, textColor })}</g>}\n </g>\n );\n }\n\n function _createFunnel(\n containerHeight: number,\n containerWidth: number,\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element[] {\n const { data } = props;\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n return data.map((d, i) => {\n const geometryProps =\n props.orientation === 'vertical'\n ? getVerticalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL })\n : getHorizontalFunnelSegmentGeometry({ d, i, data, funnelWidth, funnelHeight, isRTL });\n\n const { pathD, textX, textY, availableWidth } = geometryProps;\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps(d);\n const textProps = getSegmentTextProps({\n availableWidth,\n minTextWidth,\n textX,\n textY,\n value: d.value!,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: i,\n pathD,\n fill: d.color!,\n opacity: legendHighlighted(d.stage as string) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: d,\n tabIndex: legendHighlighted(d.stage as string) || noLegendHighlighted() ? 0 : undefined,\n });\n });\n }\n\n function isStackedFunnelData(data: FunnelChartDataPoint[]): boolean {\n return Array.isArray(data) && data.every(stage => Array.isArray(stage.subValues));\n }\n\n function _renderStackedSegment(\n stage: FunnelChartDataPoint,\n subValue: { value: number; color: string; category: string },\n stageIndex: number,\n subValueIndex: number,\n geometryParams: {\n stages: FunnelChartDataPoint[];\n totals: number[];\n maxTotal: number;\n funnelWidth: number;\n funnelHeight: number;\n isRTL: boolean;\n },\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element {\n // Ensure stages have subValues for geometry functions\n const stagesWithSubValues = geometryParams.stages.map(s => ({\n ...s,\n subValues: s.subValues || [],\n }));\n const geom =\n props.orientation === 'vertical'\n ? getStackedVerticalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n })\n : getStackedHorizontalFunnelSegmentGeometry({\n ...geometryParams,\n stages: stagesWithSubValues,\n i: stageIndex,\n k: subValueIndex,\n });\n\n const minTextWidth = 16;\n const eventHandlerProps = _getEventHandlerProps({ stage: stage.stage as string, subValue });\n const textProps = getSegmentTextProps({\n availableWidth: geom.availableWidth,\n minTextWidth,\n textX: geom.textX,\n textY: geom.textY,\n value: subValue.value,\n ...eventHandlerProps,\n });\n\n return _renderFunnelSegment({\n key: `${stageIndex}-${subValueIndex}`,\n pathD: geom.pathD,\n fill: subValue.color,\n opacity:\n (isStackedFunnelData(props.data) && legendHighlighted(subValue.category)) || noLegendHighlighted() ? 1 : 0.1,\n textProps,\n data: { stage: stage.stage as string, subValue },\n tabIndex: legendHighlighted(subValue.category) || noLegendHighlighted() ? 0 : undefined,\n });\n }\n\n function _createStackedFunnel(\n containerHeight: number,\n containerWidth: number,\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element[] {\n const { data } = props;\n\n const stages = data;\n const totals = stages.map(s => s?.subValues?.reduce((sum, subValue) => sum + subValue.value, 0) ?? 0);\n const maxTotal = Math.max(...totals);\n\n const funnelWidth = containerWidth;\n const funnelHeight = containerHeight * 0.8;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const paths: JSX.Element[] = [];\n\n const geometryParams = {\n stages,\n totals,\n maxTotal,\n funnelWidth,\n funnelHeight,\n isRTL,\n };\n\n for (let i = 0; i < stages.length; i++) {\n const cur = stages[i];\n for (let k = 0; k < (cur.subValues ?? []).length; k++) {\n const v = cur.subValues?.[k];\n if (!v) {\n continue;\n }\n paths.push(_renderStackedSegment(cur, v, i, k, geometryParams));\n }\n }\n return paths;\n }\n\n function _renderLegends(): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element {\n if (props.hideLegend) {\n return <></>;\n }\n let legends: Legend[];\n\n if (isStacked) {\n // Collect unique categories and their color\n const categoryMap: Record<string, string> = {};\n props.data.forEach((stage: FunnelChartDataPoint) => {\n (stage.subValues || []).forEach(sub => {\n if (!(sub.category in categoryMap)) {\n categoryMap[sub.category] = sub.color;\n }\n });\n });\n legends = Object.entries(categoryMap).map(([category, color]) => ({\n title: category,\n color,\n hoverAction: () => setHoveredStage(category),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n } else {\n legends = props.data.map((d: FunnelChartDataPoint) => ({\n title: d.stage as string,\n color: d.color!,\n hoverAction: () => setHoveredStage(d.stage as string),\n onMouseOutAction: () => setHoveredStage(null),\n }));\n }\n\n return (\n <div style={{ display: 'flex', justifyContent: 'center' }}>\n <Legends\n legends={legends}\n centerLegends={true}\n onChange={_onLegendSelectionChangeCallback}\n {...props.legendProps}\n />\n </div>\n );\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n const classes = useFunnelChartStyles(props);\n\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n color: calloutData?.color,\n hoverXValue: calloutData?.stage,\n YValue: calloutData?.value,\n };\n\n const width = props.width || 350;\n const height = props.height || 500;\n\n const funnelMarginTop = 40;\n const funnelWidth = width * 0.8;\n const funnelOffsetX = (width - funnelWidth) / 2;\n const focusAttributes = useFocusableGroup();\n\n return !_isChartEmpty() ? (\n <div ref={chartContainerRef} className={classes.root} {...focusAttributes}>\n <svg width={width} height={height} className={classes.chart} role={'img'} aria-label={props.chartTitle}>\n <g\n transform={\n isRTL\n ? `translate(${funnelOffsetX + funnelWidth}, ${funnelMarginTop}) scale(-1,1)`\n : `translate(${funnelOffsetX}, ${funnelMarginTop})`\n }\n >\n {isStacked\n ? _createStackedFunnel(height - funnelMarginTop, funnelWidth)\n : _createFunnel(height - funnelMarginTop, funnelWidth)}\n </g>\n </svg>\n {isPopoverOpen && (\n <ChartPopover\n {...props.calloutProps}\n XValue={calloutProps?.hoverXValue as string}\n yCalloutValue={calloutProps?.YValue as string}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n color={calloutProps?.color}\n isCartesian={false}\n />\n )}\n {_renderLegends()}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nFunnelChart.displayName = 'FunnelChart';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nFunnelChart.defaultProps = {\n orientation: 'vertical',\n};\n"],"names":["React","useId","useRtl","Legends","useFocusableGroup","ChartPopover","formatToLocaleString","getContrastTextColor","useFunnelChartStyles","getHorizontalFunnelSegmentGeometry","getVerticalFunnelSegmentGeometry","getSegmentTextProps","getStackedHorizontalFunnelSegmentGeometry","getStackedVerticalFunnelSegmentGeometry","FunnelChart","forwardRef","props","forwardedRef","_emptyChartId","isRTL","hoveredStage","setHoveredStage","useState","calloutData","setCalloutData","selectedLegends","setSelectedLegends","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","chartContainerRef","useRef","isStacked","isStackedFunnelData","data","useEffect","legendProps","_handleHover","mouseEvent","persist","updatePosition","clientX","clientY","_handleFocus","focusEvent","targetRect","target","getBoundingClientRect","left","width","top","height","_handleStackedHover","stage","subValue","value","color","category","_handleStackedFocus","_handleMouseOut","_onLegendSelectionChange","legendsSelected","event","currentLegend","canSelectMultipleLegends","slice","onChange","_onLegendSelectionChangeCallback","useCallback","getHighlightedLegend","length","legendHighlighted","legend","includes","noLegendHighlighted","_getEventHandlerProps","opacity","culture","onMouseOver","undefined","onMouseMove","onFocus","onBlur","onMouseOut","_renderSegmentText","show","textColor","textElement","text","funnelWidth","textAnchor","alignmentBaseline","fill","toString","g","transform","_renderFunnelSegment","key","pathD","textProps","tabIndex","eventHandlers","path","d","_createFunnel","containerHeight","containerWidth","funnelHeight","map","i","geometryProps","orientation","textX","textY","availableWidth","minTextWidth","eventHandlerProps","Array","isArray","every","subValues","_renderStackedSegment","stageIndex","subValueIndex","geometryParams","stagesWithSubValues","stages","s","geom","k","_createStackedFunnel","totals","reduce","sum","maxTotal","Math","max","paths","cur","v","push","_renderLegends","hideLegend","legends","categoryMap","forEach","sub","Object","entries","title","hoverAction","onMouseOutAction","div","style","display","justifyContent","centerLegends","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","classes","calloutProps","hoverXValue","YValue","funnelMarginTop","funnelOffsetX","focusAttributes","ref","className","root","svg","chart","role","aria-label","chartTitle","XValue","yCalloutValue","isCartesian","id","displayName","defaultProps"],"mappings":";;;;+BAmBac;;;;;;;iEAnBU,QAAQ;gCACT,4BAA4B;uBAC3B,wBAAwB;wBAEf,mBAAmB;8BACjB,0BAA0B;8BAC/B,mCAAmC;gCAC3B,4BAA4B;wBAC5B,yBAAyB;4CACzB,gCAAgC;gCAO9D,mBAAmB;AAGnB,oBAAMA,WAAAA,GAAyDd,OAAMe,UAAU,CAGpF,CAACC,OAAOC;QAgBJD;IAfJ,MAAME,oBAAwBjB,qBAAAA,EAAM;IACpC,MAAMkB,YAAQjB,aAAAA;IAEd,MAAM,CAACkB,cAAcC,gBAAgB,GAAGrB,OAAMsB,QAAQ,CAAgB;IACtE,MAAM,CAACC,aAAaC,eAAe,GAAGxB,OAAMsB,QAAQ,CAA8B;IAClF,MAAM,CAACG,iBAAiBC,mBAAmB,GAAG1B,OAAMsB,QAAQ,CAAW,EAAE;IACzE,MAAM,CAACK,eAAeC,iBAAiB,GAAG5B,OAAMsB,QAAQ,CAAC;QAAEO,GAAG;QAAGC,GAAG;IAAE;IACtE,MAAM,CAACC,eAAeC,eAAe,GAAGhC,OAAMsB,QAAQ,CAAC;IACvD,MAAMW,oBAAoBjC,OAAMkC,MAAM,CAAwB;IAC9D,MAAMC,YAAYC,oB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MAAM;QAASvB,OAAO;YAAE7E,SAAS;QAAI;QAAGqG,cAAY;;AAEhF,GAAG;AACHtK,YAAY4K,WAAW,GAAG;AAC1B,4DAA4D;AAC5D5K,YAAY6K,YAAY,GAAG;IACzBzE,aAAa;AACf"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["FunnelChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Data point for funnel chart\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartDataPoint {\n /**\n * Stage name or identifier\n */\n stage: string | number;\n /**\n * Sub-values for stacked funnel charts\n * Each sub-value represents a category within the stage\n */\n subValues?: Array<{ category: string; value: number; color: string }>;\n /**\n * Value for the stage (used for non-stacked funnel charts)\n */\n value?: number;\n /**\n * Color for the stage (used for non-stacked funnel charts)\n */\n color?: string;\n}\n\n/**\n * Funnel Chart component props\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartProps {\n /**\n * Data points for the funnel chart\n */\n data: FunnelChartDataPoint[];\n /**\n * Title for the chart\n */\n chartTitle?: string;\n /**\n * Width of the chart\n */\n width?: number;\n\n /**\n * Height of the chart\n */\n height?: number;\n\n /**\n * Decides whether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * Props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: FunnelChartStyles;\n\n /**\n * Defines the culture to localize the numbers and dates\n */\n culture?: string;\n\n /**\n * Reference to the chart component\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef?: React.RefObject<any>;\n\n /**\n * Additional CSS class(es) to apply to the chart\n */\n className?: string;\n\n /**\n * Orientation of the funnel chart\n * @defaultvalue 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n}\n\n/**\n * Funnel Chart style properties\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartStyleProps {\n /**\n * Additional CSS class(es) to apply to the chart\n */\n className?: string;\n /**\n * Width of the chart\n */\n chartWidth: number;\n /**\n * Height of the chart\n */\n chartHeight: number;\n}\n\n/**\n * Funnel Chart styles\n * {@docCategory FunnelChart}\n */\nexport interface FunnelChartStyles {\n /**\n * Styles for the root element\n */\n root?: string;\n\n /**\n * Styles for the chart\n */\n chart?: string;\n\n /**\n * Styles for text elements\n */\n text?: string;\n\n /**\n * Styles for the callout root element\n */\n calloutContentRoot?: string;\n}\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}