@fluentui/react-charts 9.2.3 → 9.3.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 (347) hide show
  1. package/CHANGELOG.md +79 -10
  2. package/dist/index.d.ts +98 -5
  3. package/lib/components/AreaChart/AreaChart.js +8 -6
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/AreaChart/useAreaChartStyles.styles.js +4 -2
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +4 -15
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js +95 -8
  10. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  11. package/lib/components/ChartTable/useChartTableStyles.styles.js +5 -3
  12. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  13. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +3 -2
  14. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.js +45 -42
  16. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  17. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  18. package/lib/components/CommonComponents/ChartPopover.js +14 -5
  19. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  20. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +19 -14
  21. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  22. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +7 -33
  23. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  24. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +5 -3
  25. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  26. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
  27. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  28. package/lib/components/DeclarativeChart/DeclarativeChart.js +56 -16
  29. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  30. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +19 -0
  31. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  32. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1096 -337
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  34. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  35. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  36. package/lib/components/DonutChart/Arc/Arc.js +8 -8
  37. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  38. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  39. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +9 -2
  40. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  41. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -1
  42. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  43. package/lib/components/DonutChart/DonutChart.js +61 -25
  44. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  45. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  46. package/lib/components/DonutChart/Pie/Pie.js +1 -0
  47. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  48. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  49. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +2 -0
  50. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  51. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  52. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  53. package/lib/components/DonutChart/useDonutChartStyles.styles.js +23 -4
  54. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  55. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +9 -4
  56. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  57. package/lib/components/FunnelChart/FunnelChart.js +11 -5
  58. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  59. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  60. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +2 -0
  61. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  62. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  63. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  64. package/lib/components/GanttChart/GanttChart.js +1 -0
  65. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  66. package/lib/components/GaugeChart/GaugeChart.js +2 -2
  67. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  68. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -0
  69. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  70. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  71. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  72. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +15 -9
  73. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  74. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +6 -17
  75. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  76. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +5 -21
  77. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  78. package/lib/components/HeatMapChart/HeatMapChart.js +2 -1
  79. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  80. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -0
  81. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  82. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  83. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  84. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +3 -3
  85. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  86. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +8 -2
  87. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  88. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -1
  89. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  90. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  91. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  92. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -0
  93. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  94. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  95. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  96. package/lib/components/Legends/Legends.js +1 -0
  97. package/lib/components/Legends/Legends.js.map +1 -1
  98. package/lib/components/Legends/OverflowMenu.js +1 -0
  99. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  100. package/lib/components/Legends/shape.js +1 -0
  101. package/lib/components/Legends/shape.js.map +1 -1
  102. package/lib/components/Legends/useLegendsStyles.styles.js +2 -0
  103. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  104. package/lib/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  105. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  106. package/lib/components/LineChart/LineChart.js +284 -281
  107. package/lib/components/LineChart/LineChart.js.map +1 -1
  108. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  109. package/lib/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  110. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  111. package/lib/components/LineChart/eventAnnotation/Textbox.js +1 -0
  112. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  113. package/lib/components/LineChart/useLineChartStyles.styles.js +25 -10
  114. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  115. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +5 -21
  116. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  117. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  118. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  119. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +2 -0
  120. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  121. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  122. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  123. package/lib/components/ResponsiveContainer/withResponsiveContainer.js +1 -0
  124. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  125. package/lib/components/SankeyChart/SankeyChart.js +1 -0
  126. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  127. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +14 -25
  128. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  129. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +3 -12
  130. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  131. package/lib/components/ScatterChart/ScatterChart.js +121 -81
  132. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  133. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  134. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -7
  135. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  136. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +5 -22
  137. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  138. package/lib/components/Sparkline/Sparkline.js +1 -0
  139. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  140. package/lib/components/Sparkline/useSparklineStyles.styles.js +2 -0
  141. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  142. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  143. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  144. package/lib/components/VerticalBarChart/VerticalBarChart.js +17 -12
  145. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  146. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +10 -6
  147. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  148. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +6 -19
  149. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +30 -25
  151. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  152. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +9 -6
  153. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  154. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +5 -19
  155. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  156. package/lib/types/DataPoint.js +3 -1
  157. package/lib/types/DataPoint.js.map +1 -1
  158. package/lib/utilities/Common.styles.js +47 -0
  159. package/lib/utilities/Common.styles.js.map +1 -0
  160. package/lib/utilities/Common.styles.raw.js +47 -0
  161. package/lib/utilities/Common.styles.raw.js.map +1 -0
  162. package/lib/utilities/FocusableTooltipText.js +1 -0
  163. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  164. package/lib/utilities/SVGTooltipText.js +1 -0
  165. package/lib/utilities/SVGTooltipText.js.map +1 -1
  166. package/lib/utilities/image-export-utils.js +1 -0
  167. package/lib/utilities/image-export-utils.js.map +1 -1
  168. package/lib/utilities/index.js +1 -0
  169. package/lib/utilities/index.js.map +1 -1
  170. package/lib/utilities/scatterpolar-utils.js +52 -0
  171. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  172. package/lib/utilities/utilities.js +314 -146
  173. package/lib/utilities/utilities.js.map +1 -1
  174. package/lib/utilities/vbc-utils.js.map +1 -1
  175. package/lib-commonjs/components/AreaChart/AreaChart.js +7 -5
  176. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  177. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -0
  178. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  179. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -14
  180. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  181. package/lib-commonjs/components/ChartTable/ChartTable.js +95 -8
  182. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  183. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +4 -3
  184. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  185. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +3 -2
  186. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  187. package/lib-commonjs/components/CommonComponents/CartesianChart.js +45 -42
  188. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  189. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  190. package/lib-commonjs/components/CommonComponents/ChartPopover.js +14 -5
  191. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  192. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +16 -13
  193. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  194. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +5 -32
  195. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +4 -3
  197. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  198. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
  199. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  200. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +60 -20
  201. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  202. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +22 -0
  203. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  204. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1109 -338
  205. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  206. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  207. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  208. package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -8
  209. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  210. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  211. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +11 -1
  212. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  213. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -1
  214. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  215. package/lib-commonjs/components/DonutChart/DonutChart.js +61 -25
  216. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  217. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  218. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -1
  219. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  220. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  221. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -0
  222. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  223. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  224. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  225. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +33 -4
  226. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  227. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +9 -4
  228. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  229. package/lib-commonjs/components/FunnelChart/FunnelChart.js +11 -5
  230. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  231. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  232. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -0
  233. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  234. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  235. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  236. package/lib-commonjs/components/GanttChart/GanttChart.js +1 -0
  237. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  238. package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -2
  239. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  240. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -0
  241. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  242. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  243. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  244. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +15 -9
  245. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  246. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +3 -19
  247. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  248. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +4 -20
  249. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  250. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -1
  251. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  252. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -0
  253. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  255. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  256. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +3 -3
  257. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  258. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +10 -2
  259. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  260. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -1
  261. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  262. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  263. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  264. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -0
  265. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  266. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  267. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  268. package/lib-commonjs/components/Legends/Legends.js +1 -0
  269. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  270. package/lib-commonjs/components/Legends/OverflowMenu.js +1 -0
  271. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  272. package/lib-commonjs/components/Legends/shape.js +1 -0
  273. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  274. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +1 -0
  275. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  277. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  278. package/lib-commonjs/components/LineChart/LineChart.js +282 -279
  279. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  280. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  281. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  282. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  283. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +1 -0
  284. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  285. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +31 -9
  286. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  287. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -20
  288. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  289. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  290. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  291. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -0
  292. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  293. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  294. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  295. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +2 -1
  296. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  297. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -0
  298. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  299. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +24 -33
  300. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  301. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
  302. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  303. package/lib-commonjs/components/ScatterChart/ScatterChart.js +118 -78
  304. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  305. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  306. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +14 -7
  307. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  308. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -20
  309. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  310. package/lib-commonjs/components/Sparkline/Sparkline.js +1 -0
  311. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  312. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -0
  313. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  314. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  315. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  316. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +16 -11
  317. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  318. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +6 -3
  319. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  320. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +4 -17
  321. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  322. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -24
  323. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  324. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +6 -3
  325. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  326. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +4 -18
  327. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  328. package/lib-commonjs/types/DataPoint.js +3 -1
  329. package/lib-commonjs/types/DataPoint.js.map +1 -1
  330. package/lib-commonjs/utilities/Common.styles.js +71 -0
  331. package/lib-commonjs/utilities/Common.styles.js.map +1 -0
  332. package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
  333. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
  334. package/lib-commonjs/utilities/FocusableTooltipText.js +2 -1
  335. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  336. package/lib-commonjs/utilities/SVGTooltipText.js +1 -0
  337. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  338. package/lib-commonjs/utilities/image-export-utils.js +1 -0
  339. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  340. package/lib-commonjs/utilities/index.js +1 -0
  341. package/lib-commonjs/utilities/index.js.map +1 -1
  342. package/lib-commonjs/utilities/scatterpolar-utils.js +67 -0
  343. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  344. package/lib-commonjs/utilities/utilities.js +327 -137
  345. package/lib-commonjs/utilities/utilities.js.map +1 -1
  346. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  347. package/package.json +10 -10
