@fluentui/react-charting 5.24.9 → 5.24.11

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 (327) hide show
  1. package/CHANGELOG.json +69 -1
  2. package/CHANGELOG.md +25 -2
  3. package/dist/react-charting.d.ts +167 -3
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +47 -3
  7. package/lib/FunnelChart.d.ts +1 -0
  8. package/lib/FunnelChart.js +2 -0
  9. package/lib/FunnelChart.js.map +1 -0
  10. package/lib/components/AreaChart/AreaChart.base.js +4 -0
  11. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  12. package/lib/components/ChartTable/ChartTable.base.js +2 -1
  13. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  14. package/lib/components/ChartTable/ChartTable.types.d.ts +1 -0
  15. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  16. package/lib/components/CommonComponents/CartesianChart.base.js +4 -2
  17. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  18. package/lib/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  19. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  20. package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -1
  21. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  22. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  23. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +121 -1
  24. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  25. package/lib/components/DonutChart/Arc/Arc.js +1 -0
  26. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  27. package/lib/components/DonutChart/DonutChart.base.js +5 -6
  28. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  29. package/lib/components/DonutChart/DonutChart.styles.js +2 -4
  30. package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
  31. package/lib/components/DonutChart/DonutChart.types.d.ts +4 -0
  32. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  33. package/lib/components/DonutChart/Pie/Pie.js +2 -0
  34. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  35. package/lib/components/FunnelChart/FunnelChart.base.d.ts +3 -0
  36. package/lib/components/FunnelChart/FunnelChart.base.js +266 -0
  37. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -0
  38. package/lib/components/FunnelChart/FunnelChart.d.ts +7 -0
  39. package/lib/components/FunnelChart/FunnelChart.js +9 -0
  40. package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
  41. package/lib/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
  42. package/lib/components/FunnelChart/FunnelChart.styles.js +38 -0
  43. package/lib/components/FunnelChart/FunnelChart.styles.js.map +1 -0
  44. package/lib/components/FunnelChart/FunnelChart.types.d.ts +139 -0
  45. package/lib/components/FunnelChart/FunnelChart.types.js +2 -0
  46. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
  47. package/lib/components/FunnelChart/funnelGeometry.d.ts +77 -0
  48. package/lib/components/FunnelChart/funnelGeometry.js +194 -0
  49. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
  50. package/lib/components/FunnelChart/index.d.ts +2 -0
  51. package/lib/components/FunnelChart/index.js +3 -0
  52. package/lib/components/FunnelChart/index.js.map +1 -0
  53. package/lib/components/GaugeChart/GaugeChart.base.js +3 -5
  54. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  55. package/lib/components/GaugeChart/GaugeChart.styles.js +2 -4
  56. package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  57. package/lib/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  58. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  59. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  60. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  61. package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
  62. package/lib/components/HeatMapChart/HeatMapChart.base.js +5 -16
  63. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  64. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  65. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  66. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  67. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  68. package/lib/components/Legends/Legends.base.js +5 -1
  69. package/lib/components/Legends/Legends.base.js.map +1 -1
  70. package/lib/components/LineChart/LineChart.base.d.ts +2 -0
  71. package/lib/components/LineChart/LineChart.base.js +36 -11
  72. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  73. package/lib/components/LineChart/LineChart.types.d.ts +6 -0
  74. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  75. package/lib/components/PieChart/Arc/Arc.js +2 -0
  76. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  77. package/lib/components/PieChart/Pie/Pie.js +2 -0
  78. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  79. package/lib/components/PieChart/PieChart.base.js +1 -0
  80. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  81. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  82. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  83. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  84. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  85. package/lib/components/SankeyChart/SankeyChart.base.js +4 -6
  86. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  87. package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
  88. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  89. package/lib/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  90. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  91. package/lib/components/ScatterChart/ScatterChart.base.js +12 -2
  92. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  93. package/lib/components/Sparkline/Sparkline.base.d.ts +2 -2
  94. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  95. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  96. package/lib/components/StackedBarChart/StackedBarChart.base.js +5 -1
  97. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  98. package/lib/components/TreeChart/TreeChart.base.js +17 -2
  99. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  100. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  101. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  102. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  103. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  104. package/lib/index.d.ts +2 -0
  105. package/lib/index.js +1 -0
  106. package/lib/index.js.map +1 -1
  107. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  108. package/lib/utilities/utilities.d.ts +3 -0
  109. package/lib/utilities/utilities.js +14 -0
  110. package/lib/utilities/utilities.js.map +1 -1
  111. package/lib-amd/FunnelChart.d.ts +1 -0
  112. package/lib-amd/FunnelChart.js +6 -0
  113. package/lib-amd/FunnelChart.js.map +1 -0
  114. package/lib-amd/components/AreaChart/AreaChart.base.js +4 -0
  115. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  116. package/lib-amd/components/ChartTable/ChartTable.base.js +2 -1
  117. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  118. package/lib-amd/components/ChartTable/ChartTable.types.d.ts +1 -0
  119. package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
  120. package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -2
  121. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  122. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  123. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  124. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +8 -1
  125. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  126. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  127. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +123 -2
  128. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  129. package/lib-amd/components/DonutChart/Arc/Arc.js +1 -0
  130. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  131. package/lib-amd/components/DonutChart/DonutChart.base.js +5 -6
  132. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  133. package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -4
  134. package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
  135. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +4 -0
  136. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  137. package/lib-amd/components/DonutChart/Pie/Pie.js +2 -0
  138. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  139. package/lib-amd/components/FunnelChart/FunnelChart.base.d.ts +3 -0
  140. package/lib-amd/components/FunnelChart/FunnelChart.base.js +260 -0
  141. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -0
  142. package/lib-amd/components/FunnelChart/FunnelChart.d.ts +7 -0
  143. package/lib-amd/components/FunnelChart/FunnelChart.js +11 -0
  144. package/lib-amd/components/FunnelChart/FunnelChart.js.map +1 -0
  145. package/lib-amd/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
  146. package/lib-amd/components/FunnelChart/FunnelChart.styles.js +43 -0
  147. package/lib-amd/components/FunnelChart/FunnelChart.styles.js.map +1 -0
  148. package/lib-amd/components/FunnelChart/FunnelChart.types.d.ts +139 -0
  149. package/lib-amd/components/FunnelChart/FunnelChart.types.js +5 -0
  150. package/lib-amd/components/FunnelChart/FunnelChart.types.js.map +1 -0
  151. package/lib-amd/components/FunnelChart/funnelGeometry.d.ts +77 -0
  152. package/lib-amd/components/FunnelChart/funnelGeometry.js +204 -0
  153. package/lib-amd/components/FunnelChart/funnelGeometry.js.map +1 -0
  154. package/lib-amd/components/FunnelChart/index.d.ts +2 -0
  155. package/lib-amd/components/FunnelChart/index.js +7 -0
  156. package/lib-amd/components/FunnelChart/index.js.map +1 -0
  157. package/lib-amd/components/GaugeChart/GaugeChart.base.js +3 -5
  158. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  159. package/lib-amd/components/GaugeChart/GaugeChart.styles.js +2 -4
  160. package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  161. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  162. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  163. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  164. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  165. package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
  166. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +5 -15
  167. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  168. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  169. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  170. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  171. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  172. package/lib-amd/components/Legends/Legends.base.js +5 -1
  173. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  174. package/lib-amd/components/LineChart/LineChart.base.d.ts +2 -0
  175. package/lib-amd/components/LineChart/LineChart.base.js +36 -11
  176. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  177. package/lib-amd/components/LineChart/LineChart.types.d.ts +6 -0
  178. package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
  179. package/lib-amd/components/PieChart/Arc/Arc.js +2 -0
  180. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  181. package/lib-amd/components/PieChart/Pie/Pie.js +2 -0
  182. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  183. package/lib-amd/components/PieChart/PieChart.base.js +1 -0
  184. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  185. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  186. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  187. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  188. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  189. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -6
  190. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  191. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -0
  192. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  193. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  194. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  195. package/lib-amd/components/ScatterChart/ScatterChart.base.js +12 -2
  196. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  197. package/lib-amd/components/Sparkline/Sparkline.base.d.ts +2 -2
  198. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  199. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  200. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +5 -1
  201. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  202. package/lib-amd/components/TreeChart/TreeChart.base.js +17 -2
  203. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  204. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  205. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  206. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  207. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  208. package/lib-amd/index.d.ts +2 -0
  209. package/lib-amd/index.js +3 -2
  210. package/lib-amd/index.js.map +1 -1
  211. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  212. package/lib-amd/utilities/utilities.d.ts +3 -0
  213. package/lib-amd/utilities/utilities.js +17 -2
  214. package/lib-amd/utilities/utilities.js.map +1 -1
  215. package/lib-commonjs/FunnelChart.d.ts +1 -0
  216. package/lib-commonjs/FunnelChart.js +5 -0
  217. package/lib-commonjs/FunnelChart.js.map +1 -0
  218. package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -0
  219. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  220. package/lib-commonjs/components/ChartTable/ChartTable.base.js +2 -1
  221. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  222. package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +1 -0
  223. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  224. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -2
  225. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  226. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  227. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  228. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +8 -0
  229. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  230. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  231. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +123 -2
  232. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  233. package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -0
  234. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  235. package/lib-commonjs/components/DonutChart/DonutChart.base.js +5 -6
  236. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  237. package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -4
  238. package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
  239. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +4 -0
  240. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  241. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -0
  242. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  243. package/lib-commonjs/components/FunnelChart/FunnelChart.base.d.ts +3 -0
  244. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +269 -0
  245. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -0
  246. package/lib-commonjs/components/FunnelChart/FunnelChart.d.ts +7 -0
  247. package/lib-commonjs/components/FunnelChart/FunnelChart.js +12 -0
  248. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
  249. package/lib-commonjs/components/FunnelChart/FunnelChart.styles.d.ts +2 -0
  250. package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js +42 -0
  251. package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js.map +1 -0
  252. package/lib-commonjs/components/FunnelChart/FunnelChart.types.d.ts +139 -0
  253. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +3 -0
  254. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
  255. package/lib-commonjs/components/FunnelChart/funnelGeometry.d.ts +77 -0
  256. package/lib-commonjs/components/FunnelChart/funnelGeometry.js +202 -0
  257. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
  258. package/lib-commonjs/components/FunnelChart/index.d.ts +2 -0
  259. package/lib-commonjs/components/FunnelChart/index.js +6 -0
  260. package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
  261. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +3 -5
  262. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  263. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +2 -4
  264. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  265. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  266. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  267. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  268. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  269. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +0 -1
  270. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +4 -15
  271. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  272. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  273. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  274. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  275. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  276. package/lib-commonjs/components/Legends/Legends.base.js +5 -1
  277. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  278. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +2 -0
  279. package/lib-commonjs/components/LineChart/LineChart.base.js +36 -11
  280. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  281. package/lib-commonjs/components/LineChart/LineChart.types.d.ts +6 -0
  282. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  283. package/lib-commonjs/components/PieChart/Arc/Arc.js +2 -0
  284. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  285. package/lib-commonjs/components/PieChart/Pie/Pie.js +2 -0
  286. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  287. package/lib-commonjs/components/PieChart/PieChart.base.js +1 -0
  288. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  289. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  290. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  291. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  292. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  293. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -6
  294. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  295. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
  296. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  297. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  298. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  299. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +12 -2
  300. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  301. package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +2 -2
  302. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  303. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  304. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +5 -1
  305. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  306. package/lib-commonjs/components/TreeChart/TreeChart.base.js +17 -2
  307. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  308. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  309. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  310. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  311. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  312. package/lib-commonjs/index.d.ts +2 -0
  313. package/lib-commonjs/index.js +3 -1
  314. package/lib-commonjs/index.js.map +1 -1
  315. package/lib-commonjs/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  316. package/lib-commonjs/utilities/utilities.d.ts +3 -0
  317. package/lib-commonjs/utilities/utilities.js +17 -1
  318. package/lib-commonjs/utilities/utilities.js.map +1 -1
  319. package/package.json +4 -4
  320. package/src/components/ChartTable/ChartTable.types.ts +1 -0
  321. package/src/components/CommonComponents/CartesianChart.types.ts +6 -0
  322. package/src/components/DonutChart/DonutChart.types.ts +5 -0
  323. package/src/components/FunnelChart/FunnelChart.types.ts +153 -0
  324. package/src/components/GaugeChart/GaugeChart.types.ts +5 -0
  325. package/src/components/LineChart/LineChart.types.ts +7 -0
  326. package/src/components/ResponsiveContainer/ResponsiveContainer.types.ts +3 -2
  327. package/src/components/SankeyChart/SankeyChart.types.ts +5 -0
