@fluentui/react-charts 9.1.8 → 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 +34 -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,541 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "GanttChart", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return GanttChart;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _d3array = require("d3-array");
14
+ const _reactutilities = require("@fluentui/react-utilities");
15
+ const _index = require("../Legends/index");
16
+ const _index1 = require("../CommonComponents/index");
17
+ const _ChartPopover = require("../CommonComponents/ChartPopover");
18
+ const _index2 = require("../../utilities/index");
19
+ const _chartutilities = require("@fluentui/chart-utilities");
20
+ const DEFAULT_BAR_HEIGHT = 24;
21
+ const MIN_BAR_HEIGHT = 1;
22
+ const GanttChart = /*#__PURE__*/ _react.forwardRef(({ useUTC = true, yAxisCategoryOrder = 'default', maxBarHeight = 24, ...props }, forwardedRef)=>{
23
+ var _props_legendProps;
24
+ const _barHeight = _react.useRef(DEFAULT_BAR_HEIGHT);
25
+ const _margins = _react.useRef({});
26
+ const _calloutAnchorPoint = _react.useRef(null);
27
+ const _emptyChartId = (0, _reactutilities.useId)('Gantt_empty');
28
+ const _legendId = (0, _reactutilities.useId)('gantt_legend');
29
+ const _legendMap = _react.useRef({});
30
+ const _prevProps = _react.useRef({});
31
+ const [calloutColor, setCalloutColor] = _react.useState('');
32
+ const [hoveredLegend, setHoveredLegend] = _react.useState('');
33
+ const [calloutLegend, setCalloutLegend] = _react.useState('');
34
+ const [xCalloutValue, setXCalloutValue] = _react.useState('');
35
+ const [yCalloutValue, setYCalloutValue] = _react.useState('');
36
+ const [selectedLegends, setSelectedLegends] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
37
+ const [calloutDataPoint, setCalloutDataPoint] = _react.useState();
38
+ const [clickPosition, setClickPosition] = _react.useState({
39
+ x: 0,
40
+ y: 0
41
+ });
42
+ const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
43
+ _react.useEffect(()=>{
44
+ var _prevProps_current_legendProps, _props_legendProps;
45
+ if (!(0, _index2.areArraysEqual)((_prevProps_current_legendProps = _prevProps.current.legendProps) === null || _prevProps_current_legendProps === void 0 ? void 0 : _prevProps_current_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
46
+ var _props_legendProps1;
47
+ setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
48
+ }
49
+ _prevProps.current = props;
50
+ }, [
51
+ props
52
+ ]);
53
+ const _points = _react.useMemo(()=>{
54
+ var _props_data;
55
+ _legendMap.current = {};
56
+ let colorIndex = 0;
57
+ var _props_data_map;
58
+ return (_props_data_map = (_props_data = props.data) === null || _props_data === void 0 ? void 0 : _props_data.map((point)=>{
59
+ const legend = `${point.legend}`;
60
+ if (!_legendMap.current[legend]) {
61
+ let startColor = point.color ? (0, _index2.getColorFromToken)(point.color) : (0, _index2.getNextColor)(colorIndex, 0);
62
+ let endColor = startColor;
63
+ if (props.enableGradient) {
64
+ var _point_gradient, _point_gradient1;
65
+ startColor = (_point_gradient = point.gradient) === null || _point_gradient === void 0 ? void 0 : _point_gradient[0];
66
+ endColor = (_point_gradient1 = point.gradient) === null || _point_gradient1 === void 0 ? void 0 : _point_gradient1[1];
67
+ }
68
+ _legendMap.current[legend] = {
69
+ id: `${_legendId}_${colorIndex}`,
70
+ startColor,
71
+ endColor
72
+ };
73
+ colorIndex += 1;
74
+ }
75
+ const { startColor, endColor } = _legendMap.current[legend];
76
+ return {
77
+ ...point,
78
+ color: startColor,
79
+ ...props.enableGradient ? {
80
+ gradient: [
81
+ startColor,
82
+ endColor
83
+ ]
84
+ } : {}
85
+ };
86
+ })) !== null && _props_data_map !== void 0 ? _props_data_map : [];
87
+ }, [
88
+ props.data,
89
+ props.enableGradient
90
+ ]);
91
+ const _xAxisType = _react.useMemo(()=>{
92
+ if (_points.length > 0) {
93
+ return (0, _index2.getTypeOfAxis)(_points[0].x.start, true);
94
+ }
95
+ return _index2.XAxisTypes.DateAxis;
96
+ }, [
97
+ _points
98
+ ]);
99
+ const _yAxisType = _react.useMemo(()=>{
100
+ if (_points.length > 0) {
101
+ return (0, _index2.getTypeOfAxis)(_points[0].y, false);
102
+ }
103
+ return _index2.YAxisType.StringAxis;
104
+ }, [
105
+ _points
106
+ ]);
107
+ const _yAxisPadding = _react.useMemo(()=>{
108
+ return (0, _index2.getScalePadding)(props.yAxisPadding, undefined, 1 / 2);
109
+ }, [
110
+ props.yAxisPadding
111
+ ]);
112
+ const _dateFormatOptions = _react.useMemo(()=>{
113
+ if (_xAxisType !== _index2.XAxisTypes.DateAxis) {
114
+ return undefined;
115
+ }
116
+ let lowestFormatLevel = 100;
117
+ let highestFormatLevel = -1;
118
+ _points.forEach((p)=>{
119
+ const startFormatLevel = (0, _index2.getDateFormatLevel)(p.x.start, useUTC);
120
+ const endFormatLevel = (0, _index2.getDateFormatLevel)(p.x.end, useUTC);
121
+ lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);
122
+ highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);
123
+ });
124
+ return (0, _chartutilities.getMultiLevelDateTimeFormatOptions)(lowestFormatLevel, highestFormatLevel);
125
+ }, [
126
+ useUTC,
127
+ _points,
128
+ _xAxisType
129
+ ]);
130
+ const _mapYValueToXValues = _react.useCallback(()=>{
131
+ const yValueToXValues = {};
132
+ _points.forEach((point)=>{
133
+ if (!yValueToXValues[point.y]) {
134
+ yValueToXValues[point.y] = [];
135
+ }
136
+ yValueToXValues[point.y].push(+point.x.end - +point.x.start);
137
+ });
138
+ return yValueToXValues;
139
+ }, [
140
+ _points
141
+ ]);
142
+ const _getOrderedYAxisLabels = _react.useCallback(()=>{
143
+ const yValueToXValues = _mapYValueToXValues();
144
+ if (_yAxisType !== _index2.YAxisType.StringAxis) {
145
+ return Object.keys(yValueToXValues).sort((a, b)=>+a - +b);
146
+ }
147
+ if (yAxisCategoryOrder === 'default') {
148
+ return Object.keys(yValueToXValues).reverse();
149
+ }
150
+ return (0, _index2.sortAxisCategories)(yValueToXValues, yAxisCategoryOrder);
151
+ }, [
152
+ _mapYValueToXValues,
153
+ _yAxisType,
154
+ yAxisCategoryOrder
155
+ ]);
156
+ const _yAxisLabels = _react.useMemo(()=>_getOrderedYAxisLabels(), [
157
+ _getOrderedYAxisLabels
158
+ ]);
159
+ const _getDomainNRangeValues = _react.useCallback((points, margins, containerWidth, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX)=>{
160
+ const xValues = [];
161
+ points.forEach((point)=>{
162
+ xValues.push(point.x.start, point.x.end);
163
+ });
164
+ const xMin = (0, _d3array.min)(xValues) || 0;
165
+ const xMax = (0, _d3array.max)(xValues) || 0;
166
+ return {
167
+ dStartValue: isRTL ? xMax : xMin,
168
+ dEndValue: isRTL ? xMin : xMax,
169
+ rStartValue: margins.left + (isRTL ? 0 : shiftX),
170
+ rEndValue: containerWidth - margins.right - (isRTL ? shiftX : 0)
171
+ };
172
+ }, []);
173
+ const _getMargins = _react.useCallback((margins)=>{
174
+ _margins.current = margins;
175
+ }, []);
176
+ const _getFormattedXValue = _react.useCallback((point)=>{
177
+ let formattedStartX;
178
+ let formattedEndX;
179
+ if (_xAxisType === _index2.XAxisTypes.DateAxis) {
180
+ formattedStartX = (0, _chartutilities.formatDateToLocaleString)(point.x.start, props.culture, useUTC, false, _dateFormatOptions);
181
+ formattedEndX = (0, _chartutilities.formatDateToLocaleString)(point.x.end, props.culture, useUTC, false, _dateFormatOptions);
182
+ } else {
183
+ formattedStartX = point.x.start.toString();
184
+ formattedEndX = point.x.end.toString();
185
+ }
186
+ return `${formattedStartX} - ${formattedEndX}`;
187
+ }, [
188
+ props.culture,
189
+ useUTC,
190
+ _dateFormatOptions,
191
+ _xAxisType
192
+ ]);
193
+ const _getCustomizedCallout = _react.useCallback(()=>{
194
+ const defaultRender = (point)=>{
195
+ return point ? /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
196
+ isPopoverOpen: isPopoverOpen,
197
+ clickPosition: clickPosition,
198
+ XValue: point.yAxisCalloutData || point.y.toString(),
199
+ legend: point.legend,
200
+ YValue: point.xAxisCalloutData || _getFormattedXValue(point),
201
+ color: point.color,
202
+ culture: props.culture
203
+ }) : null;
204
+ };
205
+ return props.onRenderCalloutPerDataPoint ? props.onRenderCalloutPerDataPoint(calloutDataPoint, defaultRender) : null;
206
+ //eslint-disable-next-line react-hooks/exhaustive-deps
207
+ }, [
208
+ _getFormattedXValue,
209
+ calloutDataPoint,
210
+ props.culture,
211
+ props.onRenderCalloutPerDataPoint
212
+ ]);
213
+ const _getAriaLabel = _react.useCallback((point)=>{
214
+ var _point_callOutAccessibilityData;
215
+ const xValue = point.xAxisCalloutData || _getFormattedXValue(point);
216
+ const yValue = point.yAxisCalloutData || point.y;
217
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${yValue}. ` + (point.legend ? `${point.legend}, ` : '') + `${xValue}.`;
218
+ }, [
219
+ _getFormattedXValue
220
+ ]);
221
+ const _getHighlightedLegend = _react.useCallback(()=>{
222
+ return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [
223
+ hoveredLegend
224
+ ] : [];
225
+ }, [
226
+ hoveredLegend,
227
+ selectedLegends
228
+ ]);
229
+ /**
230
+ * This function checks if the given legend is highlighted or not.
231
+ * A legend can be highlighted in 2 ways:
232
+ * 1. selection: if the user clicks on it
233
+ * 2. hovering: if there is no selected legend and the user hovers over it
234
+ */ const _legendHighlighted = _react.useCallback((legend)=>{
235
+ return _getHighlightedLegend().includes(`${legend}`);
236
+ }, [
237
+ _getHighlightedLegend
238
+ ]);
239
+ /**
240
+ * This function checks if none of the legends is selected or hovered.
241
+ */ const _noLegendHighlighted = _react.useCallback(()=>{
242
+ return _getHighlightedLegend().length === 0;
243
+ }, [
244
+ _getHighlightedLegend
245
+ ]);
246
+ const _showCallout = _react.useCallback((target, point)=>{
247
+ if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {
248
+ return;
249
+ }
250
+ if ('clientX' in target && 'clientY' in target) {
251
+ updatePosition(target.clientX, target.clientY);
252
+ } else {
253
+ const rect = target.target.getBoundingClientRect();
254
+ updatePosition(rect.left, rect.top);
255
+ }
256
+ _calloutAnchorPoint.current = point;
257
+ setPopoverOpen(true);
258
+ setCalloutLegend(point.legend);
259
+ setCalloutColor(point.color);
260
+ setXCalloutValue(point.yAxisCalloutData || point.y.toString());
261
+ setYCalloutValue(point.xAxisCalloutData || _getFormattedXValue(point));
262
+ setCalloutDataPoint(point);
263
+ }, [
264
+ _getFormattedXValue,
265
+ _legendHighlighted,
266
+ _noLegendHighlighted
267
+ ]);
268
+ const _onBarFocus = _react.useCallback((point, focusEvent)=>{
269
+ _showCallout(focusEvent, point);
270
+ }, [
271
+ _showCallout
272
+ ]);
273
+ const _onBarHover = _react.useCallback((point, mouseEvent)=>{
274
+ _showCallout(mouseEvent, point);
275
+ }, [
276
+ _showCallout
277
+ ]);
278
+ const _onBarLeave = _react.useCallback(()=>{
279
+ // do nothing
280
+ }, []);
281
+ const _handleChartMouseLeave = _react.useCallback(()=>{
282
+ _calloutAnchorPoint.current = null;
283
+ setPopoverOpen(false);
284
+ setCalloutLegend('');
285
+ setCalloutColor('');
286
+ setXCalloutValue('');
287
+ setYCalloutValue('');
288
+ setCalloutDataPoint(undefined);
289
+ }, []);
290
+ const _getBarHeight = _react.useCallback((adjustedValue)=>{
291
+ let barHeight;
292
+ if (typeof props.barHeight === 'number') {
293
+ barHeight = props.barHeight;
294
+ } else {
295
+ barHeight = adjustedValue;
296
+ }
297
+ if (typeof maxBarHeight === 'number') {
298
+ barHeight = Math.min(barHeight, maxBarHeight);
299
+ }
300
+ barHeight = Math.max(barHeight, MIN_BAR_HEIGHT);
301
+ return barHeight;
302
+ }, [
303
+ maxBarHeight,
304
+ props.barHeight
305
+ ]);
306
+ const _getOrderedDataPoints = _react.useCallback(()=>{
307
+ const result = [];
308
+ const yValueToPoints = {};
309
+ _points.forEach((point)=>{
310
+ if (!yValueToPoints[point.y]) {
311
+ yValueToPoints[point.y] = [];
312
+ }
313
+ yValueToPoints[point.y].push(point);
314
+ });
315
+ for(let i = _yAxisLabels.length - 1; i >= 0; i--){
316
+ const yValue = _yAxisLabels[i];
317
+ if (yValueToPoints[yValue]) {
318
+ result.push(...yValueToPoints[yValue].sort((a, b)=>+a.x.start - +b.x.start));
319
+ }
320
+ }
321
+ return result;
322
+ }, [
323
+ _points,
324
+ _yAxisLabels
325
+ ]);
326
+ const _createBars = _react.useCallback(({ xScale, yScalePrimary: yScale })=>{
327
+ const getGradientId = (legend)=>{
328
+ const legendId = _legendMap.current[`${legend}`].id;
329
+ return `${legendId}_gradient`;
330
+ };
331
+ const gradientDefs = [];
332
+ if (props.enableGradient) {
333
+ Object.keys(_legendMap.current).forEach((legend, index)=>{
334
+ const { startColor, endColor } = _legendMap.current[legend];
335
+ gradientDefs.push(/*#__PURE__*/ _react.createElement("linearGradient", {
336
+ key: index,
337
+ id: getGradientId(legend)
338
+ }, /*#__PURE__*/ _react.createElement("stop", {
339
+ offset: "0",
340
+ stopColor: startColor
341
+ }), /*#__PURE__*/ _react.createElement("stop", {
342
+ offset: "100%",
343
+ stopColor: endColor
344
+ })));
345
+ });
346
+ }
347
+ let scaleBandwidth = 0;
348
+ if (_yAxisType === _index2.YAxisType.StringAxis) {
349
+ scaleBandwidth = yScale.bandwidth();
350
+ _barHeight.current = _getBarHeight(scaleBandwidth);
351
+ }
352
+ const points = _getOrderedDataPoints();
353
+ const bars = points.map((point, index)=>{
354
+ const rectStartX = xScale(point.x.start);
355
+ const rectEndX = xScale(point.x.end);
356
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
357
+ const rectY = yScale(point.y) + (scaleBandwidth - _barHeight.current) / 2;
358
+ const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);
359
+ return /*#__PURE__*/ _react.createElement("rect", {
360
+ key: index,
361
+ x: Math.min(rectStartX, rectEndX),
362
+ y: rectY,
363
+ width: Math.abs(rectEndX - rectStartX),
364
+ height: _barHeight.current,
365
+ rx: props.roundCorners ? 3 : 0,
366
+ fill: props.enableGradient ? `url(#${getGradientId(point.legend)})` : point.color,
367
+ opacity: shouldHighlight ? 1 : 0.1,
368
+ onClick: point.onClick,
369
+ onMouseOver: (event)=>_onBarHover(point, event),
370
+ onMouseLeave: _onBarLeave,
371
+ onFocus: (event)=>_onBarFocus(point, event),
372
+ onBlur: _onBarLeave,
373
+ tabIndex: shouldHighlight ? 0 : -1,
374
+ role: "img",
375
+ "aria-label": _getAriaLabel(point)
376
+ });
377
+ });
378
+ return /*#__PURE__*/ _react.createElement("g", null, gradientDefs.length > 0 ? /*#__PURE__*/ _react.createElement("defs", null, gradientDefs) : null, bars);
379
+ }, [
380
+ _getAriaLabel,
381
+ _getBarHeight,
382
+ _getOrderedDataPoints,
383
+ _legendHighlighted,
384
+ _noLegendHighlighted,
385
+ _onBarFocus,
386
+ _onBarHover,
387
+ _onBarLeave,
388
+ _yAxisType,
389
+ props.enableGradient,
390
+ props.roundCorners
391
+ ]);
392
+ const _onLegendHover = _react.useCallback((legend)=>{
393
+ setHoveredLegend(legend);
394
+ }, []);
395
+ const _onLegendLeave = _react.useCallback(()=>{
396
+ setHoveredLegend('');
397
+ }, []);
398
+ const _onLegendSelectionChange = _react.useCallback((_selectedLegends, event, currentLegend)=>{
399
+ var _props_legendProps, _props_legendProps1;
400
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
401
+ setSelectedLegends(_selectedLegends);
402
+ } else {
403
+ setSelectedLegends(_selectedLegends.slice(-1));
404
+ }
405
+ if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
406
+ props.legendProps.onChange(_selectedLegends, event, currentLegend);
407
+ }
408
+ }, [
409
+ props.legendProps
410
+ ]);
411
+ const _getLegendData = _react.useCallback(()=>{
412
+ const actions = [];
413
+ Object.keys(_legendMap.current).forEach((legendTitle)=>{
414
+ const legend = {
415
+ title: legendTitle,
416
+ color: _legendMap.current[legendTitle].startColor,
417
+ hoverAction: ()=>{
418
+ _handleChartMouseLeave();
419
+ _onLegendHover(legendTitle);
420
+ },
421
+ onMouseOutAction: ()=>{
422
+ _onLegendLeave();
423
+ }
424
+ };
425
+ actions.push(legend);
426
+ });
427
+ const legends = /*#__PURE__*/ _react.createElement(_index.Legends, {
428
+ legends: actions,
429
+ enabledWrapLines: props.enabledLegendsWrapLines,
430
+ overflowText: props.legendsOverflowText,
431
+ onChange: _onLegendSelectionChange,
432
+ ...props.legendProps
433
+ });
434
+ return legends;
435
+ }, [
436
+ _handleChartMouseLeave,
437
+ _onLegendHover,
438
+ _onLegendLeave,
439
+ _onLegendSelectionChange,
440
+ props.enabledLegendsWrapLines,
441
+ props.legendProps,
442
+ props.legendsOverflowText
443
+ ]);
444
+ const _getChartTitle = _react.useCallback(()=>{
445
+ return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Gantt chart with ${_points.length} data points. `;
446
+ }, [
447
+ _points.length,
448
+ props.chartTitle
449
+ ]);
450
+ const _isChartEmpty = _react.useCallback(()=>{
451
+ return _points.length === 0;
452
+ }, [
453
+ _points.length
454
+ ]);
455
+ const _getYDomainMargins = _react.useCallback((containerHeight)=>{
456
+ let domainMargin = _index2.MIN_DOMAIN_MARGIN;
457
+ const ySet = new Set();
458
+ _points.forEach((point)=>{
459
+ ySet.add(point.y);
460
+ });
461
+ const uniqueY = Array.from(ySet);
462
+ /** Total height available to render the bars */ const totalHeight = containerHeight - (_margins.current.top + _index2.MIN_DOMAIN_MARGIN) - (_margins.current.bottom + _index2.MIN_DOMAIN_MARGIN);
463
+ if (_yAxisType !== _index2.YAxisType.StringAxis) {
464
+ _barHeight.current = _getBarHeight((0, _index2.calculateAppropriateBarWidth)(uniqueY, totalHeight, _yAxisPadding));
465
+ domainMargin += _barHeight.current / 2;
466
+ }
467
+ return {
468
+ ..._margins.current,
469
+ top: _margins.current.top + domainMargin,
470
+ bottom: _margins.current.bottom + domainMargin
471
+ };
472
+ }, [
473
+ _getBarHeight,
474
+ _points,
475
+ _yAxisPadding,
476
+ _yAxisType
477
+ ]);
478
+ function updatePosition(newX, newY) {
479
+ const threshold = 1; // Set a threshold for movement
480
+ const { x, y } = clickPosition;
481
+ // Calculate the distance moved
482
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
483
+ // Update the position only if the distance moved is greater than the threshold
484
+ if (distance > threshold) {
485
+ setClickPosition({
486
+ x: newX,
487
+ y: newY
488
+ });
489
+ setPopoverOpen(true);
490
+ }
491
+ }
492
+ if (!_isChartEmpty()) {
493
+ _barHeight.current = _getBarHeight(DEFAULT_BAR_HEIGHT);
494
+ const calloutProps = {
495
+ isPopoverOpen,
496
+ clickPosition,
497
+ color: calloutColor,
498
+ legend: calloutLegend,
499
+ XValue: xCalloutValue,
500
+ YValue: yCalloutValue,
501
+ ...props.calloutProps
502
+ };
503
+ const tickParams = {
504
+ tickValues: props.tickValues,
505
+ tickFormat: props.tickFormat
506
+ };
507
+ return /*#__PURE__*/ _react.createElement(_index1.CartesianChart, {
508
+ ...props,
509
+ yAxisPadding: _yAxisPadding,
510
+ chartTitle: _getChartTitle(),
511
+ points: _points,
512
+ chartType: _index2.ChartTypes.GanttChart,
513
+ xAxisType: _xAxisType,
514
+ yAxisType: _yAxisType,
515
+ stringDatasetForYAxisDomain: _yAxisLabels,
516
+ calloutProps: calloutProps,
517
+ tickParams: tickParams,
518
+ legendBars: _getLegendData(),
519
+ createYAxis: _index2.createYAxisForHorizontalBarChartWithAxis,
520
+ getDomainNRangeValues: _getDomainNRangeValues,
521
+ createStringYAxis: _index2.createStringYAxisForHorizontalBarChartWithAxis,
522
+ getMinMaxOfYAxis: _index2.findHBCWANumericMinMaxOfY,
523
+ customizedCallout: _getCustomizedCallout(),
524
+ getmargins: _getMargins,
525
+ getYDomainMargins: _getYDomainMargins,
526
+ onChartMouseLeave: _handleChartMouseLeave,
527
+ useUTC: useUTC,
528
+ children: _createBars
529
+ });
530
+ } else {
531
+ return /*#__PURE__*/ _react.createElement("div", {
532
+ id: _emptyChartId,
533
+ role: 'alert',
534
+ style: {
535
+ opacity: '0'
536
+ },
537
+ "aria-label": 'Graph has no data to display'
538
+ });
539
+ }
540
+ });
541
+ GanttChart.displayName = 'GanttChart';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GanttChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, ScaleBand, ScaleTime } from 'd3-scale';\nimport { useId } from '@fluentui/react-utilities';\nimport { Legend, Legends } from '../Legends/index';\nimport { Margins, GanttChartDataPoint } from '../../types/DataPoint';\nimport { CartesianChart, ModifiedCartesianChartProps } from '../CommonComponents/index';\nimport { GanttChartProps } from './GanttChart.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { ChartPopoverProps } from '../../index';\nimport {\n ChartTypes,\n YAxisType,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n createStringYAxisForHorizontalBarChartWithAxis,\n areArraysEqual,\n MIN_DOMAIN_MARGIN,\n sortAxisCategories,\n calculateAppropriateBarWidth,\n getColorFromToken,\n getScalePadding,\n getDateFormatLevel,\n} from '../../utilities/index';\nimport { formatDateToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';\n\ntype NumberScale = ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\ntype DateScale = ScaleTime<Date, number>;\n\nconst DEFAULT_BAR_HEIGHT = 24;\nconst MIN_BAR_HEIGHT = 1;\n\nexport const GanttChart: React.FunctionComponent<GanttChartProps> = React.forwardRef<HTMLDivElement, GanttChartProps>(\n ({ useUTC = true, yAxisCategoryOrder = 'default', maxBarHeight = 24, ...props }, forwardedRef) => {\n const _barHeight = React.useRef<number>(DEFAULT_BAR_HEIGHT);\n const _margins = React.useRef<Margins>({});\n const _calloutAnchorPoint = React.useRef<GanttChartDataPoint | null>(null);\n const _emptyChartId = useId('Gantt_empty');\n const _legendId = useId('gantt_legend');\n const _legendMap = React.useRef<Record<string, { id: string; startColor: string; endColor: string }>>({});\n const _prevProps = React.useRef<Partial<GanttChartProps>>({});\n\n const [calloutColor, setCalloutColor] = React.useState<string>('');\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [calloutDataPoint, setCalloutDataPoint] = React.useState<GanttChartDataPoint>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n if (!areArraysEqual(_prevProps.current.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n _prevProps.current = props;\n }, [props]);\n\n const _points = React.useMemo(() => {\n _legendMap.current = {};\n let colorIndex = 0;\n\n return (\n props.data?.map(point => {\n const legend = `${point.legend}`;\n if (!_legendMap.current[legend]) {\n let startColor = point.color ? getColorFromToken(point.color) : getNextColor(colorIndex, 0);\n let endColor = startColor;\n\n if (props.enableGradient) {\n startColor = point.gradient?.[0]!;\n endColor = point.gradient?.[1]!;\n }\n\n _legendMap.current[legend] = { id: `${_legendId}_${colorIndex}`, startColor, endColor };\n colorIndex += 1;\n }\n\n const { startColor, endColor } = _legendMap.current[legend];\n return {\n ...point,\n color: startColor,\n ...(props.enableGradient ? { gradient: [startColor, endColor] as [string, string] } : {}),\n };\n }) ?? []\n );\n }, [props.data, props.enableGradient]);\n\n const _xAxisType = React.useMemo(() => {\n if (_points.length > 0) {\n return getTypeOfAxis(_points[0].x.start, true) as XAxisTypes;\n }\n return XAxisTypes.DateAxis;\n }, [_points]);\n\n const _yAxisType = React.useMemo(() => {\n if (_points.length > 0) {\n return getTypeOfAxis(_points[0].y, false) as YAxisType;\n }\n return YAxisType.StringAxis;\n }, [_points]);\n\n const _yAxisPadding = React.useMemo(() => {\n return getScalePadding(props.yAxisPadding, undefined, 1 / 2);\n }, [props.yAxisPadding]);\n\n const _dateFormatOptions = React.useMemo(() => {\n if (_xAxisType !== XAxisTypes.DateAxis) {\n return undefined;\n }\n\n let lowestFormatLevel = 100;\n let highestFormatLevel = -1;\n _points.forEach(p => {\n const startFormatLevel = getDateFormatLevel(p.x.start as Date, useUTC as boolean);\n const endFormatLevel = getDateFormatLevel(p.x.end as Date, useUTC as boolean);\n lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);\n highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);\n });\n\n return getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);\n }, [useUTC, _points, _xAxisType]);\n\n const _mapYValueToXValues = React.useCallback(() => {\n const yValueToXValues: Record<string, number[]> = {};\n _points.forEach(point => {\n if (!yValueToXValues[point.y]) {\n yValueToXValues[point.y] = [];\n }\n yValueToXValues[point.y].push(+point.x.end - +point.x.start);\n });\n return yValueToXValues;\n }, [_points]);\n\n const _getOrderedYAxisLabels = React.useCallback(() => {\n const yValueToXValues = _mapYValueToXValues();\n\n if (_yAxisType !== YAxisType.StringAxis) {\n return Object.keys(yValueToXValues).sort((a, b) => +a - +b);\n }\n\n if (yAxisCategoryOrder === 'default') {\n return Object.keys(yValueToXValues).reverse();\n }\n return sortAxisCategories(yValueToXValues, yAxisCategoryOrder);\n }, [_mapYValueToXValues, _yAxisType, yAxisCategoryOrder]);\n\n const _yAxisLabels = React.useMemo(() => _getOrderedYAxisLabels(), [_getOrderedYAxisLabels]);\n\n const _getDomainNRangeValues = React.useCallback(\n (\n points: GanttChartDataPoint[],\n margins: Margins,\n containerWidth: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ): IDomainNRange => {\n const xValues: (Date | number)[] = [];\n points.forEach(point => {\n xValues.push(point.x.start, point.x.end);\n });\n\n const xMin = d3Min(xValues) || 0;\n const xMax = d3Max(xValues) || 0;\n\n return {\n dStartValue: isRTL ? xMax : xMin,\n dEndValue: isRTL ? xMin : xMax,\n rStartValue: margins.left! + (isRTL ? 0 : shiftX),\n rEndValue: containerWidth - margins.right! - (isRTL ? shiftX : 0),\n };\n },\n [],\n );\n\n const _getMargins = React.useCallback((margins: Margins) => {\n _margins.current = margins;\n }, []);\n\n const _getFormattedXValue = React.useCallback(\n (point: GanttChartDataPoint): string => {\n let formattedStartX: string;\n let formattedEndX: string;\n\n if (_xAxisType === XAxisTypes.DateAxis) {\n formattedStartX = formatDateToLocaleString(\n point.x.start as Date,\n props.culture,\n useUTC as boolean,\n false,\n _dateFormatOptions,\n );\n formattedEndX = formatDateToLocaleString(\n point.x.end as Date,\n props.culture,\n useUTC as boolean,\n false,\n _dateFormatOptions,\n );\n } else {\n formattedStartX = point.x.start.toString();\n formattedEndX = point.x.end.toString();\n }\n\n return `${formattedStartX} - ${formattedEndX}`;\n },\n [props.culture, useUTC, _dateFormatOptions, _xAxisType],\n );\n\n const _getCustomizedCallout = React.useCallback(() => {\n const defaultRender = (point?: GanttChartDataPoint): React.JSX.Element | null => {\n return point ? (\n <ChartPopover\n isPopoverOpen={isPopoverOpen}\n clickPosition={clickPosition}\n XValue={point.yAxisCalloutData || point.y.toString()}\n legend={point.legend}\n YValue={point.xAxisCalloutData || _getFormattedXValue(point)}\n color={point.color}\n culture={props.culture}\n />\n ) : null;\n };\n\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(calloutDataPoint, defaultRender)\n : null;\n //eslint-disable-next-line react-hooks/exhaustive-deps\n }, [_getFormattedXValue, calloutDataPoint, props.culture, props.onRenderCalloutPerDataPoint]);\n\n const _getAriaLabel = React.useCallback(\n (point: GanttChartDataPoint): string => {\n const xValue = point.xAxisCalloutData || _getFormattedXValue(point);\n const yValue = point.yAxisCalloutData || point.y;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${yValue}. ` + (point.legend ? `${point.legend}, ` : '') + `${xValue}.`\n );\n },\n [_getFormattedXValue],\n );\n\n const _getHighlightedLegend = React.useCallback(() => {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }, [hoveredLegend, selectedLegends]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = React.useCallback(\n (legend: string | undefined) => {\n return _getHighlightedLegend().includes(`${legend}`);\n },\n [_getHighlightedLegend],\n );\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = React.useCallback(() => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n const _showCallout = React.useCallback(\n (target: React.MouseEvent<SVGElement> | React.FocusEvent<SVGElement>, point: GanttChartDataPoint) => {\n if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {\n return;\n }\n if ('clientX' in target && 'clientY' in target) {\n updatePosition(target.clientX, target.clientY);\n } else {\n const rect = (target.target as SVGElement).getBoundingClientRect();\n updatePosition(rect.left, rect.top);\n }\n _calloutAnchorPoint.current = point;\n setPopoverOpen(true);\n setCalloutLegend(point.legend!);\n setCalloutColor(point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || _getFormattedXValue(point));\n setCalloutDataPoint(point);\n },\n [_getFormattedXValue, _legendHighlighted, _noLegendHighlighted],\n );\n\n const _onBarFocus = React.useCallback(\n (point: GanttChartDataPoint, focusEvent: React.FocusEvent<SVGElement>): void => {\n _showCallout(focusEvent, point);\n },\n [_showCallout],\n );\n\n const _onBarHover = React.useCallback(\n (point: GanttChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>): void => {\n _showCallout(mouseEvent, point);\n },\n [_showCallout],\n );\n\n const _onBarLeave = React.useCallback((): void => {\n // do nothing\n }, []);\n\n const _handleChartMouseLeave = React.useCallback((): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n setCalloutLegend('');\n setCalloutColor('');\n setXCalloutValue('');\n setYCalloutValue('');\n setCalloutDataPoint(undefined);\n }, []);\n\n const _getBarHeight = React.useCallback(\n (adjustedValue: number): number => {\n let barHeight: number;\n if (typeof props.barHeight === 'number') {\n barHeight = props.barHeight;\n } else {\n barHeight = adjustedValue;\n }\n if (typeof maxBarHeight === 'number') {\n barHeight = Math.min(barHeight, maxBarHeight);\n }\n barHeight = Math.max(barHeight, MIN_BAR_HEIGHT);\n return barHeight;\n },\n [maxBarHeight, props.barHeight],\n );\n\n const _getOrderedDataPoints = React.useCallback(() => {\n const result: GanttChartDataPoint[] = [];\n\n const yValueToPoints: Record<string, GanttChartDataPoint[]> = {};\n _points.forEach(point => {\n if (!yValueToPoints[point.y]) {\n yValueToPoints[point.y] = [];\n }\n yValueToPoints[point.y].push(point);\n });\n\n for (let i = _yAxisLabels.length - 1; i >= 0; i--) {\n const yValue = _yAxisLabels[i];\n if (yValueToPoints[yValue]) {\n result.push(...yValueToPoints[yValue].sort((a, b) => +a.x.start - +b.x.start));\n }\n }\n\n return result;\n }, [_points, _yAxisLabels]);\n\n const _createBars = React.useCallback(\n ({\n xScale,\n yScalePrimary: yScale,\n }: {\n xScale: DateScale | NumberScale;\n yScalePrimary: NumberScale | StringScale;\n }): React.JSX.Element => {\n const getGradientId = (legend: string | undefined) => {\n const legendId = _legendMap.current[`${legend}`].id;\n return `${legendId}_gradient`;\n };\n\n const gradientDefs: React.JSX.Element[] = [];\n if (props.enableGradient) {\n Object.keys(_legendMap.current).forEach((legend: string, index: number) => {\n const { startColor, endColor } = _legendMap.current[legend];\n gradientDefs.push(\n <linearGradient key={index} id={getGradientId(legend)}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>,\n );\n });\n }\n\n let scaleBandwidth = 0;\n if (_yAxisType === YAxisType.StringAxis) {\n scaleBandwidth = (yScale as StringScale).bandwidth();\n _barHeight.current = _getBarHeight(scaleBandwidth);\n }\n\n const points = _getOrderedDataPoints();\n const bars = points.map((point: GanttChartDataPoint, index: number) => {\n const rectStartX = xScale(point.x.start);\n const rectEndX = xScale(point.x.end);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const rectY = yScale(point.y as any)! + (scaleBandwidth - _barHeight.current) / 2;\n\n const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);\n\n return (\n <rect\n key={index}\n x={Math.min(rectStartX, rectEndX)}\n y={rectY}\n width={Math.abs(rectEndX - rectStartX)}\n height={_barHeight.current}\n rx={props.roundCorners ? 3 : 0}\n fill={props.enableGradient ? `url(#${getGradientId(point.legend)})` : point.color}\n opacity={shouldHighlight ? 1 : 0.1}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement>) => _onBarHover(point, event)}\n onMouseLeave={_onBarLeave}\n onFocus={(event: React.FocusEvent<SVGElement>) => _onBarFocus(point, event)}\n onBlur={_onBarLeave}\n tabIndex={shouldHighlight ? 0 : -1}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n />\n );\n });\n return (\n <g>\n {gradientDefs.length > 0 ? <defs>{gradientDefs}</defs> : null}\n {bars}\n </g>\n );\n },\n [\n _getAriaLabel,\n _getBarHeight,\n _getOrderedDataPoints,\n _legendHighlighted,\n _noLegendHighlighted,\n _onBarFocus,\n _onBarHover,\n _onBarLeave,\n _yAxisType,\n props.enableGradient,\n props.roundCorners,\n ],\n );\n\n const _onLegendHover = React.useCallback((legend: string): void => {\n setHoveredLegend(legend);\n }, []);\n\n const _onLegendLeave = React.useCallback((): void => {\n setHoveredLegend('');\n }, []);\n\n const _onLegendSelectionChange = React.useCallback(\n (_selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n },\n [props.legendProps],\n );\n\n const _getLegendData = React.useCallback((): React.JSX.Element => {\n const actions: Legend[] = [];\n\n Object.keys(_legendMap.current).forEach((legendTitle: string) => {\n const legend: Legend = {\n title: legendTitle,\n color: _legendMap.current[legendTitle].startColor,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n return legends;\n }, [\n _handleChartMouseLeave,\n _onLegendHover,\n _onLegendLeave,\n _onLegendSelectionChange,\n props.enabledLegendsWrapLines,\n props.legendProps,\n props.legendsOverflowText,\n ]);\n\n const _getChartTitle = React.useCallback((): string => {\n return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Gantt chart with ${_points.length} data points. `;\n }, [_points.length, props.chartTitle]);\n\n const _isChartEmpty = React.useCallback((): boolean => {\n return _points.length === 0;\n }, [_points.length]);\n\n const _getYDomainMargins = React.useCallback(\n (containerHeight: number): Margins => {\n let domainMargin = MIN_DOMAIN_MARGIN;\n\n const ySet = new Set<string | number>();\n _points.forEach((point: GanttChartDataPoint) => {\n ySet.add(point.y);\n });\n const uniqueY = Array.from(ySet);\n\n /** Total height available to render the bars */\n const totalHeight =\n containerHeight -\n (_margins.current.top! + MIN_DOMAIN_MARGIN) -\n (_margins.current.bottom! + MIN_DOMAIN_MARGIN);\n\n if (_yAxisType !== YAxisType.StringAxis) {\n _barHeight.current = _getBarHeight(\n calculateAppropriateBarWidth(uniqueY as number[] | Date[], totalHeight, _yAxisPadding),\n );\n domainMargin += _barHeight.current / 2;\n }\n\n return {\n ..._margins.current,\n top: _margins.current.top! + domainMargin,\n bottom: _margins.current.bottom! + domainMargin,\n };\n },\n [_getBarHeight, _points, _yAxisPadding, _yAxisType],\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 if (!_isChartEmpty()) {\n _barHeight.current = _getBarHeight(DEFAULT_BAR_HEIGHT);\n\n const calloutProps: ChartPopoverProps = {\n isPopoverOpen,\n clickPosition,\n color: calloutColor,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue,\n ...props.calloutProps,\n };\n const tickParams: ModifiedCartesianChartProps['tickParams'] = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n return (\n <CartesianChart\n {...props}\n yAxisPadding={_yAxisPadding}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.GanttChart}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={_getLegendData()}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n customizedCallout={_getCustomizedCallout()}\n getmargins={_getMargins}\n getYDomainMargins={_getYDomainMargins}\n onChartMouseLeave={_handleChartMouseLeave}\n useUTC={useUTC}\n children={_createBars}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n },\n);\n\nGanttChart.displayName = 'GanttChart';\n"],"names":["React","max","d3Max","min","d3Min","useId","Legends","CartesianChart","ChartPopover","ChartTypes","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","findHBCWANumericMinMaxOfY","createYAxisForHorizontalBarChartWithAxis","createStringYAxisForHorizontalBarChartWithAxis","areArraysEqual","MIN_DOMAIN_MARGIN","sortAxisCategories","calculateAppropriateBarWidth","getColorFromToken","getScalePadding","getDateFormatLevel","formatDateToLocaleString","getMultiLevelDateTimeFormatOptions","DEFAULT_BAR_HEIGHT","MIN_BAR_HEIGHT","GanttChart","forwardRef","useUTC","yAxisCategoryOrder","maxBarHeight","props","forwardedRef","_barHeight","useRef","_margins","_calloutAnchorPoint","_emptyChartId","_legendId","_legendMap","_prevProps","calloutColor","setCalloutColor","useState","hoveredLegend","setHoveredLegend","calloutLegend","setCalloutLegend","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegends","setSelectedLegends","legendProps","calloutDataPoint","setCalloutDataPoint","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","useEffect","current","_points","useMemo","colorIndex","data","map","point","legend","startColor","color","endColor","enableGradient","gradient","id","_xAxisType","length","start","DateAxis","_yAxisType","StringAxis","_yAxisPadding","yAxisPadding","undefined","_dateFormatOptions","lowestFormatLevel","highestFormatLevel","forEach","p","startFormatLevel","endFormatLevel","end","Math","_mapYValueToXValues","useCallback","yValueToXValues","push","_getOrderedYAxisLabels","Object","keys","sort","a","b","reverse","_yAxisLabels","_getDomainNRangeValues","points","margins","containerWidth","chartType","isRTL","xAxisType","barWidth","tickValues","shiftX","xValues","xMin","xMax","dStartValue","dEndValue","rStartValue","left","rEndValue","right","_getMargins","_getFormattedXValue","formattedStartX","formattedEndX","culture","toString","_getCustomizedCallout","defaultRender","XValue","yAxisCalloutData","YValue","xAxisCalloutData","onRenderCalloutPerDataPoint","_getAriaLabel","xValue","yValue","callOutAccessibilityData","ariaLabel","_getHighlightedLegend","_legendHighlighted","includes","_noLegendHighlighted","_showCallout","target","updatePosition","clientX","clientY","rect","getBoundingClientRect","top","_onBarFocus","focusEvent","_onBarHover","mouseEvent","_onBarLeave","_handleChartMouseLeave","_getBarHeight","adjustedValue","barHeight","_getOrderedDataPoints","result","yValueToPoints","i","_createBars","xScale","yScalePrimary","yScale","getGradientId","legendId","gradientDefs","index","linearGradient","key","stop","offset","stopColor","scaleBandwidth","bandwidth","bars","rectStartX","rectEndX","rectY","shouldHighlight","width","abs","height","rx","roundCorners","fill","opacity","onClick","onMouseOver","event","onMouseLeave","onFocus","onBlur","tabIndex","role","aria-label","g","defs","_onLegendHover","_onLegendLeave","_onLegendSelectionChange","_selectedLegends","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","actions","legendTitle","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_getChartTitle","chartTitle","_isChartEmpty","_getYDomainMargins","containerHeight","domainMargin","ySet","Set","add","uniqueY","Array","from","totalHeight","bottom","newX","newY","threshold","distance","sqrt","pow","calloutProps","tickParams","tickFormat","yAxisType","stringDatasetForYAxisDomain","legendBars","createYAxis","getDomainNRangeValues","createStringYAxis","getMinMaxOfYAxis","customizedCallout","getmargins","getYDomainMargins","onChartMouseLeave","children","div","style","displayName"],"mappings":";;;;+BAqCa4B;;;;;;;iEArCU,QAAQ;yBACY,WAAW;gCAEhC,4BAA4B;uBAClB,mBAAmB;wBAES,4BAA4B;8BAE3D,mCAAmC;wBAmBzD,wBAAwB;gCAC8C,4BAA4B;AAMzG,MAAMF,qBAAqB;AAC3B,MAAMC,iBAAiB;AAEhB,mBAAMC,WAAAA,GAAuD5B,OAAM6B,UAAU,CAClF,CAAC,EAAEC,SAAS,IAAI,EAAEC,qBAAqB,SAAS,EAAEC,eAAe,EAAE,EAAE,GAAGC,OAAO,EAAEC;QAcRD;IAbvE,MAAME,aAAanC,OAAMoC,MAAM,CAASV;IACxC,MAAMW,WAAWrC,OAAMoC,MAAM,CAAU,CAAC;IACxC,MAAME,sBAAsBtC,OAAMoC,MAAM,CAA6B;IACrE,MAAMG,oBAAgBlC,qBAAAA,EAAM;IAC5B,MAAMmC,gBAAYnC,qBAAAA,EAAM;IACxB,MAAMoC,aAAazC,OAAMoC,MAAM,CAAuE,CAAC;IACvG,MAAMM,aAAa1C,OAAMoC,MAAM,CAA2B,CAAC;IAE3D,MAAM,CAACO,cAAcC,gBAAgB,GAAG5C,OAAM6C,QAAQ,CAAS;IAC/D,MAAM,CAACC,eAAeC,iBAAiB,GAAG/C,OAAM6C,QAAQ,CAAS;IACjE,MAAM,CAACG,eAAeC,iBAAiB,GAAGjD,OAAM6C,QAAQ,CAAS;IACjE,MAAM,CAACK,eAAeC,iBAAiB,GAAGnD,OAAM6C,QAAQ,CAAS;IACjE,MAAM,CAACO,eA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AU;QAC9B;QAEA,OAAA,WAAA,GACE,OAAA,aAAA,CAACpP,sBAAAA,EAAAA;YACE,GAAG0B,KAAK;YACTsD,cAAcD;YACdgJ,YAAYD;YACZtH,QAAQ5C;YACR+C,WAAWzG,kBAAAA,CAAWmB,UAAU;YAChCwF,WAAWpC;YACX4K,WAAWxK;YACXyK,6BAA6BhJ;YAC7B4I,cAAcA;YACdC,YAAYA;YACZI,YAAYpC;YACZqC,aAAahP,gDAAAA;YACbiP,uBAAuBlJ;YACvBmJ,mBAAmBjP,sDAAAA;YACnBkP,kBAAkBpP,iCAAAA;YAClBqP,mBAAmB5H;YACnB6H,YAAYnI;YACZoI,mBAAmB7B;YACnB8B,mBAAmBlG;YACnBtI,QAAQA;YACRyO,UAAU3F;;IAGhB,OAAO;QACL,OAAA,WAAA,GACE,OAAA,aAAA,CAAC4F,OAAAA;YAAIzL,IAAIxC;YAAeuK,MAAM;YAAS2D,OAAO;gBAAEnE,SAAS;YAAI;YAAGS,cAAY;;IAEhF;AACF,GACA;AAEFnL,WAAW8O,WAAW,GAAG"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gantt Chart styles
3
+ * {@docCategory GanttChart}
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GanttChart.types.ts"],"sourcesContent":["import { RenderFunction } from '../../utilities/index';\nimport { CartesianChartProps, CartesianChartStyleProps, CartesianChartStyles, GanttChartDataPoint } from '../../index';\n\n/**\n * Gantt Chart properties\n * {@docCategory GanttChart}\n */\nexport interface GanttChartProps extends CartesianChartProps {\n /**\n * An array of data points to be rendered in the chart.\n */\n data?: GanttChartDataPoint[];\n\n /**\n * Callback function to render a custom callout for each data point.\n */\n onRenderCalloutPerDataPoint?: RenderFunction<GanttChartDataPoint>;\n\n /**\n * Height of each bar, in pixels.\n */\n barHeight?: number;\n\n /**\n * Title of the chart.\n */\n chartTitle?: string;\n\n /**\n * Locale identifier string used to format numbers and dates according to the specified culture.\n * Example: 'en-US', 'fr-FR'.\n */\n culture?: string;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1].\n * @default 1/2\n */\n yAxisPadding?: number;\n\n /**\n * If true, truncates y-axis tick labels longer than `noOfCharsToTruncate` with ellipses\n * and displays them in a tooltip on hover.\n * @default false\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n * If true, renders full y-axis tick labels without truncation.\n * @default false\n */\n showYAxisLables?: boolean;\n\n /**\n * If true, enables gradient fills for the bars.\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * If true, applies rounded corners to the bars.\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Maximum height of each bar, in pixels.\n * @default 24\n */\n maxBarHeight?: number;\n}\n\n/**\n * Gantt Chart style properties\n * {@docCategory GanttChart}\n */\nexport interface GanttChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Gantt Chart styles\n * {@docCategory GanttChart}\n */\nexport interface GanttChartStyles extends CartesianChartStyles {}\n"],"names":[],"mappings":"AA+EA;;;CAGC,GACD,WAAiE"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./GanttChart"), exports);
7
+ _export_star._(require("./GanttChart.types"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GanttChart';\nexport * from './GanttChart.types';\n"],"names":[],"mappings":";;;;;uBAAc,eAAe;uBACf,qBAAqB"}