@fluentui/react-charts 9.2.2 → 9.2.4

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 (229) hide show
  1. package/CHANGELOG.md +74 -2
  2. package/dist/index.d.ts +187 -15
  3. package/lib/components/AreaChart/AreaChart.js +7 -4
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/AreaChart/useAreaChartStyles.styles.js +4 -3
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +5 -16
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js +90 -6
  10. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  11. package/lib/components/CommonComponents/CartesianChart.js +83 -38
  12. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  14. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +19 -3
  15. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  16. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +8 -23
  17. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  18. package/lib/components/DeclarativeChart/DeclarativeChart.js +214 -107
  19. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  20. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +25 -1
  21. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  22. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1618 -259
  23. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  24. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +8 -3
  25. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  26. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
  27. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  28. package/lib/components/DonutChart/DonutChart.js +8 -3
  29. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  30. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  31. package/lib/components/DonutChart/useDonutChartStyles.styles.js +21 -4
  32. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  33. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
  34. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  35. package/lib/components/FunnelChart/FunnelChart.js +4 -2
  36. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  37. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  38. package/lib/components/GanttChart/useGanttChartStyles.styles.js +2 -1
  39. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  40. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
  41. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  42. package/lib/components/GaugeChart/GaugeChart.js +1 -2
  43. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  44. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +31 -10
  45. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  46. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +6 -18
  47. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  48. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +6 -22
  49. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  50. package/lib/components/HeatMapChart/HeatMapChart.js +175 -114
  51. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  52. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
  53. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  54. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
  55. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  56. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  57. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  58. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +7 -3
  59. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  60. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
  61. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  62. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +26 -6
  63. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  64. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
  65. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  66. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
  67. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  68. package/lib/components/LineChart/LineChart.js +349 -176
  69. package/lib/components/LineChart/LineChart.js.map +1 -1
  70. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  71. package/lib/components/LineChart/useLineChartStyles.styles.js +28 -8
  72. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  73. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +9 -14
  74. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  75. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  76. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  77. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +12 -25
  78. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  79. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
  80. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  81. package/lib/components/ScatterChart/ScatterChart.js +139 -81
  82. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  83. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  84. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +29 -8
  85. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  86. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +10 -15
  87. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  88. package/lib/components/VerticalBarChart/VerticalBarChart.js +28 -5
  89. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  90. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +10 -7
  91. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  92. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +7 -20
  93. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  94. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +159 -47
  95. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  96. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  97. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +9 -7
  98. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  99. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +6 -20
  100. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  101. package/lib/types/DataPoint.js +3 -1
  102. package/lib/types/DataPoint.js.map +1 -1
  103. package/lib/utilities/Common.styles.js +47 -0
  104. package/lib/utilities/Common.styles.js.map +1 -0
  105. package/lib/utilities/Common.styles.raw.js +47 -0
  106. package/lib/utilities/Common.styles.raw.js.map +1 -0
  107. package/lib/utilities/SVGTooltipText.js.map +1 -1
  108. package/lib/utilities/image-export-utils.js.map +1 -1
  109. package/lib/utilities/index.js +1 -0
  110. package/lib/utilities/index.js.map +1 -1
  111. package/lib/utilities/scatterpolar-utils.js +52 -0
  112. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  113. package/lib/utilities/utilities.js +324 -147
  114. package/lib/utilities/utilities.js.map +1 -1
  115. package/lib/utilities/vbc-utils.js.map +1 -1
  116. package/lib-commonjs/components/AreaChart/AreaChart.js +6 -3
  117. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  118. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +2 -1
  119. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  120. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +4 -15
  121. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  122. package/lib-commonjs/components/ChartTable/ChartTable.js +90 -6
  123. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  124. package/lib-commonjs/components/CommonComponents/CartesianChart.js +83 -37
  125. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  126. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  127. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +17 -2
  128. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  129. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +6 -22
  130. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  131. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +212 -107
  132. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  133. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +31 -1
  134. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  135. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1652 -260
  136. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  137. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +12 -3
  138. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  139. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -2
  140. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  141. package/lib-commonjs/components/DonutChart/DonutChart.js +7 -2
  142. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  143. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  144. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +32 -4
  145. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  146. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
  147. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  148. package/lib-commonjs/components/FunnelChart/FunnelChart.js +4 -2
  149. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  150. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  151. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +2 -1
  152. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  153. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
  154. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  155. package/lib-commonjs/components/GaugeChart/GaugeChart.js +1 -2
  156. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  157. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +30 -9
  158. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  159. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +4 -20
  160. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  161. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +5 -21
  162. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  163. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +174 -113
  164. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  165. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
  166. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  167. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
  168. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  169. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +1 -1
  170. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  171. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +10 -3
  172. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  173. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -2
  174. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  175. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +25 -5
  176. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  177. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
  178. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  179. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
  180. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  181. package/lib-commonjs/components/LineChart/LineChart.js +347 -175
  182. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  183. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  184. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +35 -5
  185. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  186. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +7 -13
  187. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  188. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  189. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  190. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +23 -33
  191. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  192. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -12
  193. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  194. package/lib-commonjs/components/ScatterChart/ScatterChart.js +137 -79
  195. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  196. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  197. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +39 -6
  198. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  199. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +9 -14
  200. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  201. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +27 -4
  202. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  203. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +7 -4
  204. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  205. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +5 -18
  206. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  207. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +158 -46
  208. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  209. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  210. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +7 -4
  211. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  212. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +5 -19
  213. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  214. package/lib-commonjs/types/DataPoint.js +3 -1
  215. package/lib-commonjs/types/DataPoint.js.map +1 -1
  216. package/lib-commonjs/utilities/Common.styles.js +71 -0
  217. package/lib-commonjs/utilities/Common.styles.js.map +1 -0
  218. package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
  219. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
  220. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  221. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  222. package/lib-commonjs/utilities/index.js +1 -0
  223. package/lib-commonjs/utilities/index.js.map +1 -1
  224. package/lib-commonjs/utilities/scatterpolar-utils.js +67 -0
  225. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  226. package/lib-commonjs/utilities/utilities.js +337 -137
  227. package/lib-commonjs/utilities/utilities.js.map +1 -1
  228. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  229. package/package.json +10 -10
