@fluentui/react-charting 5.24.10 → 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 (235) hide show
  1. package/CHANGELOG.json +42 -1
  2. package/CHANGELOG.md +14 -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 +2 -0
  18. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  19. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
  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.js +19 -1
  50. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  51. package/lib/components/PieChart/Arc/Arc.js +2 -0
  52. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  53. package/lib/components/PieChart/Pie/Pie.js +2 -0
  54. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  55. package/lib/components/PieChart/PieChart.base.js +1 -0
  56. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  57. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  58. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  59. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  60. package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  61. package/lib/components/SankeyChart/SankeyChart.base.js +4 -6
  62. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  63. package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
  64. package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  65. package/lib/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  66. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  67. package/lib/components/ScatterChart/ScatterChart.base.js +12 -2
  68. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  69. package/lib/components/Sparkline/Sparkline.base.d.ts +2 -2
  70. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  71. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  72. package/lib/components/StackedBarChart/StackedBarChart.base.js +5 -1
  73. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  74. package/lib/components/TreeChart/TreeChart.base.js +17 -2
  75. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  76. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  77. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  78. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  79. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  80. package/lib/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  81. package/lib-amd/components/AreaChart/AreaChart.base.js +4 -0
  82. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  83. package/lib-amd/components/ChartTable/ChartTable.base.js +2 -1
  84. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  85. package/lib-amd/components/ChartTable/ChartTable.types.d.ts +1 -0
  86. package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
  87. package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -2
  88. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  89. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  90. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  91. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +2 -0
  92. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  93. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
  94. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  95. package/lib-amd/components/DonutChart/Arc/Arc.js +1 -0
  96. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  97. package/lib-amd/components/DonutChart/DonutChart.base.js +5 -6
  98. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  99. package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -4
  100. package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
  101. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +4 -0
  102. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  103. package/lib-amd/components/DonutChart/Pie/Pie.js +2 -0
  104. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  105. package/lib-amd/components/FunnelChart/FunnelChart.base.js +2 -0
  106. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  107. package/lib-amd/components/GaugeChart/GaugeChart.base.js +3 -5
  108. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  109. package/lib-amd/components/GaugeChart/GaugeChart.styles.js +2 -4
  110. package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  111. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  112. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  113. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  114. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  115. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +3 -0
  116. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  117. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  118. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  119. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  120. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  121. package/lib-amd/components/Legends/Legends.base.js +5 -1
  122. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  123. package/lib-amd/components/LineChart/LineChart.base.js +19 -1
  124. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  125. package/lib-amd/components/PieChart/Arc/Arc.js +2 -0
  126. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  127. package/lib-amd/components/PieChart/Pie/Pie.js +2 -0
  128. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  129. package/lib-amd/components/PieChart/PieChart.base.js +1 -0
  130. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  131. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  132. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  133. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  134. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  135. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -6
  136. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  137. package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -0
  138. package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  139. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  140. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  141. package/lib-amd/components/ScatterChart/ScatterChart.base.js +12 -2
  142. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  143. package/lib-amd/components/Sparkline/Sparkline.base.d.ts +2 -2
  144. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  145. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  146. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +5 -1
  147. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  148. package/lib-amd/components/TreeChart/TreeChart.base.js +17 -2
  149. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  150. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  151. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  152. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  153. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  154. package/lib-amd/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  155. package/lib-commonjs/components/AreaChart/AreaChart.base.js +4 -0
  156. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  157. package/lib-commonjs/components/ChartTable/ChartTable.base.js +2 -1
  158. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  159. package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +1 -0
  160. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  161. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -2
  162. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  163. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +4 -0
  164. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  165. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -0
  166. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  167. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1 -1
  168. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  169. package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -0
  170. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  171. package/lib-commonjs/components/DonutChart/DonutChart.base.js +5 -6
  172. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  173. package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -4
  174. package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
  175. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +4 -0
  176. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  177. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -0
  178. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  179. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +2 -0
  180. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  181. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +3 -5
  182. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  183. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +2 -4
  184. package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
  185. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +4 -0
  186. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  187. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +5 -0
  188. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  189. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +3 -0
  190. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  191. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +4 -0
  192. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  193. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +6 -0
  194. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  195. package/lib-commonjs/components/Legends/Legends.base.js +5 -1
  196. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  197. package/lib-commonjs/components/LineChart/LineChart.base.js +19 -1
  198. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  199. package/lib-commonjs/components/PieChart/Arc/Arc.js +2 -0
  200. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  201. package/lib-commonjs/components/PieChart/Pie/Pie.js +2 -0
  202. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  203. package/lib-commonjs/components/PieChart/PieChart.base.js +1 -0
  204. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  205. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +13 -5
  206. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  207. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.d.ts +2 -4
  208. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
  209. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -6
  210. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  211. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
  212. package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
  213. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +4 -0
  214. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  215. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +12 -2
  216. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  217. package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +2 -2
  218. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +6 -1
  219. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  220. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +5 -1
  221. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  222. package/lib-commonjs/components/TreeChart/TreeChart.base.js +17 -2
  223. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  224. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -0
  225. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  226. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +3 -0
  227. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  228. package/lib-commonjs/utilities/ChartHoverCard/ChartHoverCard.base.js.map +1 -1
  229. package/package.json +3 -3
  230. package/src/components/ChartTable/ChartTable.types.ts +1 -0
  231. package/src/components/CommonComponents/CartesianChart.types.ts +6 -0
  232. package/src/components/DonutChart/DonutChart.types.ts +5 -0
  233. package/src/components/GaugeChart/GaugeChart.types.ts +5 -0
  234. package/src/components/ResponsiveContainer/ResponsiveContainer.types.ts +3 -2
  235. package/src/components/SankeyChart/SankeyChart.types.ts +5 -0