@@ -1 +1 @@
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, MIN_DONUT_RADIUS, useRtl } from '../../utilities/index';\nimport { Legend, Legends, LegendContainer } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } 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[]): JSXElement {\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 =\n props.innerRadius! > MIN_DONUT_RADIUS ? _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","MIN_DONUT_RADIUS","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,WAAW,QAAQ;AAC/B,SAASC,GAAG,QAAQ,cAAc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Ed,CAAChD,4BACA,oBAACqB;QAAIG,KAAK,CAAC/D,IAAuBzE,gBAAgBqC,OAAO,GAAGoC;QAAI6D,WAAWV,QAAQ5H,eAAe;OAC/F6H,6BAKP,oBAACQ;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
+ {"version":3,"sources":["../src/components/DonutChart/DonutChart.tsx"],"sourcesContent":["'use client';\n\n/* 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 { areArraysEqual, getColorFromToken, getNextColor, MIN_DONUT_RADIUS, useRtl } from '../../utilities/index';\nimport { Legend, Legends, LegendContainer } from '../../index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } 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 | undefined>(undefined);\n const [color, setColor] = React.useState<string | undefined>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [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 prevPropsRef = React.useRef<DonutChartProps | null>(null);\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 (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\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[]): JSXElement {\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 hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend!);\n },\n onMouseOutAction: () => {\n setActiveLegend(undefined);\n },\n };\n return legend;\n });\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n function _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps && props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\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(_noLegendsHighlighted() || _isLegendHighlighted(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(_noLegendsHighlighted() || _isLegendHighlighted(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 highlightedLegends = _getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || isPopoverOpen)) {\n const pointValue = data.find(point => _isLegendHighlighted(point.legend));\n return pointValue\n ? pointValue.yAxisCalloutData\n ? pointValue.yAxisCalloutData\n : pointValue.data!\n : valueInsideDonut;\n } else if (highlightedLegends.length > 0) {\n let totalValue = 0;\n data.forEach(point => {\n if (highlightedLegends.includes(point.legend!)) {\n totalValue += point.data!;\n }\n });\n return totalValue;\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 */\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _isLegendHighlighted(legend: string | undefined): boolean {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _noLegendsHighlighted(): boolean {\n return _getHighlightedLegend().length === 0;\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 =\n props.innerRadius! > MIN_DONUT_RADIUS ? _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 {props.xAxisAnnotation && (\n <text className={classes.axisAnnotation} x={_width! / 2} y={_height! - 10} textAnchor=\"middle\">\n {props.xAxisAnnotation}\n </text>\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={\n !props.hideTooltip && isPopoverOpen && (_noLegendsHighlighted() || _isLegendHighlighted(legend))\n }\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","areArraysEqual","getColorFromToken","getNextColor","MIN_DONUT_RADIUS","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","undefined","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegends","setSelectedLegends","legendProps","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","prevPropsRef","_legendsRef","_isRTL","useEffect","_fitParentContainer","current","prevProps","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","toLocaleString","_createLegends","chartData","legendDataItems","map","point","index","title","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_focusCallback","id","e","cx","cy","targetRect","target","getBoundingClientRect","left","top","updatePosition","_noLegendsHighlighted","_isLegendHighlighted","toString","xAxisCalloutData","_hoverCallback","clientX","clientY","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegends","_getHighlightedLegend","length","pointValue","find","totalValue","includes","_toLocaleString","localeString","culture","_isChartEmpty","filter","d","_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","xAxisAnnotation","text","axisAnnotation","textAnchor","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;AAEA,oCAAoC,GACpC,YAAYA,WAAW,QAAQ;AAC/B,SAASC,GAAG,QAAQ,cAAc;AAElC,SAASC,mBAAmB,QAAQ,+BAA+B;AAEnE,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,cAAc,EAAEC,iBAAiB,EAAEC,YAAY,EAAEC,gBAAgB,EAAEC,MAAM,QAAQ,wBAAwB;AAClH,SAAiBC,OAAO,QAAyB,cAAc;AAC/D,SAASC,KAAK,QAAQ,4BAA4B;AAElD,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,YAAY,QAAQ,mCAAmC;AAEhE,SAASC,OAAO,QAAQ,qCAAqC;AAE7D,MAAMC,8BAA8B;AAEpC,4FAA4F;AAC5F;;;CAGC,GACD,OAAO,MAAMC,2BAAuDf,MAAMgB,UAAU,CAClF,CAACC,OAAOC;QAiBiED;IAhBvE,MAAME,YAAYnB,MAAMoB,MAAM,CAAwB;IACtD,MA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aAAa;IACbJ,YAAY;AACd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DonutChart/DonutChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\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) => JSXElement | 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 * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\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":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/DonutChart/DonutChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { CartesianChartProps, 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 extends CartesianChartProps {\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) => JSXElement | 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 * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\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 axis annotation\n */\n axisAnnotation?: string;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: string;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  /* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react/jsx-no-bind */ /* eslint-disable @typescript-eslint/no-explicit-any */ import * as React from 'react';
2
3
  import { pie as d3Pie } from 'd3-shape';
3
4
  import { Arc } from '../Arc/index';
@@ -1 +1 @@
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 type { JSXElement } from '@fluentui/react-utilities';\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 JSXElement {\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,WAAW,QAAQ;AAE/B,SAASC,OAAOC,KAAK,QAAQ,WAAW;AAExC,SAASC,GAAG,QAAQ,eAAe;AAEnC,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,MAAMC,eAAuB;AAE7B,wGAAwG;AACxG;;;CAGC,GACD,OAAO,MAAMC,oBAAyCP,MAAMQ,UAAU,CACpE,CAACC,OAAOC;IACNV,MAAMW,SAAS,CAAC;QACdN,oBAAoBO,QAAQC,iBAAiB,EAAEJ,MAAMK,WAAW,GAAI,IAAIR;IAC1E,GAAG,EAAE;IAEL,IAAIS;IACJ,MAAMH,UAAUR,aAAaK;IAC7B,MAAMO,kBAAkBd,QACrBe,IAAI,CAAC,KACN,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,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AAKjC,GACA;AACFrC,IAAIqD,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/Pie.tsx"],"sourcesContent":["'use client';\n\n/* 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 type { JSXElement } from '@fluentui/react-utilities';\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 JSXElement {\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;AAEA,8CAA8C,GAC9C,oCAAoC,GACpC,qDAAqD,GACrD,YAAYA,WAAW,QAAQ;AAE/B,SAASC,OAAOC,KAAK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AAMgC,QAAQ;YACxBC,WAAWjC,MAAMiC,SAAS;YAC1BP,MAAMA;YACNQ,WAAWlC,MAAMkC,SAAS;YAC1BC,kBAAkBnC,MAAMmC,gBAAgB;YACxCC,cAAcpC,MAAMoC,YAAY;YAChCC,qBAAqBrC,MAAMqC,mBAAmB;YAC9CjB,YAAYd;YACZgC,YAAYtC,MAAMsC,UAAU;;IAGlC;IAEA,MAAM,EAAE3B,IAAI,EAAE,GAAGX;IACjB,MAAMyB,YAAYlB,gBAAgBI,KAAK4B,GAAG,CAAC7B,CAAAA,IAAKA,EAAEC,IAAI;IAEtD,MAAM6B,WAAW/C,QACde,IAAI,CAAC,KACN,8DAA8D;KAC7DC,KAAK,CAAC,CAACC,IAAWA,EAAEC,IAAI,EACxBC,QAAQ,CAAC,MAAMD;IAClB,MAAM8B,YAAY,CAAC,UAAU,EAAEzC,MAAM0C,KAAK,GAAG,EAAE,EAAE,EAAE1C,MAAM2C,MAAM,GAAG,EAAE,CAAC,CAAC;IAEtErC,cAAca;IAEd,qBACE,oBAACyB;QAAEC,WAAWJ;OACXD,SAASD,GAAG,CAAC,CAAC7B,GAAQc,IAAcD,aAAab,GAAGc,GAAGC,SAAS,CAACD,EAAE,EAAExB,MAAM0B,IAAI,IAC/E1B,MAAMmC,gBAAgB,kBACrB,oBAACW;QAAKC,GAAG;QAAGC,YAAW;QAASC,kBAAiB;QAASC,WAAW/C,QAAQC,iBAAiB;OAC3FJ,MAAMmC,gBAAgB;AAKjC,GACA;AACFrC,IAAIqD,WAAW,GAAG"}
@@ -1 +1 @@
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":"AAiGA,WAUC"}
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":"AAiGA,WAUC"}
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { tokens, typographyStyles } from '@fluentui/react-theme';
2
4
  import { __styles, mergeClasses } from '@griffel/react';
3
5
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["tokens","typographyStyles","__styles","mergeClasses","donutPieClassNames","root","insideDonutString","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkfmm31","Bvjb7m6","d","usePieStyles","props","_props_styles","_props_styles1","className","baseStyles","styles"],"sources":["usePieStyles.styles.js"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\n/**\n * @internal\n */ export const donutPieClassNames = {\n root: 'fui-donut-pie__root',\n insideDonutString: 'fui-donut-pie__insideDonutString'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {},\n insideDonutString: {\n ...typographyStyles.title2,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n }\n});\n/**\n * Apply styling to the Pie inside donut chart component\n */ export const usePieStyles = (props)=>{\n var _props_styles, _props_styles1;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n insideDonutString: mergeClasses(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)\n };\n};\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAG;EAClCC,IAAI,EAAE,qBAAqB;EAC3BC,iBAAiB,EAAE;AACvB,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAG,IAAA;EAAAC,iBAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,YAAY,GAAIC,KAAK,IAAG;EACrC,IAAIC,aAAa,EAAEC,cAAc;EACjC,MAAM;IAAEC;EAAU,CAAC,GAAGH,KAAK;EAC3B,MAAMI,UAAU,GAAGb,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHF,IAAI,EAAEF,YAAY,CAACC,kBAAkB,CAACC,IAAI,EAAEe,UAAU,CAACf,IAAI,EAAEc,SAAS,EAAE,CAACF,aAAa,GAAGD,KAAK,CAACK,MAAM,MAAM,IAAI,IAAIJ,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACZ,IAAI,CAAC;IAC1KC,iBAAiB,EAAEH,YAAY,CAACC,kBAAkB,CAACE,iBAAiB,EAAEc,UAAU,CAACd,iBAAiB,EAAEa,SAAS,EAAE,CAACD,cAAc,GAAGF,KAAK,CAACK,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACZ,iBAAiB;EACpO,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["tokens","typographyStyles","__styles","mergeClasses","donutPieClassNames","root","insideDonutString","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bkfmm31","Bvjb7m6","d","usePieStyles","props","_props_styles","_props_styles1","className","baseStyles","styles"],"sources":["usePieStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\n/**\n * @internal\n */ export const donutPieClassNames = {\n root: 'fui-donut-pie__root',\n insideDonutString: 'fui-donut-pie__insideDonutString'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {},\n insideDonutString: {\n ...typographyStyles.title2,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n }\n});\n/**\n * Apply styling to the Pie inside donut chart component\n */ export const usePieStyles = (props)=>{\n var _props_styles, _props_styles1;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutPieClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n insideDonutString: mergeClasses(donutPieClassNames.insideDonutString, baseStyles.insideDonutString, className, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.insideDonutString)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAG;EAClCC,IAAI,EAAE,qBAAqB;EAC3BC,iBAAiB,EAAE;AACvB,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAG,IAAA;EAAAC,iBAAA;IAAAE,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,YAAY,GAAIC,KAAK,IAAG;EACrC,IAAIC,aAAa,EAAEC,cAAc;EACjC,MAAM;IAAEC;EAAU,CAAC,GAAGH,KAAK;EAC3B,MAAMI,UAAU,GAAGb,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHF,IAAI,EAAEF,YAAY,CAACC,kBAAkB,CAACC,IAAI,EAAEe,UAAU,CAACf,IAAI,EAAEc,SAAS,EAAE,CAACF,aAAa,GAAGD,KAAK,CAACK,MAAM,MAAM,IAAI,IAAIJ,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACZ,IAAI,CAAC;IAC1KC,iBAAiB,EAAEH,YAAY,CAACC,kBAAkB,CAACE,iBAAiB,EAAEc,UAAU,CAACd,iBAAiB,EAAEa,SAAS,EAAE,CAACD,cAAc,GAAGF,KAAK,CAACK,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACZ,iBAAiB;EACpO,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { tokens, typographyStyles } from '@fluentui/react-theme';
2
3
  import { makeStyles, mergeClasses } from '@griffel/react';
3
4
  /**
@@ -1 +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":"AACA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D;;CAEC,GACD,OAAO,MAAMC,qBAAgD;IAC3DC,MAAM;IACNC,mBAAmB;AACrB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYL,WAAW;IAC3BG,MAAM,CAAC;IACPC,mBAAmB;QACjB,GAAGL,iBAAiBO,MAAM;QAC1BC,MAAMT,OAAOU,uBAAuB;QACpCC,mBAAmB;IACrB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,eAAe,CAACC;QAK+CA,eAKtEA;IATJ,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,MAAME,aAAaR;IACnB,OAAO;QACLF,MAAMF,aAAaC,mBAAmBC,IAAI,EAAEU,WAAWV,IAAI,EAAES,YAAWD,gBAAAA,MAAMG,MAAM,cAAZH,oCAAAA,cAAcR,IAAI;QAC1FC,mBAAmBH,aACjBC,mBAAmBE,iBAAiB,EACpCS,WAAWT,iBAAiB,EAC5BQ,YACAD,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcP,iBAAiB;IAEnC;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Pie/usePieStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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":"AAAA;AAGA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D;;CAEC,GACD,OAAO,MAAMC,qBAAgD;IAC3DC,MAAM;IACNC,mBAAmB;AACrB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYL,WAAW;IAC3BG,MAAM,CAAC;IACPC,mBAAmB;QACjB,GAAGL,iBAAiBO,MAAM;QAC1BC,MAAMT,OAAOU,uBAAuB;QACpCC,mBAAmB;IACrB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,eAAe,CAACC;QAK+CA,eAKtEA;IATJ,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,MAAME,aAAaR;IACnB,OAAO;QACLF,MAAMF,aAAaC,mBAAmBC,IAAI,EAAEU,WAAWV,IAAI,EAAES,YAAWD,gBAAAA,MAAMG,MAAM,cAAZH,oCAAAA,cAAcR,IAAI;QAC1FC,mBAAmBH,aACjBC,mBAAmBE,iBAAiB,EACpCS,WAAWT,iBAAiB,EAC5BQ,YACAD,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcP,iBAAiB;IAEnC;AACF,EAAE"}
@@ -1,5 +1,8 @@
1
+ 'use client';
2
+
1
3
  import { __styles, mergeClasses } from '@griffel/react';
2
4
  import { tokens, typographyStyles } from '@fluentui/react-theme';
5
+ import { getAxisTitleStyle } from '../../utilities/index';
3
6
  /**
4
7
  * @internal
5
8
  */
@@ -7,7 +10,8 @@ export const donutClassNames = {
7
10
  root: 'fui-donut__root',
8
11
  chart: 'fui-donut__chart',
9
12
  legendContainer: 'fui-donut__legendContainer',
10
- chartWrapper: 'fui-donut__chartWrapper'
13
+ chartWrapper: 'fui-donut__chartWrapper',
14
+ axisAnnotation: 'fui-donut__axisAnnotation'
11
15
  };
12
16
  /**
13
17
  * Base Styles
@@ -34,17 +38,31 @@ const useStyles = /*#__PURE__*/__styles({
34
38
  legendContainer: {
35
39
  z8tnut: "fikn0iw",
36
40
  a9b677: "fly5x3f"
41
+ },
42
+ axisAnnotation: {
43
+ Bahqtrf: "fk6fouc",
44
+ Be2twd7: "f13mqy1h",
45
+ Bhrd7zp: "fl43uef",
46
+ Bg96gwp: "fcpl73t",
47
+ B80ckks: "fmd4ok8",
48
+ fsow6f: "f17mccla",
49
+ sj55zd: "fkfq4zb",
50
+ Bkfmm31: "fhuob2q",
51
+ a6j6cd: "folz2wl"
37
52
  }
38
53
  }, {
39
54
  d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1e4lqlz{box-sizing:content-box;}", ".fzm18in{alignment-adjust:center;}", ".ftgm304{display:block;}", [".f1gl81tg{overflow:visible;}", {
40
55
  p: -1
41
- }], ".fikn0iw{padding-top:var(--spacingVerticalL);}"]
56
+ }], ".fikn0iw{padding-top:var(--spacingVerticalL);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fmd4ok8{font-style:normal;}", ".f17mccla{text-align:center;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}"],
57
+ m: [["@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.folz2wl{fill:CanvasText;}}", {
58
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
59
+ }]]
42
60
  });