@@ -51,9 +51,10 @@ const donutArcClassNames = {
51
51
  arcLabel: {
52
52
  Bahqtrf: "fk6fouc",
53
53
  Be2twd7: "fy9rknc",
54
- Bhrd7zp: "fl43uef",
54
+ Bhrd7zp: "figsok6",
55
55
  Bg96gwp: "fwrc4pm",
56
- Bkfmm31: "fhuob2q"
56
+ Bkfmm31: "fhuob2q",
57
+ Bpvj6i6: "f1l20po4"
57
58
  }
58
59
  }, {
59
60
  d: [
@@ -74,9 +75,17 @@ const donutArcClassNames = {
74
75
  ".f1au8mb3{fill:transparent;}",
75
76
  ".fk6fouc{font-family:var(--fontFamilyBase);}",
76
77
  ".fy9rknc{font-size:var(--fontSizeBase200);}",
77
- ".fl43uef{font-weight:var(--fontWeightSemibold);}",
78
+ ".figsok6{font-weight:var(--fontWeightRegular);}",
78
79
  ".fwrc4pm{line-height:var(--lineHeightBase200);}",
79
80
  ".fhuob2q{fill:var(--colorNeutralForeground1);}"
81
+ ],
82
+ m: [
83
+ [
84
+ "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f1l20po4{stroke:CanvasText;}}",
85
+ {
86
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
87
+ }
88
+ ]
80
89
  ]
81
90
  });
82
91
  const useArcStyles = (props)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["useArcStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutArcClassNames = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n cursor: 'default',\n outline: 'transparent',\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0')\n }\n }\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent'\n },\n arcLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the Arc components\n */ export const useArcStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","Bceei9c","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","ojy3ng","B4ncu3z","zxy5zd","bkw2yb","Bjksbd0","Be5yapy","Bkfmm31","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","d","p","useArcStyles","props","_props_styles","_props_styles1","_props_styles2","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBK,kBAAkB;;;gBA8BN;eAAZuB;;;uBAlCoC,gBAAgB;AAI1D,2BAA2B;IAClCtB,IAAI,EAAE,qBAAqB;IAC3BC,SAAS,EAAE,0BAA0B;IACrCC,QAAQ,EAAE;AACd,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGT,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAI,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAA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SAAS,CAAC;QACtLC,QAAQ,MAAEP,mBAAY,EAACI,kBAAkB,CAACG,QAAQ,EAAE0B,UAAU,CAAC1B,QAAQ,EAAE,CAACwB,cAAc,GAAGH,KAAK,CAACM,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACxB,QAAQ;IACrL,CAAC;AACL,CAAC"}
