@fluentui/react-charts 0.0.0-nightly-20250728-0406.1 → 0.0.0-nightly-20250730-0406.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/CHANGELOG.md +34 -15
  2. package/dist/index.d.ts +198 -10
  3. package/lib/AreaChart.js.map +1 -1
  4. package/lib/CartesianChart.js.map +1 -1
  5. package/lib/DeclarativeChart.js.map +1 -1
  6. package/lib/DonutChart.js.map +1 -1
  7. package/lib/FunnelChart.js.map +1 -1
  8. package/lib/GanttChart.js +1 -0
  9. package/lib/GanttChart.js.map +1 -0
  10. package/lib/GaugeChart.js.map +1 -1
  11. package/lib/GroupedVerticalBarChart.js.map +1 -1
  12. package/lib/HeatMapChart.js.map +1 -1
  13. package/lib/HorizontalBarChart.js.map +1 -1
  14. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  15. package/lib/Legends.js.map +1 -1
  16. package/lib/LineChart.js.map +1 -1
  17. package/lib/Popover.js.map +1 -1
  18. package/lib/ResponsiveContainer.js.map +1 -1
  19. package/lib/SankeyChart.js.map +1 -1
  20. package/lib/ScatterChart.js.map +1 -1
  21. package/lib/Sparkline.js.map +1 -1
  22. package/lib/VerticalBarChart.js.map +1 -1
  23. package/lib/VerticalStackedBarChart.js.map +1 -1
  24. package/lib/components/AreaChart/AreaChart.js +3 -3
  25. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  26. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  27. package/lib/components/AreaChart/index.js.map +1 -1
  28. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  29. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
  30. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  31. package/lib/components/CommonComponents/CartesianChart.js +12 -8
  32. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  33. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  34. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  35. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  36. package/lib/components/CommonComponents/index.js.map +1 -1
  37. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
  38. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
  39. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  40. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
  41. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
  42. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  43. package/lib/components/DeclarativeChart/DeclarativeChart.js +6 -1
  44. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  45. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +44 -13
  46. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  47. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  48. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  49. package/lib/components/DeclarativeChart/index.js.map +1 -1
  50. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  51. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  52. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  53. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
  54. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
  55. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  56. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  57. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  58. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  59. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  60. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  61. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
  62. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
  63. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  64. package/lib/components/DonutChart/index.js.map +1 -1
  65. package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
  66. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
  67. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  68. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  69. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  70. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  71. package/lib/components/FunnelChart/index.js.map +1 -1
  72. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
  73. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
  74. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  75. package/lib/components/GanttChart/GanttChart.js +530 -0
  76. package/lib/components/GanttChart/GanttChart.js.map +1 -0
  77. package/lib/components/GanttChart/GanttChart.types.js +4 -0
  78. package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
  79. package/lib/components/GanttChart/index.js +2 -0
  80. package/lib/components/GanttChart/index.js.map +1 -0
  81. package/lib/components/GanttChart/useGanttChartStyles.styles.js +24 -0
  82. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
  83. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
  84. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  85. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  86. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  87. package/lib/components/GaugeChart/index.js.map +1 -1
  88. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
  89. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
  90. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  91. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +61 -56
  92. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  93. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  94. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  95. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  96. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
  97. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  98. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  99. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  100. package/lib/components/HeatMapChart/index.js.map +1 -1
  101. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
  102. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
  103. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  104. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  105. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  106. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +5 -3
  107. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  108. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  109. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
  110. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
  111. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  112. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  113. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  114. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  115. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
  116. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
  117. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  118. package/lib/components/Legends/Legends.js +7 -8
  119. package/lib/components/Legends/Legends.js.map +1 -1
  120. package/lib/components/Legends/Legends.types.js.map +1 -1
  121. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  122. package/lib/components/Legends/index.js.map +1 -1
  123. package/lib/components/Legends/shape.js +3 -3
  124. package/lib/components/Legends/shape.js.map +1 -1
  125. package/lib/components/Legends/useLegendsStyles.styles.js +33 -6
  126. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  127. package/lib/components/Legends/useLegendsStyles.styles.raw.js +125 -0
  128. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  129. package/lib/components/LineChart/LineChart.js +3 -3
  130. package/lib/components/LineChart/LineChart.js.map +1 -1
  131. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  132. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  133. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  134. package/lib/components/LineChart/eventAnnotation/Textbox.js +2 -1
  135. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  136. package/lib/components/LineChart/index.js.map +1 -1
  137. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  138. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
  139. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  140. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  141. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  142. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  143. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
  144. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
  145. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  146. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  147. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  148. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  149. package/lib/components/SankeyChart/index.js.map +1 -1
  150. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  151. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
  152. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  153. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  154. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  155. package/lib/components/ScatterChart/index.js.map +1 -1
  156. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  157. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
  158. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  159. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  160. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  161. package/lib/components/Sparkline/index.js.map +1 -1
  162. package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
  163. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
  164. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  165. package/lib/components/VerticalBarChart/VerticalBarChart.js +56 -29
  166. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  167. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  168. package/lib/components/VerticalBarChart/index.js.map +1 -1
  169. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  170. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
  171. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  172. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -10
  173. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  174. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  175. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  176. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  177. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
  178. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  179. package/lib/index.js +1 -0
  180. package/lib/index.js.map +1 -1
  181. package/lib/types/DataPoint.js +3 -1
  182. package/lib/types/DataPoint.js.map +1 -1
  183. package/lib/types/EventAnnotation.js.map +1 -1
  184. package/lib/types/LegendDataItem.js.map +1 -1
  185. package/lib/types/index.js.map +1 -1
  186. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  187. package/lib/utilities/KeyCodes.js.map +1 -1
  188. package/lib/utilities/SVGTooltipText.js +2 -0
  189. package/lib/utilities/SVGTooltipText.js.map +1 -1
  190. package/lib/utilities/async-utils.js.map +1 -1
  191. package/lib/utilities/colors.js.map +1 -1
  192. package/lib/utilities/getWindow.js.map +1 -1
  193. package/lib/utilities/index.js.map +1 -1
  194. package/lib/utilities/overflow-utils.js.map +1 -1
  195. package/lib/utilities/string.js.map +1 -1
  196. package/lib/utilities/test-data.js +236 -0
  197. package/lib/utilities/test-data.js.map +1 -1
  198. package/lib/utilities/utilities.js +95 -27
  199. package/lib/utilities/utilities.js.map +1 -1
  200. package/lib/utilities/vbc-utils.js +2 -2
  201. package/lib/utilities/vbc-utils.js.map +1 -1
  202. package/lib-commonjs/AreaChart.js.map +1 -1
  203. package/lib-commonjs/CartesianChart.js.map +1 -1
  204. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  205. package/lib-commonjs/DonutChart.js.map +1 -1
  206. package/lib-commonjs/FunnelChart.js.map +1 -1
  207. package/lib-commonjs/GanttChart.js +6 -0
  208. package/lib-commonjs/GanttChart.js.map +1 -0
  209. package/lib-commonjs/GaugeChart.js.map +1 -1
  210. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  211. package/lib-commonjs/HeatMapChart.js.map +1 -1
  212. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  213. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  214. package/lib-commonjs/Legends.js.map +1 -1
  215. package/lib-commonjs/LineChart.js.map +1 -1
  216. package/lib-commonjs/Popover.js.map +1 -1
  217. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  218. package/lib-commonjs/SankeyChart.js.map +1 -1
  219. package/lib-commonjs/ScatterChart.js.map +1 -1
  220. package/lib-commonjs/Sparkline.js.map +1 -1
  221. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  222. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  223. package/lib-commonjs/components/AreaChart/AreaChart.js +3 -3
  224. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  225. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  226. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  227. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
  228. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  229. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
  230. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  231. package/lib-commonjs/components/CommonComponents/CartesianChart.js +11 -7
  232. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  233. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  234. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  235. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  236. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  237. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
  238. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  239. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
  240. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  241. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
  242. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  243. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
  244. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  245. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +5 -0
  246. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  247. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +47 -13
  248. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  249. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  250. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  251. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  252. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  253. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  254. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  255. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
  256. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  257. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
  258. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  259. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  260. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  261. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  262. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  263. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  264. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
  265. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  266. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
  267. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  268. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  269. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
  270. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  271. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
  272. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  273. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  274. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  275. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  276. package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
  277. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
  278. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  279. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
  280. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  281. package/lib-commonjs/components/GanttChart/GanttChart.js +541 -0
  282. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
  283. package/lib-commonjs/components/GanttChart/GanttChart.types.js +7 -0
  284. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
  285. package/lib-commonjs/components/GanttChart/index.js +7 -0
  286. package/lib-commonjs/components/GanttChart/index.js.map +1 -0
  287. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +39 -0
  288. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
  289. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
  290. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  291. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  292. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  293. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  294. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
  295. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  296. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
  297. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  298. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +61 -56
  299. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  300. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  301. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  302. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
  303. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  304. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
  305. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  306. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  307. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  308. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  309. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
  310. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  311. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
  312. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  313. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  314. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  315. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
  316. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  317. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  318. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  319. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  320. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
  321. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  322. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  323. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  324. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  325. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
  326. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  327. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
  328. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  329. package/lib-commonjs/components/Legends/Legends.js +7 -8
  330. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  331. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  332. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  333. package/lib-commonjs/components/Legends/index.js.map +1 -1
  334. package/lib-commonjs/components/Legends/shape.js +2 -2
  335. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  336. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +46 -5
  337. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  338. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +141 -0
  339. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  340. package/lib-commonjs/components/LineChart/LineChart.js +3 -3
  341. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  342. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  343. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  344. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  345. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +2 -1
  346. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  347. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  348. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
  349. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  350. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
  351. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  352. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  353. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  354. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  355. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
  356. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  357. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
  358. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  359. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  360. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  361. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  362. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  363. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
  364. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  365. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
  366. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  367. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  368. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  369. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  370. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  371. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  372. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
  373. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  374. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  375. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  376. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  377. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
  378. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  379. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
  380. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  381. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +56 -29
  382. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  383. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  384. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  385. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
  386. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  387. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
  388. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  389. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -10
  390. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  391. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  392. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  393. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
  394. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  395. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
  396. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  397. package/lib-commonjs/index.js +1 -0
  398. package/lib-commonjs/index.js.map +1 -1
  399. package/lib-commonjs/types/DataPoint.js +3 -1
  400. package/lib-commonjs/types/DataPoint.js.map +1 -1
  401. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  402. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  403. package/lib-commonjs/types/index.js.map +1 -1
  404. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  405. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  406. package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
  407. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  408. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  409. package/lib-commonjs/utilities/colors.js.map +1 -1
  410. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  411. package/lib-commonjs/utilities/index.js.map +1 -1
  412. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  413. package/lib-commonjs/utilities/string.js.map +1 -1
  414. package/lib-commonjs/utilities/test-data.js +245 -0
  415. package/lib-commonjs/utilities/test-data.js.map +1 -1
  416. package/lib-commonjs/utilities/utilities.js +91 -22
  417. package/lib-commonjs/utilities/utilities.js.map +1 -1
  418. package/lib-commonjs/utilities/vbc-utils.js +2 -2
  419. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  420. package/package.json +14 -24
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ donutArcClassNames: function() {
13
+ return donutArcClassNames;
14
+ },
15
+ useArcStyles: function() {
16
+ return useArcStyles;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const _reacttheme = require("@fluentui/react-theme");
21
+ const donutArcClassNames = {
22
+ root: 'fui-donut-arc__root',
23
+ focusRing: 'fui-donut-arc__focusRing',
24
+ arcLabel: 'fui-donut-arc__arcLabel'
25
+ };
26
+ /**
27
+ * Base Styles
28
+ */ const useStyles = (0, _react.makeStyles)({
29
+ root: {
30
+ cursor: 'default',
31
+ outline: 'transparent',
32
+ stroke: _reacttheme.tokens.colorNeutralBackground1,
33
+ '& selectors': {
34
+ '::-moz-focus-inner': {
35
+ ..._react.shorthands.border('0')
36
+ }
37
+ }
38
+ },
39
+ focusRing: {
40
+ stroke: _reacttheme.tokens.colorStrokeFocus2,
41
+ strokeWidth: _reacttheme.tokens.strokeWidthThickest,
42
+ fill: 'transparent'
43
+ },
44
+ arcLabel: {
45
+ ..._reacttheme.typographyStyles.caption1Strong,
46
+ fill: _reacttheme.tokens.colorNeutralForeground1
47
+ }
48
+ });
49
+ const useArcStyles = (props)=>{
50
+ var _props_styles, _props_styles1, _props_styles2;
51
+ const { className } = props;
52
+ const baseStyles = useStyles();
53
+ return {
54
+ root: (0, _react.mergeClasses)(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
55
+ focusRing: (0, _react.mergeClasses)(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),
56
+ arcLabel: (0, _react.mergeClasses)(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)
57
+ };
58
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DonutChart/Arc/useArcStyles.styles.ts"],"sourcesContent":["import { ArcProps, ArcStyles } from './Arc.types';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const donutArcClassNames: SlotClassNames<ArcStyles> = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n cursor: 'default',\n outline: 'transparent',\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0'),\n },\n },\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent',\n },\n arcLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n },\n});\n\n/**\n * Apply styling to the Arc components\n */\nexport const useArcStyles = (props: ArcProps): ArcStyles => {\n const { className } = props;\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, props.styles?.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, props.styles?.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, props.styles?.arcLabel),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","cursor","outline","stroke","colorNeutralBackground1","border","colorStrokeFocus2","strokeWidth","strokeWidthThickest","fill","caption1Strong","colorNeutralForeground1","useArcStyles","props","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAQaK,kBAAAA;;;IAkCAgB,YAAAA;;;;uBAzCwC,iBAAiB;4BAC7B,wBAAwB;AAM1D,2BAAsD;IAC3Df,MAAM;IACNC,WAAW;IACXC,UAAU;AACZ,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYT,iBAAAA,EAAW;IAC3BM,MAAM;QACJI,QAAQ;QACRC,SAAS;QACTC,QAAQT,kBAAAA,CAAOU,uBAAuB;QACtC,eAAe;YACb,sBAAsB;gBACpB,GAAGX,iBAAAA,CAAWY,MAAM,CAAC,IAAI;YAC3B;QACF;IACF;IACAP,WAAW;QACTK,QAAQT,kBAAAA,CAAOY,iBAAiB;QAChCC,aAAab,kBAAAA,CAAOc,mBAAmB;QACvCC,MAAM;IACR;IACAV,UAAU;QACR,GAAGJ,4BAAAA,CAAiBe,cAAc;QAClCD,MAAMf,kBAAAA,CAAOiB,uBAAuB;IACtC;AACF;AAKO,qBAAqB,CAACE;QAK+CA,eACIA,gBACHA;IAN3E,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAaf;IAEnB,OAAO;QACLH,UAAML,mBAAAA,EAAaI,mBAAmBC,IAAI,EAAEkB,WAAWlB,IAAI,EAAEiB,WAAAA,CAAWD,gBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAchB,IAAI;QAC1FC,eAAWN,mBAAAA,EAAaI,mBAAmBE,SAAS,EAAEiB,WAAWjB,SAAS,EAAA,CAAEe,iBAAAA,MAAMG,MAAM,AAANA,MAAM,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcf,SAAS;QACnGC,cAAUP,mBAAAA,EAAaI,mBAAmBG,QAAQ,EAAEgB,WAAWhB,QAAQ,EAAA,CAAEc,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcd,QAAQ;IACjG;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DonutChart.tsx"],"sourcesContent":["/* eslint-disable react/jsx-no-bind */\nimport * as React from 'react';\nimport { Pie } from './Pie/index';\nimport { DonutChartProps } from './DonutChart.types';\nimport { useDonutChartStyles } from './useDonutChartStyles.styles';\nimport { ChartDataPoint } from '../../DonutChart';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { getColorFromToken, getNextColor } from '../../utilities/index';\nimport { Legend, Legends } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\n\nconst MIN_LEGEND_CONTAINER_HEIGHT = 40;\n\n// Create a DonutChart variant which uses these default styles and this styled subcomponent.\n/**\n * Donutchart component.\n * {@docCategory DonutChart}\n */\nexport const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwardRef<HTMLDivElement, DonutChartProps>(\n (props, forwardedRef) => {\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const _uniqText: string = useId('_Pie_');\n /* eslint-disable @typescript-eslint/no-explicit-any */\n let _calloutAnchorPoint: ChartDataPoint | null;\n let _emptyChartId: string | null;\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const prevSize = React.useRef<{ width?: number; height?: number }>({});\n\n const [value, setValue] = React.useState<string | undefined>('');\n const [legend, setLegend] = React.useState<string | undefined>('');\n const [_width, setWidth] = React.useState<number | undefined>(props.width || 200);\n const [_height, setHeight] = React.useState<number | undefined>(props.height || 200);\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [color, setColor] = React.useState<string | undefined>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [focusedArcId, setFocusedArcId] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<ChartDataPoint | undefined>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n _fitParentContainer();\n }, []);\n\n React.useEffect(() => {\n if (prevSize.current.height !== props.height || prevSize.current.width !== props.width) {\n _fitParentContainer();\n }\n prevSize.current.height = props.height;\n prevSize.current.width = props.width;\n }, [props.width, props.height]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\n\n function _elevateToMinimums(data: ChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: ChartDataPoint[] = [];\n data.forEach(item => {\n sumOfData += item.data!;\n });\n data.forEach(item => {\n elevatedData.push(\n minPercent * sumOfData > item.data! && item.data! > 0\n ? {\n ...item,\n data: minPercent * sumOfData,\n yAxisCalloutData:\n item.yAxisCalloutData === undefined ? item.data!.toLocaleString() : item.yAxisCalloutData,\n }\n : item,\n );\n });\n return elevatedData;\n }\n function _createLegends(chartData: ChartDataPoint[]): JSX.Element {\n const legendDataItems = chartData.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (selectedLegend === point.legend) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(point.legend!);\n }\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend!);\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n };\n return legend;\n });\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n />\n );\n return legends;\n }\n\n function _focusCallback(data: ChartDataPoint, id: string, e: React.FocusEvent<SVGPathElement>): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (e.target as SVGPathElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n updatePosition(cx, cy);\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setFocusedArcId(id);\n setDataPointCalloutProps(data);\n }\n\n function _hoverCallback(data: ChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n if (_calloutAnchorPoint !== data) {\n _calloutAnchorPoint = data;\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setDataPointCalloutProps(data);\n updatePosition(e.clientX, e.clientY);\n }\n }\n function _onBlur(): void {\n setFocusedArcId('');\n }\n\n function _hoverLeave(): void {\n /**/\n }\n\n function _handleChartMouseLeave() {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n function _valueInsideDonut(valueInsideDonut: string | number | undefined, data: ChartDataPoint[]) {\n const highlightedLegend = _getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegend !== '' || isPopoverOpen)) {\n let legendValue = valueInsideDonut;\n data!.map((point: ChartDataPoint, index: number) => {\n if (point.legend === highlightedLegend || (isPopoverOpen && point.legend === legend)) {\n legendValue = point.yAxisCalloutData ? point.yAxisCalloutData : point.data!;\n }\n return;\n });\n return legendValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n function _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, props.culture);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n * Note: This won't work in case of multiple legends selection.\n */\n function _getHighlightedLegend() {\n return selectedLegend || activeLegend;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.chartData &&\n props.data.chartData!.filter((d: ChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n function _addDefaultColors(donutChartDataPoint?: ChartDataPoint[]): ChartDataPoint[] {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let defaultColor: string;\n if (typeof item.color === 'undefined') {\n defaultColor = getNextColor(index, 0);\n } else {\n defaultColor = getColorFromToken(item.color);\n }\n return { ...item, defaultColor };\n })\n : [];\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 /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer.current && getComputedStyle(legendContainer.current);\n legendContainerHeight =\n ((legendContainer.current && legendContainer.current.getBoundingClientRect().height) ||\n MIN_LEGEND_CONTAINER_HEIGHT) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || _rootElem.current) {\n const container = props.parentRef ? props.parentRef : _rootElem.current!;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 200;\n const shouldResize =\n _width !== currentContainerWidth || _height !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setWidth(currentContainerWidth);\n setHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n const { data, hideLegend = false } = props;\n const points = _addDefaultColors(data?.chartData);\n\n const classes = useDonutChartStyles(props);\n\n const legendBars = _createLegends(points);\n const donutMarginHorizontal = props.hideLabels ? 0 : 80;\n const donutMarginVertical = props.hideLabels ? 0 : 40;\n const outerRadius = Math.min(_width! - donutMarginHorizontal, _height! - donutMarginVertical) / 2;\n const chartData = _elevateToMinimums(points.filter((d: ChartDataPoint) => d.data! >= 0));\n const valueInsideDonut = props.innerRadius !== 0 ? _valueInsideDonut(props.valueInsideDonut!, chartData!) : '';\n const focusAttributes = useFocusableGroup();\n return !_isChartEmpty() ? (\n <div\n className={classes.root}\n ref={(rootElem: HTMLDivElement | null) => (_rootElem.current = rootElem)}\n onMouseLeave={_handleChartMouseLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes}>\n <svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>\n <Pie\n width={_width!}\n height={_height!}\n outerRadius={outerRadius}\n innerRadius={props.innerRadius!}\n data={chartData!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n hoverLeaveCallback={_hoverLeave}\n uniqText={_uniqText}\n onBlurCallback={_onBlur}\n activeArc={_getHighlightedLegend()}\n focusedArcId={focusedArcId || ''}\n href={props.href!}\n valueInsideDonut={_toLocaleString(valueInsideDonut)}\n showLabelsInPercent={props.showLabelsInPercent}\n hideLabels={props.hideLabels}\n />\n </svg>\n </div>\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={!props.hideTooltip && isPopoverOpen}\n legend={legend!}\n YValue={value!}\n color={color}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!hideLegend && (\n <div ref={(e: HTMLDivElement) => (legendContainer.current = e)} className={classes.legendContainer}>\n {legendBars}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId!} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n\nDonutChart.displayName = 'DonutChart';\nDonutChart.defaultProps = {\n innerRadius: 0,\n hideLabels: true,\n};\n"],"names":["DonutChart","MIN_LEGEND_CONTAINER_HEIGHT","React","forwardRef","props","forwardedRef","_rootElem","useRef","_uniqText","useId","_calloutAnchorPoint","_emptyChartId","legendContainer","prevSize","value","setValue","useState","legend","setLegend","_width","setWidth","width","_height","setHeight","height","activeLegend","setActiveLegend","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegend","setSelectedLegend","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","useEffect","_fitParentContainer","current","useImperativeHandle","componentRef","chartContainer","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","undefined","toLocaleString","_createLegends","chartData","legendDataItems","map","point","index","title","action","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","createElement","Legends","centerLegends","overflowText","legendsOverflowText","legendProps","_focusCallback","id","e","cx","cy","targetRect","target","getBoundingClientRect","left","top","updatePosition","toString","xAxisCalloutData","_hoverCallback","clientX","clientY","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegend","_getHighlightedLegend","legendValue","_toLocaleString","localeString","formatToLocaleString","culture","_isChartEmpty","filter","d","length","_addDefaultColors","donutChartDataPoint","defaultColor","getNextColor","getColorFromToken","newX","newY","threshold","distance","Math","sqrt","pow","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","parseFloat","marginTop","marginBottom","parentRef","container","currentContainerWidth","currentContainerHeight","shouldResize","points","classes","useDonutChartStyles","legendBars","donutMarginHorizontal","hideLabels","donutMarginVertical","outerRadius","min","innerRadius","focusAttributes","useFocusableGroup","div","className","root","ref","rootElem","onMouseLeave","chartWrapper","svg","chart","aria-label","chartTitle","Pie","onFocusCallback","hoverOnCallback","hoverLeaveCallback","uniqText","onBlurCallback","activeArc","href","showLabelsInPercent","ChartPopover","hideTooltip","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerDataPoint","customCalloutProps","calloutPropsPerDataPoint","isCartesian","role","style","opacity","displayName","defaultProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC;;;;+BAoBvBA;;;eAAAA;;;;iEAnBU;uBACH;2CAEgB;gCAEC;wBACW;wBAChB;gCACV;8BACY;8BACL;AAE7B,MAAMC,8BAA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O;YAAEC,SAAS;QAAI;QAAGvB,cAAY;;AAEjF;AAGF5J,WAAWoL,WAAW,GAAG;AACzBpL,WAAWqL,YAAY,GAAG;IACxBrC,aAAa;IACbJ,YAAY;AACd"}
1
+ {"version":3,"sources":["../src/components/DonutChart/DonutChart.tsx"],"sourcesContent":["/* eslint-disable react/jsx-no-bind */\nimport * as React from 'react';\nimport { Pie } from './Pie/index';\nimport { DonutChartProps } from './DonutChart.types';\nimport { useDonutChartStyles } from './useDonutChartStyles.styles';\nimport { ChartDataPoint } from '../../DonutChart';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { getColorFromToken, getNextColor } from '../../utilities/index';\nimport { Legend, Legends } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\n\nconst MIN_LEGEND_CONTAINER_HEIGHT = 40;\n\n// Create a DonutChart variant which uses these default styles and this styled subcomponent.\n/**\n * Donutchart component.\n * {@docCategory DonutChart}\n */\nexport const DonutChart: React.FunctionComponent<DonutChartProps> = React.forwardRef<HTMLDivElement, DonutChartProps>(\n (props, forwardedRef) => {\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const _uniqText: string = useId('_Pie_');\n /* eslint-disable @typescript-eslint/no-explicit-any */\n let _calloutAnchorPoint: ChartDataPoint | null;\n let _emptyChartId: string | null;\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const prevSize = React.useRef<{ width?: number; height?: number }>({});\n\n const [value, setValue] = React.useState<string | undefined>('');\n const [legend, setLegend] = React.useState<string | undefined>('');\n const [_width, setWidth] = React.useState<number | undefined>(props.width || 200);\n const [_height, setHeight] = React.useState<number | undefined>(props.height || 200);\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [color, setColor] = React.useState<string | undefined>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [focusedArcId, setFocusedArcId] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<ChartDataPoint | undefined>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n _fitParentContainer();\n }, []);\n\n React.useEffect(() => {\n if (prevSize.current.height !== props.height || prevSize.current.width !== props.width) {\n _fitParentContainer();\n }\n prevSize.current.height = props.height;\n prevSize.current.width = props.width;\n }, [props.width, props.height]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\n\n function _elevateToMinimums(data: ChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: ChartDataPoint[] = [];\n data.forEach(item => {\n sumOfData += item.data!;\n });\n data.forEach(item => {\n elevatedData.push(\n minPercent * sumOfData > item.data! && item.data! > 0\n ? {\n ...item,\n data: minPercent * sumOfData,\n yAxisCalloutData:\n item.yAxisCalloutData === undefined ? item.data!.toLocaleString() : item.yAxisCalloutData,\n }\n : item,\n );\n });\n return elevatedData;\n }\n function _createLegends(chartData: ChartDataPoint[]): JSX.Element {\n const legendDataItems = chartData.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (selectedLegend === point.legend) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(point.legend!);\n }\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend!);\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n };\n return legend;\n });\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n />\n );\n return legends;\n }\n\n function _focusCallback(data: ChartDataPoint, id: string, e: React.FocusEvent<SVGPathElement>): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (e.target as SVGPathElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n updatePosition(cx, cy);\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setFocusedArcId(id);\n setDataPointCalloutProps(data);\n }\n\n function _hoverCallback(data: ChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n if (_calloutAnchorPoint !== data) {\n _calloutAnchorPoint = data;\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setValue(data.data!.toString());\n setLegend(data.legend);\n setColor(data.color!);\n setXCalloutValue(data.xAxisCalloutData!);\n setYCalloutValue(data.yAxisCalloutData!);\n setDataPointCalloutProps(data);\n updatePosition(e.clientX, e.clientY);\n }\n }\n function _onBlur(): void {\n setFocusedArcId('');\n }\n\n function _hoverLeave(): void {\n /**/\n }\n\n function _handleChartMouseLeave() {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n function _valueInsideDonut(valueInsideDonut: string | number | undefined, data: ChartDataPoint[]) {\n const highlightedLegend = _getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegend !== '' || isPopoverOpen)) {\n let legendValue = valueInsideDonut;\n data!.map((point: ChartDataPoint, index: number) => {\n if (point.legend === highlightedLegend || (isPopoverOpen && point.legend === legend)) {\n legendValue = point.yAxisCalloutData ? point.yAxisCalloutData : point.data!;\n }\n return;\n });\n return legendValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n function _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, props.culture);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n * Note: This won't work in case of multiple legends selection.\n */\n function _getHighlightedLegend() {\n return selectedLegend || activeLegend;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.chartData &&\n props.data.chartData!.filter((d: ChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n function _addDefaultColors(donutChartDataPoint?: ChartDataPoint[]): ChartDataPoint[] {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let defaultColor: string;\n if (typeof item.color === 'undefined') {\n defaultColor = getNextColor(index, 0);\n } else {\n defaultColor = getColorFromToken(item.color);\n }\n return { ...item, defaultColor };\n })\n : [];\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 /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer.current && getComputedStyle(legendContainer.current);\n legendContainerHeight =\n ((legendContainer.current && legendContainer.current.getBoundingClientRect().height) ||\n MIN_LEGEND_CONTAINER_HEIGHT) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || _rootElem.current) {\n const container = props.parentRef ? props.parentRef : _rootElem.current!;\n const currentContainerWidth = container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 200;\n const shouldResize =\n _width !== currentContainerWidth || _height !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setWidth(currentContainerWidth);\n setHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n const { data, hideLegend = false } = props;\n const points = _addDefaultColors(data?.chartData);\n\n const classes = useDonutChartStyles(props);\n\n const legendBars = _createLegends(points);\n const donutMarginHorizontal = props.hideLabels ? 0 : 80;\n const donutMarginVertical = props.hideLabels ? 0 : 40;\n const outerRadius = Math.min(_width! - donutMarginHorizontal, _height! - donutMarginVertical) / 2;\n const chartData = _elevateToMinimums(points.filter((d: ChartDataPoint) => d.data! >= 0));\n const valueInsideDonut = props.innerRadius !== 0 ? _valueInsideDonut(props.valueInsideDonut!, chartData!) : '';\n const focusAttributes = useFocusableGroup();\n return !_isChartEmpty() ? (\n <div\n className={classes.root}\n ref={(rootElem: HTMLDivElement | null) => (_rootElem.current = rootElem)}\n onMouseLeave={_handleChartMouseLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes}>\n <svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>\n <Pie\n width={_width!}\n height={_height!}\n outerRadius={outerRadius}\n innerRadius={props.innerRadius!}\n data={chartData!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n hoverLeaveCallback={_hoverLeave}\n uniqText={_uniqText}\n onBlurCallback={_onBlur}\n activeArc={_getHighlightedLegend()}\n focusedArcId={focusedArcId || ''}\n href={props.href!}\n valueInsideDonut={_toLocaleString(valueInsideDonut)}\n showLabelsInPercent={props.showLabelsInPercent}\n hideLabels={props.hideLabels}\n />\n </svg>\n </div>\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={!props.hideTooltip && isPopoverOpen}\n legend={legend!}\n YValue={value!}\n color={color}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!hideLegend && (\n <div ref={(e: HTMLDivElement) => (legendContainer.current = e)} className={classes.legendContainer}>\n {legendBars}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId!} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n\nDonutChart.displayName = 'DonutChart';\nDonutChart.defaultProps = {\n innerRadius: 0,\n hideLabels: true,\n};\n"],"names":["React","Pie","useDonutChartStyles","formatToLocaleString","getColorFromToken","getNextColor","Legends","useId","useFocusableGroup","ChartPopover","MIN_LEGEND_CONTAINER_HEIGHT","DonutChart","forwardRef","props","forwardedRef","_rootElem","useRef","_uniqText","_calloutAnchorPoint","_emptyChartId","legendContainer","prevSize","value","setValue","useState","legend","setLegend","_width","setWidth","width","_height","setHeight","height","activeLegend","setActiveLegend","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegend","setSelectedLegend","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","useEffect","_fitParentContainer","current","useImperativeHandle","componentRef","chartContainer","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","undefined","toLocaleString","_createLegends","chartData","legendDataItems","map","point","index","title","action","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","legendProps","_focusCallback","id","e","cx","cy","targetRect","target","getBoundingClientRect","left","top","updatePosition","toString","xAxisCalloutData","_hoverCallback","clientX","clientY","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegend","_getHighlightedLegend","legendValue","_toLocaleString","localeString","culture","_isChartEmpty","filter","d","length","_addDefaultColors","donutChartDataPoint","defaultColor","newX","newY","threshold","distance","Math","sqrt","pow","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","parseFloat","marginTop","marginBottom","parentRef","container","currentContainerWidth","currentContainerHeight","shouldResize","points","classes","legendBars","donutMarginHorizontal","hideLabels","donutMarginVertical","outerRadius","min","innerRadius","focusAttributes","div","className","root","ref","rootElem","onMouseLeave","chartWrapper","svg","chart","aria-label","chartTitle","onFocusCallback","hoverOnCallback","hoverLeaveCallback","uniqText","onBlurCallback","activeArc","href","showLabelsInPercent","hideTooltip","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerDataPoint","customCalloutProps","calloutPropsPerDataPoint","isCartesian","role","style","opacity","displayName","defaultProps"],"mappings":"AAAA,oCAAoC,GACpC,YAAYA;;;;+BAmBCW;;;;;;;iEAnBU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBACjB,wBAAwB;wBACxC,cAAc;gCACxB,4BAA4B;8BAChB,0BAA0B;8BAC/B,mCAAmC;AAEhE,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDX,OAAMY,UAAU,CAClF,CAACC,OAAOC;IACN,MAAMC,YAAYf,OAAMgB,MAAM,CAAwB;IACtD,MAAMC,gBAAoBV,qBAAAA,EAAM;IAChC,qDAAqD,GACrD,IAAIW;IACJ,IAAIC;IACJ,MAAMC,kBAAkBpB,OAAMgB,MAAM,CAAwB;IAC5D,MAAMK,WAAWrB,OAAMgB,MAAM,CAAsC,CAAC;IAEpE,MAAM,CAACM,OAAOC,SAAS,GAAGvB,OAAMwB,QAAQ,CAAqB;IAC7D,MAAM,CAACC,QAAQC,UAAU,GAAG1B,OAAMwB,QAAQ,CAAqB;IAC/D,MAAM,CAACG,QAAQC,SAAS,GAAG5B,OAAMwB,QAAQ,CAAqBX,MAAMgB,KAAK,IAAI;IAC7E,MAAM,CAACC,SAASC,UAAU,GAAG/B,OAAMwB,QAAQ,CAAqBX,MAAMmB,MAAM,IAAI;IAChF,MAAM,CAACC,cAAcC,gBAAgB,GAAGlC,OAAMwB,QAAQ,CAAS;IAC/D,MAAM,CAACW,OAAOC,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0J,WAAW,IAAIpH;QACrC1B,QAAQA;QACR+I,QAAQlJ;QACRa,OAAOA;QACPsI,mBAAmB;QACnBC,eAAe;YACbC,mBAAmB9J,MAAM+J,2BAA2B,GAChD/J,MAAM+J,2BAA2B,CAAC/H,yBAClCuB;YACJyG,oBAAoBhK,MAAMiK,wBAAwB,GAC9CjK,MAAMiK,wBAAwB,CAACjI,yBAC/BuB;QACN;QACA2G,aAAa;QAEd,CAAChD,cAAAA,WAAAA,GACA,OAAA,aAAA,CAACqB,OAAAA;QAAIG,KAAK,CAAC/D,IAAuBpE,gBAAgBmC,OAAO,GAAGiC;QAAI6D,WAAWV,QAAQvH,eAAe;OAC/FwH,eAAAA,WAAAA,GAKP,OAAA,aAAA,CAACQ,OAAAA;QAAI7D,IAAIpE;QAAgB6J,MAAM;QAASC,OAAO;YAAEC,SAAS;QAAI;QAAGrB,cAAY;;AAEjF,GACA;AAEFlJ,WAAWwK,WAAW,GAAG;AACzBxK,WAAWyK,YAAY,GAAG;IACxBlC,aAAa;IACbJ,YAAY;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DonutChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CartesianChartStyleProps } from '../CommonComponents/index';\nimport { ChartProps, ChartDataPoint, Chart } from './index';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Donut Chart properties.\n * {@docCategory DonutChart}\n */\nexport interface DonutChartProps {\n /**\n * Data to render in the chart.\n */\n data?: ChartProps;\n\n /**\n * inner radius for donut size\n */\n innerRadius?: number;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: DonutChartStyles;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => JSX.Element | undefined;\n\n /**\n * Define a custom callout props override\n */\n calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to show the arc labels in percentage format\n * @default false\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop to hide the arc labels\n * @default true\n */\n hideLabels?: boolean;\n\n /**\n * Below height used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n height?: number;\n\n /**\n * Below width used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n width?: number;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /** decides wether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * Do not show tooltips in chart\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Optional callback to access the Chart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<Chart>;\n}\n\n/**\n * Donut Chart style properties\n * {@docCategory DonutChart}\n */\nexport interface DonutChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Donut Chart styles\n * {@docCategory DonutChart}\n */\nexport interface DonutChartStyles {\n /**\n * Style for the root element.\n */\n root?: string;\n\n /**\n * Style for the chart.\n */\n chart?: string;\n /**\n * Style for the legend container.\n */\n legendContainer: string;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: string;\n}\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/components/DonutChart/DonutChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CartesianChartStyleProps } from '../CommonComponents/index';\nimport { ChartProps, ChartDataPoint, Chart } from './index';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Donut Chart properties.\n * {@docCategory DonutChart}\n */\nexport interface DonutChartProps {\n /**\n * Data to render in the chart.\n */\n data?: ChartProps;\n\n /**\n * inner radius for donut size\n */\n innerRadius?: number;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: DonutChartStyles;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => JSX.Element | undefined;\n\n /**\n * Define a custom callout props override\n */\n calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to show the arc labels in percentage format\n * @default false\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop to hide the arc labels\n * @default true\n */\n hideLabels?: boolean;\n\n /**\n * Below height used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n height?: number;\n\n /**\n * Below width used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n width?: number;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /** decides wether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * Do not show tooltips in chart\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Optional callback to access the Chart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<Chart>;\n}\n\n/**\n * Donut Chart style properties\n * {@docCategory DonutChart}\n */\nexport interface DonutChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Donut Chart styles\n * {@docCategory DonutChart}\n */\nexport interface DonutChartStyles {\n /**\n * Style for the root element.\n */\n root?: string;\n\n /**\n * Style for the chart.\n */\n chart?: string;\n /**\n * Style for the legend container.\n */\n legendContainer: string;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: string;\n}\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Pie.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/jsx-no-bind */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { PieProps } from './index';\nimport { Arc } from '../Arc/index';\nimport { ChartDataPoint } from '../index';\nimport { usePieStyles } from './usePieStyles.styles';\nimport { wrapTextInsideDonut } from '../../../utilities/index';\nconst TEXT_PADDING: number = 5;\n\n// Create a Pie within Donut Chart variant which uses these default styles and this styled subcomponent.\n/**\n * Pie component within Donut Chart.\n * {@docCategory PieDonutChart}\n */\nexport const Pie: React.FunctionComponent<PieProps> = React.forwardRef<HTMLDivElement, PieProps>(\n (props, forwardedRef) => {\n React.useEffect(() => {\n wrapTextInsideDonut(classes.insideDonutString, props.innerRadius! * 2 - TEXT_PADDING);\n }, []);\n\n let _totalValue: number;\n const classes = usePieStyles(props);\n const pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n\n function _focusCallback(data: ChartDataPoint, id: string, e: React.FocusEvent<SVGPathElement>): void {\n props.onFocusCallback!(data, id, e);\n }\n\n function _hoverCallback(data: ChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n props.hoverOnCallback!(data, e);\n }\n\n function _computeTotalValue() {\n let totalValue = 0;\n props.data.forEach((arc: ChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function arcGenerator(d: any, i: number, focusData: any, href?: string): JSX.Element {\n const color = d && d.data && d.data.color;\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={props.innerRadius}\n outerRadius={props.outerRadius}\n color={color!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n onBlurCallback={props.onBlurCallback}\n hoverLeaveCallback={props.hoverLeaveCallback}\n uniqText={props.uniqText}\n activeArc={props.activeArc}\n href={href}\n calloutId={props.calloutId}\n valueInsideDonut={props.valueInsideDonut}\n focusedArcId={props.focusedArcId}\n showLabelsInPercent={props.showLabelsInPercent}\n totalValue={_totalValue}\n hideLabels={props.hideLabels}\n />\n );\n }\n\n const { data } = props;\n const focusData = pieForFocusRing(data.map(d => d.data!));\n\n const piechart = d3Pie<ChartDataPoint>()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02)(data);\n const translate = `translate(${props.width / 2}, ${props.height / 2})`;\n\n _totalValue = _computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: any, i: number) => arcGenerator(d, i, focusData[i], props.href))}\n {props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classes.insideDonutString}>\n {props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n },\n);\nPie.displayName = 'Pie';\n"],"names":["Pie","TEXT_PADDING","React","forwardRef","props","forwardedRef","useEffect","wrapTextInsideDonut","classes","insideDonutString","innerRadius","_totalValue","usePieStyles","pieForFocusRing","d3Pie","sort","value","d","data","padAngle","_focusCallback","id","e","onFocusCallback","_hoverCallback","hoverOnCallback","_computeTotalValue","totalValue","forEach","arc","arcGenerator","i","focusData","href","color","createElement","Arc","key","outerRadius","onBlurCallback","hoverLeaveCallback","uniqText","activeArc","calloutId","valueInsideDonut","focusedArcId","showLabelsInPercent","hideLabels","map","piechart","translate","width","height","g","transform","text","y","textAnchor","dominantBaseline","className","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,8CAA8C,GAC9C,oCAAoC,GACpC,qDAAqD;;;;+BAexCA;;;eAAAA;;;;iEAdU;yBACM;uBAET;oCAES;wBACO;AACpC,MAAMC,eAAuB;AAOtB,MAAMD,MAAAA,WAAAA,GAAyCE,OAAMC,UAAU,CACpE,CAACC,OAAOC;IACNH,OAAMI,SAAS,CAAC;QACdC,IAAAA,2BAAAA,EAAoBC,QAAQC,iBAAiB,EAAEL,MAAMM,WAAW,GAAI,IAAIT;IAC1E,GAAG,EAAE;IAEL,IAAIU;IACJ,MAAMH,UAAUI,IAAAA,gCAAAA,EAAaR;IAC7B,MAAMS,kBAAkBC,IAAAA,YAAAA,IACrBC,IAAI,CAAC,MACN,8DAA8D;KAC7DC,KAAK,CAAC,CAACC,IAAWA,EAAEC,IAAI,EACxBC,QAAQ,CAAC;IAEZ,SAASC,eAAeF,IAAoB,EAAEG,EAAU,EAAEC,CAAmC;QAC3FlB,MAAMmB,eAAe,CAAEL,MAAMG,IAAIC;IACnC;IAEA,SAASE,eAAeN,IAAoB,EAAEI,CAAmC;QAC/ElB,MAAMqB,eAAe,CAAEP,MAAMI;IAC/B;IAEA,SAASI;QACP,IAAIC,aAAa;QACjBvB,MAAMc,IAAI,CAACU,OAAO,CAAC,CAACC;YAClBF,cAAcE,IAAIX,IAAI;QACxB;Q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,GAAGc,GAAGC,SAAS,CAACD,EAAE,EAAE3B,MAAM6B,IAAI,IAC/E7B,MAAMwC,gBAAgB,IAAA,WAAA,GACrB1C,OAAAiC,aAAA,CAACoB,QAAAA;QAAKC,GAAG;QAAGC,YAAW;QAASC,kBAAiB;QAASC,WAAWnD,QAAQC,iBAAiB;OAC3FL,MAAMwC,gBAAgB;AAKjC;AAEF5C,IAAI4D,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/Pie.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/jsx-no-bind */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { PieProps } from './index';\nimport { Arc } from '../Arc/index';\nimport { ChartDataPoint } from '../index';\nimport { usePieStyles } from './usePieStyles.styles';\nimport { wrapTextInsideDonut } from '../../../utilities/index';\nconst TEXT_PADDING: number = 5;\n\n// Create a Pie within Donut Chart variant which uses these default styles and this styled subcomponent.\n/**\n * Pie component within Donut Chart.\n * {@docCategory PieDonutChart}\n */\nexport const Pie: React.FunctionComponent<PieProps> = React.forwardRef<HTMLDivElement, PieProps>(\n (props, forwardedRef) => {\n React.useEffect(() => {\n wrapTextInsideDonut(classes.insideDonutString, props.innerRadius! * 2 - TEXT_PADDING);\n }, []);\n\n let _totalValue: number;\n const classes = usePieStyles(props);\n const pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n\n function _focusCallback(data: ChartDataPoint, id: string, e: React.FocusEvent<SVGPathElement>): void {\n props.onFocusCallback!(data, id, e);\n }\n\n function _hoverCallback(data: ChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n props.hoverOnCallback!(data, e);\n }\n\n function _computeTotalValue() {\n let totalValue = 0;\n props.data.forEach((arc: ChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function arcGenerator(\n d: any,\n i: number,\n focusData: any,\n href?: string,\n ): // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element {\n const color = d && d.data && d.data.color;\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={props.innerRadius}\n outerRadius={props.outerRadius}\n color={color!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n onBlurCallback={props.onBlurCallback}\n hoverLeaveCallback={props.hoverLeaveCallback}\n uniqText={props.uniqText}\n activeArc={props.activeArc}\n href={href}\n calloutId={props.calloutId}\n valueInsideDonut={props.valueInsideDonut}\n focusedArcId={props.focusedArcId}\n showLabelsInPercent={props.showLabelsInPercent}\n totalValue={_totalValue}\n hideLabels={props.hideLabels}\n />\n );\n }\n\n const { data } = props;\n const focusData = pieForFocusRing(data.map(d => d.data!));\n\n const piechart = d3Pie<ChartDataPoint>()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02)(data);\n const translate = `translate(${props.width / 2}, ${props.height / 2})`;\n\n _totalValue = _computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: any, i: number) => arcGenerator(d, i, focusData[i], props.href))}\n {props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classes.insideDonutString}>\n {props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n },\n);\nPie.displayName = 'Pie';\n"],"names":["React","pie","d3Pie","Arc","usePieStyles","wrapTextInsideDonut","TEXT_PADDING","Pie","forwardRef","props","forwardedRef","useEffect","classes","insideDonutString","innerRadius","_totalValue","pieForFocusRing","sort","value","d","data","padAngle","_focusCallback","id","e","onFocusCallback","_hoverCallback","hoverOnCallback","_computeTotalValue","totalValue","forEach","arc","arcGenerator","i","focusData","href","color","key","outerRadius","onBlurCallback","hoverLeaveCallback","uniqText","activeArc","calloutId","valueInsideDonut","focusedArcId","showLabelsInPercent","hideLabels","map","piechart","translate","width","height","g","transform","text","y","textAnchor","dominantBaseline","className","displayName"],"mappings":"AAAA,8CAA8C,GAC9C,oCAAoC,GACpC,qDAAqD,GACrD,YAAYA;;;;;;;;;;;iEAAW,QAAQ;yBACF,WAAW;uBAEpB,eAAe;oCAEN,wBAAwB;wBACjB,2BAA2B;AAC/D,MAAMM,eAAuB;AAOtB,MAAMC,MAAAA,WAAAA,GAAyCP,OAAMQ,UAAU,CACpE,CAACC,OAAOC;IACNV,OAAMW,SAAS,CAAC;QACdN,+BAAAA,EAAoBO,QAAQC,iBAAiB,EAAEJ,MAAMK,WAAW,GAAI,IAAIR;IAC1E,GAAG,EAAE;IAEL,IAAIS;IACJ,MAAMH,cAAUR,gCAAAA,EAAaK;IAC7B,MAAMO,sBAAkBd,YAAAA,IACrBe,IAAI,CAAC,MACN,8DAA8D;KAC7DC,KAAK,CAAC,CAACC,IAAWA,EAAEC,IAAI,EACxBC,QAAQ,CAAC;IAEZ,SAASC,eAAeF,IAAoB,EAAEG,EAAU,EAAEC,CAAmC;QAC3Ff,MAAMgB,eAAe,CAAEL,MAAMG,IAAIC;IACnC;IAEA,SAASE,eAAeN,IAAoB,EAAEI,CAAmC;QAC/Ef,MAAMkB,eAAe,CAAEP,MAAMI;IAC/B;IAEA,SAASI;QACP,IAAIC,aAAa;QACjBpB,MAAMW,IAAI,CAACU,OAAO,CAAC,CAACC;YAClBF,cAAcE,IAAIX,IAAI;QACxB;QACA,OAAOS;IACT;IAEA,8DAA8D;IAC9D,SAASG,aACPb,CAAM,EACNc,CAAS,EACTC,SAAc,EACdC,IAAa;QAGb,MAAMC,QAAQjB,KAAKA,EAAEC,IAAI,IAAID,EAAEC,IAAI,CAACgB,KAAK;QACzC,OAAA,WAAA,GACE,OAAA,aAAA,CAACjC,UAAAA,EAAAA;YACCkC,KAAKJ;YACLb,MAAMD;YACNe,WAAWA;YACXpB,aAAaL,MAAMK,WAAW;YAC9BwB,aAAa7B,M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oint } from '../index';\n\nexport interface PieProps {\n /**\n * Width of the Pie.\n */\n width: number;\n /**\n * Height of the Pie.\n */\n height: number;\n /**\n * outerRadius of the Pie.\n */\n outerRadius: number;\n /**\n * innerRadius of the Pie.\n */\n innerRadius: number;\n /**\n * Data to render in the Pie.\n */\n data: ChartDataPoint[];\n /**\n * shape for pie.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n pie?: any;\n\n pieForFocusRing?: any;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n /**\n * Active Arc for chart\n */\n activeArc?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * internal prop for href\n */\n href?: string;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n\n /**\n * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop to hide the arc labels\n */\n hideLabels?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: PieStyles;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n}\n\nexport interface PieStyles {\n /**\n * Style set for the card header component root\n */\n root: string;\n\n /**\n * Style set for the inside donut string\n */\n insideDonutString: string;\n}\n"],"names":[],"rangeMappings":"","mappings":""}
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/Pie.types.ts"],"sourcesContent":["import { ChartDataPoint } from '../index';\n\nexport interface PieProps {\n /**\n * Width of the Pie.\n */\n width: number;\n /**\n * Height of the Pie.\n */\n height: number;\n /**\n * outerRadius of the Pie.\n */\n outerRadius: number;\n /**\n * innerRadius of the Pie.\n */\n innerRadius: number;\n /**\n * Data to render in the Pie.\n */\n data: ChartDataPoint[];\n /**\n * shape for pie.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n pie?: any;\n\n pieForFocusRing?: any;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n /**\n * Active Arc for chart\n */\n activeArc?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * internal prop for href\n */\n href?: string;\n\n /**\n * props for inside donut value\n */\n valueInsideDonut?: string | number;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n\n /**\n * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop to hide the arc labels\n */\n hideLabels?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: PieStyles;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n}\n\nexport interface PieStyles {\n /**\n * Style set for the card header component root\n */\n root: string;\n\n /**\n * Style set for the inside donut string\n */\n insideDonutString: string;\n}\n"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Pie';\nexport * from './Pie.types';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/index.ts"],"sourcesContent":["export * from './Pie';\nexport * from './Pie.types';\n"],"names":[],"mappings":";;;;;uBAAc,QAAQ;uBACR,cAAc"}
@@ -51,4 +51,4 @@ const usePieStyles = (props)=>{
51
51
  root: (0, _react.mergeClasses)(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
52
52
  insideDonutString: (0, _react.mergeClasses)(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)
53
53
  };
54
- }; //# sourceMappingURL=usePieStyles.styles.js.map
54
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["usePieStyles.styles.js"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\n/**\n * @internal\n */ export const donutPieClassNames = {\n root: 'fui-donut-pie__root',\n insideDonutString: 'fui-donut-pie__insideDonutString'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {},\n insideDonutString: {\n ...typographyStyles.title2,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n }\n});\n/**\n * Apply styling to the Pie inside donut chart component\n */ export const usePieStyles = (props)=>{\n var _props_styles, _props_styles1;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n insideDonutString: mergeClasses(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)\n };\n};\n"],"names":["donutPieClassNames","usePieStyles","root","insideDonutString","useStyles","__styles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkfmm31","Bvjb7m6","d","props","_props_styles","_props_styles1","className","baseStyles","mergeClasses","styles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIiBA,kBAAkB;eAAlBA;;IAgBAC,YAAY;eAAZA;;;uBAnBwB;AAG9B,MAAMD,qBAAqB;IAClCE,MAAM;IACNC,mBAAmB;AACvB;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAH,MAAA,CAAA;IAAAC,mBAAA;QAAAG,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAUX,MAAMX,eAAgBY,CAAAA;IAC7B,IAAIC,eAAeC;IACnB,MAAM,EAAEC,SAAAA,EAAW,GAAGH;IACtB,MAAMI,aAAab;IACnB,OAAO;QACHF,MAAMgB,IAAAA,mBAAY,EAAClB,mBAAmBE,IAAI,EAAEe,WAAWf,IAAI,EAAEc,WAAW,AAACF,CAAAA,gBAAgBD,MAAMM,MAAM,AAANA,MAAY,QAAQL,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcZ,IAAI;QACzKC,mBAAmBe,IAAAA,mBAAY,EAAClB,mBAAmBG,iBAAiB,EAAEc,WAAWd,iBAAiB,EAAEa,WAAW,AAACD,CAAAA,iBAAiBF,MAAMM,MAAM,AAANA,MAAY,QAAQJ,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeZ,iBAAiB;IACpO;AACJ"}
1
+ {"version":3,"sources":["usePieStyles.styles.js"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\n/**\n * @internal\n */ export const donutPieClassNames = {\n root: 'fui-donut-pie__root',\n insideDonutString: 'fui-donut-pie__insideDonutString'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {},\n insideDonutString: {\n ...typographyStyles.title2,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n }\n});\n/**\n * Apply styling to the Pie inside donut chart component\n */ export const usePieStyles = (props)=>{\n var _props_styles, _props_styles1;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n insideDonutString: mergeClasses(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)\n };\n};\n"],"names":["tokens","typographyStyles","__styles","mergeClasses","donutPieClassNames","root","insideDonutString","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkfmm31","Bvjb7m6","d","usePieStyles","props","_props_styles","_props_styles1","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBI,kBAAkB;;;IAgBlBW,YAAY;;;;uBAnBY,gBAAgB;AAG9C,2BAA2B;IAClCV,IAAI,EAAE,qBAAqB;IAC3BC,iBAAiB,EAAE;AACvB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGL,eAAA,EAAA;IAAAG,IAAA,EAAA,CAAA;IAAAC,iBAAA,EAAA;QAAAE,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAOrB,CAAC;AAGS,qBAAsBE,KAAK,IAAG;IACrC,IAAIC,aAAa,EAAEC,cAAc;IACjC,MAAM,EAAEC,SAAAA,EAAW,GAAGH,KAAK;IAC3B,MAAMI,UAAU,GAAGb,SAAS,CAAC,CAAC;IAC9B,OAAO;QACHF,IAAI,MAAEF,mBAAY,EAACC,kBAAkB,CAACC,IAAI,EAAEe,UAAU,CAACf,IAAI,EAAEc,SAAS,EAAE,CAACF,aAAa,GAAGD,KAAK,CAACK,MAAM,AAANA,MAAY,IAAI,IAAIJ,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACZ,IAAI,CAAC;QAC1KC,iBAAiB,MAAEH,mBAAY,EAACC,kBAAkB,CAACE,iBAAiB,EAAEc,UAAU,CAACd,iBAAiB,EAAEa,SAAS,EAAE,CAACD,cAAc,GAAGF,KAAK,CAACK,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACZ,iBAAiB;IACpO,CAAC;AACL,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ donutPieClassNames: function() {
13
+ return donutPieClassNames;
14
+ },
15
+ usePieStyles: function() {
16
+ return usePieStyles;
17
+ }
18
+ });
19
+ const _reacttheme = require("@fluentui/react-theme");
20
+ const _react = require("@griffel/react");
21
+ const donutPieClassNames = {
22
+ root: 'fui-donut-pie__root',
23
+ insideDonutString: 'fui-donut-pie__insideDonutString'
24
+ };
25
+ /**
26
+ * Base Styles
27
+ */ const useStyles = (0, _react.makeStyles)({
28
+ root: {},
29
+ insideDonutString: {
30
+ ..._reacttheme.typographyStyles.title2,
31
+ fill: _reacttheme.tokens.colorNeutralForeground1,
32
+ forcedColorAdjust: 'auto'
33
+ }
34
+ });
35
+ const usePieStyles = (props)=>{
36
+ var _props_styles, _props_styles1;
37
+ const { className } = props;
38
+ const baseStyles = useStyles();
39
+ return {
40
+ root: (0, _react.mergeClasses)(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
41
+ insideDonutString: (0, _react.mergeClasses)(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)
42
+ };
43
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/usePieStyles.styles.ts"],"sourcesContent":["import { PieProps, PieStyles } from './Pie.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const donutPieClassNames: SlotClassNames<PieStyles> = {\n root: 'fui-donut-pie__root',\n insideDonutString: 'fui-donut-pie__insideDonutString',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {},\n insideDonutString: {\n ...typographyStyles.title2,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n});\n\n/**\n * Apply styling to the Pie inside donut chart component\n */\nexport const usePieStyles = (props: PieProps): PieStyles => {\n const { className } = props;\n\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutPieClassNames.root, baseStyles.root, className, props.styles?.root),\n insideDonutString: mergeClasses(\n donutPieClassNames.insideDonutString,\n baseStyles.insideDonutString,\n className,\n props.styles?.insideDonutString,\n ),\n };\n};\n"],"names":["tokens","typographyStyles","makeStyles","mergeClasses","donutPieClassNames","root","insideDonutString","useStyles","title2","fill","colorNeutralForeground1","forcedColorAdjust","usePieStyles","props","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IASaI,kBAAAA;;;IAoBAQ,YAAAA;;;;4BA5B4B,wBAAwB;uBAExB,iBAAiB;AAMnD,2BAAsD;IAC3DP,MAAM;IACNC,mBAAmB;AACrB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYL,iBAAAA,EAAW;IAC3BG,MAAM,CAAC;IACPC,mBAAmB;QACjB,GAAGL,4BAAAA,CAAiBO,MAAM;QAC1BC,MAAMT,kBAAAA,CAAOU,uBAAuB;QACpCC,mBAAmB;IACrB;AACF;AAKO,qBAAqB,CAACE;QAK+CA,eAKtEA;IATJ,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,MAAME,aAAaR;IACnB,OAAO;QACLF,UAAMF,mBAAAA,EAAaC,mBAAmBC,IAAI,EAAEU,WAAWV,IAAI,EAAES,WAAAA,CAAWD,gBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAcR,IAAI;QAC1FC,uBAAmBH,mBAAAA,EACjBC,mBAAmBE,iBAAiB,EACpCS,WAAWT,iBAAiB,EAC5BQ,WAAAA,CACAD,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcP,iBAAiB;IAEnC;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './DonutChart';\nexport * from './DonutChart.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA"}
1
+ {"version":3,"sources":["../src/components/DonutChart/index.ts"],"sourcesContent":["export * from './DonutChart';\nexport * from './DonutChart.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":";;;;;uBAAc,eAAe;uBACf,qBAAqB;uBACrB,oBAAoB"}
@@ -80,4 +80,4 @@ const useDonutChartStyles = (props)=>{
80
80
  legendContainer: (0, _react.mergeClasses)(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
81
81
  chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
82
82
  };
83
- }; //# sourceMappingURL=useDonutChartStyles.styles.js.map
83
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutClassNames = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%'\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible'\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%'\n }\n});\n/**\n * Apply styling to the DonutChart component\n */ export const useDonutChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)\n };\n};\n"],"names":["donutClassNames","useDonutChartStyles","root","chart","legendContainer","chartWrapper","useStyles","__styles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","a9b677","Bqenvij","B7ck84d","ek0pe7","B68tc82","Bmxbyg5","Bpg54ce","z8tnut","d","p","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","className","baseStyles","mergeClasses","styles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIiBA,eAAe;eAAfA;;IA8BAC,mBAAmB;eAAnBA;;;uBAlCwB;AAI9B,MAAMD,kBA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QAAQL,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAevB,eAAe;QAC1MC,cAAc0B,IAAAA,mBAAY,EAAC/B,gBAAgBK,YAAY,EAAE,AAACuB,CAAAA,iBAAiBJ,MAAMQ,MAAM,AAANA,MAAY,QAAQJ,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAevB,YAAY;IACzK;AACJ"}
1
+ {"version":3,"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutClassNames = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%'\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible'\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%'\n }\n});\n/**\n * Apply styling to the DonutChart component\n */ export const useDonutChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","typographyStyles","donutClassNames","root","chart","legendContainer","chartWrapper","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","a9b677","Bqenvij","B7ck84d","ek0pe7","B68tc82","Bmxbyg5","Bpg54ce","z8tnut","d","p","useDonutChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBI,eAAe;;;IA8BfsB,mBAAmB;;;;uBAlCK,gBAAgB;AAI9C,wBAAwB;IAC/BrB,IAAI,EAAE,iBAAiB;IACvBC,KAAK,EAAE,kBAAkB;IACzBC,eAAe,EAAE,4BAA4B;IAC7CC,YAAY,EAAE;AAClB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGT,eAAA,EAAA;IAAAK,IAAA,EAAA;QAAAK,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAX,KAAA,EAAA;QAAAY,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAL,MAAA,EAAA;QAAAM,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAf,eAAA,EAAA;QAAAgB,MAAA,EAAA;QAAAP,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAQ,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,CAAA,EAAA,CAAA;YAAA;SAAA;QAAA;KAAA;AAAA,CAmBrB,CAAC;AAGS,4BAA6BE,KAAK,IAAG;IAC5C,IAAIC,aAAa,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc;IACjE,MAAM,EAAEC,SAAAA,EAAW,GAAGL,KAAK;IAC3B,MAAMM,UAAU,GAAGxB,SAAS,CAAC,CAAC;IAC9B,OAAO;QACHJ,IAAI,MAAEJ,mBAAY,EAACG,eAAe,CAACC,IAAI,EAAE4B,UAAU,CAAC5B,IAAI,EAAE2B,SAAS,EAAE,CAACJ,aAAa,GAAGD,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIN,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACvB,IAAI,CAAC;QACvKC,KAAK,MAAEL,mBAAY,EAACG,eAAe,CAACE,KAAK,EAAE2B,UAAU,CAAC3B,KAAK,EAAE,CAACuB,cAAc,GAAGF,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,KAAK,CAAC;QACnKC,eAAe,MAAEN,mBAAY,EAACG,eAAe,CAACG,eAAe,EAAE0B,UAAU,CAAC1B,eAAe,EAAE,CAACuB,cAAc,GAAGH,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,eAAe,CAAC;QAC3MC,YAAY,MAAEP,mBAAY,EAACG,eAAe,CAACI,YAAY,EAAE,CAACuB,cAAc,GAAGJ,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,YAAY;IACzK,CAAC;AACL,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ donutClassNames: function() {
13
+ return donutClassNames;
14
+ },
15
+ useDonutChartStyles: function() {
16
+ return useDonutChartStyles;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const _reacttheme = require("@fluentui/react-theme");
21
+ const donutClassNames = {
22
+ root: 'fui-donut__root',
23
+ chart: 'fui-donut__chart',
24
+ legendContainer: 'fui-donut__legendContainer',
25
+ chartWrapper: 'fui-donut__chartWrapper'
26
+ };
27
+ /**
28
+ * Base Styles
29
+ */ const useStyles = (0, _react.makeStyles)({
30
+ root: {
31
+ // alignItems: 'center',
32
+ ..._reacttheme.typographyStyles.body1,
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ width: '100%',
36
+ height: '100%'
37
+ },
38
+ chart: {
39
+ boxSizing: 'content-box',
40
+ alignmentAdjust: 'center',
41
+ display: 'block',
42
+ overflow: 'visible'
43
+ },
44
+ legendContainer: {
45
+ paddingTop: _reacttheme.tokens.spacingVerticalL,
46
+ width: '100%'
47
+ }
48
+ });
49
+ const useDonutChartStyles = (props)=>{
50
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3;
51
+ const { className } = props;
52
+ const baseStyles = useStyles();
53
+ return {
54
+ root: (0, _react.mergeClasses)(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
55
+ chart: (0, _react.mergeClasses)(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
56
+ legendContainer: (0, _react.mergeClasses)(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
57
+ chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
58
+ };
59
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DonutChart/useDonutChartStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { DonutChartProps, DonutChartStyles } from './index';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const donutClassNames: SlotClassNames<DonutChartStyles> = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible',\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%',\n },\n});\n\n/**\n * Apply styling to the DonutChart component\n */\nexport const useDonutChartStyles = (props: DonutChartProps): DonutChartStyles => {\n const { className } = props;\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, props.styles?.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, props.styles?.chart),\n legendContainer: mergeClasses(\n donutClassNames.legendContainer,\n baseStyles.legendContainer,\n props.styles?.legendContainer,\n ),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, props.styles?.chartWrapper),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","donutClassNames","root","chart","legendContainer","chartWrapper","useStyles","body1","display","flexDirection","width","height","boxSizing","alignmentAdjust","overflow","paddingTop","spacingVerticalL","useDonutChartStyles","props","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAQaI,eAAAA;;;uBAkCAgB;eAAAA;;;uBA1C4B,iBAAiB;4BACjB,wBAAwB;AAO1D,wBAA0D;IAC/Df,MAAM;IACNC,OAAO;IACPC,iBAAiB;IACjBC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYT,iBAAAA,EAAW;IAC3BK,MAAM;QACJ,wBAAwB;QACxB,GAAGF,4BAA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