43
61
  /**
44
62
  * Apply styling to the DonutChart component
45
63
  */
46
64
  export const useDonutChartStyles = props => {
47
- var _props_styles, _props_styles1, _props_styles2, _props_styles3;
65
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4;
48
66
  const {
49
67
  className
50
68
  } = props;
@@ -53,6 +71,7 @@ export const useDonutChartStyles = props => {
53
71
  root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
54
72
  chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
55
73
  legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
56
- chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
74
+ chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper),
75
+ axisAnnotation: mergeClasses(donutClassNames.axisAnnotation, baseStyles.axisAnnotation, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.axisAnnotation)
57
76
  };
58
77
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","donutClassNames","root","chart","legendContainer","chartWrapper","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","a9b677","Bqenvij","B7ck84d","ek0pe7","B68tc82","Bmxbyg5","Bpg54ce","z8tnut","d","p","useDonutChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","className","baseStyles","styles"],"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutClassNames = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%'\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible'\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%'\n }\n});\n/**\n * Apply styling to the DonutChart component\n */ export const useDonutChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE;AACA;AACA;AAAI,OAAO,MAAMC,eAAe,GAAG;EAC/BC,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE,kBAAkB;EACzBC,eAAe,EAAE,4BAA4B;EAC7CC,YAAY,EAAE;AAClB,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGT,QAAA;EAAAK,IAAA;IAAAK,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAX,KAAA;IAAAY,OAAA;IAAAC,MAAA;IAAAL,MAAA;IAAAM,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAf,eAAA;IAAAgB,MAAA;IAAAP,MAAA;EAAA;AAAA;EAAAQ,CAAA;IAAAC,CAAA;EAAA;AAAA,CAmBrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,mBAAmB,GAAIC,KAAK,IAAG;EAC5C,IAAIC,aAAa,EAAEC,cAAc,EAAEC,cAAc,EAAEC,cAAc;EACjE,MAAM;IAAEC;EAAU,CAAC,GAAGL,KAAK;EAC3B,MAAMM,UAAU,GAAGxB,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHJ,IAAI,EAAEJ,YAAY,CAACG,eAAe,CAACC,IAAI,EAAE4B,UAAU,CAAC5B,IAAI,EAAE2B,SAAS,EAAE,CAACJ,aAAa,GAAGD,KAAK,CAACO,MAAM,MAAM,IAAI,IAAIN,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAACvB,IAAI,CAAC;IACvKC,KAAK,EAAEL,YAAY,CAACG,eAAe,CAACE,KAAK,EAAE2B,UAAU,CAAC3B,KAAK,EAAE,CAACuB,cAAc,GAAGF,KAAK,CAACO,MAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,KAAK,CAAC;IACnKC,eAAe,EAAEN,YAAY,CAACG,eAAe,CAACG,eAAe,EAAE0B,UAAU,CAAC1B,eAAe,EAAE,CAACuB,cAAc,GAAGH,KAAK,CAACO,MAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,eAAe,CAAC;IAC3MC,YAAY,EAAEP,YAAY,CAACG,eAAe,CAACI,YAAY,EAAE,CAACuB,cAAc,GAAGJ,KAAK,CAACO,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,YAAY;EACzK,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","getAxisTitleStyle","donutClassNames","root","chart","legendContainer","chartWrapper","axisAnnotation","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","a9b677","Bqenvij","B7ck84d","ek0pe7","B68tc82","Bmxbyg5","Bpg54ce","z8tnut","B80ckks","fsow6f","sj55zd","Bkfmm31","a6j6cd","d","p","m","useDonutChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","className","baseStyles","styles"],"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { getAxisTitleStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const donutClassNames = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper',\n axisAnnotation: 'fui-donut__axisAnnotation'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%'\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible'\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%'\n },\n axisAnnotation: getAxisTitleStyle()\n});\n/**\n * Apply styling to the DonutChart component\n */ export const useDonutChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper),\n axisAnnotation: mergeClasses(donutClassNames.axisAnnotation, baseStyles.axis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AEL,YAAY,CAACI,eAAe,CAACC,IAAI,EAAEoC,UAAU,CAACpC,IAAI,EAAEmC,SAAS,EAAE,CAACL,aAAa,GAAGD,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIP,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAAC9B,IAAI,CAAC;IACvKC,KAAK,EAAEN,YAAY,CAACI,eAAe,CAACE,KAAK,EAAEmC,UAAU,CAACnC,KAAK,EAAE,CAAC8B,cAAc,GAAGF,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIN,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,KAAK,CAAC;IACnKC,eAAe,EAAEP,YAAY,CAACI,eAAe,CAACG,eAAe,EAAEkC,UAAU,CAAClC,eAAe,EAAE,CAAC8B,cAAc,GAAGH,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,eAAe,CAAC;IAC3MC,YAAY,EAAER,YAAY,CAACI,eAAe,CAACI,YAAY,EAAE,CAAC8B,cAAc,GAAGJ,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,YAAY,CAAC;IACtKC,cAAc,EAAET,YAAY,CAACI,eAAe,CAACK,cAAc,EAAEgC,UAAU,CAAChC,cAAc,EAAE,CAAC8B,cAAc,GAAGL,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,cAAc;EAC1M,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,12 +1,15 @@
1
+ 'use client';
1
2
  import { makeStyles, mergeClasses } from '@griffel/react';