1
+ {"version":3,"sources":["useArcStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../../utilities/utilities';\n/**\n * @internal\n */ export const donutArcClassNames = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n cursor: 'default',\n outline: 'transparent',\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0')\n }\n }\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent'\n },\n arcLabel: {\n ...typographyStyles.caption1,\n fill: tokens.colorNeutralForeground1,\n [HighContrastSelector]: {\n stroke: 'CanvasText'\n }\n }\n});\n/**\n * Apply styling to the Arc components\n */ export const useArcStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.arcLabel)\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","donutArcClassNames","root","focusRing","arcLabel","useStyles","Bceei9c","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","ojy3ng","B4ncu3z","zxy5zd","bkw2yb","Bjksbd0","Be5yapy","Bkfmm31","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","Bpvj6i6","d","p","m","useArcStyles","props","_props_styles","_props_styles1","_props_styles2","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAKiBM,kBAAkB;;;IAiClByB,YAAY;;;;uBAtCwB,gBAAgB;AAK1D,2BAA2B;IAClCxB,IAAI,EAAE,qBAAqB;IAC3BC,SAAS,EAAE,0BAA0B;IACrCC,QAAQ,EAAE;AACd,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAO,IAAA,EAAA;QAAAI,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAZ,SAAA,EAAA;QAAAQ,MAAA,EAAA;QAAAK,OAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAb,QAAA,EAAA;QAAAc,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAJ,OAAA,EAAA;QAAAK,OAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,CAAA,EAAA,CAAA;YAAA;SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,CAAA,EAAA;QAAA;YAAA;YAAA;gBAAAA,CAAA,EAAA;YAAA;SAAA;KAAA;AAAA,CAuBrB,CAAC;AAGS,sBAAsBE,KAAK,IAAG;IACrC,IAAIC,aAAa,EAAEC,cAAc,EAAEC,cAAc;IACjD,MAAM,EAAEC,SAAAA,EAAW,GAAGJ,KAAK;IAC3B,MAAMK,UAAU,GAAG3B,SAAS,CAAC,CAAC;IAC9B,OAAO;QACHH,IAAI,MAAEN,mBAAY,EAACK,kBAAkB,CAACC,IAAI,EAAE8B,UAAU,CAAC9B,IAAI,EAAE6B,SAAS,EAAE,CAACH,aAAa,GAAGD,KAAK,CAACM,MAAM,AAANA,MAAY,IAAI,IAAIL,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,aAAa,CAAC1B,IAAI,CAAC;QAC1KC,SAAS,MAAEP,mBAAY,EAACK,kBAAkB,CAACE,SAAS,EAAE6B,UAAU,CAAC7B,SAAS,EAAE,CAAC0B,cAAc,GAAGF,KAAK,CAACM,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC1B,SAAS,CAAC;QACtLC,QAAQ,MAAER,mBAAY,EAACK,kBAAkB,CAACG,QAAQ,EAAE4B,UAAU,CAAC5B,QAAQ,EAAE,CAAC0B,cAAc,GAAGH,KAAK,CAACM,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC1B,QAAQ;IACrL,CAAC;AACL,CAAC"}
@@ -18,6 +18,7 @@ _export(exports, {
18
18
  });
19
19
  const _react = require("@griffel/react");
20
20
  const _reacttheme = require("@fluentui/react-theme");
21
+ const _utilities = require("../../../utilities/utilities");
21
22
  const donutArcClassNames = {
22
23
  root: 'fui-donut-arc__root',
23
24
  focusRing: 'fui-donut-arc__focusRing',
@@ -42,8 +43,11 @@ const donutArcClassNames = {
42
43
  fill: 'transparent'
43
44
  },
44
45
  arcLabel: {
45
- ..._reacttheme.typographyStyles.caption1Strong,
46
- fill: _reacttheme.tokens.colorNeutralForeground1
46
+ ..._reacttheme.typographyStyles.caption1,
47
+ fill: _reacttheme.tokens.colorNeutralForeground1,
48
+ [_utilities.HighContrastSelector]: {
49
+ stroke: 'CanvasText'
50
+ }
47
51
  }
48
52
  });
