@fluentui/react-charts 9.1.10 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/dist/index.d.ts +39 -3
  3. package/lib/AreaChart.js.map +1 -1
  4. package/lib/CartesianChart.js.map +1 -1
  5. package/lib/DeclarativeChart.js.map +1 -1
  6. package/lib/DonutChart.js.map +1 -1
  7. package/lib/FunnelChart.js.map +1 -1
  8. package/lib/GanttChart.js.map +1 -1
  9. package/lib/GaugeChart.js.map +1 -1
  10. package/lib/GroupedVerticalBarChart.js.map +1 -1
  11. package/lib/HeatMapChart.js.map +1 -1
  12. package/lib/HorizontalBarChart.js.map +1 -1
  13. package/lib/HorizontalBarChartWithAxis.js.map +1 -1
  14. package/lib/Legends.js.map +1 -1
  15. package/lib/LineChart.js.map +1 -1
  16. package/lib/Popover.js.map +1 -1
  17. package/lib/ResponsiveContainer.js.map +1 -1
  18. package/lib/SankeyChart.js.map +1 -1
  19. package/lib/ScatterChart.js.map +1 -1
  20. package/lib/Sparkline.js.map +1 -1
  21. package/lib/VerticalBarChart.js.map +1 -1
  22. package/lib/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/components/AreaChart/AreaChart.js +11 -3
  24. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  25. package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
  26. package/lib/components/AreaChart/index.js.map +1 -1
  27. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  28. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +41 -0
  29. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  30. package/lib/components/CommonComponents/CartesianChart.js +2 -1
  31. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  33. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  34. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  35. package/lib/components/CommonComponents/index.js.map +1 -1
  36. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +1 -2
  37. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +128 -0
  38. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  39. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +1 -2
  40. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +126 -0
  41. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  42. package/lib/components/DeclarativeChart/DeclarativeChart.js +15 -7
  43. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  44. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +44 -13
  45. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  46. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  47. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  48. package/lib/components/DeclarativeChart/index.js.map +1 -1
  49. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  50. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  51. package/lib/components/DonutChart/Arc/index.js.map +1 -1
  52. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +1 -2
  53. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +44 -0
  54. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  55. package/lib/components/DonutChart/DonutChart.js +11 -3
  56. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  57. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  58. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  59. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  60. package/lib/components/DonutChart/Pie/index.js.map +1 -1
  61. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +1 -2
  62. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +29 -0
  63. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  64. package/lib/components/DonutChart/index.js.map +1 -1
  65. package/lib/components/DonutChart/useDonutChartStyles.styles.js +1 -2
  66. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +45 -0
  67. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  68. package/lib/components/FunnelChart/FunnelChart.js +10 -1
  69. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  71. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  72. package/lib/components/FunnelChart/index.js.map +1 -1
  73. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +1 -2
  74. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +51 -0
  75. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  76. package/lib/components/GanttChart/GanttChart.js +19 -2
  77. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  78. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  79. package/lib/components/GanttChart/index.js.map +1 -1
  80. package/lib/components/GanttChart/useGanttChartStyles.styles.js +1 -2
  81. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +23 -0
  82. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  83. package/lib/components/GaugeChart/GaugeChart.js +9 -2
  84. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  85. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  86. package/lib/components/GaugeChart/index.js.map +1 -1
  87. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +1 -2
  88. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +142 -0
  89. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  90. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  91. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  92. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  93. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
  94. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  95. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +53 -0
  96. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  97. package/lib/components/HeatMapChart/HeatMapChart.js +11 -3
  98. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  99. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  100. package/lib/components/HeatMapChart/index.js.map +1 -1
  101. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -2
  102. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +38 -0
  103. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  104. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  105. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  106. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  107. package/lib/components/HorizontalBarChart/index.js.map +1 -1
  108. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -2
  109. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +120 -0
  110. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  111. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  112. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  113. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  114. package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  115. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -2
  116. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +39 -0
  117. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  118. package/lib/components/Legends/Legends.js +28 -10
  119. package/lib/components/Legends/Legends.js.map +1 -1
  120. package/lib/components/Legends/Legends.types.js.map +1 -1
  121. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  122. package/lib/components/Legends/index.js.map +1 -1
  123. package/lib/components/Legends/shape.js.map +1 -1
  124. package/lib/components/Legends/useLegendsStyles.styles.js +57 -14
  125. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  126. package/lib/components/Legends/useLegendsStyles.styles.raw.js +138 -0
  127. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  128. package/lib/components/LineChart/LineChart.js +9 -2
  129. package/lib/components/LineChart/LineChart.js.map +1 -1
  130. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  131. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  132. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  133. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  134. package/lib/components/LineChart/index.js.map +1 -1
  135. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  136. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +52 -0
  137. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  138. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  139. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  140. package/lib/components/ResponsiveContainer/index.js.map +1 -1
  141. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -2
  142. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +28 -0
  143. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  144. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  145. package/lib/components/SankeyChart/SankeyChart.js +5 -1
  146. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  147. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  148. package/lib/components/SankeyChart/index.js.map +1 -1
  149. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  150. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +77 -0
  151. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  152. package/lib/components/ScatterChart/ScatterChart.js +11 -3
  153. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  154. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  155. package/lib/components/ScatterChart/index.js.map +1 -1
  156. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  157. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +43 -0
  158. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  159. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  160. package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
  161. package/lib/components/Sparkline/index.js.map +1 -1
  162. package/lib/components/Sparkline/useSparklineStyles.styles.js +1 -2
  163. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +30 -0
  164. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  165. package/lib/components/VerticalBarChart/VerticalBarChart.js +62 -28
  166. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  167. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  168. package/lib/components/VerticalBarChart/index.js.map +1 -1
  169. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  170. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +58 -0
  171. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  172. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  173. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  174. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  175. package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
  176. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  177. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +49 -0
  178. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  179. package/lib/index.js.map +1 -1
  180. package/lib/types/DataPoint.js.map +1 -1
  181. package/lib/types/EventAnnotation.js.map +1 -1
  182. package/lib/types/LegendDataItem.js.map +1 -1
  183. package/lib/types/index.js.map +1 -1
  184. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  185. package/lib/utilities/KeyCodes.js.map +1 -1
  186. package/lib/utilities/SVGTooltipText.js +2 -0
  187. package/lib/utilities/SVGTooltipText.js.map +1 -1
  188. package/lib/utilities/async-utils.js.map +1 -1
  189. package/lib/utilities/colors.js.map +1 -1
  190. package/lib/utilities/getWindow.js.map +1 -1
  191. package/lib/utilities/image-export-utils.js +256 -0
  192. package/lib/utilities/image-export-utils.js.map +1 -0
  193. package/lib/utilities/index.js.map +1 -1
  194. package/lib/utilities/overflow-utils.js.map +1 -1
  195. package/lib/utilities/string.js.map +1 -1
  196. package/lib/utilities/test-data.js.map +1 -1
  197. package/lib/utilities/utilities.js +50 -5
  198. package/lib/utilities/utilities.js.map +1 -1
  199. package/lib/utilities/vbc-utils.js.map +1 -1
  200. package/lib-commonjs/AreaChart.js.map +1 -1
  201. package/lib-commonjs/CartesianChart.js.map +1 -1
  202. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  203. package/lib-commonjs/DonutChart.js.map +1 -1
  204. package/lib-commonjs/FunnelChart.js.map +1 -1
  205. package/lib-commonjs/GanttChart.js.map +1 -1
  206. package/lib-commonjs/GaugeChart.js.map +1 -1
  207. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
  208. package/lib-commonjs/HeatMapChart.js.map +1 -1
  209. package/lib-commonjs/HorizontalBarChart.js.map +1 -1
  210. package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
  211. package/lib-commonjs/Legends.js.map +1 -1
  212. package/lib-commonjs/LineChart.js.map +1 -1
  213. package/lib-commonjs/Popover.js.map +1 -1
  214. package/lib-commonjs/ResponsiveContainer.js.map +1 -1
  215. package/lib-commonjs/SankeyChart.js.map +1 -1
  216. package/lib-commonjs/ScatterChart.js.map +1 -1
  217. package/lib-commonjs/Sparkline.js.map +1 -1
  218. package/lib-commonjs/VerticalBarChart.js.map +1 -1
  219. package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
  220. package/lib-commonjs/components/AreaChart/AreaChart.js +10 -2
  221. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  222. package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
  223. package/lib-commonjs/components/AreaChart/index.js.map +1 -1
  224. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -1
  225. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  226. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +57 -0
  227. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -0
  228. package/lib-commonjs/components/CommonComponents/CartesianChart.js +2 -1
  229. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  230. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  231. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  232. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  233. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  234. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +1 -1
  235. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  236. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +142 -0
  237. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -0
  238. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +1 -1
  239. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  240. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +140 -0
  241. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -0
  242. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -6
  243. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  244. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +47 -13
  245. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  246. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  247. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  248. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
  249. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  250. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  251. package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
  252. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +1 -1
  253. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +58 -0
  255. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -0
  256. package/lib-commonjs/components/DonutChart/DonutChart.js +10 -2
  257. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  258. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  259. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  260. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  261. package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
  262. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -1
  263. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +43 -0
  264. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -0
  265. package/lib-commonjs/components/DonutChart/index.js.map +1 -1
  266. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +1 -1
  267. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +59 -0
  268. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -0
  269. package/lib-commonjs/components/FunnelChart/FunnelChart.js +10 -1
  270. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  271. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  272. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  273. package/lib-commonjs/components/FunnelChart/index.js.map +1 -1
  274. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -1
  275. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +65 -0
  277. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -0
  278. package/lib-commonjs/components/GanttChart/GanttChart.js +18 -1
  279. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  280. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  281. package/lib-commonjs/components/GanttChart/index.js.map +1 -1
  282. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +1 -1
  283. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +39 -0
  284. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -0
  285. package/lib-commonjs/components/GaugeChart/GaugeChart.js +9 -2
  286. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  287. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  288. package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
  289. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -1
  290. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  291. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +160 -0
  292. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -0
  293. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +70 -58
  294. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  295. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  296. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
  297. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -1
  298. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +69 -0
  299. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -0
  300. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +10 -2
  301. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  302. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  303. package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
  304. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -1
  305. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +56 -0
  306. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -0
  307. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +23 -26
  308. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  309. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  310. package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
  311. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +1 -1
  312. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +134 -0
  313. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -0
  314. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -2
  315. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  316. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  317. package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
  318. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -1
  319. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +55 -0
  320. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -0
  321. package/lib-commonjs/components/Legends/Legends.js +28 -10
  322. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  323. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  324. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  325. package/lib-commonjs/components/Legends/index.js.map +1 -1
  326. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  327. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +101 -28
  328. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  329. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +174 -0
  330. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -0
  331. package/lib-commonjs/components/LineChart/LineChart.js +9 -2
  332. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  333. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  334. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  335. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  336. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  337. package/lib-commonjs/components/LineChart/index.js.map +1 -1
  338. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +1 -1
  339. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +66 -0
  340. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -0
  341. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  342. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  343. package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
  344. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -1
  345. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +46 -0
  346. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -0
  347. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  348. package/lib-commonjs/components/SankeyChart/SankeyChart.js +5 -1
  349. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  350. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  351. package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
  352. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +1 -1
  353. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  354. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +95 -0
  355. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -0
  356. package/lib-commonjs/components/ScatterChart/ScatterChart.js +10 -2
  357. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  358. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  359. package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
  360. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  361. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +57 -0
  362. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -0
  363. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  364. package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
  365. package/lib-commonjs/components/Sparkline/index.js.map +1 -1
  366. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -1
  367. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +44 -0
  368. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -0
  369. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +62 -28
  370. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  371. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  372. package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
  373. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -1
  374. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +74 -0
  375. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -0
  376. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +22 -8
  377. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  378. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  379. package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
  380. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -1
  381. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  382. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +67 -0
  383. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -0
  384. package/lib-commonjs/index.js.map +1 -1
  385. package/lib-commonjs/types/DataPoint.js.map +1 -1
  386. package/lib-commonjs/types/EventAnnotation.js.map +1 -1
  387. package/lib-commonjs/types/LegendDataItem.js.map +1 -1
  388. package/lib-commonjs/types/index.js.map +1 -1
  389. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  390. package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
  391. package/lib-commonjs/utilities/SVGTooltipText.js +2 -0
  392. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  393. package/lib-commonjs/utilities/async-utils.js.map +1 -1
  394. package/lib-commonjs/utilities/colors.js.map +1 -1
  395. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  396. package/lib-commonjs/utilities/image-export-utils.js +274 -0
  397. package/lib-commonjs/utilities/image-export-utils.js.map +1 -0
  398. package/lib-commonjs/utilities/index.js.map +1 -1
  399. package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
  400. package/lib-commonjs/utilities/string.js.map +1 -1
  401. package/lib-commonjs/utilities/test-data.js.map +1 -1
  402. package/lib-commonjs/utilities/utilities.js +56 -5
  403. package/lib-commonjs/utilities/utilities.js.map +1 -1
  404. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  405. package/package.json +12 -22