2
3
  import { tokens, typographyStyles } from '@fluentui/react-theme';
4
+ import { getAxisTitleStyle } from '../../utilities/index';
3
5
  /**
4
6
  * @internal
5
7
  */ export const donutClassNames = {
6
8
  root: 'fui-donut__root',
7
9
  chart: 'fui-donut__chart',
8
10
  legendContainer: 'fui-donut__legendContainer',
9
- chartWrapper: 'fui-donut__chartWrapper'
11
+ chartWrapper: 'fui-donut__chartWrapper',
12
+ axisAnnotation: 'fui-donut__axisAnnotation'
10
13
  };
11
14
  /**
12
15
  * Base Styles
@@ -28,18 +31,20 @@ import { tokens, typographyStyles } from '@fluentui/react-theme';
28
31
  legendContainer: {
29
32
  paddingTop: tokens.spacingVerticalL,
30
33
  width: '100%'
31
- }
34
+ },
35
+ axisAnnotation: getAxisTitleStyle()
32
36
  });
33
37
  /**
34
38
  * Apply styling to the DonutChart component
35
39
  */ export const useDonutChartStyles = (props)=>{
36
- var _props_styles, _props_styles1, _props_styles2, _props_styles3;
40
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4;
37
41
  const { className } = props;
38
42
  const baseStyles = useStyles();
39
43
  return {
40
44
  root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
41
45
  chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
42
46
  legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
43
- chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
47
+ chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper),
48
+ axisAnnotation: mergeClasses(donutClassNames.axisAnnotation, baseStyles.axisAnnotation, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.axisAnnotation)
44
49
  };