@@ -29,6 +29,7 @@ var Arc = /** @class */ (function (_super) {
29
29
  _updateChart(nextProps);
30
30
  return null;
31
31
  };
32
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
32
33
  Arc.prototype.render = function () {
33
34
  var _this = this;
34
35
  var _a;
@@ -51,6 +52,7 @@ var LabeledArc = /** @class */ (function (_super) {
51
52
  _this._arcId = getId('piechart_arc');
52
53
  return _this;
53
54
  }
55
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
54
56
  LabeledArc.prototype.render = function () {
55
57
  var _this = this;
56
58
  var _a, _b;
@@ -1 +1 @@
1
- {"version":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AC,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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,c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AE,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;oBACvF,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;oBACnG,YAAY,EAAE,UAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,cAAI,oBAAoB,CAAC,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,WAAW,GACxB,CACA,CACL,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAzDD,CAAgC,GAAG,GAyDlC;;AAED,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 // 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"]}
@@ -9,11 +9,13 @@ var Pie = /** @class */ (function (_super) {
9
9
  __extends(Pie, _super);
10
10
  function Pie(props) {
11
11
  var _this = _super.call(this, props) || this;
12
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
12
13
  _this.arcGenerator = function (d, i) {
13
14
  return (React.createElement(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 }));
14
15
  };
15
16
  return _this;
16
17
  }
18
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
17
19
  Pie.prototype.render = function () {
18
20
  var _this = this;
19
21
  // const getClassNames = classNamesFunction<IPieProps, IPieStyles>();
@@ -1 +1 @@
1
- {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/PieChart/Pie/Pie.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAg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uBAAL,KAAK,CAAE,UAAU,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QACO,IAAA,KAA2B,IAAI,CAAC,KAAK,OAAf,EAAtB,MAAM,mBAAG,aAAa,KAAA,CAAgB;QAE9C,IAAI,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,iBAAiB,CAAC,KAAK,CAAC,EAAxB,CAAwB,CAAC,CAAC,CAAC;QAElF,IAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAM,SAAS,GAAG,oBAAa,KAAK,GAAG,CAAC,eAAK,MAAM,GAAG,CAAC,MAAG,CAAC;QAE3D,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,kBAAkB,CAAC,QAAQ;YAC/C,6BAAK,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAc,UAAU;gBACvD,2BAAG,SAAS,EAAC,KAAK,EAAC,SAAS,EAAE,SAAS,IACpC,QAAQ,CAAC,GAAG,CAAC,UAAC,CAAW,EAAE,CAAS,IAAK,OAAA,KAAI,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAvB,CAAuB,CAAC,CAChE,CACA,CACI,CACb,CAAC;IACJ,CAAC;IArDa,gBAAY,GAAuB;QAC/C,GAAG,EAAE,KAAK,EAAE;aACT,QAAQ,CAAC,IAAI,CAAC;aACd,IAAI,CAAC,IAAI,CAAC;YACX,uDAAuD;aACtD,KAAK,CAAC,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC;KAC1B,AANyB,CAMxB;IAgDJ,UAAC;CAAA,AAvDD,CAAyB,KAAK,CAAC,SAAS,GAuDvC;SAvDY,GAAG","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 }\n}\n"]}
1
+ {"version":3,"file":"Pie.js","sourceRoot":"../src/","sources":["components/PieChart/Pie/Pie.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAgB,YAAY,EAAE,MAAM,U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PieProps } 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"]}
@@ -10,6 +10,7 @@ var PieChartBase = /** @class */ (function (_super) {
10
10
  _this._emptyChartId = getId('_PieChart_empty');
11
11
  return _this;
12
12
  }
13
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
13
14
  PieChartBase.prototype.render = function () {
14
15
  var _a = this.props, data = _a.data, width = _a.width, height = _a.height, colors = _a.colors, chartTitle = _a.chartTitle;
15
16
  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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGhC,IAAM,aAAa,GAAG,kBAAkB,EAAwC,CAAC;AAEjF;IAAkC,gCAAmC;IASnE,sBAAmB,KAAqB;QACtC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QACb,KAAI,CAAC,aAAa,GAAG,KAAK,CAAC,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,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KACZ,CAAC;IA4DJ,mBAAC;CAAA,AAjED,CAAkC,KAAK,CAAC,SAAS,GAiEhD;SAjEY,YAAY","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 }\n}\n"]}
1
+ {"version":3,"file":"PieChart.base.js","sourceRoot":"../src/","sources":["components/PieChart/PieChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGhC,IAAM,aAAa,GAAG,kBAAkB,EAAwC,CAAC;AAEjF;IAAkC,gCAAmC;IASnE,sBAAmB,KAAqB;QACtC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QACb,KAAI,CAAC,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;;IAChD,CAAC;IAED,4DAA4D;IACrD,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,GAAG,CAAC,CAAC;QACzF,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YAAY","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"]}
@@ -60,15 +60,23 @@ export var ResponsiveContainer = function (props) {
60
60
  }
61
61
  }
62
62
  return React.Children.map(props.children, function (child) {
63
- var _a;
63
+ var _a, _b, _c, _d, _e, _f;
64
+ var commonStyles = {
65
+ root: __assign(__assign({}, (_a = child.props.styles) === null || _a === void 0 ? void 0 : _a.root), { width: '100%', height: '100%' }),
66
+ chartWrapper: __assign(__assign({}, (_b = child.props.styles) === null || _b === void 0 ? void 0 : _b.chartWrapper), { width: '100%' }),
67
+ chart: __assign(__assign({}, (_c = child.props.styles) === null || _c === void 0 ? void 0 : _c.chart), {
68
+ // This overrides the pixel width of svg allowing it to resize properly within a flexbox or grid layout.
69
+ // Note: height is not set to 100% because that causes the charts to resize vertically in an infinite loop.
70
+ width: '100%' }),
71
+ };
64
72
  return React.cloneElement(child, {
65
73
  width: calculatedWidth,
66
74
  height: calculatedHeight,
75
+ // For SankeyChart
67
76
  shouldResize: (calculatedWidth !== null && calculatedWidth !== void 0 ? calculatedWidth : 0) + (calculatedHeight !== null && calculatedHeight !== void 0 ? calculatedHeight : 0),
68
- styles: __assign(__assign({}, child.props.styles), { root: __assign(__assign({}, (_a = child.props.styles) === null || _a === void 0 ? void 0 : _a.root), {
69
- // Ensure the child element fills the parent container
70
- // https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height
71
- width: calculatedWidth, height: calculatedHeight }) }),
77
+ styles: __assign(__assign(__assign({}, child.props.styles), commonStyles), {
78
+ // For HeatMapChart
79
+ subComponentStyles: __assign(__assign({}, (_d = child.props.styles) === null || _d === void 0 ? void 0 : _d.subComponentStyles), { cartesianStyles: __assign(__assign({}, (_f = (_e = child.props.styles) === null || _e === void 0 ? void 0 : _e.subComponentStyles) === null || _f === void 0 ? void 0 : _f.cartesianStyles), commonStyles) }) }),
72
80
  });
73
81
  });
74
82
  }, [size, props.aspect, props.maxHeight, props.children]);
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsiveContainer.js","sour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C;gBAClG,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC;YACrC,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,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,wBAED,KAAK,CAAC,KAAK,CAAC,MAAM,KACrB,IAAI,wBACC,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","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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;GAGG;AACH,MAAM,CAAC,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,SAAS,CAAC,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,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B,gBAAgB,cAAhB,gBAAgB,GAAI,CAAC,CAAC;gBAC9D,MAAM,iCAED,KAAK,CAAC,KAAK,CAAC,MAAM,GAClB,YAAY;oBACf,mBAAmB;oBACnB,kBAAkB,wBACb,MAAA,KAAK,CAAC,KAAK,CAAC,MAAM,0CAAE,kBAAkB,KACzC,eAAe,wBACV,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","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"]}
@@ -258,16 +258,14 @@ function linkValue(originalLinks, link) {
258
258
  // This is exported for unit tests.
259
259
  export function preRenderLayout(margins, containerWidth, containerHeight, isRtl) {
260
260
  var left = margins.left, right = margins.right, top = margins.top, bottom = margins.bottom;
261
- var width = containerWidth - right;
262
- var height = containerHeight - bottom > 0 ? containerHeight - bottom : 0;
263
261
  var sankey = d3Sankey()
264
262
  .nodeWidth(NODE_WIDTH)
265
263
  .extent([
266
264
  [left, top],
267
- [width - 1, height - 6],
265
+ [containerWidth - right, containerHeight - bottom],
268
266
  ])
269
267
  .nodeAlign(isRtl ? sankeyRight : sankeyJustify);
270
- return { sankey: sankey, height: height, width: width };
268
+ return { sankey: sankey, height: containerHeight, width: containerWidth };
271
269
  }
272
270
  var elipsis = '...';
273
271
  /**
@@ -601,7 +599,7 @@ var SankeyChartBase = /** @class */ (function (_super) {
601
599
  var calloutProps = __assign({ isCalloutVisible: state.isCalloutVisible, directionalHint: 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);
602
600
  return (React.createElement("div", { className: classNames_1.root, role: 'presentation', ref: function (rootElem) { return (_this.chartContainer = rootElem); }, onMouseLeave: this._onCloseCallout },
603
601
  React.createElement(FocusZone, { direction: FocusZoneDirection.vertical, className: classNames_1.chartWrapper },
604
- React.createElement("svg", { width: width, height: height, id: this._chartId },
602
+ React.createElement("svg", { width: width, height: height, id: this._chartId, className: classNames_1.chart },
605
603
  nodeLinkDomOrderArray_1.map(function (item) {
606
604
  if (item.type === 'node') {
607
605
  return (React.createElement("g", { key: nodes_1[item.index].nodeId, className: classNames_1.nodes }, nodeData_1[item.index]));
@@ -693,7 +691,7 @@ var SankeyChartBase = /** @class */ (function (_super) {
693
691
  var nodeValues = valuesOfNodes(transformed.nodes);
694
692
  var linkValues = valuesOfLinks(transformed.links);
695
693
  adjustOnePercentHeightNodes(nodesInColumn, nodeValues, linkValues);
696
- adjustPadding(sankey, height - 6, nodesInColumn);
694
+ adjustPadding(sankey, containerHeight - this._margins.top - this._margins.bottom, nodesInColumn);
697
695
  // `sankey` is called a second time, probably to re-layout the nodes with the one-percent adjusted weights.
698
696
  // NOTE: The second call to `sankey` is required to allow links to be hoverable.
699
697
  // Without the second call, the links are not hoverable.