@@ -1 +1 @@
1
- {"version":3,"sources":["Arc.tsx"],"sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { useArcStyles } from './useArcStyles.styles';\nimport { ChartDataPoint } from '../index';\nimport { ArcProps } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth, useRtl } from '../../../utilities/index';\n\n// Create a Arc within Donut Chart variant which uses these default styles and this styled subcomponent.\n/**\n * Arc component within Donut Chart.\n * {@docCategory ArcDonutChart}\n */\nexport const Arc: React.FunctionComponent<ArcProps> = React.forwardRef<HTMLDivElement, ArcProps>(\n (props, forwardedRef) => {\n const arc = d3Arc();\n const currentRef = React.createRef<SVGPathElement>();\n const _isRTL: boolean = useRtl();\n const classes = useArcStyles(props);\n\n React.useEffect(() => {\n _updateChart(props);\n }, [props]);\n\n function _onFocus(data: ChartDataPoint, id: string, event: React.FocusEvent<SVGPathElement, Element>): void {\n props.onFocusCallback!(data, id, event, currentRef.current);\n }\n\n function _hoverOn(data: ChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n props.hoverOnCallback!(data, mouseEvent);\n }\n\n function _hoverOff(): void {\n props.hoverLeaveCallback!();\n }\n\n function _onBlur(): void {\n props.onBlurCallback!();\n }\n\n function _getAriaLabel(): string {\n const point = props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n }\n\n function _shouldHighlightArc(legend?: string): boolean {\n const { activeArc } = props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n }\n\n function _renderArcLabel(className: string) {\n const { data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels, activeArc } = props;\n\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n (activeArc !== data!.data.legend && activeArc !== '')\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid({ ...data!, innerRadius, outerRadius });\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== _isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n }\n\n function _updateChart(newProps: ArcProps): void {\n if (newProps.arc && newProps.innerRadius && newProps.outerRadius) {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n }\n }\n\n const { href, focusedArcId } = props;\n //TO DO 'replace' is throwing error\n const id =\n props.uniqText! +\n (typeof props.data!.data.legend === 'string' ? props.data!.data.legend.replace(/\\s+/g, '') : '') +\n props.data!.data.data;\n const opacity: number = props.activeArc === props.data!.data.legend || props.activeArc === '' ? 1 : 0.1;\n const cornerRadius = props.roundCorners ? 3 : 0;\n return (\n <g ref={currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n // TODO innerradius and outerradius were absent\n <path\n id={id + 'focusRing'}\n d={\n arc.cornerRadius(cornerRadius)({\n ...props.data!,\n innerRadius: props.innerRadius,\n outerRadius: props.outerRadius,\n })!\n }\n className={classes.focusRing}\n />\n )}\n <path\n // TODO innerradius and outerradius were absent\n id={id}\n d={\n arc.cornerRadius(cornerRadius)({\n ...props.data!,\n innerRadius: props.innerRadius,\n outerRadius: props.outerRadius,\n })!\n }\n className={classes.root}\n style={{ fill: props.color, cursor: href ? 'pointer' : 'default' }}\n onFocus={event => _onFocus(props.data!.data, id, event)}\n data-is-focusable={props.activeArc === props.data!.data.legend || props.activeArc === ''}\n onMouseOver={event => _hoverOn(props.data!.data, event)}\n onMouseMove={event => _hoverOn(props.data!.data, event)}\n onMouseLeave={_hoverOff}\n tabIndex={_shouldHighlightArc(props.data!.data.legend!) ? 0 : undefined}\n onBlur={_onBlur}\n opacity={opacity}\n onClick={props.data?.data.onClick}\n aria-label={_getAriaLabel()}\n role=\"img\"\n />\n {_renderArcLabel(classes.arcLabel)}\n </g>\n );\n },\n);\nArc.displayName = 'Arc';\n"],"names":["React","arc","d3Arc","useArcStyles","format","d3Format","formatScientificLimitWidth","useRtl","Arc","forwardRef","props","forwardedRef","currentRef","createRef","_isRTL","classes","useEffect","_updateChart","_onFocus","data","id","event","onFocusCallback","current","_hoverOn","mouseEvent","persist","hoverOnCallback","_hoverOff","hoverLeaveCallback","_onBlur","onBlurCallback","_getAriaLabel","point","legend","xAxisCalloutData","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_shouldHighlightArc","activeArc","length","undefined","includes","_renderArcLabel","className","innerRadius","outerRadius","showLabelsInPercent","totalValue","hideLabels","Math","abs","endAngle","startAngle","PI","base","perp","centroid","hyp","sqrt","labelRadius","max","angle","arcValue","value","text","x","y","textAnchor","dominantBaseline","aria-hidden","newProps","href","focusedArcId","uniqText","replace","opacity","cornerRadius","roundCorners","g","ref","path","d","focusRing","root","style","fill","color","cursor","onFocus","data-is-focusable","onMouseOver","onMouseMove","onMouseLeave","tabIndex","onBlur","onClick","aria-label","role","arcLabel","displayName"],"mappings":";;;;+BAaaQ;;;;;;;iEAbU,QAAQ;yBACF,WAAW;oCACX,wBAAwB;0BAGlB,YAAY;uBACI,2BAA2B;AAOvE,YAAMA,WAAAA,GAAyCR,OAAMS,UAAU,CACpE,CAACC,OAAOC;QA4HSD;IA3Hf,MAAMT,UAAMC,YAAAA;IACZ,MAAMU,aAAAA,WAAAA,GAAaZ,OAAMa,SAAS;IAClC,MAAMC,aAAkBP,aAAAA;IACxB,MAAMQ,cAAUZ,gCAAAA,EAAaO;IAE7BV,OAAMgB,SAAS,CAAC;QACdC,aAAaP;IACf,GAAG;QAACA;KAAM;IAEV,SAASQ,SAASC,IAAoB,EAAEC,EA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IAAI,EAAEE;QACjD0E,cAAcnE;QACdoE,UAAUxD,oBAAoB9B,MAAMS,IAAI,CAAEA,IAAI,CAACe,MAAM,IAAK,IAAIS;QAC9DsD,QAAQnE;QACRgD,SAASA;QACToB,OAAO,EAAA,CAAExF,cAAAA,MAAMS,IAAAA,AAAI,MAAA,QAAVT,gBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,YAAYS,IAAI,CAAC+E,OAAO;QACjCC,cAAYnE;QACZoE,MAAK;QAENvD,gBAAgB9B,QAAQsF,QAAQ;AAGvC,GACA;AACF7F,IAAI8F,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Arc/Arc.tsx"],"sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { useArcStyles } from './useArcStyles.styles';\nimport { ChartDataPoint } from '../index';\nimport { ArcProps } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth, useRtl } from '../../../utilities/index';\n\n// Create a Arc within Donut Chart variant which uses these default styles and this styled subcomponent.\n/**\n * Arc component within Donut Chart.\n * {@docCategory ArcDonutChart}\n */\nexport const Arc: React.FunctionComponent<ArcProps> = React.forwardRef<HTMLDivElement, ArcProps>(\n (props, forwardedRef) => {\n const arc = d3Arc();\n const currentRef = React.createRef<SVGPathElement>();\n const _isRTL: boolean = useRtl();\n const classes = useArcStyles(props);\n\n React.useEffect(() => {\n _updateChart(props);\n }, [props]);\n\n function _onFocus(data: ChartDataPoint, id: string, event: React.FocusEvent<SVGPathElement, Element>): void {\n props.onFocusCallback!(data, id, event, currentRef.current);\n }\n\n function _hoverOn(data: ChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n props.hoverOnCallback!(data, mouseEvent);\n }\n\n function _hoverOff(): void {\n props.hoverLeaveCallback!();\n }\n\n function _onBlur(): void {\n props.onBlurCallback!();\n }\n\n function _getAriaLabel(): string {\n const point = props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n }\n\n function _shouldHighlightArc(legend?: string): boolean {\n const { activeArc } = props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n }\n\n function _renderArcLabel(className: string) {\n const { data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels, activeArc } = props;\n\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n (activeArc !== data!.data.legend && activeArc !== '')\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid({ ...data!, innerRadius, outerRadius });\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== _isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n }\n\n function _updateChart(newProps: ArcProps): void {\n if (newProps.arc && newProps.innerRadius && newProps.outerRadius) {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n }\n }\n\n const { href, focusedArcId } = props;\n //TO DO 'replace' is throwing error\n const id =\n props.uniqText! +\n (typeof props.data!.data.legend === 'string' ? props.data!.data.legend.replace(/\\s+/g, '') : '') +\n props.data!.data.data;\n const opacity: number = props.activeArc === props.data!.data.legend || props.activeArc === '' ? 1 : 0.1;\n const cornerRadius = props.roundCorners ? 3 : 0;\n return (\n <g ref={currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n // TODO innerradius and outerradius were absent\n <path\n id={id + 'focusRing'}\n d={\n arc.cornerRadius(cornerRadius)({\n ...props.data!,\n innerRadius: props.innerRadius,\n outerRadius: props.outerRadius,\n })!\n }\n className={classes.focusRing}\n />\n )}\n <path\n // TODO innerradius and outerradius were absent\n id={id}\n d={\n arc.cornerRadius(cornerRadius)({\n ...props.data!,\n innerRadius: props.innerRadius,\n outerRadius: props.outerRadius,\n })!\n }\n className={classes.root}\n style={{ fill: props.color, cursor: href ? 'pointer' : 'default' }}\n onFocus={event => _onFocus(props.data!.data, id, event)}\n data-is-focusable={props.activeArc === props.data!.data.legend || props.activeArc === ''}\n onMouseOver={event => _hoverOn(props.data!.data, event)}\n onMouseMove={event => _hoverOn(props.data!.data, event)}\n onMouseLeave={_hoverOff}\n tabIndex={_shouldHighlightArc(props.data!.data.legend!) ? 0 : undefined}\n onBlur={_onBlur}\n opacity={opacity}\n onClick={props.data?.data.onClick}\n aria-label={_getAriaLabel()}\n role=\"img\"\n />\n {_renderArcLabel(classes.arcLabel)}\n </g>\n );\n },\n);\nArc.displayName = 'Arc';\n"],"names":["React","arc","d3Arc","useArcStyles","format","d3Format","formatScientificLimitWidth","useRtl","Arc","forwardRef","props","forwardedRef","currentRef","createRef","_isRTL","classes","useEffect","_updateChart","_onFocus","data","id","event","onFocusCallback","current","_hoverOn","mouseEvent","persist","hoverOnCallback","_hoverOff","hoverLeaveCallback","_onBlur","onBlurCallback","_getAriaLabel","point","legend","xAxisCalloutData","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_shouldHighlightArc","activeArc","length","undefined","includes","_renderArcLabel","className","innerRadius","outerRadius","showLabelsInPercent","totalValue","hideLabels","Math","abs","endAngle","startAngle","PI","base","perp","centroid","hyp","sqrt","labelRadius","max","angle","arcValue","value","text","x","y","textAnchor","dominantBaseline","aria-hidden","newProps","href","focusedArcId","uniqText","replace","opacity","cornerRadius","roundCorners","g","ref","path","d","focusRing","root","style","fill","color","cursor","onFocus","data-is-focusable","onMouseOver","onMouseMove","onMouseLeave","tabIndex","onBlur","onClick","aria-label","role","arcLabel","displayName"],"mappings":";;;;+BAaaQ;;;;;;;iEAbU,QAAQ;yBACF,WAAW;oCACX,wBAAwB;0BAGlB,YAAY;uBACI,2BAA2B;AAOvE,YAAMA,WAAAA,GAAyCR,OAAMS,UAAU,CACpE,CAACC,OAAOC;QA4HSD;IA3Hf,MAAMT,UAAMC,YAAAA;IACZ,MAAMU,aAAAA,WAAAA,GAAaZ,OAAMa,SAAS;IAClC,MAAMC,aAAkBP,aAAAA;IACxB,MAAMQ,cAAUZ,gCAAAA,EAAaO;IAE7BV,OAAMgB,SAAS,CAAC;QACdC,aAAaP;IACf,GAAG;QAACA;KAAM;IAEV,SAASQ,SAASC,IAAoB,EAAEC,EAAU,EAAEC,KAAgD;QAClGX,MAAMY,eAAe,CAAEH,MAAMC,IAAIC,OAAOT,WAAWW,OAAO;IAC5D;IAEA,SAASC,SAASL,IAAoB,EAAEM,UAA4C;QAClFA,WAAWC,OAAO;QAClBhB,MAAMiB,eAAe,CAAER,MAAMM;IAC/B;IAEA,SAASG;QACPlB,MAAMmB,kBAAkB;IAC1B;IAEA,SAASC;QACPpB,MAAMqB,cAAc;IACtB;IAEA,SAASC;YAIAC;QAHP,MAAMA,QAAQvB,MAAMS,IAAI,CAAEA,IAAI;QAC9B,MAAMe,SAASD,MAAME,gBAAgB,IAAIF,MAAMC,MAAM;QACrD,MAAME,SAASH,MAAMI,gBAAgB,IAAIJ,MAAMd,IAAI,IAAI;QACvD,OAAOc,CAAAA,CAAAA,kCAAAA,MAAMK,wBAAAA,AAAwB,MAAA,QAA9BL,oCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,gCAAgCM,SAAAA,AAAS,KAAKL,CAAAA,SAAS,GAAGA,OAAO,EAAE,CAAC,GAAG,EAAA,CAAC,GAAK,GAA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C/C/D,IAAIA;QACJgE,GACEnF,IAAI8E,YAAY,CAACA,cAAc;YAC7B,GAAGrE,MAAMS,IAAI;YACb4B,aAAarC,MAAMqC,WAAW;YAC9BC,aAAatC,MAAMsC,WAAW;QAChC;QAEFF,WAAW/B,QAAQuE,IAAI;QACvBC,OAAO;YAAEC,MAAM9E,MAAM+E,KAAK;YAAEC,QAAQhB,OAAO,YAAY;QAAU;QACjEiB,SAAStE,CAAAA,QAASH,SAASR,MAAMS,IAAI,CAAEA,IAAI,EAAEC,IAAIC;QACjDuE,qBAAmBlF,MAAM+B,SAAS,KAAK/B,MAAMS,IAAI,CAAEA,IAAI,CAACe,MAAM,IAAIxB,MAAM+B,SAAS,KAAK;QACtFoD,aAAaxE,CAAAA,QAASG,SAASd,MAAMS,IAAI,CAAEA,IAAI,EAAEE;QACjDyE,aAAazE,CAAAA,QAASG,SAASd,MAAMS,IAAI,CAAEA,IAAI,EAAEE;QACjD0E,cAAcnE;QACdoE,UAAUxD,oBAAoB9B,MAAMS,IAAI,CAAEA,IAAI,CAACe,MAAM,IAAK,IAAIS;QAC9DsD,QAAQnE;QACRgD,SAASA;QACToB,OAAO,EAAA,CAAExF,cAAAA,MAAMS,IAAAA,AAAI,MAAA,QAAVT,gBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,YAAYS,IAAI,CAAC+E,OAAO;QACjCC,cAAYnE;QACZoE,MAAK;QAENvD,gBAAgB9B,QAAQsF,QAAQ;AAGvC,GACA;AACF7F,IAAI8F,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Arc.types.ts"],"sourcesContent":["import { ChartDataPoint } from '../index';\nexport interface ArcProps {\n /**\n * Data to render in the Arc.\n */\n data?: ArcData;\n\n /**\n * Data to render focused Arc\n */\n focusData?: ArcData;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n /**\n * shape for Arc.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n arc?: any;\n\n /**\n * innerRadius of the Arc.\n */\n innerRadius: number;\n\n /**\n * outerRadius of the Arc.\n */\n outerRadius: number;\n\n /**\n * Color for the Arc.\n */\n color: string;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * Active Arc for chart\n */\n activeArc?: 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 * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop used to define the sum of all arc values\n */\n totalValue?: number;\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?: ArcStyles;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n}\n\nexport interface ArcData {\n /**\n * Data to render in the chart for individual arc.\n */\n data: ChartDataPoint;\n /**\n * endAngle of the Arc\n */\n endAngle: number;\n /**\n * index of the Arc\n */\n index: number;\n /**\n * padAngle of the Arc\n */\n padAngle: number;\n /**\n * startAngle of the Arc\n */\n startAngle: number;\n /**\n * value of the Arc\n */\n value: number;\n}\n\nexport interface ArcStyles {\n /**\n * Style set for the card header component root\n */\n root: string;\n\n /**\n * styles for the focus\n */\n focusRing: string;\n\n /**\n * Style for the arc labels\n */\n arcLabel: string;\n}\n"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/components/DonutChart/Arc/Arc.types.ts"],"sourcesContent":["import { ChartDataPoint } from '../index';\nexport interface ArcProps {\n /**\n * Data to render in the Arc.\n */\n data?: ArcData;\n\n /**\n * Data to render focused Arc\n */\n focusData?: ArcData;\n\n /**\n * id of the focused arc\n */\n focusedArcId?: string;\n /**\n * shape for Arc.\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n arc?: any;\n\n /**\n * innerRadius of the Arc.\n */\n innerRadius: number;\n\n /**\n * outerRadius of the Arc.\n */\n outerRadius: number;\n\n /**\n * Color for the Arc.\n */\n color: string;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverOnCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n onFocusCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n onBlurCallback?: Function;\n\n /**\n * Defines the function that is executed upon hovering Leave the legend\n */\n hoverLeaveCallback?: Function;\n\n /**\n * Uniq string for chart\n */\n uniqText?: string;\n\n /**\n * string for callout id\n */\n calloutId?: string;\n\n /**\n * Active Arc for chart\n */\n activeArc?: 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 * Prop to show the arc labels in percentage format\n */\n showLabelsInPercent?: boolean;\n\n /**\n * Prop used to define the sum of all arc values\n */\n totalValue?: number;\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?: ArcStyles;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n}\n\nexport interface ArcData {\n /**\n * Data to render in the chart for individual arc.\n */\n data: ChartDataPoint;\n /**\n * endAngle of the Arc\n */\n endAngle: number;\n /**\n * index of the Arc\n */\n index: number;\n /**\n * padAngle of the Arc\n */\n padAngle: number;\n /**\n * startAngle of the Arc\n */\n startAngle: number;\n /**\n * value of the Arc\n */\n value: number;\n}\n\nexport interface ArcStyles {\n /**\n * Style set for the card header component root\n */\n root: string;\n\n /**\n * styles for the focus\n */\n focusRing: string;\n\n /**\n * Style for the arc labels\n */\n arcLabel: string;\n}\n"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Arc';\nexport * from './Arc.types';\n"],"names":[],"mappings":";;;;;uBAAc,QAAQ;uBACR,cAAc"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Arc/index.ts"],"sourcesContent":["export * from './Arc';\nexport * from './Arc.types';\n"],"names":[],"mappings":";;;;;uBAAc,QAAQ;uBACR,cAAc"}
@@ -88,4 +88,4 @@ const useArcStyles = (props)=>{
88
88
  focusRing: (0, _react.mergeClasses)(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),
89
89
  arcLabel: (0, _react.mergeClasses)(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)
90
90
  };