45
50
  };
@@ -1 +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":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAIjE;;CAEC,GACD,OAAO,MAAMC,kBAAoD;IAC/DC,MAAM;IACNC,OAAO;IACPC,iBAAiB;IACjBC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYT,WAAW;IAC3BK,MAAM;QACJ,wBAAwB;QACxB,GAAGF,iBAAiBO,KAAK;QACzBC,SAAS;QACTC,eAAe;QACfC,OAAO;QACPC,QAAQ;IACV;IACAR,OAAO;QACLS,WAAW;QACXC,iBAAiB;QACjBL,SAAS;QACTM,UAAU;IACZ;IACAV,iBAAiB;QACfW,YAAYhB,OAAOiB,gBAAgB;QACnCN,OAAO;IACT;AACF;AAEA;;CAEC,GACD,OAAO,MAAMO,sBAAsB,CAACC;QAKqCA,eACRA,gBAI3DA,gBAEuDA;IAX3D,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAad;IAEnB,OAAO;QACLJ,MAAMJ,aAAaG,gBAAgBC,IAAI,EAAEkB,WAAWlB,IAAI,EAAEiB,YAAWD,gBAAAA,MAAMG,MAAM,cAAZH,oCAAAA,cAAchB,IAAI;QACvFC,OAAOL,aAAaG,gBAAgBE,KAAK,EAAEiB,WAAWjB,KAAK,GAAEe,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcf,KAAK;QAChFC,iBAAiBN,aACfG,gBAAgBG,eAAe,EAC/BgB,WAAWhB,eAAe,GAC1Bc,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcd,eAAe;QAE/BC,cAAcP,aAAaG,gBAAgBI,YAAY,GAAEa,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcb,YAAY;IACrF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/DonutChart/useDonutChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { DonutChartProps, DonutChartStyles } from './index';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { getAxisTitleStyle } from '../../utilities/index';\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 axisAnnotation: 'fui-donut__axisAnnotation',\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 axisAnnotation: getAxisTitleStyle() as GriffelStyle,\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 axisAnnotation: mergeClasses(\n donutClassNames.axisAnnotation,\n baseStyles.axisAnnotation,\n props.styles?.axisAnnotation,\n ),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","getAxisTitleStyle","donutClassNames","root","chart","legendContainer","chartWrapper","axisAnnotation","useStyles","body1","display","flexDirection","width","height","boxSizing","alignmentAdjust","overflow","paddingTop","spacingVerticalL","useDonutChartStyles","props","className","baseStyles","styles"],"mappings":"AAAA;AAEA,SAAuBA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AACxE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAGjE,SAASC,iB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+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { useId } from '@fluentui/react-utilities';
3
4
  import { useRtl } from '../../utilities/index';