49
53
  const useArcStyles = (props)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/DonutChart/Arc/useArcStyles.styles.ts"],"sourcesContent":["import { ArcProps, ArcStyles } from './Arc.types';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport const donutArcClassNames: SlotClassNames<ArcStyles> = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n cursor: 'default',\n outline: 'transparent',\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0'),\n },\n },\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent',\n },\n arcLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n },\n});\n\n/**\n * Apply styling to the Arc components\n */\nexport const useArcStyles = (props: ArcProps): ArcStyles => {\n const { className } = props;\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, props.styles?.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, props.styles?.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, props.styles?.arcLabel),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","donutArcClassNames","root","focusRing","arcLabel","useStyles","cursor","outline","stroke","colorNeutralBackground1","border","colorStrokeFocus2","strokeWidth","strokeWidthThickest","fill","caption1Strong","colorNeutralForeground1","useArcStyles","props","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAQaK,kBAAAA;;;IAkCAgB,YAAAA;;;;uBAzCwC,iBAAiB;4BAC7B,wBAAwB;AAM1D,2BAAsD;IAC3Df,MAAM;IACNC,WAAW;IACXC,UAAU;AACZ,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYT,iBAAAA,EAAW;IAC3BM,MAAM;QACJI,QAAQ;QACRC,SAAS;QACTC,QAAQT,kBAAAA,CAAOU,uBAAuB;QACtC,eAAe;YACb,sBAAsB;gBACpB,GAAGX,iBAAAA,CAAWY,MAAM,CAAC,IAAI;YAC3B;QACF;IACF;IACAP,WAAW;QACTK,QAAQT,kBAAAA,CAAOY,iBAAiB;QAChCC,aAAab,kBAAAA,CAAOc,mBAAmB;QACvCC,MAAM;IACR;IACAV,UAAU;QACR,GAAGJ,4BAAAA,CAAiBe,cAAc;QAClCD,MAAMf,kBAAAA,CAAOiB,uBAAuB;IACtC;AACF;AAKO,qBAAqB,CAACE;QAK+CA,eACIA,gBACHA;IAN3E,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAaf;IAEnB,OAAO;QACLH,UAAML,mBAAAA,EAAaI,mBAAmBC,IAAI,EAAEkB,WAAWlB,IAAI,EAAEiB,WAAAA,CAAWD,gBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAchB,IAAI;QAC1FC,eAAWN,mBAAAA,EAAaI,mBAAmBE,SAAS,EAAEiB,WAAWjB,SAAS,EAAA,CAAEe,iBAAAA,MAAMG,MAAM,AAANA,MAAM,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcf,SAAS;QACnGC,cAAUP,mBAAAA,EAAaI,mBAAmBG,QAAQ,EAAEgB,WAAWhB,QAAQ,EAAA,CAAEc,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcd,QAAQ;IACjG;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/DonutChart/Arc/useArcStyles.styles.ts"],"sourcesContent":["import { ArcProps, ArcStyles } from './Arc.types';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { HighContrastSelector } from '../../../utilities/utilities';\n\n/**\n * @internal\n */\nexport const donutArcClassNames: SlotClassNames<ArcStyles> = {\n root: 'fui-donut-arc__root',\n focusRing: 'fui-donut-arc__focusRing',\n arcLabel: 'fui-donut-arc__arcLabel',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n cursor: 'default',\n outline: 'transparent',\n stroke: tokens.colorNeutralBackground1,\n '& selectors': {\n '::-moz-focus-inner': {\n ...shorthands.border('0'),\n },\n },\n },\n focusRing: {\n stroke: tokens.colorStrokeFocus2,\n strokeWidth: tokens.strokeWidthThickest,\n fill: 'transparent',\n },\n arcLabel: {\n ...typographyStyles.caption1,\n fill: tokens.colorNeutralForeground1,\n [HighContrastSelector]: {\n stroke: 'CanvasText',\n },\n },\n});\n\n/**\n * Apply styling to the Arc components\n */\nexport const useArcStyles = (props: ArcProps): ArcStyles => {\n const { className } = props;\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(donutArcClassNames.root, baseStyles.root, className, props.styles?.root),\n focusRing: mergeClasses(donutArcClassNames.focusRing, baseStyles.focusRing, props.styles?.focusRing),\n arcLabel: mergeClasses(donutArcClassNames.arcLabel, baseStyles.arcLabel, props.styles?.arcLabel),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","HighContrastSelector","donutArcClassNames","root","focusRing","arcLabel","useStyles","cursor","outline","stroke","colorNeutralBackground1","border","colorStrokeFocus2","strokeWidth","strokeWidthThickest","fill","caption1","colorNeutralForeground1","useArcStyles","props","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IASaM,kBAAAA;;;IAqCAgB,YAAAA;;;;uBA7CwC,iBAAiB;4BAC7B,wBAAwB;2BAE5B,+BAA+B;AAK7D,2BAAsD;IAC3Df,MAAM;IACNC,WAAW;IACXC,UAAU;AACZ,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYV,iBAAAA,EAAW;IAC3BO,MAAM;QACJI,QAAQ;QACRC,SAAS;QACTC,QAAQV,kBAAAA,CAAOW,uBAAuB;QACtC,eAAe;YACb,sBAAsB;gBACpB,GAAGZ,iBAAAA,CAAWa,MAAM,CAAC,IAAI;YAC3B;QACF;IACF;IACAP,WAAW;QACTK,QAAQV,kBAAAA,CAAOa,iBAAiB;QAChCC,aAAad,kBAAAA,CAAOe,mBAAmB;QACvCC,MAAM;IACR;IACAV,UAAU;QACR,GAAGL,4BAAAA,CAAiBgB,QAAQ;QAC5BD,MAAMhB,kBAAAA,CAAOkB,uBAAuB;QACpC,CAAChB,+BAAAA,CAAqB,EAAE;YACtBQ,QAAQ;QACV;IACF;AACF;AAKO,qBAAqB,CAACU;QAK+CA,eACIA,gBACHA;IAN3E,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAaf;IAEnB,OAAO;QACLH,UAAMN,mBAAAA,EAAaK,mBAAmBC,IAAI,EAAEkB,WAAWlB,IAAI,EAAEiB,WAAAA,CAAWD,gBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAchB,IAAI;QAC1FC,eAAWP,mBAAAA,EAAaK,mBAAmBE,SAAS,EAAEiB,WAAWjB,SAAS,EAAA,CAAEe,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcf,SAAS;QACnGC,cAAUR,mBAAAA,EAAaK,mBAAmBG,QAAQ,EAAEgB,WAAWhB,QAAQ,EAAA,CAAEc,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcd,QAAQ;IACjG;AACF,EAAE"}
@@ -246,14 +246,19 @@ const DonutChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
246
246
  const donutMarginVertical = props.hideLabels ? 0 : 40;
247
247
  const outerRadius = Math.min(_width - donutMarginHorizontal, _height - donutMarginVertical) / 2;
248
248
  const chartData = _elevateToMinimums(points.filter((d)=>d.data >= 0));
249
- const valueInsideDonut = props.innerRadius !== 0 ? _valueInsideDonut(props.valueInsideDonut, chartData) : '';
249
+ const valueInsideDonut = props.innerRadius > _index1.MIN_DONUT_RADIUS ? _valueInsideDonut(props.valueInsideDonut, chartData) : '';
250
250
  const focusAttributes = (0, _reacttabster.useFocusableGroup)();
251
251
  var _props_culture;
252
252
  return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement("div", {
253
253
  className: classes.root,
254
254
  ref: (rootElem)=>_rootElem.current = rootElem,
255
255
  onMouseLeave: _handleChartMouseLeave
256
- }, /*#__PURE__*/ _react.createElement("div", {
256
+ }, props.xAxisAnnotation && /*#__PURE__*/ _react.createElement("text", {
257
+ className: classes.axisAnnotation,
258
+ x: _width / 2,
259
+ y: _height - 10,
260
+ textAnchor: "middle"
261
+ }, props.xAxisAnnotation), /*#__PURE__*/ _react.createElement("div", {
257
262
  className: classes.chartWrapper,
258
263
  ...focusAttributes
259
264
  }, /*#__PURE__*/ _react.createElement("svg", {
@@ -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, 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 = props.innerRadius !== 0 ? _valueInsideDonut(props.valueInsideDonut!, chartData!) : '';\n const focusAttributes = useFocusableGroup();\n return !_isChartEmpty() ? (\n <div\n className={classes.root}\n ref={(rootElem: HTMLDivElement | null) => (_rootElem.current = rootElem)}\n onMouseLeave={_handleChartMouseLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes}>\n <svg className={classes.chart} aria-label={data?.chartTitle} width={_width} height={_height}>\n <Pie\n width={_width!}\n height={_height!}\n outerRadius={outerRadius}\n innerRadius={props.innerRadius!}\n data={chartData!}\n onFocusCallback={_focusCallback}\n hoverOnCallback={_hoverCallback}\n hoverLeaveCallback={_hoverLeave}\n uniqText={_uniqText}\n onBlurCallback={_onBlur}\n activeArc={_getHighlightedLegend()}\n focusedArcId={focusedArcId || ''}\n href={props.href!}\n valueInsideDonut={_toLocaleString(valueInsideDonut)}\n showLabelsInPercent={props.showLabelsInPercent}\n hideLabels={props.hideLabels}\n />\n </svg>\n </div>\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={!props.hideTooltip && isPopoverOpen}\n legend={legend!}\n YValue={value!}\n color={color}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!hideLegend && (\n <div ref={(e: HTMLDivElement) => (legendContainer.current = e)} className={classes.legendContainer}>\n {legendBars}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId!} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n\nDonutChart.displayName = 'DonutChart';\nDonutChart.defaultProps = {\n innerRadius: 0,\n hideLabels: true,\n};\n"],"names":["React","Pie","useDonutChartStyles","formatToLocaleString","getColorFromToken","getNextColor","useRtl","Legends","useId","useFocusableGroup","ChartPopover","toImage","MIN_LEGEND_CONTAINER_HEIGHT","DonutChart","forwardRef","props","forwardedRef","_rootElem","useRef","_uniqText","_calloutAnchorPoint","_emptyChartId","legendContainer","prevSize","value","setValue","useState","legend","setLegend","_width","setWidth","width","_height","setHeight","height","activeLegend","setActiveLegend","color","setColor","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","selectedLegend","setSelectedLegend","focusedArcId","setFocusedArcId","dataPointCalloutProps","setDataPointCalloutProps","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","_legendsRef","_isRTL","useEffect","_fitParentContainer","current","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_elevateToMinimums","data","sumOfData","minPercent","elevatedData","forEach","item","push","yAxisCalloutData","undefined","toLocaleString","_createLegends","chartData","legendDataItems","map","point","index","title","action","hoverAction","_handleChartMouseLeave","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","legendProps","legendRef","_focusCallback","id","e","cx","cy","targetRect","target","getBoundingClientRect","left","top","updatePosition","toString","xAxisCalloutData","_hoverCallback","clientX","clientY","_onBlur","_hoverLeave","_valueInsideDonut","valueInsideDonut","highlightedLegend","_getHighlightedLegend","legendValue","_toLocaleString","localeString","culture","_isChartEmpty","filter","d","length","_addDefaultColors","donutChartDataPoint","defaultColor","newX","newY","threshold","distance","Math","sqrt","pow","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","parseFloat","marginTop","marginBottom","parentRef","container","currentContainerWidth","currentContainerHeight","shouldResize","points","classes","legendBars","donutMarginHorizontal","hideLabels","donutMarginVertical","outerRadius","min","innerRadius","focusAttributes","div","className","root","ref","rootElem","onMouseLeave","chartWrapper","svg","chart","aria-label","chartTitle","onFocusCallback","hoverOnCallback","hoverLeaveCallback","uniqText","onBlurCallback","activeArc","href","showLabelsInPercent","hideTooltip","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerDataPoint","customCalloutProps","calloutPropsPerDataPoint","isCartesian","role","style","opacity","displayName","defaultProps"],"mappings":"AAAA,oCAAoC,GACpC,YAAYA;;;;+BAsBCa;;;;;;;iEAtBU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBACT,wBAAwB;wBAC/B,cAAc;gCACzC,4BAA4B;8BAEhB,0BAA0B;8BAC/B,mCAAmC;kCAExC,qCAAqC;AAE7D,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDb,OAAMc,UAAU,CAClF,CAACC,OAAOC;IACN,MAAMC,YAAYjB,OAAMkB,MAAM,CAAwB;IACtD,MAAMC,gBAAoBX,qBAAAA,EAAM;IAChC,qDAAqD,GACrD,IAAIY;IACJ,IAAIC;IACJ,MAAMC,kBAAkBtB,OAAMkB,MAAM,CAAwB;IAC5D,MAAMK,WAAWvB,OAAMkB,MAAM,CAAsC,CAAC;IAEpE,MAAM,CAACM,OAAOC,SAAS,GAAGzB,OAAM0B,QAAQ,CAAqB;IAC7D,MAAM,CAACC,QAAQC,UAAU,GAAG5B,OAAM0B,QAAQ,CAAqB;IAC/D,MAAM,CAACG,QAAQC,SAAS,GAAG9B,OAAM0B,QAAQ,CAAqBX,MAAMgB,KAAK,IAAI;IAC7E,MAAM,CAACC,SAASC,UAAU,GAAGjC,OAAM0B,QAAQ,CAAqBX,MAAMmB,MAAM,IAAI;IAChF,MAAM,CAACC,cAAcC,gBAAgB,GAAGpC,OAAM0B,QAAQ,CAAS;IAC/D,MAAM,CAACW,OAAOC,SAAS,GAAGtC,OAAM0B,Q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;QAClC6D,qBAAqB9J,MAAM8J,mBAAmB;QAC9CxB,YAAYtI,MAAMsI,UAAU;wBAIlC,OAAA,aAAA,CAAC3I,0BAAAA,EAAAA;QACC6B,eAAeA;QACfE,eAAeA;QACf6E,SAASvG,CAAAA,iBAAAA,MAAMuG,OAAAA,AAAO,MAAA,QAAbvG,mBAAAA,KAAAA,IAAAA,iBAAiB;QAC1BkC,eAAeA;QACfI,eAAe,CAACtC,MAAM+J,WAAW,IAAIzH;QACrC1B,QAAQA;QACRoJ,QAAQvJ;QACRa,OAAOA;QACP2I,mBAAmB;QACnBC,eAAe;YACbC,mBAAmBnK,MAAMoK,2BAA2B,GAChDpK,MAAMoK,2BAA2B,CAACpI,yBAClC2B;YACJ0G,oBAAoBrK,MAAMsK,wBAAwB,GAC9CtK,MAAMsK,wBAAwB,CAACtI,yBAC/B2B;QACN;QACA4G,aAAa;QAEd,CAAChD,cAAAA,WAAAA,GACA,OAAA,aAAA,CAACqB,OAAAA;QAAIG,KAAK,CAAC/D,IAAuBzE,gBAAgBqC,OAAO,GAAGoC;QAAI6D,WAAWV,QAAQ5H,eAAe;OAC/F6H,eAAAA,WAAAA,GAKP,OAAA,aAAA,CAACQ,OAAAA;QAAI7D,IAAIzE;QAAgBkK,MAAM;QAASC,OAAO;YAAEC,SAAS;QAAI;QAAGrB,cAAY;;AAEjF,GACA;AAEFvJ,WAAW6K,WAAW,GAAG;AACzB7K,WAAW8K,YAAY,GAAG;IACxBlC,aAAa;IACbJ,YAAY;AACd"}
1
+ {"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 {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={!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","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,oCAAoC,GACpC,YAAYA;;;;+BAsBCc;;;;;;;iEAtBU,QAAQ;uBACX,cAAc;2CAEE,+BAA+B;gCAE9B,4BAA4B;wBACS,wBAAwB;wBACjD,cAAc;gCACzC,4BAA4B;8BAEhB,0BAA0B;8BAC/B,mCAAmC;kCAExC,qCAAqC;AAE7D,MAAMD,8BAA8B;AAO7B,mBAAMC,WAAAA,GAAuDd,OAAMe,UAAU,CAClF,CAACC,OAAOC;IACN,MAAMC,YAAYlB,OAAMmB,MAAM,CAAwB;IACtD,MAAMC,gBAAoBX,qBAAAA,EAAM;IAChC,qDAAqD,GACrD,IAAIY;IACJ,IAAIC;IACJ,MAAMC,kBAAkBvB,OAAMmB,MAAM,CAAwB;IAC5D,MAAMK,WAAWxB,OAAMmB,MAAM,CAAsC,CAAC;IAEpE,MAAM,CAACM,OAAOC,SAAS,GAAG1B,OAAM2B,QAAQ,CAAqB;IAC7D,MAAM,CAACC,QAAQC,UAAU,GAAG7B,OAAM2B,QAAQ,CAAqB;IAC/D,MAAM,CAACG,QAAQC,SAAS,GAAG/B,OAAM2B,QAAQ,CAAqBX,MAAMgB,KAAK,IAAI;IAC7E,MAAM,CAACC,SAASC,UAAU,GAAGlC,OAAM2B,QAAQ,CAAqBX,MAAMmB,MAAM,IAAI;IAChF,MAAM,CAACC,cA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+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":";;;;;iEAAuB,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":";;;;;iEAAuB,QAAQ"}
@@ -21,7 +21,8 @@ const donutClassNames = {
21
21
  root: 'fui-donut__root',
22
22
  chart: 'fui-donut__chart',
23
23
  legendContainer: 'fui-donut__legendContainer',
24
- chartWrapper: 'fui-donut__chartWrapper'
24
+ chartWrapper: 'fui-donut__chartWrapper',
25
+ axisAnnotation: 'fui-donut__axisAnnotation'
25
26
  };
26
27
  /**
27
28
  * Base Styles
@@ -47,6 +48,17 @@ const donutClassNames = {
47
48
  legendContainer: {
48
49
  z8tnut: "fikn0iw",
49
50
  a9b677: "fly5x3f"
51
+ },
52
+ axisAnnotation: {
53
+ Bahqtrf: "fk6fouc",
54
+ Be2twd7: "f13mqy1h",
55
+ Bhrd7zp: "fl43uef",
56
+ Bg96gwp: "fcpl73t",
57
+ B80ckks: "fmd4ok8",
58
+ fsow6f: "f17mccla",
59
+ sj55zd: "fkfq4zb",
60
+ Bkfmm31: "fhuob2q",
61
+ a6j6cd: "folz2wl"
50
62
  }
51
63
  }, {
52
64
  d: [
@@ -67,17 +79,33 @@ const donutClassNames = {
67
79
  p: -1
68
80
  }
69
81
  ],
70
- ".fikn0iw{padding-top:var(--spacingVerticalL);}"
82
+ ".fikn0iw{padding-top:var(--spacingVerticalL);}",
83
+ ".f13mqy1h{font-size:var(--fontSizeBase100);}",
84
+ ".fl43uef{font-weight:var(--fontWeightSemibold);}",
85
+ ".fcpl73t{line-height:var(--lineHeightBase100);}",
86
+ ".fmd4ok8{font-style:normal;}",
87
+ ".f17mccla{text-align:center;}",
88
+ ".fkfq4zb{color:var(--colorNeutralForeground2);}",
89
+ ".fhuob2q{fill:var(--colorNeutralForeground1);}"
90
+ ],
91
+ m: [
92
+ [
93
+ "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.folz2wl{fill:CanvasText;}}",
94
+ {
95
+ m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
96
+ }
97
+ ]
71
98
  ]
72
99
  });
73
100
  const useDonutChartStyles = (props)=>{
74
- var _props_styles, _props_styles1, _props_styles2, _props_styles3;
101
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4;
75
102
  const { className } = props;
76
103
  const baseStyles = useStyles();
77
104
  return {
78
105
  root: (0, _react.mergeClasses)(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
79
106
  chart: (0, _react.mergeClasses)(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
80
107
  legendContainer: (0, _react.mergeClasses)(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
81
- chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
108
+ chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper),
109
+ axisAnnotation: (0, _react.mergeClasses)(donutClassNames.axisAnnotation, baseStyles.axisAnnotation, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.axisAnnotation)
82
110
  };
83
111
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const donutClassNames = {\n root: 'fui-donut__root',\n chart: 'fui-donut__chart',\n legendContainer: 'fui-donut__legendContainer',\n chartWrapper: 'fui-donut__chartWrapper'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n // alignItems: 'center',\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%'\n },\n chart: {\n boxSizing: 'content-box',\n alignmentAdjust: 'center',\n display: 'block',\n overflow: 'visible'\n },\n legendContainer: {\n paddingTop: tokens.spacingVerticalL,\n width: '100%'\n }\n});\n/**\n * Apply styling to the DonutChart component\n */ export const useDonutChartStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3;\n const { className } = props;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chart: mergeClasses(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),\n legendContainer: mergeClasses(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),\n chartWrapper: mergeClasses(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","typographyStyles","donutClassNames","root","chart","legendContainer","chartWrapper","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","a9b677","Bqenvij","B7ck84d","ek0pe7","B68tc82","Bmxbyg5","Bpg54ce","z8tnut","d","p","useDonutChartStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","className","baseStyles","styles"],"mappings":";;;;;;;;;;;IAIiBI,eAAe;;;IA8BfsB,mBAAmB;;;;uBAlCK,gBAAgB;AAI9C,wBAAwB;IAC/BrB,IAAI,EAAE,iBAAiB;IACvBC,KAAK,EAAE,kBAAkB;IACzBC,eAAe,EAAE,4BAA4B;IAC7CC,YAAY,EAAE;AAClB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGT,eAAA,EAAA;IAAAK,IAAA,EAAA;QA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,mBAAY,EAACG,eAAe,CAACG,eAAe,EAAE0B,UAAU,CAAC1B,eAAe,EAAE,CAACuB,cAAc,GAAGH,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,eAAe,CAAC;QAC3MC,YAAY,MAAEP,mBAAY,EAACG,eAAe,CAACI,YAAY,EAAE,CAACuB,cAAc,GAAGJ,KAAK,CAACO,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACvB,YAAY;IACzK,CAAC;AACL,CAAC"}
1
+ {"version":3,"sources":["useDonutChartStyles.styles.js"],"sourcesContent":["import { 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.axisAnnotation, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.axisAnnotation)\n };\n};\n"],"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"],"mappings":";;;;;;;;;;;IAKiBK,eAAe;;;uBAgCI;eAAnB6B;;;uBArCwB,gBAAgB;AAK9C,wBAAwB;IAC/B5B,IAAI,EAAE,iBAAiB;IACvBC,KAAK,EAAE,kBAAkB;IACzBC,eAAe,EAAE,4BAA4B;IAC7CC,YAAY,EAAE,yBAAyB;IACvCC,cAAc,EAAE;AACpB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAM,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAZ,KAAA,EAAA;QAAAa,OA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F,KAAK,CAACQ,MAAM,AAANA,MAAY,IAAI,IAAIN,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,KAAK,CAAC;QACnKC,eAAe,MAAEP,mBAAY,EAACI,eAAe,CAACG,eAAe,EAAEkC,UAAU,CAAClC,eAAe,EAAE,CAAC8B,cAAc,GAAGH,KAAK,CAACQ,MAAAA,AAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,eAAe,CAAC;QAC3MC,YAAY,MAAER,mBAAY,EAACI,eAAe,CAACI,YAAY,EAAE,CAAC8B,cAAc,GAAGJ,KAAK,CAACQ,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,YAAY,CAAC;QACtKC,cAAc,MAAET,mBAAY,EAACI,eAAe,CAACK,cAAc,EAAEgC,UAAU,CAAChC,cAAc,EAAE,CAAC8B,cAAc,GAAGL,KAAK,CAACQ,MAAM,AAANA,MAAY,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC9B,cAAc;IAC1M,CAAC;AACL,CAAC"}
@@ -18,11 +18,13 @@ _export(exports, {
18
18
  });
19
19
  const _react = require("@griffel/react");
20
20
  const _reacttheme = require("@fluentui/react-theme");
21
+ const _index = require("../../utilities/index");
21
22
  const donutClassNames = {
22
23
  root: 'fui-donut__root',
23
24
  chart: 'fui-donut__chart',
24
25
  legendContainer: 'fui-donut__legendContainer',
25
- chartWrapper: 'fui-donut__chartWrapper'
26
+ chartWrapper: 'fui-donut__chartWrapper',
27
+ axisAnnotation: 'fui-donut__axisAnnotation'
26
28
  };
27
29
  /**
28
30
  * Base Styles
@@ -44,16 +46,18 @@ const donutClassNames = {
44
46
  legendContainer: {
45
47
  paddingTop: _reacttheme.tokens.spacingVerticalL,
46
48
  width: '100%'
47
- }
49
+ },
50
+ axisAnnotation: (0, _index.getAxisTitleStyle)()
48
51
  });
49
52
  const useDonutChartStyles = (props)=>{
50
- var _props_styles, _props_styles1, _props_styles2, _props_styles3;
53
+ var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4;
51
54
  const { className } = props;
52
55
  const baseStyles = useStyles();
53
56
  return {
54
57
  root: (0, _react.mergeClasses)(donutClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),
55
58
  chart: (0, _react.mergeClasses)(donutClassNames.chart, baseStyles.chart, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chart),
56
59
  legendContainer: (0, _react.mergeClasses)(donutClassNames.legendContainer, baseStyles.legendContainer, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.legendContainer),
57
- chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper)
60
+ chartWrapper: (0, _react.mergeClasses)(donutClassNames.chartWrapper, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chartWrapper),
61
+ axisAnnotation: (0, _react.mergeClasses)(donutClassNames.axisAnnotation, baseStyles.axisAnnotation, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.axisAnnotation)
58
62
  };
59
63
  };
@@ -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":";;;;;;;;;;;IAQaI,eAAAA;;;uBAkCAgB;eAAAA;;;uBA1C4B,iBAAiB;4BACjB,wBAAwB;AAO1D,wBAA0D;IAC/Df,MAAM;IACNC,OAAO;IACPC,iBAAiB;IACjBC,cAAc;AAChB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYT,iBAAAA,EAAW;IAC3BK,MAAM;QACJ,wBAAwB;QACxB,GAAGF,4BAAAA,CAAiBO,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,kBAAAA,CAAOiB,gBAAgB;QACnCN,OAAO;IACT;AACF;AAKO,4BAA4B,CAACQ;QAKqCA,eACRA,gBAI3DA,gBAEuDA;IAX3D,MAAM,EAAEC,SAAS,EAAE,GAAGD;IACtB,MAAME,aAAad;IAEnB,OAAO;QACLJ,UAAMJ,mBAAAA,EAAaG,gBAAgBC,IAAI,EAAEkB,WAAWlB,IAAI,EAAEiB,WAAAA,CAAWD,gBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAchB,IAAI;QACvFC,WAAOL,mBAAAA,EAAaG,gBAAgBE,KAAK,EAAEiB,WAAWjB,KAAK,EAAA,CAAEe,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcf,KAAK;QAChFC,qBAAiBN,mBAAAA,EACfG,gBAAgBG,eAAe,EAC/BgB,WAAWhB,eAAe,EAAA,AAC1Bc,kBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcd,eAAe;QAE/BC,cAAcP,uBAAAA,EAAaG,gBAAgBI,YAAY,EAAA,CAAEa,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcb,YAAY;IACrF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/DonutChart/useDonutChartStyles.styles.ts"],"sourcesContent":["import { 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":";;;;;;;;;;;IASaK,eAAAA;;;IAoCAiB,mBAAAA;;;;uBA7C0C,iBAAiB;4BAC/B,wBAAwB;uBAG/B,wBAAwB;AAKnD,wBAA0D;IAC/DhB,MAAM;IACNC,OAAO;IACPC,iBAAiB;IACjBC,cAAc;IACdC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYX,iBAAAA,EAAW;IAC3BM,MAAM;QACJ,wBAAwB;QACxB,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AA,IAAAA,eAAcb,cAAc;IAEhC;AACF,EAAE"}
@@ -144,13 +144,14 @@ const FunnelChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
144
144
  };
145
145
  }
146
146
  }
147
- function _renderSegmentText({ show, x, y, value, textColor }) {
147
+ function _renderSegmentText({ show, x, y, value, textColor, opacity }) {
148
148
  if (!show) {
149
149
  return null;
150
150
  }
151
151
  const textElement = /*#__PURE__*/ _react.createElement("text", {
152
152
  x: isRTL ? funnelWidth - x : x,
153
153
  y: y,
154
+ opacity: opacity,
154
155
  textAnchor: "middle",
155
156
  alignmentBaseline: "middle",
156
157
  fill: textColor
@@ -175,7 +176,8 @@ const FunnelChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
175
176
  tabIndex: tabIndex
176
177
  }), textProps && /*#__PURE__*/ _react.createElement("g", eventHandlers, _renderSegmentText({
177
178
  ...textProps,
178
- textColor
179
+ textColor,
180
+ opacity
179
181
  })));
180
182
  }
181
183
  function _createFunnel(containerHeight, containerWidth) {