91
- }; //# sourceMappingURL=useArcStyles.styles.js.map
91
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["useArcStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutArcClassNames = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel'\n};\n/**\n * Base Styles\n */ const 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 * Apply styling to the Arc components\n */ export const useArcStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","Bceei9c","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","ojy3ng","B4ncu3z","zxy5zd","bkw2yb","Bjksbd0","Be5yapy","Bkfmm31","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","p","useArcStyles","props","_props_styles","_props_styles1","_props_styles2","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBK,kBAAkB;;;gBA8BN;eAAZuB;;;uBAlCoC,gBAAgB;AAI1D,2BAA2B;IAClCtB,IAAI,EAAE,qBAAqB;IAC3BC,SAAS,EAAE,0BAA0B;IACrCC,QAAQ,EAAE;AACd,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGT,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAI,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAZ,SAAA,EAAA;QAAAQ,MAAA,EAAA;QAAAK,OAA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;IACrL,CAAC;AACL,CAAC"}
1
+ {"version":3,"sources":["useArcStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutArcClassNames = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel'\n};\n/**\n * Base Styles\n */ const 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 * Apply styling to the Arc components\n */ export const useArcStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","Bceei9c","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","ojy3ng","B4ncu3z","zxy5zd","bkw2yb","Bjksbd0","Be5yapy","Bkfmm31","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","p","useArcStyles","props","_props_styles","_props_styles1","_props_styles2","className","baseStyles","styles"],"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AM,IAAI,IAAIL,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACxB,IAAI,CAAC;QAC1KC,SAAS,MAAEN,mBAAY,EAACI,kBAAkB,CAACE,SAAS,EAAE2B,UAAU,CAAC3B,SAAS,EAAE,CAACwB,cAAc,GAAGF,KAAK,CAACM,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACxB,SAAS,CAAC;QACtLC,QAAQ,MAAEP,mBAAY,EAACI,kBAAkB,CAACG,QAAQ,EAAE0B,UAAU,CAAC1B,QAAQ,EAAE,CAACwB,cAAc,GAAGH,KAAK,CAACM,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACxB,QAAQ;IACrL,CAAC;AACL,CAAC"}
@@ -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"}
@@ -18,6 +18,7 @@ const _index2 = require("../../index");
18
18
  const _reactutilities = require("@fluentui/react-utilities");