@@ -133,13 +134,14 @@ export const FunnelChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
133
134
  };
134
135
  }
135
136
  }
136
- function _renderSegmentText({ show, x, y, value, textColor }) {
137
+ function _renderSegmentText({ show, x, y, value, textColor, opacity }) {
137
138
  if (!show) {
138
139
  return null;
139
140
  }
140
141
  const textElement = /*#__PURE__*/ React.createElement("text", {
141
142
  x: isRTL ? funnelWidth - x : x,
142
143
  y: y,
144
+ opacity: opacity,
143
145
  textAnchor: "middle",
144
146
  alignmentBaseline: "middle",
145
147
  fill: textColor
@@ -164,7 +166,8 @@ export const FunnelChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
164
166
  tabIndex: tabIndex
165
167
  }), textProps && /*#__PURE__*/ React.createElement("g", eventHandlers, _renderSegmentText({
166
168
  ...textProps,
167
- textColor
169
+ textColor,
170
+ opacity
168
171
  })));
169
172
  }
170
173
  function _createFunnel(containerHeight, containerWidth) {
@@ -362,11 +365,14 @@ export const FunnelChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
362
365
  const funnelWidth = width * 0.8;
363
366
  const funnelOffsetX = (width - funnelWidth) / 2;
364
367
  const focusAttributes = useFocusableGroup();
365
- var _props_culture;
366
368
  return !_isChartEmpty() ? /*#__PURE__*/ React.createElement("div", {
367
369
  ref: chartContainerRef,
368
370
  className: classes.root,
369
- ...focusAttributes
371
+ ...focusAttributes,
372
+ style: {
373
+ width,
374
+ height
375
+ }
370
376
  }, /*#__PURE__*/ React.createElement("svg", {
371
377
  width: width,
372
378
  height: height,
@@ -379,7 +385,7 @@ export const FunnelChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=
379
385
  ...props.calloutProps,
380
386
  XValue: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.hoverXValue,
381
387
  yCalloutValue: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.YValue,
382
- culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
388
+ culture: props.culture,
383
389
  clickPosition: clickPosition,
384
390
  isPopoverOpen: isPopoverOpen,
385
391
  color: calloutProps === null || calloutProps === void 0 ? void 0 : calloutProps.color,