@@ -58,6 +58,7 @@ var Arc = /** @class */ (function (_super) {
58
58
  Arc.prototype.updateChart = function (newProps) {
59
59
  _updateChart(newProps);
60
60
  };
61
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
61
62
  Arc.prototype.render = function () {
62
63
  var _a, _b, _c, _d, _e, _f, _g;
63
64
  var _h = this.props, arc = _h.arc, href = _h.href, focusedArcId = _h.focusedArcId, activeArc = _h.activeArc;
@@ -1 +1 @@
1
- {"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AACxC,2DAAkF;AAClF,2CAAyC;AAGzC,uCAA+C;AAC/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port { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth } from '../../../utilities/index';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n public render(): JSX.Element {\n const { arc, href, focusedArcId, activeArc } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id =\n this.props.uniqText! +\n (typeof this.props.data!.data.legend === 'string' ? this.props.data!.data.legend.replace(/\\s+/g, '') : '') +\n this.props.data!.data.data;\n const opacity: number =\n activeArc && activeArc.length > 0 ? (activeArc.includes(this.props.data?.data.legend!) ? 1 : 0.1) : 1;\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={\n this._shouldHighlightArc(this.props.data!.data.legend!) || this.props.activeArc?.length === 0\n }\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _shouldHighlightArc = (legend?: string): boolean => {\n const { activeArc } = this.props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels } = this.props;\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n !this._shouldHighlightArc(data!.data.legend!)\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
1
+ {"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/DonutChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AACxC,2DAAkF;AAClF,2CAAyC;AAGzC,uCAA+C;AAC/C,kDAAsE;AAMtE;IAAyB,+BAAqC;IAA9D;;QAKS,WAAK,GAAO,EAAE,CAAC;QAEd,gBAAU,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAC/C,YAAM,GAAY,IAAA,kBAAM,GAAE,CAAC;QA0F3B,eAAS,GAAG;YAClB,KAAI,CAAC,KAAK,CAAC,kBAAmB,EAAE,CAAC;QACnC,CAAC,CAAC;QAEM,aAAO,GAAG;YAChB,KAAI,CAAC,KAAK,CAAC,cAAe,EAAE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ACL,CAAC;IACJ,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,EAAU;QAChD,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAEO,sBAAQ,GAAhB,UAAiB,IAAqB,EAAE,UAA4C;QAClF,UAAU,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC;IAUO,4BAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IA3Ga,gBAAY,GAAuB;QAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;KACb,AAFyB,CAExB;IAuJJ,UAAC;CAAA,AA1JD,CAAyB,KAAK,CAAC,SAAS,GA0JvC;AA1JY,kBAAG;AA4JhB,SAAS,YAAY,CAAC,QAAmB;IACvC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import * as React from 'react';\nimport { arc as d3Arc } from 'd3-shape';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { IChartDataPoint } from '../index';\nimport { IArcProps, IArcStyleProps, IArcStyles } from './index';\nimport { format as d3Format } from 'd3-format';\nimport { formatScientificLimitWidth } from '../../../utilities/index';\n\nexport interface IArcState {\n isCalloutVisible?: boolean;\n}\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n public state: {} = {};\n\n private currentRef = React.createRef<SVGPathElement>();\n private _isRTL: boolean = getRTL();\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): Partial<IArcState> | null {\n _updateChart(nextProps);\n return null;\n }\n\n public updateChart(newProps: IArcProps): void {\n _updateChart(newProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { arc, href, focusedArcId, activeArc } = this.props;\n const getClassNames = classNamesFunction<IArcStyleProps, IArcStyles>();\n const id =\n this.props.uniqText! +\n (typeof this.props.data!.data.legend === 'string' ? this.props.data!.data.legend.replace(/\\s+/g, '') : '') +\n this.props.data!.data.data;\n const opacity: number =\n activeArc && activeArc.length > 0 ? (activeArc.includes(this.props.data?.data.legend!) ? 1 : 0.1) : 1;\n const startAngle = this.props.data?.startAngle ?? 0;\n const endAngle = (this.props.data?.endAngle ?? 0) - startAngle;\n const cornerRadius = this.props.roundCorners ? 3 : 0;\n\n const classNames = getClassNames(getStyles, {\n solidFill: this.props.enableGradient ? 'transparent' : this.props.color,\n gradientFill: `conic-gradient(\n from ${startAngle}rad,\n ${this.props.color},\n ${this.props.nextColor} ${endAngle}rad\n )`,\n href: href!,\n theme: this.props.theme!,\n opacity,\n });\n\n const clipId = getId('Arc_clip') + `${this.props.color}_${this.props.nextColor}`;\n\n return (\n <g ref={this.currentRef}>\n {!!focusedArcId && focusedArcId === id && (\n <path\n id={id + 'focusRing'}\n d={arc.cornerRadius(cornerRadius)(this.props.focusData)}\n className={classNames.focusRing}\n />\n )}\n\n <path\n id={id}\n d={arc.cornerRadius(cornerRadius)(this.props.data)}\n onFocus={this._onFocus.bind(this, this.props.data!.data, id)}\n className={classNames.root}\n data-is-focusable={\n this._shouldHighlightArc(this.props.data!.data.legend!) || this.props.activeArc?.length === 0\n }\n onMouseOver={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseMove={this._hoverOn.bind(this, this.props.data!.data)}\n onMouseLeave={this._hoverOff}\n onBlur={this._onBlur}\n onClick={href ? this._redirectToUrl.bind(this, href) : this.props.data?.data.onClick}\n aria-label={this._getAriaLabel()}\n role=\"img\"\n />\n {this._renderArcLabel(classNames.arcLabel)}\n\n {this.props.enableGradient && (\n <>\n <clipPath id={clipId}>\n <path d={arc.cornerRadius(cornerRadius)(this.props.data)} />\n </clipPath>\n <foreignObject x=\"-50%\" y=\"-50%\" width=\"100%\" height=\"100%\" clipPath={`url(#${clipId})`}>\n <div className={classNames.gradientArc} />\n </foreignObject>\n </>\n )}\n </g>\n );\n }\n\n private _onFocus(data: IChartDataPoint, id: string): void {\n this.props.onFocusCallback!(data, id, this.currentRef.current);\n }\n\n private _hoverOn(data: IChartDataPoint, mouseEvent: React.MouseEvent<SVGPathElement>): void {\n mouseEvent.persist();\n this.props.hoverOnCallback!(data, mouseEvent);\n }\n\n private _hoverOff = (): void => {\n this.props.hoverLeaveCallback!();\n };\n\n private _onBlur = (): void => {\n this.props.onBlurCallback!();\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _getAriaLabel = (): string => {\n const point = this.props.data!.data;\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _shouldHighlightArc = (legend?: string): boolean => {\n const { activeArc } = this.props;\n // If no activeArc is provided, highlight all arcs. Otherwise, only highlight the arcs that are active.\n return !activeArc || activeArc.length === 0 || legend === undefined || activeArc.includes(legend);\n };\n\n private _renderArcLabel = (className: string) => {\n const { arc, data, innerRadius, outerRadius, showLabelsInPercent, totalValue, hideLabels } = this.props;\n if (\n hideLabels ||\n Math.abs(data!.endAngle - data!.startAngle) < Math.PI / 12 ||\n !this._shouldHighlightArc(data!.data.legend!)\n ) {\n return null;\n }\n\n const [base, perp] = arc.centroid(data);\n const hyp = Math.sqrt(base * base + perp * perp);\n const labelRadius = Math.max(innerRadius!, outerRadius!) + 2;\n const angle = (data!.startAngle + data!.endAngle) / 2;\n const arcValue = data!.value;\n\n return (\n <text\n x={(hyp === 0 ? 0 : base / hyp) * labelRadius}\n y={(hyp === 0 ? 0 : perp / hyp) * labelRadius}\n textAnchor={angle > Math.PI !== this._isRTL ? 'end' : 'start'}\n dominantBaseline={angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto'}\n className={className}\n aria-hidden={true}\n >\n {showLabelsInPercent\n ? d3Format('.0%')(totalValue! === 0 ? 0 : arcValue / totalValue!)\n : formatScientificLimitWidth(arcValue)}\n </text>\n );\n };\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
@@ -144,14 +144,13 @@ var DonutChartBase = /** @class */ (function (_super) {
144
144
  });
145
145
  }
146
146
  };
147
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
147
148
  DonutChartBase.prototype.render = function () {
148
149
  var _this = this;
149
150
  var _a = this.props, data = _a.data, _b = _a.hideLegend, hideLegend = _b === void 0 ? false : _b;
150
151
  var points = this._addDefaultColors(data === null || data === void 0 ? void 0 : data.chartData);
151
152
  this._classNames = getClassNames(this.props.styles, {
152
153
  theme: this.props.theme,
153
- width: this.state._width,
154
- height: this.state._height,
155
154
  color: this.state.color,
156
155
  className: this.props.className,
157
156
  });
@@ -165,10 +164,9 @@ var DonutChartBase = /** @class */ (function (_super) {
165
164
  : '';
166
165
  return !this._isChartEmpty() ? (React.createElement("div", { className: this._classNames.root, ref: function (rootElem) { return (_this._rootElem = rootElem); }, onMouseLeave: this._handleChartMouseLeave },
167
166
  this.props.xAxisAnnotation && (React.createElement("text", { className: this._classNames.axisAnnotation, x: this.state._width / 2, y: this.state._height - 10, textAnchor: "middle" }, this.props.xAxisAnnotation)),
168
- React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.horizontal, handleTabKey: react_focus_1.FocusZoneTabbableElements.all },
169
- React.createElement("div", null,
170
- React.createElement("svg", { className: this._classNames.chart, "aria-label": data === null || data === void 0 ? void 0 : data.chartTitle, ref: function (node) { return _this._setViewBox(node); } },
171
- React.createElement(index_2.Pie, { width: this.state._width, height: this.state._height, outerRadius: outerRadius, innerRadius: this.props.innerRadius, data: chartData, enableGradient: this.props.enableGradient, roundCorners: this.props.roundCorners, onFocusCallback: this._focusCallback, hoverOnCallback: this._hoverCallback, hoverLeaveCallback: this._hoverLeave, uniqText: this._uniqText, onBlurCallback: this._onBlur, activeArc: this._getHighlightedLegend(), focusedArcId: this.state.focusedArcId || '', href: this.props.href, calloutId: this._calloutId, valueInsideDonut: this._toLocaleString(valueInsideDonut), theme: this.props.theme, showLabelsInPercent: this.props.showLabelsInPercent, hideLabels: this.props.hideLabels })))),
167
+ React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.horizontal, handleTabKey: react_focus_1.FocusZoneTabbableElements.all, className: this._classNames.chartWrapper },
168
+ React.createElement("svg", { className: this._classNames.chart, "aria-label": data === null || data === void 0 ? void 0 : data.chartTitle, ref: function (node) { return _this._setViewBox(node); }, width: this.state._width, height: this.state._height },
169
+ React.createElement(index_2.Pie, { width: this.state._width, height: this.state._height, outerRadius: outerRadius, innerRadius: this.props.innerRadius, data: chartData, enableGradient: this.props.enableGradient, roundCorners: this.props.roundCorners, onFocusCallback: this._focusCallback, hoverOnCallback: this._hoverCallback, hoverLeaveCallback: this._hoverLeave, uniqText: this._uniqText, onBlurCallback: this._onBlur, activeArc: this._getHighlightedLegend(), focusedArcId: this.state.focusedArcId || '', href: this.props.href, calloutId: this._calloutId, valueInsideDonut: this._toLocaleString(valueInsideDonut), theme: this.props.theme, showLabelsInPercent: this.props.showLabelsInPercent, hideLabels: this.props.hideLabels }))),
172
170
  React.createElement(Callout_1.Callout, tslib_1.__assign({ target: this._currentHoverElement, alignTargetEdge: true, isBeakVisible: false, directionalHint: Callout_1.DirectionalHint.topAutoEdge, gapSpace: 15, hidden: !(!this.props.hideTooltip && this.state.showHover), id: this._calloutId, onDismiss: this._closeCallout,
173
171
  // eslint-disable-next-line @typescript-eslint/no-deprecated
174
172
  preventDismissOnLostFocus: true,
@@ -208,6 +206,7 @@ var DonutChartBase = /** @class */ (function (_super) {
208
206
  var viewbox = "0 0 ".concat(widthVal, " ").concat(heightVal);
209
207
  node.setAttribute('viewBox', viewbox);
210
208
  };
209
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
211
210
  DonutChartBase.prototype._createLegends = function (chartData) {
212
211
  var _this = this;
213
212
  var legendDataItems = chartData.map(function (point, index) {
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.base.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAA0G;AAG1G,uDAAuE;AACvE,qDAAiG;AACjG,qCAAoF;AACpF,qCAAkC;AAElC,+CAO+B;AAC/B,6DAAiE;AAEjE,yEAA6D;AAG7D,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA4C,CAAC;AACrF,IAAM,uBAAuB,GAAG,EAAE,CAAC;AAkBnC;IAAoC,0CAAmD;IAiCrF,wBAAY,KAAuB;;QACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QA4JR,aAAO,GAAG,UAAC,IAA0B;;YAC1C,OAAO,IAAA,4BAAO,EAAC,KAAI,CAAC,SAAS,EAAE,MAAA,KAAI,CAAC,WAAW,CAAC,OAAO,0CAAE,KAAK,EAAE,IAAA,kBAAM,GAAE,EAAE,IAAI,CAAC,CAAC;QAClF,CAAC,CAAC;QAEM,mBAAa,GAAG;YACtB,KAAI,CAAC,QAAQ,CAAC;gBACZ,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;QACL,CAAC,CAAC;QA0FM,oBAAc,GAAG,UAAC,IAAqB,EAAE,EAAU,EAAE,OAAuB;YAClF,KAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC;YACpC,KA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7Ya,2BAAY,GAA8B;QACtD,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,IAAI;KACjB,AAHyB,CAGxB;IA2ZJ,qBAAC;CAAA,AA/ZD,CAAoC,KAAK,CAAC,SAAS,GA+ZlD;AA/ZY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, initializeComponentRef } from '@fluentui/react/lib/Utilities';\nimport { ScaleOrdinal } from 'd3-scale';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IAccessibilityProps, ChartHoverCard, ILegend, Legends } from '../../index';\nimport { Pie } from './Pie/index';\nimport { IChartDataPoint, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './index';\nimport {\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n getNextGradient,\n areArraysEqual,\n MIN_DONUT_RADIUS,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { ILegendContainer } from '../Legends/index';\n\nconst getClassNames = classNamesFunction<IDonutChartStyleProps, IDonutChartStyles>();\nconst LEGEND_CONTAINER_HEIGHT = 40;\n\nexport interface IDonutChartState {\n showHover?: boolean;\n value?: string | undefined;\n legend?: string | undefined;\n _width?: number | undefined;\n _height?: number | undefined;\n activeLegend?: string;\n color?: string | undefined;\n xCalloutValue?: string;\n yCalloutValue?: string;\n focusedArcId?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n selectedLegends: string[];\n}\n\nexport class DonutChartBase extends React.Component<IDonutChartProps, IDonutChartState> implements IChart {\n public static defaultProps: Partial<IDonutChartProps> = {\n innerRadius: 0,\n hideLabels: true,\n };\n public _colors: ScaleOrdinal<string, {}>;\n private _classNames: IProcessedStyleSet<IDonutChartStyles>;\n private _rootElem: HTMLElement | null;\n private _uniqText: string;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private _currentHoverElement: any;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string | null;\n private _legendsRef: React.RefObject<ILegendContainer>;\n\n public static getDerivedStateFromProps(\n nextProps: Readonly<IDonutChartProps>,\n prevState: Readonly<IDonutChartState>,\n ): Partial<IDonutChartState> | null {\n let widthState: { _width: number } | undefined;\n if (nextProps.width && nextProps.width !== prevState._width) {\n widthState = { _width: nextProps.width };\n }\n\n let heightState: { _height: number } | undefined;\n if (nextProps.height && nextProps.height !== prevState._height) {\n heightState = { _height: nextProps.height - LEGEND_CONTAINER_HEIGHT };\n }\n\n return { ...widthState, ...heightState };\n }\n\n constructor(props: IDonutChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n this.state = {\n showHover: false,\n value: '',\n legend: '',\n _width: this.props.width || 200,\n _height: this.props.height || 200,\n activeLegend: undefined,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n focusedArcId: '',\n selectedLegends: props.legendProps?.selectedLegends || [],\n };\n this._hoverCallback = this._hoverCallback.bind(this);\n this._focusCallback = this._focusCallback.bind(this);\n this._hoverLeave = this._hoverLeave.bind(this);\n this._calloutId = getId('callout');\n this._uniqText = getId('_Pie_');\n this._emptyChartId = getId('_DonutChart_empty');\n this._legendsRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (this._rootElem) {\n this.setState({\n _width: this._rootElem.offsetWidth,\n _height: this._rootElem.offsetHeight - LEGEND_CONTAINER_HEIGHT,\n });\n }\n }\n\n public componentDidUpdate(prevProps: IDonutChartProps): void {\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, this.props.legendProps?.selectedLegends)) {\n this.setState({\n selectedLegends: this.props.legendProps?.selectedLegends || [],\n });\n }\n }\n\n public render(): JSX.Element {\n const { data, hideLegend = false } = this.props;\n const points = this._addDefaultColors(data?.chartData);\n\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n width: this.state._width!,\n height: this.state._height!,\n color: this.state.color!,\n className: this.props.className!,\n });\n\n const legendBars = this._createLegends(points);\n const donutMarginHorizontal = this.props.hideLabels ? 0 : 80;\n const donutMarginVertical = this.props.hideLabels ? 0 : 40;\n const outerRadius =\n Math.min(this.state._width! - donutMarginHorizontal, this.state._height! - donutMarginVertical) / 2;\n const chartData = this._elevateToMinimums(points.filter((d: IChartDataPoint) => d.data! >= 0));\n const valueInsideDonut =\n this.props.innerRadius! > MIN_DONUT_RADIUS\n ? this._valueInsideDonut(this.props.valueInsideDonut!, chartData!)\n : '';\n return !this._isChartEmpty() ? (\n <div\n className={this._classNames.root}\n ref={(rootElem: HTMLElement | null) => (this._rootElem = rootElem)}\n onMouseLeave={this._handleChartMouseLeave}\n >\n {this.props.xAxisAnnotation && (\n <text\n className={this._classNames.axisAnnotation}\n x={this.state._width! / 2}\n y={this.state._height! - 10}\n textAnchor=\"middle\"\n >\n {this.props.xAxisAnnotation}\n </text>\n )}\n <FocusZone direction={FocusZoneDirection.horizontal} handleTabKey={FocusZoneTabbableElements.all}>\n <div>\n <svg\n className={this._classNames.chart}\n aria-label={data?.chartTitle}\n ref={(node: SVGElement | null) => this._setViewBox(node)}\n >\n <Pie\n width={this.state._width!}\n height={this.state._height!}\n outerRadius={outerRadius}\n innerRadius={this.props.innerRadius!}\n data={chartData!}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n hoverLeaveCallback={this._hoverLeave}\n uniqText={this._uniqText}\n onBlurCallback={this._onBlur}\n activeArc={this._getHighlightedLegend()}\n focusedArcId={this.state.focusedArcId || ''}\n href={this.props.href!}\n calloutId={this._calloutId}\n valueInsideDonut={this._toLocaleString(valueInsideDonut)}\n theme={this.props.theme!}\n showLabelsInPercent={this.props.showLabelsInPercent}\n hideLabels={this.props.hideLabels}\n />\n </svg>\n </div>\n </FocusZone>\n <Callout\n target={this._currentHoverElement}\n alignTargetEdge={true}\n isBeakVisible={false}\n directionalHint={DirectionalHint.topAutoEdge}\n gapSpace={15}\n hidden={!(!this.props.hideTooltip && this.state.showHover)}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered arc */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps!)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.value}\n color={this.state.color}\n culture={this.props.culture}\n />\n )}\n </Callout>\n {!hideLegend && <div className={this._classNames.legendContainer}>{legendBars}</div>}\n </div>\n ) : (\n <div\n id={this._emptyChartId!}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._rootElem;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return toImage(this._rootElem, this._legendsRef.current?.toSVG, getRTL(), opts);\n };\n\n private _closeCallout = () => {\n this.setState({\n showHover: false,\n });\n };\n\n private _elevateToMinimums(data: IChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: IChartDataPoint[] = [];\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 private _setViewBox(node: SVGElement | null): void {\n if (node === null) {\n return;\n }\n\n const widthVal = node.parentElement ? node.parentElement.clientWidth : this.state._width;\n\n const heightVal =\n node.parentElement && node.parentElement?.offsetHeight > this.state._height!\n ? node.parentElement?.offsetHeight\n : this.state._height;\n const viewbox = `0 0 ${widthVal!} ${heightVal!}`;\n node.setAttribute('viewBox', viewbox);\n }\n\n private _createLegends(chartData: IChartDataPoint[]): JSX.Element {\n const legendDataItems = chartData.map((point: IChartDataPoint, index: number) => {\n const color: string = this.props.enableGradient\n ? point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0]\n : point.color!;\n\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n this._handleChartMouseLeave();\n this.setState({ activeLegend: point.legend! });\n },\n onMouseOutAction: () => {\n this.setState({ activeLegend: undefined });\n },\n };\n return legend;\n });\n\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this._onLegendSelectionChange.bind(this)}\n ref={this._legendsRef}\n />\n );\n return legends;\n }\n\n private _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (this.props.legendProps && this.props.legendProps?.canSelectMultipleLegends) {\n this.setState({ selectedLegends });\n } else {\n this.setState({ selectedLegends: selectedLegends.slice(-1) });\n }\n if (this.props.legendProps?.onChange) {\n this.props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, element: SVGPathElement): void => {\n this._currentHoverElement = element;\n this.setState({\n /** Show the callout if highlighted arc is focused and Hide it if unhighlighted arc is focused */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color: data.color!,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n focusedArcId: id,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n };\n\n private _hoverCallback = (data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void => {\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this._currentHoverElement = e;\n let color: string = data.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(this.props.data?.chartData?.findIndex(item => item.legend === data.legend) || 0, 0);\n color = data.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n /** Show the callout if highlighted arc is hovered and Hide it if unhighlighted arc is hovered */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n }\n };\n private _onBlur = (): void => {\n this.setState({ focusedArcId: '' });\n };\n\n private _hoverLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({ showHover: false });\n };\n\n private _valueInsideDonut(valueInsideDonut: string | number | undefined, data: IChartDataPoint[]) {\n const highlightedLegends = this._getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || this.state.showHover)) {\n const pointValue = data.find(point => this._isLegendHighlighted(point.legend));\n return pointValue\n ? pointValue.yAxisCalloutData\n ? pointValue.yAxisCalloutData\n : pointValue.data!\n : valueInsideDonut;\n } else if (highlightedLegends.length > 0) {\n let totalValue = 0;\n data.forEach(point => {\n if (highlightedLegends.includes(point.legend!)) {\n totalValue += point.data!;\n }\n });\n return totalValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n private _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, this.props.culture, this.props.useUTC);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n */\n private _getHighlightedLegend() {\n return this.state.selectedLegends.length > 0\n ? this.state.selectedLegends\n : this.state.activeLegend\n ? [this.state.activeLegend]\n : [];\n }\n\n private _isLegendHighlighted = (legend: string | undefined): boolean => {\n return this._getHighlightedLegend().includes(legend!);\n };\n\n private _noLegendsHighlighted = (): boolean => {\n return this._getHighlightedLegend().length === 0;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.chartData &&\n this.props.data.chartData!.filter((d: IChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n private _addDefaultColors = (donutChartDataPoint?: IChartDataPoint[]): IChartDataPoint[] => {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n}\n"]}
1
+ {"version":3,"file":"DonutChart.base.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAA0G;AAG1G,uDAAuE;AACvE,qDAAiG;AACjG,qCAAoF;AACpF,qCAAkC;AAElC,+CAO+B;AAC/B,6DAAiE;AAEjE,yEAA6D;AAG7D,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA4C,CAAC;AACrF,IAAM,uBAAuB,GAAG,EAAE,CAAC;AAkBnC;IAAoC,0CAAmD;IAiCrF,wBAAY,KAAuB;;QACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QA+JR,aAAO,GAAG,UAAC,IAA0B;;YAC1C,OAAO,IAAA,4BAAO,EAAC,KAAI,CAAC,SAAS,EAA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AC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;gBAC3B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAUO,sCAAa,GAArB;QACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS;YACzB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAU,CAAC,MAAM,CAAC,UAAC,CAAkB,IAAK,OAAA,CAAC,CAAC,IAAK,GAAG,CAAC,EAAX,CAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAClF,CAAC;IACJ,CAAC;IAjZa,2BAAY,GAA8B;QACtD,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,IAAI;KACjB,AAHyB,CAGxB;IA+ZJ,qBAAC;CAAA,AAnaD,CAAoC,KAAK,CAAC,SAAS,GAmalD;AAnaY,wCAAc","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL, initializeComponentRef } from '@fluentui/react/lib/Utilities';\nimport { ScaleOrdinal } from 'd3-scale';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection, FocusZoneTabbableElements } from '@fluentui/react-focus';\nimport { IAccessibilityProps, ChartHoverCard, ILegend, Legends } from '../../index';\nimport { Pie } from './Pie/index';\nimport { IChartDataPoint, IDonutChartProps, IDonutChartStyleProps, IDonutChartStyles } from './index';\nimport {\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n getNextGradient,\n areArraysEqual,\n MIN_DONUT_RADIUS,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { ILegendContainer } from '../Legends/index';\n\nconst getClassNames = classNamesFunction<IDonutChartStyleProps, IDonutChartStyles>();\nconst LEGEND_CONTAINER_HEIGHT = 40;\n\nexport interface IDonutChartState {\n showHover?: boolean;\n value?: string | undefined;\n legend?: string | undefined;\n _width?: number | undefined;\n _height?: number | undefined;\n activeLegend?: string;\n color?: string | undefined;\n xCalloutValue?: string;\n yCalloutValue?: string;\n focusedArcId?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n selectedLegends: string[];\n}\n\nexport class DonutChartBase extends React.Component<IDonutChartProps, IDonutChartState> implements IChart {\n public static defaultProps: Partial<IDonutChartProps> = {\n innerRadius: 0,\n hideLabels: true,\n };\n public _colors: ScaleOrdinal<string, {}>;\n private _classNames: IProcessedStyleSet<IDonutChartStyles>;\n private _rootElem: HTMLElement | null;\n private _uniqText: string;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private _currentHoverElement: any;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string | null;\n private _legendsRef: React.RefObject<ILegendContainer>;\n\n public static getDerivedStateFromProps(\n nextProps: Readonly<IDonutChartProps>,\n prevState: Readonly<IDonutChartState>,\n ): Partial<IDonutChartState> | null {\n let widthState: { _width: number } | undefined;\n if (nextProps.width && nextProps.width !== prevState._width) {\n widthState = { _width: nextProps.width };\n }\n\n let heightState: { _height: number } | undefined;\n if (nextProps.height && nextProps.height !== prevState._height) {\n heightState = { _height: nextProps.height - LEGEND_CONTAINER_HEIGHT };\n }\n\n return { ...widthState, ...heightState };\n }\n\n constructor(props: IDonutChartProps) {\n super(props);\n\n initializeComponentRef(this);\n\n this.state = {\n showHover: false,\n value: '',\n legend: '',\n _width: this.props.width || 200,\n _height: this.props.height || 200,\n activeLegend: undefined,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n focusedArcId: '',\n selectedLegends: props.legendProps?.selectedLegends || [],\n };\n this._hoverCallback = this._hoverCallback.bind(this);\n this._focusCallback = this._focusCallback.bind(this);\n this._hoverLeave = this._hoverLeave.bind(this);\n this._calloutId = getId('callout');\n this._uniqText = getId('_Pie_');\n this._emptyChartId = getId('_DonutChart_empty');\n this._legendsRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (this._rootElem) {\n this.setState({\n _width: this._rootElem.offsetWidth,\n _height: this._rootElem.offsetHeight - LEGEND_CONTAINER_HEIGHT,\n });\n }\n }\n\n public componentDidUpdate(prevProps: IDonutChartProps): void {\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, this.props.legendProps?.selectedLegends)) {\n this.setState({\n selectedLegends: this.props.legendProps?.selectedLegends || [],\n });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { data, hideLegend = false } = this.props;\n const points = this._addDefaultColors(data?.chartData);\n\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n color: this.state.color!,\n className: this.props.className!,\n });\n\n const legendBars = this._createLegends(points);\n const donutMarginHorizontal = this.props.hideLabels ? 0 : 80;\n const donutMarginVertical = this.props.hideLabels ? 0 : 40;\n const outerRadius =\n Math.min(this.state._width! - donutMarginHorizontal, this.state._height! - donutMarginVertical) / 2;\n const chartData = this._elevateToMinimums(points.filter((d: IChartDataPoint) => d.data! >= 0));\n const valueInsideDonut =\n this.props.innerRadius! > MIN_DONUT_RADIUS\n ? this._valueInsideDonut(this.props.valueInsideDonut!, chartData!)\n : '';\n return !this._isChartEmpty() ? (\n <div\n className={this._classNames.root}\n ref={(rootElem: HTMLElement | null) => (this._rootElem = rootElem)}\n onMouseLeave={this._handleChartMouseLeave}\n >\n {this.props.xAxisAnnotation && (\n <text\n className={this._classNames.axisAnnotation}\n x={this.state._width! / 2}\n y={this.state._height! - 10}\n textAnchor=\"middle\"\n >\n {this.props.xAxisAnnotation}\n </text>\n )}\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n handleTabKey={FocusZoneTabbableElements.all}\n className={this._classNames.chartWrapper}\n >\n <svg\n className={this._classNames.chart}\n aria-label={data?.chartTitle}\n ref={(node: SVGElement | null) => this._setViewBox(node)}\n width={this.state._width}\n height={this.state._height}\n >\n <Pie\n width={this.state._width!}\n height={this.state._height!}\n outerRadius={outerRadius}\n innerRadius={this.props.innerRadius!}\n data={chartData!}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n hoverLeaveCallback={this._hoverLeave}\n uniqText={this._uniqText}\n onBlurCallback={this._onBlur}\n activeArc={this._getHighlightedLegend()}\n focusedArcId={this.state.focusedArcId || ''}\n href={this.props.href!}\n calloutId={this._calloutId}\n valueInsideDonut={this._toLocaleString(valueInsideDonut)}\n theme={this.props.theme!}\n showLabelsInPercent={this.props.showLabelsInPercent}\n hideLabels={this.props.hideLabels}\n />\n </svg>\n </FocusZone>\n <Callout\n target={this._currentHoverElement}\n alignTargetEdge={true}\n isBeakVisible={false}\n directionalHint={DirectionalHint.topAutoEdge}\n gapSpace={15}\n hidden={!(!this.props.hideTooltip && this.state.showHover)}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered arc */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps!)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.value}\n color={this.state.color}\n culture={this.props.culture}\n />\n )}\n </Callout>\n {!hideLegend && <div className={this._classNames.legendContainer}>{legendBars}</div>}\n </div>\n ) : (\n <div\n id={this._emptyChartId!}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n public get chartContainer(): HTMLElement | null {\n return this._rootElem;\n }\n\n public toImage = (opts?: IImageExportOptions): Promise<string> => {\n return toImage(this._rootElem, this._legendsRef.current?.toSVG, getRTL(), opts);\n };\n\n private _closeCallout = () => {\n this.setState({\n showHover: false,\n });\n };\n\n private _elevateToMinimums(data: IChartDataPoint[]) {\n let sumOfData = 0;\n const minPercent = 0.01;\n const elevatedData: IChartDataPoint[] = [];\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 private _setViewBox(node: SVGElement | null): void {\n if (node === null) {\n return;\n }\n\n const widthVal = node.parentElement ? node.parentElement.clientWidth : this.state._width;\n\n const heightVal =\n node.parentElement && node.parentElement?.offsetHeight > this.state._height!\n ? node.parentElement?.offsetHeight\n : this.state._height;\n const viewbox = `0 0 ${widthVal!} ${heightVal!}`;\n node.setAttribute('viewBox', viewbox);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _createLegends(chartData: IChartDataPoint[]): JSX.Element {\n const legendDataItems = chartData.map((point: IChartDataPoint, index: number) => {\n const color: string = this.props.enableGradient\n ? point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0]\n : point.color!;\n\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color,\n hoverAction: () => {\n this._handleChartMouseLeave();\n this.setState({ activeLegend: point.legend! });\n },\n onMouseOutAction: () => {\n this.setState({ activeLegend: undefined });\n },\n };\n return legend;\n });\n\n const legends = (\n <Legends\n legends={legendDataItems}\n centerLegends\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={this._onLegendSelectionChange.bind(this)}\n ref={this._legendsRef}\n />\n );\n return legends;\n }\n\n private _onLegendSelectionChange(\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (this.props.legendProps && this.props.legendProps?.canSelectMultipleLegends) {\n this.setState({ selectedLegends });\n } else {\n this.setState({ selectedLegends: selectedLegends.slice(-1) });\n }\n if (this.props.legendProps?.onChange) {\n this.props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, element: SVGPathElement): void => {\n this._currentHoverElement = element;\n this.setState({\n /** Show the callout if highlighted arc is focused and Hide it if unhighlighted arc is focused */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color: data.color!,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n focusedArcId: id,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n };\n\n private _hoverCallback = (data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void => {\n if (this._calloutAnchorPoint !== data) {\n this._calloutAnchorPoint = data;\n this._currentHoverElement = e;\n let color: string = data.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(this.props.data?.chartData?.findIndex(item => item.legend === data.legend) || 0, 0);\n color = data.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n /** Show the callout if highlighted arc is hovered and Hide it if unhighlighted arc is hovered */\n showHover: this._noLegendsHighlighted() || this._isLegendHighlighted(data.legend),\n value: data.data!.toString(),\n legend: data.legend,\n color,\n xCalloutValue: data.xAxisCalloutData!,\n yCalloutValue: data.yAxisCalloutData!,\n dataPointCalloutProps: data,\n callOutAccessibilityData: data.callOutAccessibilityData!,\n });\n }\n };\n private _onBlur = (): void => {\n this.setState({ focusedArcId: '' });\n };\n\n private _hoverLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({ showHover: false });\n };\n\n private _valueInsideDonut(valueInsideDonut: string | number | undefined, data: IChartDataPoint[]) {\n const highlightedLegends = this._getHighlightedLegend();\n if (valueInsideDonut !== undefined && (highlightedLegends.length === 1 || this.state.showHover)) {\n const pointValue = data.find(point => this._isLegendHighlighted(point.legend));\n return pointValue\n ? pointValue.yAxisCalloutData\n ? pointValue.yAxisCalloutData\n : pointValue.data!\n : valueInsideDonut;\n } else if (highlightedLegends.length > 0) {\n let totalValue = 0;\n data.forEach(point => {\n if (highlightedLegends.includes(point.legend!)) {\n totalValue += point.data!;\n }\n });\n return totalValue;\n } else {\n return valueInsideDonut;\n }\n }\n\n private _toLocaleString(data: string | number | undefined) {\n const localeString = formatToLocaleString(data, this.props.culture, this.props.useUTC);\n if (!localeString) {\n return data;\n }\n return localeString?.toString();\n }\n\n /**\n * This function returns\n * the selected legend if there is one\n * or the hovered legend if none of the legends is selected.\n */\n private _getHighlightedLegend() {\n return this.state.selectedLegends.length > 0\n ? this.state.selectedLegends\n : this.state.activeLegend\n ? [this.state.activeLegend]\n : [];\n }\n\n private _isLegendHighlighted = (legend: string | undefined): boolean => {\n return this._getHighlightedLegend().includes(legend!);\n };\n\n private _noLegendsHighlighted = (): boolean => {\n return this._getHighlightedLegend().length === 0;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.chartData &&\n this.props.data.chartData!.filter((d: IChartDataPoint) => d.data! > 0).length > 0\n );\n }\n\n private _addDefaultColors = (donutChartDataPoint?: IChartDataPoint[]): IChartDataPoint[] => {\n return donutChartDataPoint\n ? donutChartDataPoint.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0, this.props.theme?.isInverted);\n } else {\n color = getColorFromToken(item.color, this.props.theme?.isInverted);\n }\n\n return { ...item, color };\n })\n : [];\n };\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getStyles = void 0;
4
4
  var index_1 = require("../../utilities/index");
5
5
  var getStyles = function (props) {
6
- var className = props.className, width = props.width, height = props.height, theme = props.theme;
6
+ var className = props.className, theme = props.theme;
7
7
  return {
8
8
  root: [
9
9
  theme.fonts.medium,
@@ -18,8 +18,6 @@ var getStyles = function (props) {
18
18
  className,
19
19
  ],
20
20
  chart: {
21
- width: width,
22
- height: height,
23
21
  boxSizing: 'content-box',
24
22
  overflow: 'visible',
25
23
  alignmentAdjust: 'center',
@@ -27,7 +25,7 @@ var getStyles = function (props) {
27
25
  },
28
26
  legendContainer: {
29
27
  paddingTop: '16px',
30
- width: "".concat(width, "px"),
28
+ width: '100%',
31
29
  },
32
30
  axisAnnotation: (0, index_1.getAxisTitleStyle)(theme, theme.fonts.small),
33
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.styles.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.styles.ts"],"names":[],"mappings":";;;AACA,+CAA0D;AAEnD,IAAM,SAAS,GAAG,UAAC,KAA4B;IAC5C,IAAA,SAAS,GAA2B,KAAK,UAAhC,EAAE,KAAK,GAAoB,KAAK,MAAzB,EAAE,MAAM,GAAY,KAAK,OAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;IAClD,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB,eAAe;YACf;gBACE,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;gBACvB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;aACf;YACD,SAAS;SACV;QACD,KAAK,EAAE;YACL,KAAK,OAAA;YACL,MAAM,QAAA;YACN,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,SAAS;YACnB,eAAe,EAAE,QAAQ;YACzB,OAAO,EAAE,OAAO;SACjB;QACD,eAAe,EAAE;YACf,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,UAAG,KAAK,OAAI;SACpB;QACD,cAAc,EAAE,IAAA,yBAAiB,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;KAC5D,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,SAAS,aA6BpB","sourcesContent":["import { IDonutChartStyleProps, IDonutChartStyles } from './DonutChart.types';\nimport { getAxisTitleStyle } from '../../utilities/index';\n\nexport const getStyles = (props: IDonutChartStyleProps): IDonutChartStyles => {\n const { className, width, height, theme } = props;\n return {\n root: [\n theme.fonts.medium,\n 'ms-DonutChart',\n {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n },\n className,\n ],\n chart: {\n width,\n height,\n boxSizing: 'content-box',\n overflow: 'visible',\n alignmentAdjust: 'center',\n display: 'block',\n },\n legendContainer: {\n paddingTop: '16px',\n width: `${width}px`,\n },\n axisAnnotation: getAxisTitleStyle(theme, theme.fonts.small),\n };\n};\n"]}
1
+ {"version":3,"file":"DonutChart.styles.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.styles.ts"],"names":[],"mappings":";;;AACA,+CAA0D;AAEnD,IAAM,SAAS,GAAG,UAAC,KAA4B;IAC5C,IAAA,SAAS,GAAY,KAAK,UAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;IACnC,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB,eAAe;YACf;gBACE,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;gBACvB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;aACf;YACD,SAAS;SACV;QACD,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,SAAS;YACnB,eAAe,EAAE,QAAQ;YACzB,OAAO,EAAE,OAAO;SACjB;QACD,eAAe,EAAE;YACf,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,MAAM;SACd;QACD,cAAc,EAAE,IAAA,yBAAiB,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;KAC5D,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB","sourcesContent":["import { IDonutChartStyleProps, IDonutChartStyles } from './DonutChart.types';\nimport { getAxisTitleStyle } from '../../utilities/index';\n\nexport const getStyles = (props: IDonutChartStyleProps): IDonutChartStyles => {\n const { className, theme } = props;\n return {\n root: [\n theme.fonts.medium,\n 'ms-DonutChart',\n {\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n },\n className,\n ],\n chart: {\n boxSizing: 'content-box',\n overflow: 'visible',\n alignmentAdjust: 'center',\n display: 'block',\n },\n legendContainer: {\n paddingTop: '16px',\n width: '100%',\n },\n axisAnnotation: getAxisTitleStyle(theme, theme.fonts.small),\n };\n};\n"]}
@@ -91,4 +91,8 @@ export interface IDonutChartStyles {
91
91
  * styles for axis annotation
92
92
  */
93
93
  axisAnnotation?: IStyle;
94
+ /**
95
+ * Styles for the chart wrapper div
96
+ */
97
+ chartWrapper?: IStyle;
94
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.types.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle } from '@fluentui/react/lib/Styling';\nimport { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { ICartesianChartProps, ICartesianChartStyleProps } from '../CommonComponents/index';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IChartProps, IChartDataPoint, IChart } from './index';\n\nexport interface IDonutChart {}\n\n/**\n * Donut Chart properties.\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\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?: IStyleFunctionOrObject<IDonutChartStyleProps, IDonutChartStyles>;\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?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\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 * Prop to enable the gradient in the chart\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Optional callback to access the IChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IChart>;\n}\n\n/**\n * Donut Chart style properties\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartStyleProps extends ICartesianChartStyleProps {}\n\n/**\n * Donut Chart styles\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the chart.\n */\n chart?: IStyle;\n /**\n * Style for the legend container.\n */\n legendContainer: IStyle;\n\n /**\n * styles for axis annotation\n */\n axisAnnotation?: IStyle;\n}\n"]}
1
+ {"version":3,"file":"DonutChart.types.js","sourceRoot":"../src/","sources":["components/DonutChart/DonutChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle } from '@fluentui/react/lib/Styling';\nimport { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { ICartesianChartProps, ICartesianChartStyleProps } from '../CommonComponents/index';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IChartProps, IChartDataPoint, IChart } from './index';\n\nexport interface IDonutChart {}\n\n/**\n * Donut Chart properties.\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\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?: IStyleFunctionOrObject<IDonutChartStyleProps, IDonutChartStyles>;\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?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\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 * Prop to enable the gradient in the chart\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Optional callback to access the IChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IChart>;\n}\n\n/**\n * Donut Chart style properties\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartStyleProps extends ICartesianChartStyleProps {}\n\n/**\n * Donut Chart styles\n * {@docCategory DonutChart}\n */\nexport interface IDonutChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the chart.\n */\n chart?: IStyle;\n /**\n * Style for the legend container.\n */\n legendContainer: IStyle;\n\n /**\n * styles for axis annotation\n */\n axisAnnotation?: IStyle;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: IStyle;\n}\n"]}
@@ -14,6 +14,7 @@ var Pie = /** @class */ (function (_super) {
14
14
  tslib_1.__extends(Pie, _super);
15
15
  function Pie(props) {
16
16
  var _this = _super.call(this, props) || this;
17
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
17
18
  _this.arcGenerator = function (d, i, focusData, href) {
18
19
  var _a, _b, _c, _d;
19
20
  var color = d && d.data && d.data.color;
@@ -42,6 +43,7 @@ var Pie = /** @class */ (function (_super) {
42
43
  .padAngle(0);
43
44
  return _this;
44
45
  }
46
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
45
47
  Pie.prototype.render = function () {
46
48
  var _this = this;
47
49
  var _a = this.props, pie = _a.pie, data = _a.data;
@@ -1 +1 @@
1
- {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/DonutChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,sCAA6C;AAE7C,2DAAmE;AACnE,2CAAyC;AACzC,kDAAgF;AAEhF,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8B,CAAC;AACvE,IAAM,YAAY,GAAW,CAAC,CAAC;AAE/B;IAAyB,+BAA8B;IAarD,aAAY,KAAgB;QAC1B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QASR,kBAAY,GAAG,UAAC,CAAW,EAAE,CAAS,EAAE,SAAmB,EAAE,IAAa;;YAC/E,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACxC,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IAAI,KAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;gBAC9B,KAAK,GAAG,MAAA,MAAA,KAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,0CAAG,CAAC,CAAC,mCAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,CAAC,EAAE,KAAI,CAAC,KAAK,CAAC,KAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnG,SAAS,GAAG,MAAA,MAAA,KAAI,CAAC,KAAK,CAAC,IAAI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ie } from 'd3-shape';\nimport { IPieProps, IPieStyleProps, IPieStyles } from './index';\nimport { Arc, IArcData } from '../Arc/index';\nimport { IChartDataPoint } from '../index';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Pie.styles';\nimport { getNextGradient, wrapTextInsideDonut } from '../../../utilities/index';\n\nconst getClassNames = classNamesFunction<IPieStyleProps, IPieStyles>();\nconst TEXT_PADDING: number = 5;\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02),\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pieForFocusRing: any;\n private _totalValue: number;\n\n constructor(props: IPieProps) {\n super(props);\n this._hoverCallback = this._hoverCallback.bind(this);\n this._pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n }\n\n public arcGenerator = (d: IArcData, i: number, focusData: IArcData, href?: string): JSX.Element => {\n let color = d && d.data && d.data.color;\n let nextColor = color;\n\n if (this.props.enableGradient) {\n color = this.props.data[i].gradient?.[0] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[0];\n nextColor = this.props.data[i].gradient?.[1] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[1];\n }\n\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={color!}\n nextColor={nextColor}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n onBlurCallback={this.props.onBlurCallback}\n hoverLeaveCallback={this.props.hoverLeaveCallback}\n uniqText={this.props.uniqText}\n activeArc={this.props.activeArc}\n href={href}\n calloutId={this.props.calloutId}\n valueInsideDonut={this.props.valueInsideDonut}\n theme={this.props.theme!}\n focusedArcId={this.props.focusedArcId}\n showLabelsInPercent={this.props.showLabelsInPercent}\n totalValue={this._totalValue}\n hideLabels={this.props.hideLabels}\n />\n );\n };\n\n public render(): JSX.Element {\n const { pie, data } = this.props;\n const focusData = this._pieForFocusRing(data);\n const piechart = pie(data);\n const translate = `translate(${this.props.width / 2}, ${this.props.height / 2})`;\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n this._totalValue = this._computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i, focusData[i], this.props.href))}\n {this.props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classNames.insideDonutString}>\n {this.props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n }\n\n public componentDidUpdate(): void {\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n wrapTextInsideDonut(classNames.insideDonutString, this.props.innerRadius! * 2 - TEXT_PADDING);\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, e: SVGPathElement): void => {\n this.props.onFocusCallback!(data, id, e);\n };\n\n private _hoverCallback(data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n this.props.hoverOnCallback!(data, e);\n }\n\n private _computeTotalValue = () => {\n let totalValue = 0;\n this.props.data.forEach((arc: IChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n };\n}\n"]}
1
+ {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/DonutChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,sCAA6C;AAE7C,2DAAmE;AACnE,2CAAyC;AACzC,kDAAgF;AAEhF,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8B,CAAC;AACvE,IAAM,YAAY,GAAW,CAAC,CAAC;AAE/B;IAAyB,+BAA8B;IAarD,aAAY,KAAgB;QAC1B,YAAA,MAAK,YAA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,IAAA,2BAAmB,EAAC,UAAU,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,WAAY,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;IAChG,CAAC;IAMO,4BAAc,GAAtB,UAAuB,IAAqB,EAAE,CAAmC;QAC/E,IAAI,CAAC,KAAK,CAAC,eAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAnGa,gBAAY,GAAuB;QAC/C,GAAG,EAAE,IAAA,cAAK,GAAE;aACT,IAAI,CAAC,IAAI,CAAC;YACX,8DAA8D;aAC7D,KAAK,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC;aACzB,QAAQ,CAAC,IAAI,CAAC;KAClB,AANyB,CAMxB;IAsGJ,UAAC;CAAA,AA7GD,CAAyB,KAAK,CAAC,SAAS,GA6GvC;AA7GY,kBAAG","sourcesContent":["import * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { IPieProps, IPieStyleProps, IPieStyles } from './index';\nimport { Arc, IArcData } from '../Arc/index';\nimport { IChartDataPoint } from '../index';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Pie.styles';\nimport { getNextGradient, wrapTextInsideDonut } from '../../../utilities/index';\n\nconst getClassNames = classNamesFunction<IPieStyleProps, IPieStyles>();\nconst TEXT_PADDING: number = 5;\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0.02),\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pieForFocusRing: any;\n private _totalValue: number;\n\n constructor(props: IPieProps) {\n super(props);\n this._hoverCallback = this._hoverCallback.bind(this);\n this._pieForFocusRing = d3Pie()\n .sort(null)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .value((d: any) => d.data)\n .padAngle(0);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public arcGenerator = (d: IArcData, i: number, focusData: IArcData, href?: string): JSX.Element => {\n let color = d && d.data && d.data.color;\n let nextColor = color;\n\n if (this.props.enableGradient) {\n color = this.props.data[i].gradient?.[0] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[0];\n nextColor = this.props.data[i].gradient?.[1] ?? getNextGradient(i, 0, this.props.theme!.isInverted)[1];\n }\n\n return (\n <Arc\n key={i}\n data={d}\n focusData={focusData}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={color!}\n nextColor={nextColor}\n enableGradient={this.props.enableGradient}\n roundCorners={this.props.roundCorners}\n onFocusCallback={this._focusCallback}\n hoverOnCallback={this._hoverCallback}\n onBlurCallback={this.props.onBlurCallback}\n hoverLeaveCallback={this.props.hoverLeaveCallback}\n uniqText={this.props.uniqText}\n activeArc={this.props.activeArc}\n href={href}\n calloutId={this.props.calloutId}\n valueInsideDonut={this.props.valueInsideDonut}\n theme={this.props.theme!}\n focusedArcId={this.props.focusedArcId}\n showLabelsInPercent={this.props.showLabelsInPercent}\n totalValue={this._totalValue}\n hideLabels={this.props.hideLabels}\n />\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { pie, data } = this.props;\n const focusData = this._pieForFocusRing(data);\n const piechart = pie(data);\n const translate = `translate(${this.props.width / 2}, ${this.props.height / 2})`;\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n this._totalValue = this._computeTotalValue();\n\n return (\n <g transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i, focusData[i], this.props.href))}\n {this.props.valueInsideDonut && (\n <text y={5} textAnchor=\"middle\" dominantBaseline=\"middle\" className={classNames.insideDonutString}>\n {this.props.valueInsideDonut}\n </text>\n )}\n </g>\n );\n }\n\n public componentDidUpdate(): void {\n const classNames = getClassNames(getStyles, {\n theme: this.props.theme!,\n });\n\n wrapTextInsideDonut(classNames.insideDonutString, this.props.innerRadius! * 2 - TEXT_PADDING);\n }\n\n private _focusCallback = (data: IChartDataPoint, id: string, e: SVGPathElement): void => {\n this.props.onFocusCallback!(data, id, e);\n };\n\n private _hoverCallback(data: IChartDataPoint, e: React.MouseEvent<SVGPathElement>): void {\n this.props.hoverOnCallback!(data, e);\n }\n\n private _computeTotalValue = () => {\n let totalValue = 0;\n this.props.data.forEach((arc: IChartDataPoint) => {\n totalValue += arc.data!;\n });\n return totalValue;\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IFunnelChartProps } from './FunnelChart.types';
3
+ export declare const FunnelChartBase: React.FunctionComponent<IFunnelChartProps>;