@fluentui/react-charting 5.24.10 → 5.24.12

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 (256) hide show
  1. package/CHANGELOG.json +69 -1
  2. package/CHANGELOG.md +25 -2
  3. package/dist/react-charting.d.ts +18 -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 +7 -3
  7. package/lib/components/AreaChart/AreaChart.base.js +4 -0
  8. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.base.js +2 -1
  10. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  11. package/lib/components/ChartTable/ChartTable.types.d.ts +1 -0
  12. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.base.js +4 -2
  14. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  16. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  17. package/lib/components/DeclarativeChart/DeclarativeChart.js +14 -1
  18. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  19. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +112 -12
  20. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  21. package/lib/components/DonutChart/Arc/Arc.js +1 -0
  22. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  23. package/lib/components/DonutChart/DonutChart.base.js +5 -6
  24. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  25. package/lib/components/DonutChart/DonutChart.styles.js +2 -4
  26. package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
  27. package/lib/components/DonutChart/DonutChart.types.d.ts +4 -0
  28. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  29. package/lib/components/DonutChart/Pie/Pie.js +2 -0
  30. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  31. package/lib/components/FunnelChart/FunnelChart.base.js +2 -0
  32. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  33. package/lib/components/GaugeChart/GaugeChart.base.js +3 -5
  34. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  35. package/lib/components/GaugeChart/GaugeChart.styles.js +2 -4
  36. package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  37. package/lib/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  38. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  39. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  40. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  41. package/lib/components/HeatMapChart/HeatMapChart.base.js +3 -0
  42. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  43. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  44. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  45. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  46. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  47. package/lib/components/Legends/Legends.base.js +5 -1
  48. package/lib/components/Legends/Legends.base.js.map +1 -1
  49. package/lib/components/LineChart/LineChart.base.d.ts +1 -0
  50. package/lib/components/LineChart/LineChart.base.js +53 -12
  51. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  52. package/lib/components/PieChart/Arc/Arc.js +2 -0
  53. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  54. package/lib/components/PieChart/Pie/Pie.js +2 -0
  55. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  56. package/lib/components/PieChart/PieChart.base.js +1 -0
  57. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  58. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  59. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  60. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  61. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  62. package/lib/components/SankeyChart/SankeyChart.base.js +4 -6
  63. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  64. package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
  65. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  66. package/lib/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  67. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  68. package/lib/components/ScatterChart/ScatterChart.base.js +41 -8
  69. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  70. package/lib/components/Sparkline/Sparkline.base.d.ts +2 -2
  71. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  72. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  73. package/lib/components/StackedBarChart/StackedBarChart.base.js +5 -1
  74. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  75. package/lib/components/TreeChart/TreeChart.base.js +17 -2
  76. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  77. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  78. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  79. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  80. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  81. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  82. package/lib/utilities/scatterpolar-utils.d.ts +22 -0
  83. package/lib/utilities/scatterpolar-utils.js +38 -0
  84. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  85. package/lib/utilities/utilities.d.ts +6 -0
  86. package/lib/utilities/utilities.js +16 -4
  87. package/lib/utilities/utilities.js.map +1 -1
  88. package/lib-amd/components/AreaChart/AreaChart.base.js +4 -0
  89. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  90. package/lib-amd/components/ChartTable/ChartTable.base.js +2 -1
  91. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  92. package/lib-amd/components/ChartTable/ChartTable.types.d.ts +1 -0
  93. package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
  94. package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -2
  95. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  96. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  97. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  98. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +14 -1
  99. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  100. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +111 -11
  101. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  102. package/lib-amd/components/DonutChart/Arc/Arc.js +1 -0
  103. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  104. package/lib-amd/components/DonutChart/DonutChart.base.js +5 -6
  105. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  106. package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -4
  107. package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
  108. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +4 -0
  109. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  110. package/lib-amd/components/DonutChart/Pie/Pie.js +2 -0
  111. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  112. package/lib-amd/components/FunnelChart/FunnelChart.base.js +2 -0
  113. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  114. package/lib-amd/components/GaugeChart/GaugeChart.base.js +3 -5
  115. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  116. package/lib-amd/components/GaugeChart/GaugeChart.styles.js +2 -4
  117. package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  118. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  119. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  120. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  121. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  122. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +3 -0
  123. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  124. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  125. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  126. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  127. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  128. package/lib-amd/components/Legends/Legends.base.js +5 -1
  129. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  130. package/lib-amd/components/LineChart/LineChart.base.d.ts +1 -0
  131. package/lib-amd/components/LineChart/LineChart.base.js +52 -12
  132. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  133. package/lib-amd/components/PieChart/Arc/Arc.js +2 -0
  134. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  135. package/lib-amd/components/PieChart/Pie/Pie.js +2 -0
  136. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  137. package/lib-amd/components/PieChart/PieChart.base.js +1 -0
  138. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  139. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  140. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  141. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  142. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  143. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -6
  144. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  145. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -0
  146. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  147. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  148. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  149. package/lib-amd/components/ScatterChart/ScatterChart.base.js +40 -8
  150. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  151. package/lib-amd/components/Sparkline/Sparkline.base.d.ts +2 -2
  152. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  153. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  154. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +5 -1
  155. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  156. package/lib-amd/components/TreeChart/TreeChart.base.js +17 -2
  157. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  158. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  159. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  160. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  161. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  162. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  163. package/lib-amd/utilities/scatterpolar-utils.d.ts +22 -0
  164. package/lib-amd/utilities/scatterpolar-utils.js +43 -0
  165. package/lib-amd/utilities/scatterpolar-utils.js.map +1 -0
  166. package/lib-amd/utilities/utilities.d.ts +6 -0
  167. package/lib-amd/utilities/utilities.js +18 -5
  168. package/lib-amd/utilities/utilities.js.map +1 -1
  169. package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -0
  170. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  171. package/lib-commonjs/components/ChartTable/ChartTable.base.js +2 -1
  172. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  173. package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +1 -0
  174. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  175. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -2
  176. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  177. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  178. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  179. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +14 -1
  180. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  181. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +111 -11
  182. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  183. package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -0
  184. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  185. package/lib-commonjs/components/DonutChart/DonutChart.base.js +5 -6
  186. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  187. package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -4
  188. package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
  189. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +4 -0
  190. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  191. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -0
  192. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  193. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +2 -0
  194. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  195. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +3 -5
  196. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  197. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +2 -4
  198. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  199. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  200. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  201. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  202. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  203. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +3 -0
  204. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  205. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  206. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  207. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  208. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  209. package/lib-commonjs/components/Legends/Legends.base.js +5 -1
  210. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  211. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +1 -0
  212. package/lib-commonjs/components/LineChart/LineChart.base.js +52 -11
  213. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  214. package/lib-commonjs/components/PieChart/Arc/Arc.js +2 -0
  215. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  216. package/lib-commonjs/components/PieChart/Pie/Pie.js +2 -0
  217. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  218. package/lib-commonjs/components/PieChart/PieChart.base.js +1 -0
  219. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  220. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  221. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  222. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  223. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  224. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -6
  225. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  226. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
  227. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  228. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  229. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  230. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +40 -7
  231. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  232. package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +2 -2
  233. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  234. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  235. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +5 -1
  236. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  237. package/lib-commonjs/components/TreeChart/TreeChart.base.js +17 -2
  238. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  239. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  240. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  241. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  242. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  243. package/lib-commonjs/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  244. package/lib-commonjs/utilities/scatterpolar-utils.d.ts +22 -0
  245. package/lib-commonjs/utilities/scatterpolar-utils.js +42 -0
  246. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  247. package/lib-commonjs/utilities/utilities.d.ts +6 -0
  248. package/lib-commonjs/utilities/utilities.js +18 -5
  249. package/lib-commonjs/utilities/utilities.js.map +1 -1
  250. package/package.json +4 -4
  251. package/src/components/ChartTable/ChartTable.types.ts +1 -0
  252. package/src/components/CommonComponents/CartesianChart.types.ts +6 -0
  253. package/src/components/DonutChart/DonutChart.types.ts +5 -0
  254. package/src/components/GaugeChart/GaugeChart.types.ts +5 -0
  255. package/src/components/ResponsiveContainer/ResponsiveContainer.types.ts +3 -2
  256. package/src/components/SankeyChart/SankeyChart.types.ts +5 -0