19
19
  const _reacttabster = require("@fluentui/react-tabster");
20
20
  const _ChartPopover = require("../CommonComponents/ChartPopover");
21
+ const _imageexportutils = require("../../utilities/image-export-utils");
21
22
  const MIN_LEGEND_CONTAINER_HEIGHT = 40;
22
23
  const DonutChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
23
24
  const _rootElem = _react.useRef(null);
@@ -42,6 +43,8 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
42
43
  y: 0
43
44
  });
44
45
  const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
46
+ const _legendsRef = _react.useRef(null);
47
+ const _isRTL = (0, _index1.useRtl)();
45
48
  _react.useEffect(()=>{
46
49
  _fitParentContainer();
47
50
  }, []);
@@ -56,7 +59,11 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
56
59
  props.height
57
60
  ]);
58
61
  _react.useImperativeHandle(props.componentRef, ()=>({
59
- chartContainer: _rootElem.current
62
+ chartContainer: _rootElem.current,
63
+ toImage: (opts)=>{
64
+ var _legendsRef_current;
65
+ return (0, _imageexportutils.toImage)(_rootElem.current, (_legendsRef_current = _legendsRef.current) === null || _legendsRef_current === void 0 ? void 0 : _legendsRef_current.toSVG, _isRTL, opts);
66
+ }
60
67
  }), []);
