@fluentui/react-charting 5.23.27 → 5.23.29

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 (257) hide show
  1. package/CHANGELOG.json +49 -1
  2. package/CHANGELOG.md +23 -2
  3. package/dist/react-charting.d.ts +54 -0
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +31 -0
  7. package/lib/DeclarativeChart.d.ts +1 -1
  8. package/lib/DeclarativeChart.js +1 -1
  9. package/lib/DeclarativeChart.js.map +1 -1
  10. package/lib/components/AreaChart/AreaChart.base.d.ts +4 -1
  11. package/lib/components/AreaChart/AreaChart.base.js +12 -2
  12. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.base.d.ts +3 -2
  14. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  16. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  17. package/lib/components/DeclarativeChart/DeclarativeChart.d.ts +13 -1
  18. package/lib/components/DeclarativeChart/DeclarativeChart.js +31 -22
  19. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  20. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +25 -29
  21. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  22. package/lib/components/DeclarativeChart/imageExporter.d.ts +10 -0
  23. package/lib/components/DeclarativeChart/imageExporter.js +222 -0
  24. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
  25. package/lib/components/DeclarativeChart/index.d.ts +2 -0
  26. package/lib/components/DeclarativeChart/index.js +2 -0
  27. package/lib/components/DeclarativeChart/index.js.map +1 -0
  28. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  29. package/lib/components/DonutChart/DonutChart.base.d.ts +3 -1
  30. package/lib/components/DonutChart/DonutChart.base.js +9 -1
  31. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  32. package/lib/components/DonutChart/DonutChart.types.d.ts +7 -2
  33. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  34. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  35. package/lib/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  36. package/lib/components/GaugeChart/GaugeChart.base.js +9 -1
  37. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  38. package/lib/components/GaugeChart/GaugeChart.types.d.ts +7 -2
  39. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  40. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
  41. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +12 -2
  42. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  43. package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +4 -2
  44. package/lib/components/HeatMapChart/HeatMapChart.base.js +12 -2
  45. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  46. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  47. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +4 -2
  48. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +12 -2
  49. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  50. package/lib/components/Legends/Legends.base.js.map +1 -1
  51. package/lib/components/Legends/shape.js.map +1 -1
  52. package/lib/components/LineChart/LineChart.base.d.ts +4 -1
  53. package/lib/components/LineChart/LineChart.base.js +12 -2
  54. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  55. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  56. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  57. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  58. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  59. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  60. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  61. package/lib/components/SankeyChart/SankeyChart.base.d.ts +3 -3
  62. package/lib/components/SankeyChart/SankeyChart.base.js +3 -2
  63. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  64. package/lib/components/SankeyChart/SankeyChart.types.d.ts +7 -2
  65. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  66. package/lib/components/Sparkline/Sparkline.base.js.map +1 -1
  67. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  68. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  69. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  70. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
  71. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +12 -2
  72. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  73. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -1
  74. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +12 -2
  75. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  76. package/lib/index.d.ts +2 -2
  77. package/lib/index.js.map +1 -1
  78. package/lib/types/IDataPoint.d.ts +6 -0
  79. package/lib/types/IDataPoint.js.map +1 -1
  80. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  81. package/lib/utilities/SVGTooltipText.js.map +1 -1
  82. package/lib/utilities/colors.js +44 -44
  83. package/lib/utilities/colors.js.map +1 -1
  84. package/lib/utilities/gradients.js +27 -27
  85. package/lib/utilities/gradients.js.map +1 -1
  86. package/lib/utilities/locale-util.js.map +1 -1
  87. package/lib/utilities/utilities.js.map +1 -1
  88. package/lib/utilities/vbc-utils.js.map +1 -1
  89. package/lib-amd/DeclarativeChart.d.ts +1 -1
  90. package/lib-amd/DeclarativeChart.js +2 -2
  91. package/lib-amd/DeclarativeChart.js.map +1 -1
  92. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +4 -1
  93. package/lib-amd/components/AreaChart/AreaChart.base.js +11 -1
  94. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  95. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +3 -2
  96. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  97. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  98. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  99. package/lib-amd/components/DeclarativeChart/DeclarativeChart.d.ts +13 -1
  100. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +31 -24
  101. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  102. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +25 -29
  103. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  104. package/lib-amd/components/DeclarativeChart/imageExporter.d.ts +10 -0
  105. package/lib-amd/components/DeclarativeChart/imageExporter.js +227 -0
  106. package/lib-amd/components/DeclarativeChart/imageExporter.js.map +1 -0
  107. package/lib-amd/components/DeclarativeChart/index.d.ts +2 -0
  108. package/lib-amd/components/DeclarativeChart/index.js +6 -0
  109. package/lib-amd/components/DeclarativeChart/index.js.map +1 -0
  110. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  111. package/lib-amd/components/DonutChart/DonutChart.base.d.ts +3 -1
  112. package/lib-amd/components/DonutChart/DonutChart.base.js +8 -0
  113. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  114. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +7 -2
  115. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  116. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  117. package/lib-amd/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  118. package/lib-amd/components/GaugeChart/GaugeChart.base.js +8 -0
  119. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  120. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +7 -2
  121. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  122. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
  123. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +11 -1
  124. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  125. package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +4 -2
  126. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +11 -1
  127. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  128. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  129. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +4 -2
  130. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +11 -1
  131. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  132. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  133. package/lib-amd/components/Legends/shape.js.map +1 -1
  134. package/lib-amd/components/LineChart/LineChart.base.d.ts +4 -1
  135. package/lib-amd/components/LineChart/LineChart.base.js +11 -1
  136. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  137. package/lib-amd/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  138. package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  139. package/lib-amd/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  140. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  141. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  142. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  143. package/lib-amd/components/SankeyChart/SankeyChart.base.d.ts +3 -3
  144. package/lib-amd/components/SankeyChart/SankeyChart.base.js +2 -1
  145. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  146. package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +7 -2
  147. package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
  148. package/lib-amd/components/Sparkline/Sparkline.base.js.map +1 -1
  149. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  150. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  151. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  152. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
  153. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +11 -1
  154. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  155. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -1
  156. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +11 -1
  157. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  158. package/lib-amd/index.d.ts +2 -2
  159. package/lib-amd/index.js.map +1 -1
  160. package/lib-amd/types/IDataPoint.d.ts +6 -0
  161. package/lib-amd/types/IDataPoint.js.map +1 -1
  162. package/lib-amd/utilities/FocusableTooltipText.js.map +1 -1
  163. package/lib-amd/utilities/SVGTooltipText.js.map +1 -1
  164. package/lib-amd/utilities/colors.js +44 -44
  165. package/lib-amd/utilities/colors.js.map +1 -1
  166. package/lib-amd/utilities/gradients.js +27 -27
  167. package/lib-amd/utilities/gradients.js.map +1 -1
  168. package/lib-amd/utilities/locale-util.js.map +1 -1
  169. package/lib-amd/utilities/utilities.js.map +1 -1
  170. package/lib-amd/utilities/vbc-utils.js.map +1 -1
  171. package/lib-commonjs/DeclarativeChart.d.ts +1 -1
  172. package/lib-commonjs/DeclarativeChart.js +1 -1
  173. package/lib-commonjs/DeclarativeChart.js.map +1 -1
  174. package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +4 -1
  175. package/lib-commonjs/components/AreaChart/AreaChart.base.js +11 -1
  176. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  177. package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +3 -2
  178. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  179. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  180. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  181. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.d.ts +13 -1
  182. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +32 -24
  183. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  184. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +25 -29
  185. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  186. package/lib-commonjs/components/DeclarativeChart/imageExporter.d.ts +10 -0
  187. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +226 -0
  188. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
  189. package/lib-commonjs/components/DeclarativeChart/index.d.ts +2 -0
  190. package/lib-commonjs/components/DeclarativeChart/index.js +5 -0
  191. package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
  192. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  193. package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +3 -1
  194. package/lib-commonjs/components/DonutChart/DonutChart.base.js +8 -0
  195. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  196. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +7 -2
  197. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  198. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  199. package/lib-commonjs/components/GaugeChart/GaugeChart.base.d.ts +3 -1
  200. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +8 -0
  201. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  202. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +7 -2
  203. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  204. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +4 -1
  205. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +11 -1
  206. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  207. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +4 -2
  208. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +11 -1
  209. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  210. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  211. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +4 -2
  212. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +11 -1
  213. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  214. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  215. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  216. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +4 -1
  217. package/lib-commonjs/components/LineChart/LineChart.base.js +11 -1
  218. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  219. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  220. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  221. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  222. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  223. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  224. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  225. package/lib-commonjs/components/SankeyChart/SankeyChart.base.d.ts +3 -3
  226. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +2 -1
  227. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  228. package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +7 -2
  229. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  230. package/lib-commonjs/components/Sparkline/Sparkline.base.js.map +1 -1
  231. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  232. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  233. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  234. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +4 -1
  235. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -1
  236. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  237. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +4 -1
  238. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +11 -1
  239. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  240. package/lib-commonjs/index.d.ts +2 -2
  241. package/lib-commonjs/index.js.map +1 -1
  242. package/lib-commonjs/types/IDataPoint.d.ts +6 -0
  243. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  244. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  245. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  246. package/lib-commonjs/utilities/colors.js +44 -44
  247. package/lib-commonjs/utilities/colors.js.map +1 -1
  248. package/lib-commonjs/utilities/gradients.js +27 -27
  249. package/lib-commonjs/utilities/gradients.js.map +1 -1
  250. package/lib-commonjs/utilities/locale-util.js.map +1 -1
  251. package/lib-commonjs/utilities/utilities.js.map +1 -1
  252. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  253. package/package.json +4 -4
  254. package/src/components/CommonComponents/CartesianChart.types.ts +13 -1
  255. package/src/components/DonutChart/DonutChart.types.ts +8 -2
  256. package/src/components/GaugeChart/GaugeChart.types.ts +8 -2
  257. package/src/components/SankeyChart/SankeyChart.types.ts +8 -2