@@ -32,6 +32,7 @@ var Arc = /** @class */ (function (_super) {
32
32
  _updateChart(nextProps);
33
33
  return null;
34
34
  };
35
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
35
36
  Arc.prototype.render = function () {
36
37
  var _this = this;
37
38
  var _a;
@@ -54,6 +55,7 @@ var LabeledArc = /** @class */ (function (_super) {
54
55
  _this._arcId = (0, Utilities_1.getId)('piechart_arc');
55
56
  return _this;
56
57
  }
58
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
57
59
  LabeledArc.prototype.render = function () {
58
60
  var _this = this;
59
61
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"Arc.js","sourceRoot":"../src/","sources":["components/PieChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,2DAAkF;AAClF,2CAAyC;AACzC,0DAA2D;AAC3D,oEAAmE;AACnE,6DAAiE;AAEjE;IAAyB,+BAAqC;IAY5D,aAAmB,KAAgB;QACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAQR,iBAAW,GAAG,UAAC,QAAmB;YACvC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC,CAAC;QAgBQ,cAAQ,GAAG;YACnB,KAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,C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AAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;oBACnG,YAAY,EAAE,UAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,cAAI,IAAA,sCAAoB,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAE;oBAC9E,SAAS,EAAE,UAAU,CAAC,OAAO;iBAC9B,EACD,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAC7C,kBAAkB,EAAE,KAAK,EACzB,QAAQ,EAAE,EAAE,EACZ,WAAW,EAAE,uBAAW,GACxB,CACA,CACL,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAxDD,CAAgC,GAAG,GAwDlC;AAxDY,gCAAU;AA0DvB,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 { IArcProps, IArcState, IArcStyles } from './Arc.types';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { wrapContent } from '../../../utilities/utilities';\nimport { SVGTooltipText } from '../../../utilities/SVGTooltipText';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n protected _arcId: string;\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): null {\n _updateChart(nextProps);\n return null;\n }\n\n public constructor(props: IArcProps) {\n super(props);\n this.state = {\n isArcFocused: false,\n };\n\n this._arcId = getId('piechart_arc');\n }\n\n public updateChart = (newProps: IArcProps) => {\n _updateChart(newProps);\n };\n\n public render(): JSX.Element {\n const { arc } = this.props;\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme), { ...this.props });\n\n return (\n <path\n d={arc(this.props.data)}\n className={`${this.state.isArcFocused ? classNames.arcRootFocussed : classNames.arcRoot}`}\n onClick={this.props.data?.data.onClick}\n />\n );\n }\n\n protected _onFocus = () => {\n this.setState({ isArcFocused: true });\n };\n\n protected _onBlur = () => {\n this.setState({ isArcFocused: false });\n };\n}\n\nexport class LabeledArc extends Arc {\n private _isRTL = getRTL();\n\n public constructor(props: IArcProps) {\n super(props);\n this._arcId = getId('piechart_arc');\n }\n\n public render(): JSX.Element {\n const { data, culture } = this.props;\n const gap = 4;\n // placing the labels on the outside arc\n const [labelX, labelY] = d3Arc().centroid({\n endAngle: data?.endAngle || 0,\n startAngle: data?.startAngle || 0,\n padAngle: data?.padAngle,\n innerRadius: this.props?.outerRadius || 0,\n outerRadius: this.props?.outerRadius || 0 + gap,\n });\n\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme));\n\n const angle = ((data?.startAngle || 0) + (data?.endAngle || 0)) / 2;\n\n const content = `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`;\n\n return (\n <g\n className={`${classNames.arc} arc`}\n data-is-focusable={true}\n id={this._arcId}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n aria-label={content}\n role=\"img\"\n >\n {super.render()}\n <SVGTooltipText\n content={content}\n textProps={{\n x: labelX + (angle > Math.PI ? -10 : 10),\n y: labelY + (angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 10 : -10),\n dominantBaseline: angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto',\n textAnchor: (!this._isRTL && angle > Math.PI) || (this._isRTL && angle < Math.PI) ? 'end' : 'start',\n 'aria-label': `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`,\n className: classNames.arcText,\n }}\n isTooltipVisibleProp={this.state.isArcFocused}\n shouldReceiveFocus={false}\n maxWidth={40}\n wrapContent={wrapContent}\n />\n </g>\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/PieChart/Arc/Arc.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AAExC,2DAAkF;AAClF,2CAAyC;AACzC,0DAA2D;AAC3D,oEAAmE;AACnE,6DAAiE;AAEjE;IAAyB,+BAAqC;IAY5D,aAAmB,KAAgB;QACjC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAQR,iBAAW,GAAG,UAAC,QAAmB;YACvC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC,CAAC;QAiBQ,cAAQ,GAAG;YACnB,KAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC;QAEQ,aAAO,GAAG;YAClB,KAAI,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC;QAhCA,KAAI,CAAC,KAAK,GAAG;YACX,YAAY,EAAE,KAAK;SACpB,CAAC;QAEF,KAAI,CAAC,MAAM,GAAG,IAAA,iBAAK,EAAC,cAAc,CAAC,CAAC;;IACtC,CAAC;IAZa,4BAAwB,GAAtC,UAAuC,SAA8B;QACnE,YAAY,CAAC,SAAS,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAeD,4DAA4D;IACrD,oBAAM,GAAb;QAAA,iBAYC;;QAXS,IAAA,GAAG,GAAK,IAAI,CAAC,KAAK,IAAf,CAAgB;QAC3B,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAyB,CAAC;QACl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S,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 { IArcProps, IArcState, IArcStyles } from './Arc.types';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { getStyles } from './Arc.styles';\nimport { wrapContent } from '../../../utilities/utilities';\nimport { SVGTooltipText } from '../../../utilities/SVGTooltipText';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\n\nexport class Arc extends React.Component<IArcProps, IArcState> {\n public static defaultProps: Partial<IArcProps> = {\n arc: d3Arc(),\n };\n\n protected _arcId: string;\n\n public static getDerivedStateFromProps(nextProps: Readonly<IArcProps>): null {\n _updateChart(nextProps);\n return null;\n }\n\n public constructor(props: IArcProps) {\n super(props);\n this.state = {\n isArcFocused: false,\n };\n\n this._arcId = getId('piechart_arc');\n }\n\n public updateChart = (newProps: IArcProps) => {\n _updateChart(newProps);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { arc } = this.props;\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme), { ...this.props });\n\n return (\n <path\n d={arc(this.props.data)}\n className={`${this.state.isArcFocused ? classNames.arcRootFocussed : classNames.arcRoot}`}\n onClick={this.props.data?.data.onClick}\n />\n );\n }\n\n protected _onFocus = () => {\n this.setState({ isArcFocused: true });\n };\n\n protected _onBlur = () => {\n this.setState({ isArcFocused: false });\n };\n}\n\nexport class LabeledArc extends Arc {\n private _isRTL = getRTL();\n\n public constructor(props: IArcProps) {\n super(props);\n this._arcId = getId('piechart_arc');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { data, culture } = this.props;\n const gap = 4;\n // placing the labels on the outside arc\n const [labelX, labelY] = d3Arc().centroid({\n endAngle: data?.endAngle || 0,\n startAngle: data?.startAngle || 0,\n padAngle: data?.padAngle,\n innerRadius: this.props?.outerRadius || 0,\n outerRadius: this.props?.outerRadius || 0 + gap,\n });\n\n const getClassNames = classNamesFunction<IArcProps, IArcStyles>();\n const classNames = getClassNames(props => getStyles(props, this.props.theme));\n\n const angle = ((data?.startAngle || 0) + (data?.endAngle || 0)) / 2;\n\n const content = `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`;\n\n return (\n <g\n className={`${classNames.arc} arc`}\n data-is-focusable={true}\n id={this._arcId}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n aria-label={content}\n role=\"img\"\n >\n {super.render()}\n <SVGTooltipText\n content={content}\n textProps={{\n x: labelX + (angle > Math.PI ? -10 : 10),\n y: labelY + (angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 10 : -10),\n dominantBaseline: angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? 'hanging' : 'auto',\n textAnchor: (!this._isRTL && angle > Math.PI) || (this._isRTL && angle < Math.PI) ? 'end' : 'start',\n 'aria-label': `${data?.data.x}-${formatToLocaleString(data?.data.y, culture)}`,\n className: classNames.arcText,\n }}\n isTooltipVisibleProp={this.state.isArcFocused}\n shouldReceiveFocus={false}\n maxWidth={40}\n wrapContent={wrapContent}\n />\n </g>\n );\n }\n}\n\nfunction _updateChart(newProps: IArcProps): void {\n newProps.arc.innerRadius(newProps.innerRadius);\n newProps.arc.outerRadius(newProps.outerRadius);\n}\n"]}
@@ -12,11 +12,13 @@ var Pie = /** @class */ (function (_super) {
12
12
  tslib_1.__extends(Pie, _super);
13
13
  function Pie(props) {
14
14
  var _this = _super.call(this, props) || this;
15
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
15
16
  _this.arcGenerator = function (d, i) {
16
17
  return (React.createElement(Arc_1.LabeledArc, { culture: _this.props.culture, key: i, data: d, innerRadius: _this.props.innerRadius, outerRadius: _this.props.outerRadius, color: "".concat(_this.colors(i)), theme: _this.props.theme }));
17
18
  };
18
19
  return _this;
19
20
  }
21
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
20
22
  Pie.prototype.render = function () {
21
23
  var _this = this;
22
24
  // const getClassNames = classNamesFunction<IPieProps, IPieStyles>();
@@ -1 +1 @@
1
- {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/PieChart/Pie/Pie.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwC;AACxC,qCAAsD;AAEtD,kCAAwC;AAExC,qDAAsE;AACtE,oDAA4E;AAE5E;IAAyB,+BAA8B;IAUrD,aAAY,KAAgB;QAC1B,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAGR,kBAAY,GAAG,UAAC,CAAW,EAAE,CAAS;YAC3C,OAAO,CACL,oBAAC,gBAAU,IACT,OAAO,EAAE,KAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,KAAI,CAAC,KAAK,CAAC,WAAW,EACnC,WAAW,EAAE,KAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,UAAG,KAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,EAC1B,KAAK,EAAE,KAAI,CAAC,KAAK,CAAC,KAAK,GACvB,CACH,CAAC;QACJ,CAAC,CAAC;;IAdF,CAAC;IAgBM,oBAAM,GAAb;QAAA,iBA0BC;QAzBC,qEAAqE;QAC/D,IAAA,KAAkD,IAAI,CAAC,KAAK,EAA1D,GAAG,SAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,KAAK,WAAe,CAAC;QAEnE,IAAM,aAAa,GAAkB,EAAE,CAAC;QACxC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,M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AAC,CAAC,CAAC,EAAH,CAAG,CAAC;KAC1B,AANyB,CAMxB;IAgDJ,UAAC;CAAA,AAvDD,CAAyB,KAAK,CAAC,SAAS,GAuDvC;AAvDY,kBAAG","sourcesContent":["import * as React from 'react';\nimport { pie as d3Pie } from 'd3-shape';\nimport { ScaleOrdinal, scaleOrdinal } from 'd3-scale';\nimport { IPieProps } from './Pie.types';\nimport { LabeledArc } from '../Arc/Arc';\nimport { IArcData } from '../Arc/Arc.types';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { getColorFromToken, getNextColor } from '../../../utilities/colors';\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .padAngle(0.01)\n .sort(null)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .value((d: any) => d.y),\n };\n private colors: ScaleOrdinal<string | number, any>;\n\n constructor(props: IPieProps) {\n super(props);\n }\n\n public arcGenerator = (d: IArcData, i: number): JSX.Element => {\n return (\n <LabeledArc\n culture={this.props.culture}\n key={i}\n data={d}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={`${this.colors(i)}`}\n theme={this.props.theme}\n />\n );\n };\n\n public render(): JSX.Element {\n // const getClassNames = classNamesFunction<IPieProps, IPieStyles>();\n const { pie, data, width, height, chartTitle, theme } = this.props;\n\n const defaultColors: Array<string> = [];\n if (data && !this.props.colors) {\n for (let i = 0; i < data.length; i++) {\n defaultColors.push(getNextColor(i, 0, theme?.isInverted));\n }\n }\n const { colors = defaultColors } = this.props;\n\n this.colors = scaleOrdinal().range(colors.map(color => getColorFromToken(color)));\n\n const piechart = pie(data);\n const translate = `translate(${width / 2}, ${height / 2})`;\n\n return (\n <FocusZone direction={FocusZoneDirection.domOrder}>\n <svg width={width} height={height} aria-label={chartTitle}>\n <g className=\"pie\" transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i))}\n </g>\n </svg>\n </FocusZone>\n );\n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Ordinal } from 'd3-scale';\nimport { IPieProps } from './Pie.types';\nimport { LabeledArc } from '../Arc/Arc';\nimport { IArcData } from '../Arc/Arc.types';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { getColorFromToken, getNextColor } from '../../../utilities/colors';\n\nexport class Pie extends React.Component<IPieProps, {}> {\n public static defaultProps: Partial<IPieProps> = {\n pie: d3Pie()\n .padAngle(0.01)\n .sort(null)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .value((d: any) => d.y),\n };\n private colors: ScaleOrdinal<string | number, any>;\n\n constructor(props: IPieProps) {\n super(props);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public arcGenerator = (d: IArcData, i: number): JSX.Element => {\n return (\n <LabeledArc\n culture={this.props.culture}\n key={i}\n data={d}\n innerRadius={this.props.innerRadius}\n outerRadius={this.props.outerRadius}\n color={`${this.colors(i)}`}\n theme={this.props.theme}\n />\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n // const getClassNames = classNamesFunction<IPieProps, IPieStyles>();\n const { pie, data, width, height, chartTitle, theme } = this.props;\n\n const defaultColors: Array<string> = [];\n if (data && !this.props.colors) {\n for (let i = 0; i < data.length; i++) {\n defaultColors.push(getNextColor(i, 0, theme?.isInverted));\n }\n }\n const { colors = defaultColors } = this.props;\n\n this.colors = scaleOrdinal().range(colors.map(color => getColorFromToken(color)));\n\n const piechart = pie(data);\n const translate = `translate(${width / 2}, ${height / 2})`;\n\n return (\n <FocusZone direction={FocusZoneDirection.domOrder}>\n <svg width={width} height={height} aria-label={chartTitle}>\n <g className=\"pie\" transform={translate}>\n {piechart.map((d: IArcData, i: number) => this.arcGenerator(d, i))}\n </g>\n </svg>\n </FocusZone>\n );\n }\n}\n"]}
@@ -13,6 +13,7 @@ var PieChartBase = /** @class */ (function (_super) {
13
13
  _this._emptyChartId = (0, Utilities_1.getId)('_PieChart_empty');
14
14
  return _this;
15
15
  }
16
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
16
17
  PieChartBase.prototype.render = function () {
17
18
  var _a = this.props, data = _a.data, width = _a.width, height = _a.height, colors = _a.colors, chartTitle = _a.chartTitle;
18
19
  var _b = this.props, theme = _b.theme, className = _b.className, styles = _b.styles, culture = _b.culture;
@@ -1 +1 @@
1
- {"version":3,"file":"PieChart.base.js","sourceRoot":"../src/","sources":["components/PieChart/PieChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,2DAA0E;AAE1E,iCAAgC;AAGhC,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAwC,CAAC;AAEjF;IAAkC,wCAAmC;IASnE,sBAAmB,KAAqB;QACtC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QACb,KAAI,CAAC,aAAa,GAAG,IAAA,iBAAK,EAAC,iBAAiB,CAAC,CAAC;;IAChD,CAAC;IAEM,6BAAM,GAAb;QACQ,IAAA,KAA8C,IAAI,CAAC,KAAK,EAAtD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,UAAU,gBAAe,CAAC;QAEzD,IAAA,KAAwC,IAAI,CAAC,KAAK,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAe,CAAC;QACzD,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC,MAAO,EAAE;YACxC,KAAK,EAAE,KAAM;YACb,KAAK,EAAE,KAAM;YACb,MAAM,EAAE,MAAO;YACf,SAAS,WAAA;SACV,CAAC,CAAC;QAEH,IAAM,cAAc,GAAG,EAAE,CAAC;QAC1B,IAAM,gBAAgB,GAAG,EAAE,CAAC;QAC5B,IAAM,OAAO,GAAG,CAAC,CAAC;QAElB;;;WAGG;QAEH,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAM,GAAG,CAAC,GAAG,cAAc,EAAE,MAAO,GAAG,CAAC,GAAG,gBAAgB,CAAC,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C,SAAS,GAiEhD;AAjEY,oCAAY","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId } from '@fluentui/react/lib/Utilities';\nimport { IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart.types';\nimport { Pie } from './Pie/Pie';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\n\nconst getClassNames = classNamesFunction<IPieChartStyleProps, IPieChartStyles>();\n\nexport class PieChartBase extends React.Component<IPieChartProps, {}> {\n public static defaultProps: Partial<IPieChartProps> = {\n data: [],\n width: 600,\n height: 350,\n };\n private _classNames: IProcessedStyleSet<IPieChartStyles>;\n private _emptyChartId: string;\n\n public constructor(props: IPieChartProps) {\n super(props);\n this._emptyChartId = getId('_PieChart_empty');\n }\n\n public render(): JSX.Element {\n const { data, width, height, colors, chartTitle } = this.props;\n\n const { theme, className, styles, culture } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: width!,\n height: height!,\n className,\n });\n\n const TEXT_MAX_WIDTH = 40;\n const TEXT_LINE_HEIGHT = 16;\n const PADDING = 4;\n\n /**\n * The radius for the pie chart is computed based on the space available inside the svg\n * after subtracting the max amount of space that can be used by the text in pie chart\n */\n\n const radius = Math.min(width! - 2 * TEXT_MAX_WIDTH, height! - 2 * TEXT_LINE_HEIGHT) / 2;\n const outerRadius = radius;\n\n return !this._isChartEmpty() ? (\n <div className={this._classNames.root}>\n {this.props.chartTitle && <p className={this._classNames.chartTitle}>{this.props.chartTitle}</p>}\n <Pie\n culture={culture}\n width={width! + 2 * PADDING}\n height={height! + 2 * PADDING}\n outerRadius={outerRadius}\n innerRadius={1}\n data={data!}\n colors={colors!}\n chartTitle={chartTitle!}\n theme={theme}\n />\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 private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0 && this.props.data.filter(item => item.y > 0).length > 0);\n }\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ClC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,2BAAG,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU,IAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAK;YAChG,oBAAC,SAAG,IACF,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAM,GAAG,CAAC,GAAG,OAAO,EAC3B,MAAM,EAAE,MAAO,GAAG,CAAC,GAAG,OAAO,EAC7B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,CAAC,EACd,IAAI,EAAE,IAAK,EACX,MAAM,EAAE,MAAO,EACf,UAAU,EAAE,UAAW,EACvB,KAAK,EAAE,KAAK,GACZ,CACE,CACP,CAAC,CAAC,CAAC,CACF,6BACE,EAAE,EAAE,IAAI,CAAC,aAAa,EACtB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBACX,8BAA8B,GAC1C,CACH,CAAC;IACJ,CAAC;IAEO,oCAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,CAAC,GAAG,CAAC,EAAV,CAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnH,CAAC;IAhEa,yBAAY,GAA4B;QACpD,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;KACZ,CAAC;IA6DJ,mBAAC;CAAA,AAlED,CAAkC,KAAK,CAAC,SAAS,GAkEhD;AAlEY,oCAAY","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId } from '@fluentui/react/lib/Utilities';\nimport { IPieChartProps, IPieChartStyleProps, IPieChartStyles } from './PieChart.types';\nimport { Pie } from './Pie/Pie';\nimport { IProcessedStyleSet } from '@fluentui/react/lib/Styling';\n\nconst getClassNames = classNamesFunction<IPieChartStyleProps, IPieChartStyles>();\n\nexport class PieChartBase extends React.Component<IPieChartProps, {}> {\n public static defaultProps: Partial<IPieChartProps> = {\n data: [],\n width: 600,\n height: 350,\n };\n private _classNames: IProcessedStyleSet<IPieChartStyles>;\n private _emptyChartId: string;\n\n public constructor(props: IPieChartProps) {\n super(props);\n this._emptyChartId = getId('_PieChart_empty');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSX.Element {\n const { data, width, height, colors, chartTitle } = this.props;\n\n const { theme, className, styles, culture } = this.props;\n this._classNames = getClassNames(styles!, {\n theme: theme!,\n width: width!,\n height: height!,\n className,\n });\n\n const TEXT_MAX_WIDTH = 40;\n const TEXT_LINE_HEIGHT = 16;\n const PADDING = 4;\n\n /**\n * The radius for the pie chart is computed based on the space available inside the svg\n * after subtracting the max amount of space that can be used by the text in pie chart\n */\n\n const radius = Math.min(width! - 2 * TEXT_MAX_WIDTH, height! - 2 * TEXT_LINE_HEIGHT) / 2;\n const outerRadius = radius;\n\n return !this._isChartEmpty() ? (\n <div className={this._classNames.root}>\n {this.props.chartTitle && <p className={this._classNames.chartTitle}>{this.props.chartTitle}</p>}\n <Pie\n culture={culture}\n width={width! + 2 * PADDING}\n height={height! + 2 * PADDING}\n outerRadius={outerRadius}\n innerRadius={1}\n data={data!}\n colors={colors!}\n chartTitle={chartTitle!}\n theme={theme}\n />\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 private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0 && this.props.data.filter(item => item.y > 0).length > 0);\n }\n}\n"]}
@@ -63,15 +63,23 @@ var ResponsiveContainer = function (props) {
63
63
  }
64
64
  }
65
65
  return React.Children.map(props.children, function (child) {
66
- var _a;
66
+ var _a, _b, _c, _d, _e, _f;
67
+ var commonStyles = {
68
+ root: tslib_1.__assign(tslib_1.__assign({}, (_a = child.props.styles) === null || _a === void 0 ? void 0 : _a.root), { width: '100%', height: '100%' }),
69
+ chartWrapper: tslib_1.__assign(tslib_1.__assign({}, (_b = child.props.styles) === null || _b === void 0 ? void 0 : _b.chartWrapper), { width: '100%' }),
70
+ chart: tslib_1.__assign(tslib_1.__assign({}, (_c = child.props.styles) === null || _c === void 0 ? void 0 : _c.chart), {
71
+ // This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.
72
+ // Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.
73
+ width: '100%' }),
74
+ };
67
75
  return React.cloneElement(child, {
68
76
  width: calculatedWidth,
69
77
  height: calculatedHeight,
78
+ // For SankeyChart
70
79
  shouldResize: (calculatedWidth !== null && calculatedWidth !== void 0 ? calculatedWidth : 0) + (calculatedHeight !== null && calculatedHeight !== void 0 ? calculatedHeight : 0),
71
- styles: tslib_1.__assign(tslib_1.__assign({}, child.props.styles), { root: tslib_1.__assign(tslib_1.__assign({}, (_a = child.props.styles) === null || _a === void 0 ? void 0 : _a.root), {
72
- // Ensure the child element fills the parent container
73
- // https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height
74
- width: calculatedWidth, height: calculatedHeight }) }),
80
+ styles: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, child.props.styles), commonStyles), {
81
+ // For HeatMapChart
82
+ subComponentStyles: tslib_1.__assign(tslib_1.__assign({}, (_d = child.props.styles) === null || _d === void 0 ? void 0 : _d.subComponentStyles), { cartesianStyles: tslib_1.__assign(tslib_1.__assign({}, (_f = (_e = child.props.styles) === null || _e === void 0 ? void 0 : _e.subComponentStyles) === null || _f === void 0 ? void 0 : _f.cartesianStyles), commonStyles) }) }),
75
83
  });
76
84
  });
77
85
  }, [size, props.aspect, props.maxHeight, props.children]);
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveContainer.js","sourceRoot":"../src/","sources":["components/ResponsiveCont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,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAA,KAAK;;YAC7C,OAAO,KAAK,CAAC,YAAY,CAAwB,KAAK,EAAE;gBACtD,KAAK,EAAE,eAAe;gBACtB,MAAM,EAAE,gBAAgB;gBACxB,YAAY,EAAE,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,CAAC,CAAC;gBAC9D,MAAM,wCAED,KAAK,CAAC,KAAK,CAAC,MAAM,KACrB,IAAI,wCACC,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,IAAI;wBAC3B,sDAAsD;wBACtD,4GAA4G;wBAC5G,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,gBAAgB,MAE3B;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,6BACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE;YACL,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,MAAM;YAC5B,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,MAAM;YAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,IAEA,YAAY,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AAjGW,QAAA,mBAAmB,uBAiG9B","sourcesContent":["import * as React from 'react';\nimport { getWindow } from '@fluentui/react';\nimport { IResponsiveChildProps, IResponsiveContainerProps } from './ResponsiveContainer.types';\n\n/**\n * Responsive Container component\n * {@docCategory ResponsiveContainer}\n */\nexport const ResponsiveContainer: React.FC<IResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<IResponsiveContainerProps['onResize']>();\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n\n React.useEffect(() => {\n const _window = getWindow(containerRef.current) as (Window & typeof globalThis) | undefined;\n let animationFrameId: number | undefined;\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window && _window.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, []);\n\n const chartContent = React.useMemo(() => {\n let calculatedWidth = size.containerWidth;\n let calculatedHeight = size.containerHeight;\n\n if (typeof props.aspect === 'number' && props.aspect > 0) {\n if (calculatedWidth) {\n calculatedHeight = calculatedWidth / props.aspect;\n } else if (calculatedHeight) {\n calculatedWidth = calculatedHeight * props.aspect;\n }\n\n if (typeof props.maxHeight === 'number' && calculatedHeight && calculatedHeight > props.maxHeight) {\n calculatedHeight = props.maxHeight;\n }\n }\n\n return React.Children.map(props.children, child => {\n return React.cloneElement<IResponsiveChildProps>(child, {\n width: calculatedWidth,\n height: calculatedHeight,\n shouldResize: (calculatedWidth ?? 0) + (calculatedHeight ?? 0),\n styles: {\n // Keep components styles\n ...child.props.styles,\n root: {\n ...child.props.styles?.root,\n // Ensure the child element fills the parent container\n // https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height\n width: calculatedWidth,\n height: calculatedHeight,\n },\n },\n });\n });\n }, [size, props.aspect, props.maxHeight, props.children]);\n\n return (\n <div\n ref={containerRef}\n style={{\n width: props.width ?? '100%',\n height: props.height ?? '100%',\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n }}\n >\n {chartContent}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ResponsiveContainer.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,yCAA4C;AAG5C;;;GAGG;AACI,IAAM,mBAAmB,GAAwC,UAAA,KAAK;;IAC3E,IAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IACxD,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAyC,CAAC;IAEpE,IAAA,KAAkB,KAAK,CAAC,QAAQ,CAAwD,EAAE,CAAC,EAA1F,IAAI,QAAA,EAAE,OAAO,QAA6E,CAAC;IAElG,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IAErC,KAAK,CAAC,SAAS,CAAC;QACd,IAAM,OAAO,GAAG,IAAA,iBAAS,EAAC,YAAY,CAAC,OAAO,CAA6C,CAAC;QAC5F,IAAI,gBAAoC,CAAC;QACzC,IAAI,cAA0C,CAAC;QAE/C,IAAM,cAAc,GAAG,UAAC,OAA8B;;YAC9C,IAAA,KAAqD,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAlE,cAAc,WAAA,EAAU,eAAe,YAA2B,CAAC;YAClF,sEAAsE;YACtE,gGAAgG;YAChG,gBAAgB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qB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B,kBAAkB,wCACb,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,kBAAkB,KACzC,eAAe,wCACV,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,kBAAkB,0CAAE,eAAe,GACvD,YAAY,OAGpB;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,6BACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE;YACL,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,MAAM;YAC5B,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,mCAAI,MAAM;YAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,IAEA,YAAY,CACT,CACP,CAAC;AACJ,CAAC,CAAC;AAtHW,QAAA,mBAAmB,uBAsH9B","sourcesContent":["import * as React from 'react';\nimport { getWindow } from '@fluentui/react';\nimport { IResponsiveChildProps, IResponsiveContainerProps } from './ResponsiveContainer.types';\n\n/**\n * Responsive Container component\n * {@docCategory ResponsiveContainer}\n */\nexport const ResponsiveContainer: React.FC<IResponsiveContainerProps> = props => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const onResizeRef = React.useRef<IResponsiveContainerProps['onResize']>();\n\n const [size, setSize] = React.useState<{ containerWidth?: number; containerHeight?: number }>({});\n\n onResizeRef.current = props.onResize;\n\n React.useEffect(() => {\n const _window = getWindow(containerRef.current) as (Window & typeof globalThis) | undefined;\n let animationFrameId: number | undefined;\n let resizeObserver: ResizeObserver | undefined;\n\n const resizeCallback = (entries: ResizeObserverEntry[]) => {\n const { width: containerWidth, height: containerHeight } = entries[0].contentRect;\n // rAF is an alternative to the throttle function. For more info, see:\n // https://css-tricks.com/debouncing-throttling-explained-examples/#aa-requestanimationframe-raf\n animationFrameId = _window?.requestAnimationFrame(() => {\n setSize(prevSize => {\n const roundedWidth = Math.floor(containerWidth);\n const roundedHeight = Math.floor(containerHeight);\n if (prevSize.containerWidth === roundedWidth && prevSize.containerHeight === roundedHeight) {\n return prevSize;\n }\n\n return { containerWidth: roundedWidth, containerHeight: roundedHeight };\n });\n });\n onResizeRef.current?.(containerWidth, containerHeight);\n };\n\n if (_window && _window.ResizeObserver) {\n resizeObserver = new _window.ResizeObserver(resizeCallback);\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n }\n\n return () => {\n if (animationFrameId) {\n _window?.cancelAnimationFrame(animationFrameId);\n }\n\n resizeObserver?.disconnect();\n };\n }, []);\n\n const chartContent = React.useMemo(() => {\n let calculatedWidth = size.containerWidth;\n let calculatedHeight = size.containerHeight;\n\n if (typeof props.aspect === 'number' && props.aspect > 0) {\n if (calculatedWidth) {\n calculatedHeight = calculatedWidth / props.aspect;\n } else if (calculatedHeight) {\n calculatedWidth = calculatedHeight * props.aspect;\n }\n\n if (typeof props.maxHeight === 'number' && calculatedHeight && calculatedHeight > props.maxHeight) {\n calculatedHeight = props.maxHeight;\n }\n }\n\n return React.Children.map(props.children, child => {\n const commonStyles = {\n root: {\n ...child.props.styles?.root,\n width: '100%',\n height: '100%',\n },\n chartWrapper: {\n ...child.props.styles?.chartWrapper,\n width: '100%',\n },\n chart: {\n ...child.props.styles?.chart,\n // This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.\n // Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.\n width: '100%',\n },\n };\n\n return React.cloneElement<IResponsiveChildProps>(child, {\n width: calculatedWidth,\n height: calculatedHeight,\n // For SankeyChart\n shouldResize: (calculatedWidth ?? 0) + (calculatedHeight ?? 0),\n styles: {\n // Keep components styles\n ...child.props.styles,\n ...commonStyles,\n // For HeatMapChart\n subComponentStyles: {\n ...child.props.styles?.subComponentStyles,\n cartesianStyles: {\n ...child.props.styles?.subComponentStyles?.cartesianStyles,\n ...commonStyles,\n },\n },\n },\n });\n });\n }, [size, props.aspect, props.maxHeight, props.children]);\n\n return (\n <div\n ref={containerRef}\n style={{\n width: props.width ?? '100%',\n height: props.height ?? '100%',\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n }}\n >\n {chartContent}\n </div>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IStyle, IStyleFunctionOrObject } from '@fluentui/react';
2
+ import { IStyleFunctionOrObject } from '@fluentui/react';
3
3
  /**
4
4
  * Responsive Child props
5
5
  * {@docCategory ResponsiveContainer}
@@ -8,9 +8,7 @@ export interface IResponsiveChildProps {
8
8
  width?: number;
9
9
  height?: number;
10
10
  shouldResize?: number;
11
- styles?: IStyleFunctionOrObject<{}, {
12
- root: IStyle;
13
- }>;
11
+ styles?: IStyleFunctionOrObject<any, any>;
14
12
  }
15
13
  /**
16
14
  * Responsive Container props
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveContainer.types.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IStyle, IStyleFunctionOrObject } from '@fluentui/react';\n\n/**\n * Responsive Child props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveChildProps {\n width?: number;\n height?: number;\n shouldResize?: number;\n styles?: IStyleFunctionOrObject<{}, { root: IStyle }>;\n}\n\n/**\n * Responsive Container props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveContainerProps {\n /**\n * Aspect ratio (width / height) of the container. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n\n /**\n * Width of the container\n */\n width?: number | string;\n\n /**\n * Height of the container\n */\n height?: number | string;\n\n /**\n * Minimum width of the container\n */\n minWidth?: number | string;\n\n /**\n * Minimum height of the container\n */\n minHeight?: number | string;\n\n /**\n * Maximum height of the container\n */\n maxHeight?: number;\n\n /**\n * Callback providing the updated chart width and height values when the container is resized\n */\n onResize?: (width: number, height: number) => void;\n\n /**\n * Child component to be rendered within the container\n */\n children: React.ReactElement<IResponsiveChildProps>;\n}\n"]}
1
+ {"version":3,"file":"ResponsiveContainer.types.js","sourceRoot":"../src/","sources":["components/ResponsiveContainer/ResponsiveContainer.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IStyleFunctionOrObject } from '@fluentui/react';\n\n/**\n * Responsive Child props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveChildProps {\n width?: number;\n height?: number;\n shouldResize?: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n styles?: IStyleFunctionOrObject<any, any>;\n}\n\n/**\n * Responsive Container props\n * {@docCategory ResponsiveContainer}\n */\nexport interface IResponsiveContainerProps {\n /**\n * Aspect ratio (width / height) of the container. If specified, the height will be calculated by width / aspect.\n */\n aspect?: number;\n\n /**\n * Width of the container\n */\n width?: number | string;\n\n /**\n * Height of the container\n */\n height?: number | string;\n\n /**\n * Minimum width of the container\n */\n minWidth?: number | string;\n\n /**\n * Minimum height of the container\n */\n minHeight?: number | string;\n\n /**\n * Maximum height of the container\n */\n maxHeight?: number;\n\n /**\n * Callback providing the updated chart width and height values when the container is resized\n */\n onResize?: (width: number, height: number) => void;\n\n /**\n * Child component to be rendered within the container\n */\n children: React.ReactElement<IResponsiveChildProps>;\n}\n"]}
@@ -263,16 +263,14 @@ function linkValue(originalLinks, link) {
263
263
  // This is exported for unit tests.
264
264
  function preRenderLayout(margins, containerWidth, containerHeight, isRtl) {
265
265
  var left = margins.left, right = margins.right, top = margins.top, bottom = margins.bottom;
266
- var width = containerWidth - right;
267
- var height = containerHeight - bottom > 0 ? containerHeight - bottom : 0;
268
266
  var sankey = (0, d3_sankey_1.sankey)()
269
267
  .nodeWidth(NODE_WIDTH)
270
268
  .extent([
271
269
  [left, top],
272
- [width - 1, height - 6],
270
+ [containerWidth - right, containerHeight - bottom],
273
271
  ])
274
272
  .nodeAlign(isRtl ? d3_sankey_1.sankeyRight : d3_sankey_1.sankeyJustify);
275
- return { sankey: sankey, height: height, width: width };
273
+ return { sankey: sankey, height: containerHeight, width: containerWidth };
276
274
  }
277
275
  exports.preRenderLayout = preRenderLayout;
278
276
  var elipsis = '...';
@@ -607,7 +605,7 @@ var SankeyChartBase = /** @class */ (function (_super) {
607
605
  var calloutProps = tslib_1.__assign({ isCalloutVisible: state.isCalloutVisible, directionalHint: Callout_1.DirectionalHint.topAutoEdge, id: "toolTip".concat(this._calloutId), target: state.refSelected, color: state.color, XValue: state.xCalloutValue, YValue: state.yCalloutValue ? state.yCalloutValue : state.dataForHoverCard, descriptionMessage: state.descriptionMessage, isBeakVisible: false, gapSpace: 15, onDismiss: this._onCloseCallout, className: classNames_1.calloutContentRoot, preventDismissOnLostFocus: true }, this.props.calloutProps);
608
606
  return (React.createElement("div", { className: classNames_1.root, role: 'presentation', ref: function (rootElem) { return (_this.chartContainer = rootElem); }, onMouseLeave: this._onCloseCallout },
609
607
  React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.vertical, className: classNames_1.chartWrapper },
610
- React.createElement("svg", { width: width, height: height, id: this._chartId },
608
+ React.createElement("svg", { width: width, height: height, id: this._chartId, className: classNames_1.chart },
611
609
  nodeLinkDomOrderArray_1.map(function (item) {
612
610
  if (item.type === 'node') {
613
611
  return (React.createElement("g", { key: nodes_1[item.index].nodeId, className: classNames_1.nodes }, nodeData_1[item.index]));
@@ -699,7 +697,7 @@ var SankeyChartBase = /** @class */ (function (_super) {
699
697
  var nodeValues = valuesOfNodes(transformed.nodes);
700
698
  var linkValues = valuesOfLinks(transformed.links);
701
699
  adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);
702
- adjustPadding(sankey, height - 6, nodesInColumn);
700
+ adjustPadding(sankey, containerHeight - this._margins.top - this._margins.bottom, nodesInColumn);
703
701
  // `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.
704
702
  // NOTE: The second call to `sankey` is required to allow links to be hoverable.
705
703
  // Without the second call, the links are not hoverable.