61
68
  function _elevateToMinimums(data) {
62
69
  let sumOfData = 0;
@@ -102,7 +109,8 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
102
109
  legends: legendDataItems,
103
110
  centerLegends: true,
104
111
  overflowText: props.legendsOverflowText,
105
- ...props.legendProps
112
+ ...props.legendProps,
113
+ legendRef: _legendsRef
106
114
  });
107
115
  return legends;
108
116
  }
@@ -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":["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,M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,IAAI;QAChB5D,kBAAkBI,gBAAgBJ;QAClC6D,qBAAqBzJ,MAAMyJ,mBAAmB;QAC9CxB,YAAYjI,MAAMiI,UAAU;wBAIlC,OAAA,aAAA,CAACrI,0BAAAA,EAAAA;QACC4B,eAAeA;QACfE,eAAeA;QACfwE,SAASlG,CAAAA,iBAAAA,MAAMkG,OAAAA,AAAO,MAAA,QAAblG,mBAAAA,KAAAA,IAAAA,iBAAiB;QAC1BkC,eAAeA;QACfI,eAAe,CAACtC,MAAM0J,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
+ {"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, useRtl } from '../../utilities/index';\nimport { Legend, Legends, LegendContainer } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { ImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\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 const _legendsRef = React.useRef<LegendContainer>(null);\n const _isRTL: boolean = useRtl();\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 toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(_rootElem.current, _legendsRef.current?.toSVG, _isRTL, opts);\n },\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 legendRef={_legendsRef}\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","useRtl","Legends","useId","useFocusableGroup","ChartPopover","toImage","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","_legendsRef","_isRTL","useEffect","_fitParentContainer","current","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_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","legendRef","_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;;;;+BAqBCa;;;;;;;iEArBU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBACT,wBAAwB;wBAC/B,cAAc;gCACzC,4BAA4B;8BAChB,0BAA0B;8BAC/B,mCAAmC;kCAExC,qCAAqC;AAE7D,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDb,OAAMc,UAAU,CAClF,CAACC,OAAOC;IACN,MAAMC,YAAYjB,OAAMkB,MAAM,CAAwB;IACtD,MAAMC,gBAAoBX,qBAAAA,EAAM;IAChC,qDAAqD,GACrD,IAAIY;IACJ,IAAIC;IACJ,MAAMC,kBAAkBtB,OAAMkB,MAAM,CAAwB;IAC5D,MAAMK,WAAWvB,OAAMkB,MAAM,CAAsC,CAAC;IAEpE,MAAM,CAACM,OAAOC,SAAS,GAAGzB,OAAM0B,QAAQ,CAAqB;IAC7D,MAAM,CAACC,QAAQC,UAAU,GAAG5B,OAAM0B,QAAQ,CAAqB;IAC/D,MAAM,CAACG,QAAQC,SAAS,GAAG9B,OAAM0B,QAAQ,CAAqBX,MAAMgB,KAAK,IAAI;IAC7E,MAAM,CAACC,SAASC,UAAU,GAAGjC,OAAM0B,QAAQ,CAAqBX,MAAMmB,MAAM,IAAI;IAChF,MAAM,CAACC,cAAcC,gBAAgB,GAAGpC,OAAM0B,QAAQ,CAAS;IAC/D,MAAM,CAACW,OAAOC,SAAS,GAAGtC,OAAM0B,QAAQ,CAAqB;IAC7D,MAAM,CAACa,eAAeC,iBAAiB,GAAGxC,OAAM0B,QAAQ,CAAS;IACjE,MAAM,CAAC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AC3I,0BAAAA,EAAAA;QACC6B,eAAeA;QACfE,eAAeA;QACf6E,SAASvG,CAAAA,iBAAAA,MAAMuG,OAAAA,AAAO,MAAA,QAAbvG,mBAAAA,KAAAA,IAAAA,iBAAiB;QAC1BkC,eAAeA;QACfI,eAAe,CAACtC,MAAM+J,WAAW,IAAIzH;QACrC1B,QAAQA;QACRoJ,QAAQvJ;QACRa,OAAOA;QACP2I,mBAAmB;QACnBC,eAAe;YACbC,mBAAmBnK,MAAMoK,2BAA2B,GAChDpK,MAAMoK,2BAA2B,CAACpI,yBAClC2B;YACJ0G,oBAAoBrK,MAAMsK,wBAAwB,GAC9CtK,MAAMsK,wBAAwB,CAACtI,yBAC/B2B;QACN;QACA4G,aAAa;QAEd,CAAChD,cAAAA,WAAAA,GACA,OAAA,aAAA,CAACqB,OAAAA;QAAIG,KAAK,CAAC/D,IAAuBzE,gBAAgBqC,OAAO,GAAGoC;QAAI6D,WAAWV,QAAQ5H,eAAe;OAC/F6H,eAAAA,WAAAA,GAKP,OAAA,aAAA,CAACQ,OAAAA;QAAI7D,IAAIzE;QAAgBkK,MAAM;QAASC,OAAO;YAAEC,SAAS;QAAI;QAAGrB,cAAY;;AAEjF,GACA;AAEFvJ,WAAW6K,WAAW,GAAG;AACzB7K,WAAW8K,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":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
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":["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,SA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,aAAA,CAACyB,KAAAA;QAAEC,WAAWJ;OACXD,SAASD,GAAG,CAAC,CAAC7B,GAAQc,IAAcD,aAAab,GAAGc,GAAGC,SAAS,CAACD,EAAE,EAAExB,MAAM0B,IAAI,IAC/E1B,MAAMmC,gBAAgB,IAAA,WAAA,GACrB,OAAA,aAAA,CAACW,QAAAA;QAAKC,GAAG;QAAGC,YAAW;QAASC,kBAAiB;QAASC,WAAW/C,QAAQC,iBAAiB;OAC3FJ,MAAMmC,gBAAgB;AAKjC,GACA;AACFrC,IAAIqD,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;YAC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IAAIqD,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["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
+ {"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":[],"mappings":";;;;;uBAAc,QAAQ;uBACR,cAAc"}
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
+ };
@@ -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":[],"mappings":";;;;;uBAAc,eAAe;uBACf,qBAAqB;uBACrB,oBAAoB"}
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
+ };
@@ -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;AAE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