@@ -1 +1 @@
1
- {"version":3,"file":"SankeyChart.types.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChartProps } from '../../types/IDataPoint';\n\nexport type { IChartProps, IDataPoint, ISankeyChartData } from '../../types/IDataPoint';\n\n/**\n * Sankey Chart properties\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SankeyChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the Sankey chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * should chart resize when parent resize.\n */\n shouldResize?: number;\n\n /**\n * Color for path\n */\n pathColor?: string;\n\n /**\n * Colors for nodes\n */\n colorsForNodes?: string[];\n\n /**\n * Colors for nodes border\n */\n borderColorsForNodes?: string[];\n\n /**\n * Localized strings to show in the UX.\n */\n strings?: ISankeyChartStrings;\n\n /**\n * Localized strings to use for the chart's accessibility features.\n */\n accessibility?: ISankeyChartAccessibilityProps;\n\n /**\n * Format node and link values.\n */\n formatNumberOptions?: Intl.NumberFormatOptions;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n * @default true\n */\n enableReflow?: boolean;\n}\n\n/**\n * Sankey Chart style properties\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartStyleProps {\n theme: ITheme;\n className?: string;\n width: number;\n height: number;\n pathColor?: string;\n}\n\n/**\n * Sankey Chart styles\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the nodes.\n */\n nodes?: IStyle;\n\n /**\n * Style for the links.\n */\n links?: IStyle;\n\n /**\n * Style for the text inside node.\n */\n nodeTextContainer?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n toolTip?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n\n calloutContentRoot?: IStyle;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: IStyle;\n}\n\n/**\n * Set of strings which are used when rendering the chart.\n */\nexport interface ISankeyChartStrings {\n /**\n * A value similar to \"from \\{0\\}\" where \\{0\\} is the name of the source node for a link.\n * This is shown in the `ChartHoverCard` when the user hovers the mouse over a link.\n */\n linkFrom?: string;\n}\n\n/**\n * Set of strings which are used when rendering accessibility information within the chart.\n */\nexport interface ISankeyChartAccessibilityProps {\n /**\n * Aria label for when the chart is empty.\n */\n emptyAriaLabel?: string;\n /**\n * A value similar to \"node \\{0\\} with weight \\{1\\}\".\n * \\{0\\} is the name of the node.\n * \\{1\\} is the weight of the node (as computed by the sankey layout engine via the links to or from this node).\n */\n nodeAriaLabel?: string;\n /**\n * A value similar to \"link from \\{0\\} to $\\{1\\} with weight $\\{2\\}\".\n * \\{0\\} is the source node, \\{1\\} is the target node, and \\{2\\} is the value of the link.\n */\n linkAriaLabel?: string;\n}\n"]}
1
+ {"version":3,"file":"SankeyChart.types.js","sourceRoot":"../src/","sources":["components/SankeyChart/SankeyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { IRefObject, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChart, IChartProps } from '../../types/IDataPoint';\n\nexport type { IChartProps, IDataPoint, ISankeyChartData } from '../../types/IDataPoint';\n\n/**\n * Sankey Chart properties\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartProps {\n /**\n * Data to render in the chart.\n */\n data: IChartProps;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SankeyChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the Sankey chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * should chart resize when parent resize.\n */\n shouldResize?: number;\n\n /**\n * Color for path\n */\n pathColor?: string;\n\n /**\n * Colors for nodes\n */\n colorsForNodes?: string[];\n\n /**\n * Colors for nodes border\n */\n borderColorsForNodes?: string[];\n\n /**\n * Localized strings to show in the UX.\n */\n strings?: ISankeyChartStrings;\n\n /**\n * Localized strings to use for the chart's accessibility features.\n */\n accessibility?: ISankeyChartAccessibilityProps;\n\n /**\n * Format node and link values.\n */\n formatNumberOptions?: Intl.NumberFormatOptions;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n * @default true\n */\n enableReflow?: boolean;\n\n /**\n * Optional callback to access the IChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IChart>;\n}\n\n/**\n * Sankey Chart style properties\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartStyleProps {\n theme: ITheme;\n className?: string;\n width: number;\n height: number;\n pathColor?: string;\n}\n\n/**\n * Sankey Chart styles\n * {@docCategory SankeyChart}\n */\nexport interface ISankeyChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the nodes.\n */\n nodes?: IStyle;\n\n /**\n * Style for the links.\n */\n links?: IStyle;\n\n /**\n * Style for the text inside node.\n */\n nodeTextContainer?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n toolTip?: IStyle;\n\n /**\n * Style for the tooltip ,when user hover over the truncated node detail.\n */\n\n calloutContentRoot?: IStyle;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: IStyle;\n}\n\n/**\n * Set of strings which are used when rendering the chart.\n */\nexport interface ISankeyChartStrings {\n /**\n * A value similar to \"from \\{0\\}\" where \\{0\\} is the name of the source node for a link.\n * This is shown in the `ChartHoverCard` when the user hovers the mouse over a link.\n */\n linkFrom?: string;\n}\n\n/**\n * Set of strings which are used when rendering accessibility information within the chart.\n */\nexport interface ISankeyChartAccessibilityProps {\n /**\n * Aria label for when the chart is empty.\n */\n emptyAriaLabel?: string;\n /**\n * A value similar to \"node \\{0\\} with weight \\{1\\}\".\n * \\{0\\} is the name of the node.\n * \\{1\\} is the weight of the node (as computed by the sankey layout engine via the links to or from this node).\n */\n nodeAriaLabel?: string;\n /**\n * A value similar to \"link from \\{0\\} to $\\{1\\} with weight $\\{2\\}\".\n * \\{0\\} is the source node, \\{1\\} is the target node, and \\{2\\} is the value of the link.\n */\n linkAriaLabel?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Sparkline.base.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UA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;IAEO,qCAAa,GAArB;QACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa;YAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAtB,CAAsB,CAAC,CAAC,MAAM,KAAK,CAAC,CAClF,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAtJD,CAAmC,KAAK,CAAC,SAAS,GAsJjD","sourcesContent":["import * as React from 'react';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { area as d3Area, line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';\nimport { max as d3Max, extent as d3Extent } from 'd3-array';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILineChartDataPoint } from '../../types/IDataPoint';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from '../../index';\n\nconst getClassNames = classNamesFunction<ISparklineStyleProps, ISparklineStyles>();\n\nexport interface ISparklineState {\n _points: ILineChartDataPoint[] | null;\n _width: number;\n _height: number;\n _valueTextWidth: number;\n}\n\nexport class SparklineBase extends React.Component<ISparklineProps, ISparklineState> {\n private margin = {\n top: 2,\n right: 0,\n bottom: 0,\n left: 0,\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private x: any;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private y: any;\n private area: any;\n private line: any;\n private _emptyChartId: string;\n private _isRTL: boolean = getRTL();\n\n constructor(props: ISparklineProps) {\n super(props);\n this.state = {\n _points: null,\n _width: this.props.width! || 80,\n _height: this.props.height! || 20,\n _valueTextWidth: this.props.valueTextWidth! || 80,\n };\n this._emptyChartId = getId('_SparklineChart_empty');\n }\n\n public componentDidMount() {\n if (!this._isChartEmpty()) {\n const area = d3Area()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n .y0(this.state._height)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y1((d: any) => this.y(d.y))\n .curve(d3curveLinear);\n this.area = area;\n\n const line = d3Line()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y((d: any) => this.y(d.y))\n .curve(d3curveLinear);\n this.line = line;\n\n const points = this.props.data!.lineChartData![0].data;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const [xMin, xMax] = d3Extent(points, (d: any) => d.x);\n\n this.x = d3ScaleLinear()\n .domain([xMin, xMax])\n .range([this.margin.left!, this.state._width - this.margin.right!]);\n this.y = d3ScaleLinear()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .domain([0, d3Max(points, (d: any) => d.y)])\n .range([this.state._height - this.margin.bottom!, this.margin.top!]);\n\n this.setState({\n _points: points,\n });\n }\n }\n\n public drawSparkline() {\n return (\n <>\n <path\n className=\"line\"\n d={this.line(this.state._points)}\n fill={'transparent'}\n opacity={1}\n strokeWidth={2}\n stroke={this.props.data!.lineChartData![0].color!}\n />\n <path\n className=\"area\"\n d={this.area(this.state._points)}\n opacity={1}\n fillOpacity={0.2}\n fill={this.props.data!.lineChartData![0].color!}\n role=\"img\"\n aria-hidden\n />\n </>\n );\n }\n\n public render() {\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n return !this._isChartEmpty() ? (\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n isCircularNavigation={true}\n className={classNames.inlineBlock}\n >\n <div className={classNames.inlineBlock}>\n {this.state._width >= 50 && this.state._height >= 16 ? (\n <svg\n width={this.state._width}\n height={this.state._height}\n data-is-focusable={true}\n aria-label={`Sparkline with label ${this.props.data!.lineChartData![0].legend!}`}\n >\n {this.state._points ? this.drawSparkline() : null}\n </svg>\n ) : (\n <></>\n )}\n {this.props.showLegend && this.props.data!.lineChartData![0].legend ? (\n <svg width={this.state._valueTextWidth} height={this.state._height} data-is-focusable={true}>\n <text\n x=\"0%\"\n textAnchor={this._isRTL ? 'end' : 'start'}\n dx={8}\n y=\"100%\"\n dy={-5}\n className={classNames.valueText}\n >\n {this.props.data!.lineChartData![0].legend!}\n </text>\n </svg>\n ) : (\n <></>\n )}\n </div>\n </FocusZone>\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 !(\n this.props.data &&\n this.props.data.lineChartData &&\n this.props.data.lineChartData.length > 0 &&\n this.props.data.lineChartData.filter(item => item.data.length === 0).length === 0\n );\n }\n}\n"]}
1
+ {"version":3,"file":"Sparkline.base.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGlF,IAAM,aAAa,GAAG,kBAAkB,EAA0C,CAAC;AASnF;IAAmC,iCAAiD;IAkBlF,uBAAY,KAAsB;QAChC,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;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,KAAK,CAAC,CAClF,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAtJD,CAAmC,KAAK,CAAC,SAAS,GAsJjD","sourcesContent":["import * as React from 'react';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { area as d3Area, line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';\nimport { max as d3Max, extent as d3Extent } from 'd3-array';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILineChartDataPoint } from '../../types/IDataPoint';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from '../../index';\n\nconst getClassNames = classNamesFunction<ISparklineStyleProps, ISparklineStyles>();\n\nexport interface ISparklineState {\n _points: ILineChartDataPoint[] | null;\n _width: number;\n _height: number;\n _valueTextWidth: number;\n}\n\nexport class SparklineBase extends React.Component<ISparklineProps, ISparklineState> {\n private margin = {\n top: 2,\n right: 0,\n bottom: 0,\n left: 0,\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private x: any;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private y: any;\n private area: any;\n private line: any;\n private _emptyChartId: string;\n private _isRTL: boolean = getRTL();\n\n constructor(props: ISparklineProps) {\n super(props);\n this.state = {\n _points: null,\n _width: this.props.width! || 80,\n _height: this.props.height! || 20,\n _valueTextWidth: this.props.valueTextWidth! || 80,\n };\n this._emptyChartId = getId('_SparklineChart_empty');\n }\n\n public componentDidMount() {\n if (!this._isChartEmpty()) {\n const area = d3Area()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n .y0(this.state._height)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y1((d: any) => this.y(d.y))\n .curve(d3curveLinear);\n this.area = area;\n\n const line = d3Line()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y((d: any) => this.y(d.y))\n .curve(d3curveLinear);\n this.line = line;\n\n const points = this.props.data!.lineChartData![0].data;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const [xMin, xMax] = d3Extent(points, (d: any) => d.x);\n\n this.x = d3ScaleLinear()\n .domain([xMin, xMax])\n .range([this.margin.left!, this.state._width - this.margin.right!]);\n this.y = d3ScaleLinear()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .domain([0, d3Max(points, (d: any) => d.y)])\n .range([this.state._height - this.margin.bottom!, this.margin.top!]);\n\n this.setState({\n _points: points,\n });\n }\n }\n\n public drawSparkline() {\n return (\n <>\n <path\n className=\"line\"\n d={this.line(this.state._points)}\n fill={'transparent'}\n opacity={1}\n strokeWidth={2}\n stroke={this.props.data!.lineChartData![0].color!}\n />\n <path\n className=\"area\"\n d={this.area(this.state._points)}\n opacity={1}\n fillOpacity={0.2}\n fill={this.props.data!.lineChartData![0].color!}\n role=\"img\"\n aria-hidden\n />\n </>\n );\n }\n\n public render() {\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n return !this._isChartEmpty() ? (\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n isCircularNavigation={true}\n className={classNames.inlineBlock}\n >\n <div className={classNames.inlineBlock}>\n {this.state._width >= 50 && this.state._height >= 16 ? (\n <svg\n width={this.state._width}\n height={this.state._height}\n data-is-focusable={true}\n aria-label={`Sparkline with label ${this.props.data!.lineChartData![0].legend!}`}\n >\n {this.state._points ? this.drawSparkline() : null}\n </svg>\n ) : (\n <></>\n )}\n {this.props.showLegend && this.props.data!.lineChartData![0].legend ? (\n <svg width={this.state._valueTextWidth} height={this.state._height} data-is-focusable={true}>\n <text\n x=\"0%\"\n textAnchor={this._isRTL ? 'end' : 'start'}\n dx={8}\n y=\"100%\"\n dy={-5}\n className={classNames.valueText}\n >\n {this.props.data!.lineChartData![0].legend!}\n </text>\n </svg>\n ) : (\n <></>\n )}\n </div>\n </FocusZone>\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 !(\n this.props.data &&\n this.props.data.lineChartData &&\n this.props.data.lineChartData.length > 0 &&\n this.props.data.lineChartData.filter(item => item.data.length === 0).length === 0\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MultiStackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/MultiStackedBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAW,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAOL,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,IAAM,aAAa,GAAG,kBAAkB,EAAgE,CAAC;AAwBzG;IAA8C,4CAAuE;IAkBnH,kCAAmB,KAAiC;QAApD,YACE,kBAAM,KAAK,CAAC,SAsBb;QA9BO,YAAM,GAAY,MAAM,EAAE,CAAC;QAma3B,kBAAY,GAAG;YACf,IAAA,KAAiD,KAAI,CAAC,KAAK,EAAzD,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,SAAS,eAAe,CAAC;YAClE,KAAI,CAAC,WAAW,GAAG,aAA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luentui/react/lib/Utilities';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { ILegend, Legends } from '../Legends/index';\nimport {\n IAccessibilityProps,\n IChartDataPoint,\n IChartProps,\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyles,\n IMultiStackedBarChartStyleProps,\n MultiStackedBarChartVariant,\n} from './index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport {\n ChartHoverCard,\n formatValueWithSIPrefix,\n getAccessibleDataObject,\n getNextGradient,\n} from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\n\nconst getClassNames = classNamesFunction<IMultiStackedBarChartStyleProps, IMultiStackedBarChartStyles>();\n\nexport interface IRefArrayData {\n legendText?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMultiStackedBarChartState {\n isCalloutVisible: boolean;\n refArray: IRefArrayData[];\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class MultiStackedBarChartBase extends React.Component<IMultiStackedBarChartProps, IMultiStackedBarChartState> {\n public static defaultProps: Partial<IMultiStackedBarChartProps> = {\n barHeight: 12,\n hideRatio: [],\n hideDenominator: [],\n };\n\n private _classNames: IProcessedStyleSet<IMultiStackedBarChartStyles>;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _longestBarTotalValue: number;\n private _isRTL: boolean = getRTL();\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _emptyChartId: string;\n private _barId: string;\n private _barIdPlaceholderPartToWhole: string;\n private _barIdEmpty: string;\n\n public constructor(props: IMultiStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n refArray: [],\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._onLeave = this._onLeave.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n this._emptyChartId = getId('_MSBC_empty');\n this._barId = getId('_MSBC_rect_');\n this._barIdPlaceholderPartToWhole = getId('_MSBC_rect_partToWhole_');\n this._barIdEmpty = getId('_MSBC_rect_empty');\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n public render(): JSX.Element {\n if (!this._isChartEmpty()) {\n const { data, theme, culture } = this.props;\n this._adjustProps();\n const { palette } = theme!;\n const legends = this._getLegendData(data!, this.props.hideRatio!, palette);\n const { isCalloutVisible } = this.state;\n\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: theme!,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n\n const legendName = this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend;\n const calloutYVal = this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard;\n\n this._longestBarTotalValue = this._computeLongestBarTotalValue();\n\n const bars: JSX.Element[] = data!.map((singleChartData: IChartProps, index: number) => {\n const singleChartBars = this._createBarsAndLegends(\n singleChartData!,\n this.props.barHeight!,\n palette,\n this.props.hideRatio![index],\n this.props.hideDenominator![index],\n this.props.href,\n index,\n );\n return (\n <div key={index} id={`_MSBC_bar-${index}`}>\n {singleChartBars}\n </div>\n );\n });\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n {bars}\n {!this.props.hideLegend && <div className={this._classNames.legendContainer}>{legends}</div>}\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard Legend={legendName} YValue={calloutYVal} color={this.state.color} culture={culture} />\n )}\n </>\n </Callout>\n </div>\n );\n }\n\n return (\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 /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n hideRatio: boolean,\n hideDenominator: boolean,\n href?: string,\n barNo?: number,\n ): JSX.Element {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n const { culture } = this.props;\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const barTotalValue = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n const total =\n this.props.variant === MultiStackedBarChartVariant.AbsoluteScale ? this._longestBarTotalValue : barTotalValue;\n\n let sumOfPercent = 0;\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n const currValue = (pointData / total) * 100;\n let value = currValue ? currValue : 0;\n\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n // Include an imaginary placeholder bar with value equal to\n // the difference between longestBarTotalValue and barTotalValue\n // while calculating sumOfPercent to get correct scalingRatio for absolute-scale variant\n if (this.props.variant === MultiStackedBarChartVariant.AbsoluteScale) {\n let value = total === 0 ? 0 : ((total - barTotalValue) / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n }\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n let prevPosition = 0;\n let value = 0;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color\n ? point.color\n : point.placeHolder\n ? palette.neutralLight\n : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n const pointData = point.data ? point.data : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100 ? (pointData / total) * 100 : 0;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n const hoverCardYColor = point.placeHolder ? this.props.theme!.semanticColors.bodyText : startColor;\n\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n\n const gradientId = getId('MSBC_Gradient') + `_${barNo}_${index}`;\n\n return (\n <g\n key={index}\n className={point.placeHolder ? this._classNames.placeHolderOnHover : this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, point.legend!);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, hoverCardYColor, point)}\n onBlur={this._onBarLeave}\n role=\"img\"\n aria-label={this._getAriaLabel(point)}\n onMouseOver={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseLeave={this._onBarLeave}\n onClick={href ? (point.placeHolder ? undefined : this._redirectToUrl.bind(this, href)) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={`${this._barId}-${barNo}-${index}`}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n if (this.props.variant === MultiStackedBarChartVariant.AbsoluteScale && !this.props.hideLabels) {\n let showLabel = false;\n let barLabel = 0;\n if (this._noLegendHighlighted()) {\n showLabel = true;\n barLabel = barTotalValue;\n } else {\n data.chartData?.forEach(point => {\n if (this._legendHighlighted(point.legend!)) {\n showLabel = true;\n barLabel += point.data ? point.data : 0;\n }\n });\n }\n if (showLabel) {\n bars.push(\n <text\n key=\"text\"\n x={`${\n this._isRTL\n ? 100 - (startingPoint[startingPoint.length - 1] || 0) - value - totalMarginPercent\n : (startingPoint[startingPoint.length - 1] || 0) + value + totalMarginPercent\n }%`}\n textAnchor={'start'}\n y={barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${this._isRTL ? -4 : 4})`}\n className={this._classNames.barLabel}\n aria-label={`Total: ${barLabel}`}\n role=\"img\"\n >\n {formatValueWithSIPrefix(barLabel)}\n </text>,\n );\n }\n } else {\n // Render placeholder bars only for part-to-whole variant\n if (data.chartData!.length === 0) {\n bars.push(\n <g key={0} className={this._classNames.noData} onClick={this._redirectToUrl.bind(this, href)}>\n <rect\n key={0}\n id={this._barIdPlaceholderPartToWhole}\n x={'0%'}\n y={0}\n width={'100%'}\n height={barHeight}\n fill={palette.neutralLight}\n rx={this.props.roundCorners ? 3 : 0}\n />\n </g>,\n );\n }\n if (barTotalValue === 0) {\n bars.push(\n <g key={'empty'} className={this._classNames.noData} onClick={this._redirectToUrl.bind(this, href)}>\n <rect\n key={0}\n id={this._barIdEmpty}\n x={'0%'}\n y={0}\n width={'100%'}\n height={barHeight}\n fill={palette.neutralLight}\n rx={this.props.roundCorners ? 3 : 0}\n />\n </g>,\n );\n }\n }\n const hideNumber = hideRatio === undefined ? false : hideRatio;\n\n // Hide right side text of chart title for absolute-scale variant\n const showRatio =\n this.props.variant !== MultiStackedBarChartVariant.AbsoluteScale && !hideNumber && data!.chartData!.length === 2;\n const showNumber =\n this.props.variant !== MultiStackedBarChartVariant.AbsoluteScale && !hideNumber && data!.chartData!.length === 1;\n\n const getChartData = () => convertToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture);\n return (\n <div className={this._classNames.singleChartRoot}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + convertToLocaleString(barTotalValue, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartWrapper}>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n {bars}\n </svg>\n </div>\n </FocusZone>\n </div>\n );\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this.state.refArray.forEach((obj: IRefArrayData) => {\n if (obj.legendText === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this.state.refArray.push({ legendText: legendTitle, refElement: element });\n }\n\n private _adjustProps = (): void => {\n const { theme, className, styles, width, barHeight } = this.props;\n this._classNames = getClassNames(styles!, {\n legendColor: this.state.color,\n theme: theme!,\n width,\n className,\n barHeight,\n });\n };\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _getLegendData = (data: IChartProps[], hideRatio: boolean[], palette: IPalette): JSX.Element => {\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const actions: ILegend[] = [];\n data.forEach((singleChartData: IChartProps, index: number) => {\n const validChartData = singleChartData.chartData!.filter((_: IChartDataPoint) => !_.placeHolder);\n if (validChartData!.length < 3) {\n const hideNumber = hideRatio[index] === undefined ? false : hideRatio[index];\n if (hideNumber) {\n validChartData!.forEach((point: IChartDataPoint, pointIndex: number) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n if (this.props.enableGradient) {\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === point.legend! && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: ILegend = {\n title: point.legend!,\n color,\n action: () => {\n this._onClick(point.legend!);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n },\n onMouseOutAction: () => {\n this._onLeave();\n },\n };\n actions.push(legend);\n });\n }\n } else {\n validChartData!.forEach((point: IChartDataPoint, pointIndex: number) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n if (this.props.enableGradient) {\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === point.legend! && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: ILegend = {\n title: point.legend!,\n color,\n action: () => {\n this._onClick(point.legend!);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n },\n onMouseOutAction: () => {\n this._onLeave();\n },\n };\n actions.push(legend);\n });\n }\n });\n return (\n <Legends\n legends={actions}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n };\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : point.placeHolder ? 'Remaining, ' : '') + `${yValue}.`\n );\n };\n\n private _computeLongestBarTotalValue = () => {\n let longestBarTotalValue = 0;\n this.props.data!.forEach(({ chartData }) => {\n const barTotalValue = chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n longestBarTotalValue = Math.max(longestBarTotalValue, barTotalValue);\n });\n return longestBarTotalValue;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.length > 0 &&\n this.props.data.filter(\n item => item.chartData && item.chartData.length === 0 && (!item.chartTitle || item.chartTitle === ''),\n ).length === 0\n );\n }\n}\n"]}
1
+ {"version":3,"file":"MultiStackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/MultiStackedBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAW,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAOL,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,IAAM,aAAa,GAAG,kB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CAAC,EAAE,CAAC;IAC5C,CAAC;IAiDO,gDAAa,GAArB;QACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;YAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CACpB,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,EAA7F,CAA6F,CACtG,CAAC,MAAM,KAAK,CAAC,CACf,CAAC;IACJ,CAAC;IA9nBa,qCAAY,GAAwC;QAChE,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,eAAe,EAAE,EAAE;KACpB,AAJyB,CAIxB;IA2nBJ,+BAAC;CAAA,AAhoBD,CAA8C,KAAK,CAAC,SAAS,GAgoB5D;SAhoBY,wBAAwB","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { ILegend, Legends } from '../Legends/index';\nimport {\n IAccessibilityProps,\n IChartDataPoint,\n IChartProps,\n IMultiStackedBarChartProps,\n IMultiStackedBarChartStyles,\n IMultiStackedBarChartStyleProps,\n MultiStackedBarChartVariant,\n} from './index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport {\n ChartHoverCard,\n formatValueWithSIPrefix,\n getAccessibleDataObject,\n getNextGradient,\n} from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\n\nconst getClassNames = classNamesFunction<IMultiStackedBarChartStyleProps, IMultiStackedBarChartStyles>();\n\nexport interface IRefArrayData {\n legendText?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMultiStackedBarChartState {\n isCalloutVisible: boolean;\n refArray: IRefArrayData[];\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class MultiStackedBarChartBase extends React.Component<IMultiStackedBarChartProps, IMultiStackedBarChartState> {\n public static defaultProps: Partial<IMultiStackedBarChartProps> = {\n barHeight: 12,\n hideRatio: [],\n hideDenominator: [],\n };\n\n private _classNames: IProcessedStyleSet<IMultiStackedBarChartStyles>;\n private _calloutId: string;\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _longestBarTotalValue: number;\n private _isRTL: boolean = getRTL();\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _emptyChartId: string;\n private _barId: string;\n private _barIdPlaceholderPartToWhole: string;\n private _barIdEmpty: string;\n\n public constructor(props: IMultiStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n refArray: [],\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._onLeave = this._onLeave.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n this._emptyChartId = getId('_MSBC_empty');\n this._barId = getId('_MSBC_rect_');\n this._barIdPlaceholderPartToWhole = getId('_MSBC_rect_partToWhole_');\n this._barIdEmpty = getId('_MSBC_rect_empty');\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n public render(): JSX.Element {\n if (!this._isChartEmpty()) {\n const { data, theme, culture } = this.props;\n this._adjustProps();\n const { palette } = theme!;\n const legends = this._getLegendData(data!, this.props.hideRatio!, palette);\n const { isCalloutVisible } = this.state;\n\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: theme!,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n\n const legendName = this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend;\n const calloutYVal = this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard;\n\n this._longestBarTotalValue = this._computeLongestBarTotalValue();\n\n const bars: JSX.Element[] = data!.map((singleChartData: IChartProps, index: number) => {\n const singleChartBars = this._createBarsAndLegends(\n singleChartData!,\n this.props.barHeight!,\n palette,\n this.props.hideRatio![index],\n this.props.hideDenominator![index],\n this.props.href,\n index,\n );\n return (\n <div key={index} id={`_MSBC_bar-${index}`}>\n {singleChartBars}\n </div>\n );\n });\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n {bars}\n {!this.props.hideLegend && <div className={this._classNames.legendContainer}>{legends}</div>}\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard Legend={legendName} YValue={calloutYVal} color={this.state.color} culture={culture} />\n )}\n </>\n </Callout>\n </div>\n );\n }\n\n return (\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 /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n hideRatio: boolean,\n hideDenominator: boolean,\n href?: string,\n barNo?: number,\n ): JSX.Element {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n const { culture } = this.props;\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const barTotalValue = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n const total =\n this.props.variant === MultiStackedBarChartVariant.AbsoluteScale ? this._longestBarTotalValue : barTotalValue;\n\n let sumOfPercent = 0;\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n const currValue = (pointData / total) * 100;\n let value = currValue ? currValue : 0;\n\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n // Include an imaginary placeholder bar with value equal to\n // the difference between longestBarTotalValue and barTotalValue\n // while calculating sumOfPercent to get correct scalingRatio for absolute-scale variant\n if (this.props.variant === MultiStackedBarChartVariant.AbsoluteScale) {\n let value = total === 0 ? 0 : ((total - barTotalValue) / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n }\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n let prevPosition = 0;\n let value = 0;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color\n ? point.color\n : point.placeHolder\n ? palette.neutralLight\n : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n const pointData = point.data ? point.data : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100 ? (pointData / total) * 100 : 0;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n const hoverCardYColor = point.placeHolder ? this.props.theme!.semanticColors.bodyText : startColor;\n\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n\n const gradientId = getId('MSBC_Gradient') + `_${barNo}_${index}`;\n\n return (\n <g\n key={index}\n className={point.placeHolder ? this._classNames.placeHolderOnHover : this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, point.legend!);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, hoverCardYColor, point)}\n onBlur={this._onBarLeave}\n role=\"img\"\n aria-label={this._getAriaLabel(point)}\n onMouseOver={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseLeave={this._onBarLeave}\n onClick={href ? (point.placeHolder ? undefined : this._redirectToUrl.bind(this, href)) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={`${this._barId}-${barNo}-${index}`}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n if (this.props.variant === MultiStackedBarChartVariant.AbsoluteScale && !this.props.hideLabels) {\n let showLabel = false;\n let barLabel = 0;\n if (this._noLegendHighlighted()) {\n showLabel = true;\n barLabel = barTotalValue;\n } else {\n data.chartData?.forEach(point => {\n if (this._legendHighlighted(point.legend!)) {\n showLabel = true;\n barLabel += point.data ? point.data : 0;\n }\n });\n }\n if (showLabel) {\n bars.push(\n <text\n key=\"text\"\n x={`${\n this._isRTL\n ? 100 - (startingPoint[startingPoint.length - 1] || 0) - value - totalMarginPercent\n : (startingPoint[startingPoint.length - 1] || 0) + value + totalMarginPercent\n }%`}\n textAnchor={'start'}\n y={barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${this._isRTL ? -4 : 4})`}\n className={this._classNames.barLabel}\n aria-label={`Total: ${barLabel}`}\n role=\"img\"\n >\n {formatValueWithSIPrefix(barLabel)}\n </text>,\n );\n }\n } else {\n // Render placeholder bars only for part-to-whole variant\n if (data.chartData!.length === 0) {\n bars.push(\n <g key={0} className={this._classNames.noData} onClick={this._redirectToUrl.bind(this, href)}>\n <rect\n key={0}\n id={this._barIdPlaceholderPartToWhole}\n x={'0%'}\n y={0}\n width={'100%'}\n height={barHeight}\n fill={palette.neutralLight}\n rx={this.props.roundCorners ? 3 : 0}\n />\n </g>,\n );\n }\n if (barTotalValue === 0) {\n bars.push(\n <g key={'empty'} className={this._classNames.noData} onClick={this._redirectToUrl.bind(this, href)}>\n <rect\n key={0}\n id={this._barIdEmpty}\n x={'0%'}\n y={0}\n width={'100%'}\n height={barHeight}\n fill={palette.neutralLight}\n rx={this.props.roundCorners ? 3 : 0}\n />\n </g>,\n );\n }\n }\n const hideNumber = hideRatio === undefined ? false : hideRatio;\n\n // Hide right side text of chart title for absolute-scale variant\n const showRatio =\n this.props.variant !== MultiStackedBarChartVariant.AbsoluteScale && !hideNumber && data!.chartData!.length === 2;\n const showNumber =\n this.props.variant !== MultiStackedBarChartVariant.AbsoluteScale && !hideNumber && data!.chartData!.length === 1;\n\n const getChartData = () => convertToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture);\n return (\n <div className={this._classNames.singleChartRoot}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + convertToLocaleString(barTotalValue, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartWrapper}>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n {bars}\n </svg>\n </div>\n </FocusZone>\n </div>\n );\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this.state.refArray.forEach((obj: IRefArrayData) => {\n if (obj.legendText === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this.state.refArray.push({ legendText: legendTitle, refElement: element });\n }\n\n private _adjustProps = (): void => {\n const { theme, className, styles, width, barHeight } = this.props;\n this._classNames = getClassNames(styles!, {\n legendColor: this.state.color,\n theme: theme!,\n width,\n className,\n barHeight,\n });\n };\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _getLegendData = (data: IChartProps[], hideRatio: boolean[], palette: IPalette): JSX.Element => {\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const actions: ILegend[] = [];\n data.forEach((singleChartData: IChartProps, index: number) => {\n const validChartData = singleChartData.chartData!.filter((_: IChartDataPoint) => !_.placeHolder);\n if (validChartData!.length < 3) {\n const hideNumber = hideRatio[index] === undefined ? false : hideRatio[index];\n if (hideNumber) {\n validChartData!.forEach((point: IChartDataPoint, pointIndex: number) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n if (this.props.enableGradient) {\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === point.legend! && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: ILegend = {\n title: point.legend!,\n color,\n action: () => {\n this._onClick(point.legend!);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n },\n onMouseOutAction: () => {\n this._onLeave();\n },\n };\n actions.push(legend);\n });\n }\n } else {\n validChartData!.forEach((point: IChartDataPoint, pointIndex: number) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n if (this.props.enableGradient) {\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n const checkSimilarLegends = actions.filter(\n (leg: ILegend) => leg.title === point.legend! && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: ILegend = {\n title: point.legend!,\n color,\n action: () => {\n this._onClick(point.legend!);\n },\n hoverAction: () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n },\n onMouseOutAction: () => {\n this._onLeave();\n },\n };\n actions.push(legend);\n });\n }\n });\n return (\n <Legends\n legends={actions}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n };\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : point.placeHolder ? 'Remaining, ' : '') + `${yValue}.`\n );\n };\n\n private _computeLongestBarTotalValue = () => {\n let longestBarTotalValue = 0;\n this.props.data!.forEach(({ chartData }) => {\n const barTotalValue = chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n longestBarTotalValue = Math.max(longestBarTotalValue, barTotalValue);\n });\n return longestBarTotalValue;\n };\n\n private _isChartEmpty(): boolean {\n return !(\n this.props.data &&\n this.props.data.length > 0 &&\n this.props.data.filter(\n item => item.chartData && item.chartData.length === 0 && (!item.chartTitle || item.chartTitle === ''),\n ).length === 0\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAW,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,IAAM,aAAa,GAAG,kBAAkB,EAAsD,CAAC;AAiB/F;IAAyC,uCAA6D;IAepG,6BAAmB,KAA4B;QAA/C,YACE,kBAAM,KAAK,CAAC,SAoBb;QAvBO,YAAM,GAAG,MAAM,EAAE,CAAC;QA0clB,4BAAsB,GAAG;YAC/B,KAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;YAChC,KAAI,CAAC,QAAQ,CAAC;gBACZ,gBAAgB,EAAE,KAAK;aACxB,CAAC,CAAC;QACL,CAAC,CAAC;QAMM,mBAAa,GAAG;YACtB,KAAI,CAAC,QAAQ,CAAC;gBACZ,gBAAgB,EAAE,KAAK;aACxB,CAAC,CAAC;QACL,CAAC,CAAC;QAEF;;;;;WAKG;QACK,wBAAkB,GAAG,UAAC,WAAmB;YAC/C,OAAO,CACL,KAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW;gBACzC,CAAC,KAAI,CAAC,KAAK,CAAC,cAAc,KAAK,EAAE,IAAI,KA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AwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAkCO,2CAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjG,CAAC;IAngBa,gCAAY,GAAmC;QAC3D,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE,KAAK;KACtB,AALyB,CAKxB;IA+fJ,0BAAC;CAAA,AArgBD,CAAyC,KAAK,CAAC,SAAS,GAqgBvD;SArgBY,mBAAmB","sourcesContent":["import * as React from 'react';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ILegend, Legends } from '../Legends/index';\nimport { IAccessibilityProps, IChartDataPoint, IChartProps } from './index';\nimport { IRefArrayData, IStackedBarChartProps, IStackedBarChartStyleProps, IStackedBarChartStyles } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ChartHoverCard, getAccessibleDataObject, getNextGradient } from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { convertToLocaleString } from '../../utilities/locale-util';\n\nconst getClassNames = classNamesFunction<IStackedBarChartStyleProps, IStackedBarChartStyles>();\nexport interface IStackedBarChartState {\n isCalloutVisible: boolean;\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class StackedBarChartBase extends React.Component<IStackedBarChartProps, IStackedBarChartState> {\n public static defaultProps: Partial<IStackedBarChartProps> = {\n barHeight: 12,\n hideNumberDisplay: false,\n hideLegend: false,\n ignoreFixStyle: false,\n };\n private _classNames: IProcessedStyleSet<IStackedBarChartStyles>;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string;\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _isRTL = getRTL();\n\n public constructor(props: IStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._onLeave = this._onLeave.bind(this);\n this._refCallback = this._refCallback.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_SBC_empty');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n public render(): JSX.Element {\n if (!this._isChartEmpty()) {\n this._adjustProps();\n const { data, benchmarkData, targetData, hideNumberDisplay, ignoreFixStyle, culture } = this.props;\n const { palette } = this.props.theme!;\n const barHeight = ignoreFixStyle || data!.chartData!.length > 2 ? this.props.barHeight : 12;\n\n if (benchmarkData) {\n // benchmark color is used to render color for benchmark triangle and benchmark legend\n benchmarkData.color = benchmarkData.color || palette.neutralTertiary;\n }\n\n if (targetData) {\n // target color is used to render color for target triangle and target legend\n targetData.color = targetData.color || palette.neutralSecondary;\n }\n\n const bars = this._createBarsAndLegends(data!, barHeight!, palette, benchmarkData, targetData);\n\n const showRatio = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 2;\n const showNumber = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 1;\n const total = data!.chartData!.reduce(\n (acc: number, value: IChartDataPoint) => acc + (value.data ? value.data : 0),\n 0,\n );\n\n let benchmarkRatio = 0;\n if (benchmarkData && total) {\n benchmarkRatio = (benchmarkData.data! / total) * 100;\n }\n let targetRatio = 0;\n if (targetData && total) {\n targetRatio = (targetData.data! / total) * 100;\n }\n\n const showLegend = this.props.hideLegend === false && (ignoreFixStyle || data!.chartData!.length > 2);\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n benchmarkColor: benchmarkData ? benchmarkData.color : '',\n benchmarkRatio,\n targetColor: targetData ? targetData.color : '',\n targetRatio,\n showTriangle: !!(benchmarkData || targetData),\n });\n const getChartData = () =>\n convertToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture);\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!this.props.hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + convertToLocaleString(total, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n {(benchmarkData || targetData) && (\n <div className={this._classNames.benchmarkContainer}>\n {benchmarkData && <div className={this._classNames.benchmark} role=\"text\" />}\n {targetData && <div className={this._classNames.target} role=\"text\" />}\n </div>\n )}\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n <g>{bars[0]}</g>\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard}\n color={this.state.color}\n culture={culture}\n />\n )}\n </>\n </Callout>\n </svg>\n </div>\n </FocusZone>\n {showLegend && <div className={this._classNames.legendContainer}>{bars[1]}</div>}\n </div>\n );\n }\n\n return (\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 _adjustProps(): void {\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n width: this.props.width!,\n barHeight: this.props.barHeight!,\n className: this.props.className!,\n });\n }\n\n /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n benchmarkData?: IChartDataPoint,\n targetData?: IChartDataPoint,\n ): [JSX.Element[], JSX.Element] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const legendDataItems: ILegend[] = [];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.data ? point.data : 0;\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color: startColor,\n action:\n total > 0\n ? () => {\n this._onClick(point.legend!);\n }\n : undefined,\n hoverAction:\n total > 0\n ? () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n }\n : undefined,\n onMouseOutAction:\n total > 0\n ? () => {\n this._onLeave();\n }\n : undefined,\n };\n\n if (!point.placeHolder) {\n legendDataItems.push(legend);\n }\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href: this.props.href!,\n });\n\n const gradientId = getId('SBC_Gradient') + `_${index}`;\n\n return (\n <g\n key={index}\n className={this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, legend.title);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, startColor, point)}\n onBlur={this._onBarLeave}\n aria-label={this._getAriaLabel(point)}\n role=\"img\"\n onMouseOver={this._onBarHover.bind(this, pointData, startColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, startColor, point)}\n onMouseLeave={this._onBarLeave}\n pointerEvents=\"all\"\n onClick={this.props.href ? this._redirectToUrl.bind(this, this.props.href!) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={getId('_SBC_bar')}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n\n // add benchmark legends\n this._addLegend(legendDataItems, benchmarkData);\n this._addLegend(legendDataItems, targetData);\n const legends = (\n <Legends\n legends={legendDataItems}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n return [\n total === 0\n ? [\n this._generateEmptyBar(\n barHeight,\n this.props.barBackgroundColor ? this.props.barBackgroundColor : palette.neutralLight,\n ),\n ]\n : bars,\n legends,\n ];\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this._refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _addLegend(legendDataItems: ILegend[], data?: IChartDataPoint): void {\n if (data) {\n const legend: ILegend = {\n title: data.legend!,\n color: data.color!,\n shape: 'triangle',\n };\n legendDataItems.push(legend);\n }\n }\n\n private _generateEmptyBar(barHeight: number, color: string): JSX.Element {\n return (\n <g key={0} className={this._classNames.opacityChangeOnHover}>\n <rect key={0} id={getId('_SBC_empty_bar_')} x={'0%'} y={0} width={'100%'} height={barHeight} fill={color} />\n </g>\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.chartData && this.props.data.chartData.length > 0);\n }\n}\n"]}
1
+ {"version":3,"file":"StackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAW,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,IAAM,aAAa,GAAG,kBAAkB,EAAsD,CAAC;AAiB/F;IAAyC,uCAA6D;IAepG,6BAAmB,KAA4B;QAC7C,YAAA,MAAK,YAAC,KAAK,CAAC,SAAC;QAHP,YAAM,GAAG,MAAM,EAAE,CAAC;QA0clB,4BAAsB,GAAG;YAC/B,KAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;YAChC,KAAI,CAAC,QAAQ,CAAC;gBACZ,gBAAgB,EAAE,KAAK;aACxB,CAAC,CAAC;QACL,CAAC,CAAC;QAMM,mBAAa,GAAG;YACtB,KAAI,CAAC,QAAQ,CAAC;gBACZ,gBAAgB,EAAE,KAAK;aACxB,CAAC,CAAC;QACL,CAAC,CAAC;QAEF;;;;;WAKG;QACK,wBAAkB,GAAG,UAAC,WAAmB;YAC/C,O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AO;gBAC5B,gBAAgB,EAAE,SAAS;gBAC3B,KAAK,OAAA;gBACL,aAAa,EAAE,KAAK,CAAC,gBAAiB;gBACtC,aAAa,EAAE,KAAK,CAAC,gBAAiB;gBACtC,qBAAqB,wBAAO,KAAK,KAAE,KAAK,OAAA,GAAE;gBAC1C,wBAAwB,EAAE,KAAK,CAAC,wBAAyB;aAC1D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,yCAAW,GAAnB;QACE,IAAI;IACN,CAAC;IASO,4CAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAkCO,2CAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjG,CAAC;IAngBa,gCAAY,GAAmC;QAC3D,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE,KAAK;KACtB,AALyB,CAKxB;IA+fJ,0BAAC;CAAA,AArgBD,CAAyC,KAAK,CAAC,SAAS,GAqgBvD;SArgBY,mBAAmB","sourcesContent":["import * as React from 'react';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ILegend, Legends } from '../Legends/index';\nimport { IAccessibilityProps, IChartDataPoint, IChartProps } from './index';\nimport { IRefArrayData, IStackedBarChartProps, IStackedBarChartStyleProps, IStackedBarChartStyles } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ChartHoverCard, getAccessibleDataObject, getNextGradient } from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { convertToLocaleString } from '../../utilities/locale-util';\n\nconst getClassNames = classNamesFunction<IStackedBarChartStyleProps, IStackedBarChartStyles>();\nexport interface IStackedBarChartState {\n isCalloutVisible: boolean;\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class StackedBarChartBase extends React.Component<IStackedBarChartProps, IStackedBarChartState> {\n public static defaultProps: Partial<IStackedBarChartProps> = {\n barHeight: 12,\n hideNumberDisplay: false,\n hideLegend: false,\n ignoreFixStyle: false,\n };\n private _classNames: IProcessedStyleSet<IStackedBarChartStyles>;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string;\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _isRTL = getRTL();\n\n public constructor(props: IStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._onLeave = this._onLeave.bind(this);\n this._refCallback = this._refCallback.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_SBC_empty');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n public render(): JSX.Element {\n if (!this._isChartEmpty()) {\n this._adjustProps();\n const { data, benchmarkData, targetData, hideNumberDisplay, ignoreFixStyle, culture } = this.props;\n const { palette } = this.props.theme!;\n const barHeight = ignoreFixStyle || data!.chartData!.length > 2 ? this.props.barHeight : 12;\n\n if (benchmarkData) {\n // benchmark color is used to render color for benchmark triangle and benchmark legend\n benchmarkData.color = benchmarkData.color || palette.neutralTertiary;\n }\n\n if (targetData) {\n // target color is used to render color for target triangle and target legend\n targetData.color = targetData.color || palette.neutralSecondary;\n }\n\n const bars = this._createBarsAndLegends(data!, barHeight!, palette, benchmarkData, targetData);\n\n const showRatio = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 2;\n const showNumber = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 1;\n const total = data!.chartData!.reduce(\n (acc: number, value: IChartDataPoint) => acc + (value.data ? value.data : 0),\n 0,\n );\n\n let benchmarkRatio = 0;\n if (benchmarkData && total) {\n benchmarkRatio = (benchmarkData.data! / total) * 100;\n }\n let targetRatio = 0;\n if (targetData && total) {\n targetRatio = (targetData.data! / total) * 100;\n }\n\n const showLegend = this.props.hideLegend === false && (ignoreFixStyle || data!.chartData!.length > 2);\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n benchmarkColor: benchmarkData ? benchmarkData.color : '',\n benchmarkRatio,\n targetColor: targetData ? targetData.color : '',\n targetRatio,\n showTriangle: !!(benchmarkData || targetData),\n });\n const getChartData = () =>\n convertToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture);\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!this.props.hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + convertToLocaleString(total, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n {(benchmarkData || targetData) && (\n <div className={this._classNames.benchmarkContainer}>\n {benchmarkData && <div className={this._classNames.benchmark} role=\"text\" />}\n {targetData && <div className={this._classNames.target} role=\"text\" />}\n </div>\n )}\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n <g>{bars[0]}</g>\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard}\n color={this.state.color}\n culture={culture}\n />\n )}\n </>\n </Callout>\n </svg>\n </div>\n </FocusZone>\n {showLegend && <div className={this._classNames.legendContainer}>{bars[1]}</div>}\n </div>\n );\n }\n\n return (\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 _adjustProps(): void {\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n width: this.props.width!,\n barHeight: this.props.barHeight!,\n className: this.props.className!,\n });\n }\n\n /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n benchmarkData?: IChartDataPoint,\n targetData?: IChartDataPoint,\n ): [JSX.Element[], JSX.Element] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const legendDataItems: ILegend[] = [];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.data ? point.data : 0;\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color: startColor,\n action:\n total > 0\n ? () => {\n this._onClick(point.legend!);\n }\n : undefined,\n hoverAction:\n total > 0\n ? () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n }\n : undefined,\n onMouseOutAction:\n total > 0\n ? () => {\n this._onLeave();\n }\n : undefined,\n };\n\n if (!point.placeHolder) {\n legendDataItems.push(legend);\n }\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href: this.props.href!,\n });\n\n const gradientId = getId('SBC_Gradient') + `_${index}`;\n\n return (\n <g\n key={index}\n className={this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, legend.title);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, startColor, point)}\n onBlur={this._onBarLeave}\n aria-label={this._getAriaLabel(point)}\n role=\"img\"\n onMouseOver={this._onBarHover.bind(this, pointData, startColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, startColor, point)}\n onMouseLeave={this._onBarLeave}\n pointerEvents=\"all\"\n onClick={this.props.href ? this._redirectToUrl.bind(this, this.props.href!) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={getId('_SBC_bar')}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n\n // add benchmark legends\n this._addLegend(legendDataItems, benchmarkData);\n this._addLegend(legendDataItems, targetData);\n const legends = (\n <Legends\n legends={legendDataItems}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n return [\n total === 0\n ? [\n this._generateEmptyBar(\n barHeight,\n this.props.barBackgroundColor ? this.props.barBackgroundColor : palette.neutralLight,\n ),\n ]\n : bars,\n legends,\n ];\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this._refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _addLegend(legendDataItems: ILegend[], data?: IChartDataPoint): void {\n if (data) {\n const legend: ILegend = {\n title: data.legend!,\n color: data.color!,\n shape: 'triangle',\n };\n legendDataItems.push(legend);\n }\n }\n\n private _generateEmptyBar(barHeight: number, color: string): JSX.Element {\n return (\n <g key={0} className={this._classNames.opacityChangeOnHover}>\n <rect key={0} id={getId('_SBC_empty_bar_')} x={'0%'} y={0} width={'100%'} height={barHeight} fill={color} />\n </g>\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend!,\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.chartData && this.props.data.chartData.length > 0);\n }\n}\n"]}