@fluentui/react-charting 5.21.32 → 5.22.1

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 (188) hide show
  1. package/CHANGELOG.json +37 -1
  2. package/CHANGELOG.md +21 -2
  3. package/dist/react-charting.d.ts +152 -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 +60 -0
  7. package/lib/components/DonutChart/Arc/Arc.js +22 -5
  8. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  9. package/lib/components/DonutChart/Arc/Arc.types.d.ts +15 -0
  10. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  11. package/lib/components/DonutChart/DonutChart.base.js +13 -4
  12. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  13. package/lib/components/DonutChart/DonutChart.types.d.ts +10 -0
  14. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  15. package/lib/components/DonutChart/Pie/Pie.js +8 -2
  16. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  17. package/lib/components/DonutChart/Pie/Pie.types.d.ts +10 -0
  18. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  19. package/lib/components/GaugeChart/GaugeChart.base.js +30 -6
  20. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  21. package/lib/components/GaugeChart/GaugeChart.types.d.ts +14 -0
  22. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  23. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +29 -6
  24. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  25. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +10 -0
  26. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  27. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +26 -9
  28. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  29. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +10 -0
  30. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  31. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +75 -30
  32. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  33. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +10 -0
  34. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  35. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +29 -10
  36. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  37. package/lib/components/StackedBarChart/MultiStackedBarChart.types.d.ts +10 -0
  38. package/lib/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
  39. package/lib/components/StackedBarChart/StackedBarChart.base.js +18 -7
  40. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  41. package/lib/components/StackedBarChart/StackedBarChart.types.d.ts +10 -0
  42. package/lib/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
  43. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +79 -14
  44. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  45. package/lib/components/VerticalBarChart/VerticalBarChart.types.d.ts +10 -0
  46. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  47. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +32 -10
  48. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  49. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +10 -0
  50. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  51. package/lib/index.d.ts +39 -20
  52. package/lib/index.js +20 -20
  53. package/lib/index.js.map +1 -1
  54. package/lib/types/IDataPoint.d.ts +25 -0
  55. package/lib/types/IDataPoint.js.map +1 -1
  56. package/lib/utilities/gradients.d.ts +30 -0
  57. package/lib/utilities/gradients.js +173 -0
  58. package/lib/utilities/gradients.js.map +1 -0
  59. package/lib/utilities/index.d.ts +1 -0
  60. package/lib/utilities/index.js +1 -0
  61. package/lib/utilities/index.js.map +1 -1
  62. package/lib/version.js +1 -1
  63. package/lib/version.js.map +1 -1
  64. package/lib-amd/components/DonutChart/Arc/Arc.js +21 -4
  65. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  66. package/lib-amd/components/DonutChart/Arc/Arc.types.d.ts +15 -0
  67. package/lib-amd/components/DonutChart/Arc/Arc.types.js.map +1 -1
  68. package/lib-amd/components/DonutChart/DonutChart.base.js +12 -3
  69. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  70. package/lib-amd/components/DonutChart/DonutChart.types.d.ts +10 -0
  71. package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
  72. package/lib-amd/components/DonutChart/Pie/Pie.js +7 -1
  73. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  74. package/lib-amd/components/DonutChart/Pie/Pie.types.d.ts +10 -0
  75. package/lib-amd/components/DonutChart/Pie/Pie.types.js.map +1 -1
  76. package/lib-amd/components/GaugeChart/GaugeChart.base.js +28 -4
  77. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  78. package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +14 -0
  79. package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
  80. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +28 -5
  81. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  82. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +10 -0
  83. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  84. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +25 -8
  85. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  86. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +10 -0
  87. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  88. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +74 -29
  89. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  90. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +10 -0
  91. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  92. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +28 -9
  93. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  94. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.d.ts +10 -0
  95. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
  96. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +17 -6
  97. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  98. package/lib-amd/components/StackedBarChart/StackedBarChart.types.d.ts +10 -0
  99. package/lib-amd/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
  100. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +78 -13
  101. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  102. package/lib-amd/components/VerticalBarChart/VerticalBarChart.types.d.ts +10 -0
  103. package/lib-amd/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  104. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +31 -9
  105. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  106. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +10 -0
  107. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  108. package/lib-amd/index.d.ts +39 -20
  109. package/lib-amd/index.js +36 -21
  110. package/lib-amd/index.js.map +1 -1
  111. package/lib-amd/types/IDataPoint.d.ts +25 -0
  112. package/lib-amd/types/IDataPoint.js.map +1 -1
  113. package/lib-amd/utilities/gradients.d.ts +30 -0
  114. package/lib-amd/utilities/gradients.js +180 -0
  115. package/lib-amd/utilities/gradients.js.map +1 -0
  116. package/lib-amd/utilities/index.d.ts +1 -0
  117. package/lib-amd/utilities/index.js +2 -1
  118. package/lib-amd/utilities/index.js.map +1 -1
  119. package/lib-amd/version.js +1 -1
  120. package/lib-amd/version.js.map +1 -1
  121. package/lib-commonjs/components/DonutChart/Arc/Arc.js +21 -4
  122. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  123. package/lib-commonjs/components/DonutChart/Arc/Arc.types.d.ts +15 -0
  124. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  125. package/lib-commonjs/components/DonutChart/DonutChart.base.js +12 -3
  126. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  127. package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +10 -0
  128. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  129. package/lib-commonjs/components/DonutChart/Pie/Pie.js +7 -1
  130. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  131. package/lib-commonjs/components/DonutChart/Pie/Pie.types.d.ts +10 -0
  132. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  133. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +28 -4
  134. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  135. package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +14 -0
  136. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  137. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +28 -5
  138. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  139. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +10 -0
  140. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  141. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +25 -8
  142. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  143. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +10 -0
  144. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  145. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +74 -29
  146. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  147. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +10 -0
  148. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  149. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +28 -9
  150. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  151. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.d.ts +10 -0
  152. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
  153. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +17 -6
  154. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  155. package/lib-commonjs/components/StackedBarChart/StackedBarChart.types.d.ts +10 -0
  156. package/lib-commonjs/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
  157. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +78 -13
  158. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  159. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.d.ts +10 -0
  160. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  161. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +31 -9
  162. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  163. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +10 -0
  164. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  165. package/lib-commonjs/index.d.ts +39 -20
  166. package/lib-commonjs/index.js +55 -21
  167. package/lib-commonjs/index.js.map +1 -1
  168. package/lib-commonjs/types/IDataPoint.d.ts +25 -0
  169. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  170. package/lib-commonjs/utilities/gradients.d.ts +30 -0
  171. package/lib-commonjs/utilities/gradients.js +178 -0
  172. package/lib-commonjs/utilities/gradients.js.map +1 -0
  173. package/lib-commonjs/utilities/index.d.ts +1 -0
  174. package/lib-commonjs/utilities/index.js +1 -0
  175. package/lib-commonjs/utilities/index.js.map +1 -1
  176. package/lib-commonjs/version.js +1 -1
  177. package/lib-commonjs/version.js.map +1 -1
  178. package/package.json +3 -3
  179. package/src/components/DonutChart/Arc/Arc.types.ts +18 -0
  180. package/src/components/DonutChart/DonutChart.types.ts +12 -0
  181. package/src/components/DonutChart/Pie/Pie.types.ts +12 -0
  182. package/src/components/GaugeChart/GaugeChart.types.ts +17 -0
  183. package/src/components/HorizontalBarChart/HorizontalBarChart.types.ts +12 -0
  184. package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +12 -0
  185. package/src/components/StackedBarChart/MultiStackedBarChart.types.ts +12 -0
  186. package/src/components/StackedBarChart/StackedBarChart.types.ts +12 -0
  187. package/src/components/VerticalBarChart/VerticalBarChart.types.ts +12 -0
  188. package/src/components/VerticalStackedBarChart/VerticalStackedBarChart.types.ts +12 -0
@@ -1 +1 @@
1
- {"version":3,"file":"MultiStackedBarChart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JyB,CAIxB;QA8lBJ,+BAAC;KAAA,AAnmBD,CAA8C,KAAK,CAAC,SAAS,GAmmB5D","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 { ChartHoverCard, formatValueWithSIPrefix, getAccessibleDataObject } 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 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 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 const color: string = point.color\n ? point.color\n : point.placeHolder\n ? palette.neutralLight\n : defaultPalette[Math.floor(Math.random() * 4 + 1)];\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 : color;\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 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 <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 fill={color}\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 />\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 />\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,\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) => {\n const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\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) => {\n const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\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,\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":";;;;IAwBA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgE,CAAC;IAwBzG;QAA8C,oDAAuE;QAkBnH,kCAAmB,KAAiC;YAApD,YACE,kBAAM,KAAK,CAAC,SAsBb;YA9BO,YAAM,GAAY,IAAA,kBAAM,GAAE,CAAC;YAma3B,kBAAY,GAAG;;gBACb,IAAA,KAAK,IAAP,KAAiD,KAAI,CAAC,KAAK,WAApD,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,SAAS,eAAA,CAAgB;gBAClE,KAAI,CAAC,WAAW,GAAG,aAAa,CAAC,MAAO,EAAE;oBACxC,WAAW,EAAE,KAAI,CAAC,KAAK,CAAC,KAAK;oBAC7B,KAAK,EAAE,KAAM;oBACb,KAAK,OAAA;oBACL,SAAS,WAAA;oBACT,SAAS,WAAA;iBACV,CAAC,CAAC;YACL,CAAC,CAAC;YAQM,oBAAc,GAAG,UAAC,IAAmB,EAAE,SAAoB,EAAE,OAAiB;gBACpF,IAAM,cAAc,GAAa,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;gBAChH,IAAM,OAAO,GAAc,EAAE,CAAC;gBAC9B,IAAI,CAAC,OAAO,CAAC,UAAC,eAA4B,EAAE,KAAa;oBACvD,IAAM,cAAc,GAAG,eAAe,CAAC,SAAU,CAAC,MAAM,CAAC,UAAC,CAAkB,IAAK,OAAA,CAAC,CAAC,CAAC,WAAW,EAAd,CAAc,CAAC,CAAC;oBACjG,IAAI,cAAe,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC9B,IAAM,UAAU,GAAG,SAAS,CAAC,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AAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,CAAC;QAiDO,gDAAa,GAArB;YACE,OAAO,CAAC,CACN,IAAI,CAAC,KAAK,CAAC,IAAI;gBACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;gBAC1B,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;QACJ,CAAC;QA9nBa,qCAAY,GAAwC;YAChE,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,EAAE;YACb,eAAe,EAAE,EAAE;SACpB,AAJyB,CAIxB;QA2nBJ,+BAAC;KAAA,AAhoBD,CAA8C,KAAK,CAAC,SAAS,GAgoB5D","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"]}
@@ -99,6 +99,16 @@ export interface IMultiStackedBarChartProps {
99
99
  * @default false
100
100
  */
101
101
  hideLabels?: boolean;
102
+ /**
103
+ * @default false
104
+ * The prop used to enable gradient fill color for the chart.
105
+ */
106
+ enableGradient?: boolean;
107
+ /**
108
+ * @default false
109
+ * The prop used to enable rounded corners for the chart.
110
+ */
111
+ roundCorners?: boolean;
102
112
  }
103
113
  /**
104
114
  * Multi Stacked Bar Chart style properties
@@ -1 +1 @@
1
- {"version":3,"file":"MultiStackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/MultiStackedBarChart.types.ts"],"names":[],"mappings":";;;;IA0PA;;OAEG;IACH,IAAY,2BAGX;IAHD,WAAY,2BAA2B;QACrC,4DAA6B,CAAA;QAC7B,+DAAgC,CAAA;IAClC,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","sourcesContent":["import { IChartProps, IChartDataPoint } from './index';\nimport { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\n/**\n * Multi Stacked Bar Chart properties\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartProps {\n /**\n * An array of chart data points for the multistacked bar chart\n */\n data?: IChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n * This property is applicable only if there are 1 or 2 datapoints.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show the legend at the bottom of chart\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IMultiStackedBarChartStyleProps, IMultiStackedBarChartStyles>;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n * This prop is applicable only if hide ratio is false and there are exactly 2 datapoints.\n */\n hideDenominator?: boolean[];\n\n /**\n * overflow props for legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of MultiStackedBarChart to render\n * @default MultiStackedBarChartVariant.PartToWhole\n */\n variant?: MultiStackedBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n}\n\n/**\n * Multi Stacked Bar Chart style properties\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * barHeight for each chart\n */\n barHeight?: number;\n\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * Prop to define the variant of MultiStackedBarChart to render\n */\n variant?: MultiStackedBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n */\n hideLabels?: boolean;\n}\n\n/**\n * Multi Stacked Bar Chart styles\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartStyles {\n /**\n * Styling for the root container\n */\n root: IStyle;\n\n /**\n * Styling for the root container of each chart in the multistacked bar chart\n */\n singleChartRoot: IStyle;\n\n /**\n * Styling for each item in the container\n */\n items: IStyle;\n\n /**\n * Styling for each svg in the multistacked bar chart\n */\n chart: IStyle;\n\n /**\n * Styling for chart title of the stacked bar chart\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style to change the opacity of placeholder data point when we hover a single bar or legend\n */\n placeHolderOnHover: IStyle;\n\n /**\n * Style for the legends container\n */\n legendContainer: IStyle;\n\n /**\n * Style for stacked bar chart with no data\n */\n noData: IStyle;\n\n /**\n * Style for the bar labels\n */\n barLabel: IStyle;\n\n /**\n * Style for the div containing the chart\n */\n chartWrapper: IStyle;\n}\n\n/**\n * {@docCategory MultiStackedBarChart}\n */\nexport enum MultiStackedBarChartVariant {\n PartToWhole = 'part-to-whole',\n AbsoluteScale = 'absolute-scale',\n}\n"]}
1
+ {"version":3,"file":"MultiStackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/MultiStackedBarChart.types.ts"],"names":[],"mappings":";;;;IAsQA;;OAEG;IACH,IAAY,2BAGX;IAHD,WAAY,2BAA2B;QACrC,4DAA6B,CAAA;QAC7B,+DAAgC,CAAA;IAClC,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","sourcesContent":["import { IChartProps, IChartDataPoint } from './index';\nimport { IStyle, ITheme } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\n/**\n * Multi Stacked Bar Chart properties\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartProps {\n /**\n * An array of chart data points for the multistacked bar chart\n */\n data?: IChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n * This property is applicable only if there are 1 or 2 datapoints.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show the legend at the bottom of chart\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IMultiStackedBarChartStyleProps, IMultiStackedBarChartStyles>;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n * This prop is applicable only if hide ratio is false and there are exactly 2 datapoints.\n */\n hideDenominator?: boolean[];\n\n /**\n * overflow props for legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of MultiStackedBarChart to render\n * @default MultiStackedBarChartVariant.PartToWhole\n */\n variant?: MultiStackedBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the chart.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Multi Stacked Bar Chart style properties\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * barHeight for each chart\n */\n barHeight?: number;\n\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * Prop to define the variant of MultiStackedBarChart to render\n */\n variant?: MultiStackedBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n */\n hideLabels?: boolean;\n}\n\n/**\n * Multi Stacked Bar Chart styles\n * {@docCategory MultiStackedBarChart}\n */\nexport interface IMultiStackedBarChartStyles {\n /**\n * Styling for the root container\n */\n root: IStyle;\n\n /**\n * Styling for the root container of each chart in the multistacked bar chart\n */\n singleChartRoot: IStyle;\n\n /**\n * Styling for each item in the container\n */\n items: IStyle;\n\n /**\n * Styling for each svg in the multistacked bar chart\n */\n chart: IStyle;\n\n /**\n * Styling for chart title of the stacked bar chart\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style to change the opacity of placeholder data point when we hover a single bar or legend\n */\n placeHolderOnHover: IStyle;\n\n /**\n * Style for the legends container\n */\n legendContainer: IStyle;\n\n /**\n * Style for stacked bar chart with no data\n */\n noData: IStyle;\n\n /**\n * Style for the bar labels\n */\n barLabel: IStyle;\n\n /**\n * Style for the div containing the chart\n */\n chartWrapper: IStyle;\n}\n\n/**\n * {@docCategory MultiStackedBarChart}\n */\nexport enum MultiStackedBarChartVariant {\n PartToWhole = 'part-to-whole',\n AbsoluteScale = 'absolute-scale',\n}\n"]}
@@ -185,12 +185,18 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
185
185
  */
186
186
  var scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;
187
187
  var bars = data.chartData.map(function (point, index) {
188
- var color = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];
188
+ var _a, _b, _c, _d;
189
+ var startColor = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];
190
+ var endColor = startColor;
191
+ if (_this.props.enableGradient) {
192
+ startColor = ((_a = point.gradient) === null || _a === void 0 ? void 0 : _a[0]) || (0, index_2.getNextGradient)(index, 0, (_b = _this.props.theme) === null || _b === void 0 ? void 0 : _b.isInverted)[0];
193
+ endColor = ((_c = point.gradient) === null || _c === void 0 ? void 0 : _c[1]) || (0, index_2.getNextGradient)(index, 0, (_d = _this.props.theme) === null || _d === void 0 ? void 0 : _d.isInverted)[1];
194
+ }
189
195
  var pointData = point.data ? point.data : 0;
190
196
  // mapping data to the format Legends component needs
191
197
  var legend = {
192
198
  title: point.legend,
193
- color: color,
199
+ color: startColor,
194
200
  action: total > 0
195
201
  ? function () {
196
202
  _this._onClick(point.legend);
@@ -232,12 +238,17 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
232
238
  shouldHighlight: shouldHighlight,
233
239
  href: _this.props.href,
234
240
  });
241
+ var gradientId = (0, Utilities_1.getId)('SBC_Gradient') + "_".concat(index);
235
242
  return (React.createElement("g", { key: index, className: _this._classNames.opacityChangeOnHover, ref: function (e) {
236
243
  _this._refCallback(e, legend.title);
237
- }, "data-is-focusable": !_this.props.hideTooltip && shouldHighlight, onFocus: _this._onBarFocus.bind(_this, pointData, color, point), onBlur: _this._onBarLeave, "aria-label": _this._getAriaLabel(point), role: "img", onMouseOver: _this._onBarHover.bind(_this, pointData, color, point), onMouseMove: _this._onBarHover.bind(_this, pointData, color, point), onMouseLeave: _this._onBarLeave, pointerEvents: "all", onClick: _this.props.href ? _this._redirectToUrl.bind(_this, _this.props.href) : point.onClick },
244
+ }, "data-is-focusable": !_this.props.hideTooltip && shouldHighlight, onFocus: _this._onBarFocus.bind(_this, pointData, startColor, point), onBlur: _this._onBarLeave, "aria-label": _this._getAriaLabel(point), role: "img", onMouseOver: _this._onBarHover.bind(_this, pointData, startColor, point), onMouseMove: _this._onBarHover.bind(_this, pointData, startColor, point), onMouseLeave: _this._onBarLeave, pointerEvents: "all", onClick: _this.props.href ? _this._redirectToUrl.bind(_this, _this.props.href) : point.onClick },
245
+ _this.props.enableGradient && (React.createElement("defs", null,
246
+ React.createElement("linearGradient", { id: gradientId },
247
+ React.createElement("stop", { offset: "0", stopColor: startColor }),
248
+ React.createElement("stop", { offset: "100%", stopColor: endColor })))),
238
249
  React.createElement("rect", { key: index, id: (0, Utilities_1.getId)('_SBC_bar'), x: "".concat(_this._isRTL
239
250
  ? 100 - startingPoint[index] - value - _this.state.barSpacingInPercent * index
240
- : startingPoint[index] + _this.state.barSpacingInPercent * index, "%"), y: 0, width: value + '%', height: barHeight, fill: color })));
251
+ : startingPoint[index] + _this.state.barSpacingInPercent * index, "%"), y: 0, width: value + '%', height: barHeight, rx: _this.props.roundCorners ? 3 : 0, fill: _this.props.enableGradient ? "url(#".concat(gradientId, ")") : startColor })));
241
252
  });
242
253
  // add benchmark legends
243
254
  this._addLegend(legendDataItems, benchmarkData);
@@ -265,7 +276,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
265
276
  color: color,
266
277
  xCalloutValue: point.xAxisCalloutData,
267
278
  yCalloutValue: point.yAxisCalloutData,
268
- dataPointCalloutProps: point,
279
+ dataPointCalloutProps: tslib_1.__assign(tslib_1.__assign({}, point), { color: color }),
269
280
  callOutAccessibilityData: point.callOutAccessibilityData,
270
281
  });
271
282
  }
@@ -323,7 +334,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
323
334
  color: color,
324
335
  xCalloutValue: point.xAxisCalloutData,
325
336
  yCalloutValue: point.yAxisCalloutData,
326
- dataPointCalloutProps: point,
337
+ dataPointCalloutProps: tslib_1.__assign(tslib_1.__assign({}, point), { color: color }),
327
338
  callOutAccessibilityData: point.callOutAccessibilityData,
328
339
  });
329
340
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.base.tsx"],"names":[],"mappings":";;;;IAYA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAsD,CAAC;IAiB/F;QAAyC,+CAA6D;QAepG,6BAAmB,KAA4B;YAA/C,YACE,kBAAM,KAAK,CAAC,SAoBb;YAvBO,YAAM,GAAG,IAAA,kBAAM,GAAE,CAAC;YAoblB,4BAAsB,GAAG;gBAC/B,KAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;gBAChC,KAAI,CAAC,QAAQ,CAAC;oBACZ,gBAAgB,EAAE,KAAK;iBACxB,CAAC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;KAAA,AA/eD,CAAyC,KAAK,CAAC,SAAS,GA+evD","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 } 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 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 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 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 const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\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: color,\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 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 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: shouldHighlight,\n href: this.props.href!,\n });\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, color, point)}\n onBlur={this._onBarLeave}\n aria-label={this._getAriaLabel(point)}\n role=\"img\"\n onMouseOver={this._onBarHover.bind(this, pointData, color, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, color, point)}\n onMouseLeave={this._onBarLeave}\n pointerEvents=\"all\"\n onClick={this.props.href ? this._redirectToUrl.bind(this, this.props.href!) : point.onClick}\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 fill={color}\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: color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: point,\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: color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: point,\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":";;;;IAYA,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAsD,CAAC;IAiB/F;QAAyC,+CAA6D;QAepG,6BAAmB,KAA4B;YAA/C,YACE,kBAAM,KAAK,CAAC,SAoBb;YAvBO,YAAM,GAAG,IAAA,kBAAM,GAAE,CAAC;YA0clB,4BAAsB,GAAG;gBAC/B,KAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;gBAChC,KAAI,CAAC,QAAQ,CAAC;oBACZ,gBAAgB,EAAE,KAAK;iBACxB,CAAC,CAAC;YACL,CAAC,CAAC;YAMM,mBAAa,GAAG;gBACtB,KAAI,CAAC,QAAQ,CAAC;oBACZ,gBAAgB,EAAE,KAAK;iBACxB,CAAC,CAAC;YACL,CAAC,CAAC;YAEF;;;;;eAKG;YACK,wBAAkB,GAAG,UAAC,WAAmB;gBAC/C,OAAO,CACL,KAAI,CAAC,KAAK,CAAC,cAAc,KAAK,WAAW;oBACzC,CAAC,KAAI,CAAC,KAAK,CAAC,cAAc,KAAK,EAAE,IAAI,KAAI,CAAC,KAAK,CAAC,YAAY,KAAK,WA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,KAAK,OAAA,GAAE;oBAC1C,wBAAwB,EAAE,KAAK,CAAC,wBAAyB;iBAC1D,CAAC,CAAC;aACJ;QACH,CAAC;QAEO,yCAAW,GAAnB;YACE,IAAI;QACN,CAAC;QASO,4CAAc,GAAtB,UAAuB,IAAwB;YAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,CAAC;QAkCO,2CAAa,GAArB;YACE,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;QACjG,CAAC;QAngBa,gCAAY,GAAmC;YAC3D,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,KAAK;YACxB,UAAU,EAAE,KAAK;YACjB,cAAc,EAAE,KAAK;SACtB,AALyB,CAKxB;QA+fJ,0BAAC;KAAA,AArgBD,CAAyC,KAAK,CAAC,SAAS,GAqgBvD","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"]}
@@ -111,6 +111,16 @@ export interface IStackedBarChartProps {
111
111
  * The prop used to define the culture to localized the numbers
112
112
  */
113
113
  culture?: string;
114
+ /**
115
+ * @default false
116
+ * The prop used to enable gradient fill color for the chart.
117
+ */
118
+ enableGradient?: boolean;
119
+ /**
120
+ * @default false
121
+ * The prop used to enable rounded corners for the chart.
122
+ */
123
+ roundCorners?: boolean;
114
124
  }
115
125
  /**
116
126
  * Stacked Bar Chart style properties
@@ -1 +1 @@
1
- {"version":3,"file":"StackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\nexport interface IStackedBarChart {}\nimport { IChartProps, IChartDataPoint } from './index';\n\n/**\n * Stacked Bar Chart properties\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\n\n /**\n * Benchmark Data to render in the chart.\n */\n benchmarkData?: IChartDataPoint;\n\n /**\n * Target Data to render in the chart.\n */\n targetData?: IChartDataPoint;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Do not show the legend at the bottom of chart\n * when there are more than two datapoints\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show number/ratio on top of bar\n *\n * @default false\n */\n hideNumberDisplay?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\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<IStackedBarChartStyleProps, IStackedBarChartStyles>;\n\n /**\n * Color setting of bar background color, this will show while all data points value is 0\n */\n barBackgroundColor?: string;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set, the fixed display pattern for less than 2 data points chart will be ignore\n */\n ignoreFixStyle?: boolean;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n */\n hideDenominator?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /**\n * overflow props for the legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\n/**\n * Stacked Bar Chart style properties\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of bar in the chart.\n */\n barHeight?: number;\n\n /**\n * prop to show data of the chart with appropriate legend color\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check which specific section of the stacked bar chart is selected or hovered upon\n */\n isChartSelected?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * the color for the benchmark triangle\n */\n benchmarkColor?: string;\n\n /**\n * the ratio position for the benchmark triangle\n */\n benchmarkRatio?: number;\n\n /**\n * the color for the target triangle\n */\n targetColor?: string;\n\n /**\n * the ratio position for the target triangle\n */\n targetRatio?: number;\n\n /**\n * prop to check if benchmark data or target data is provided\n */\n showTriangle?: boolean;\n}\n\n/**\n * Stacked Bar Chart styles\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * Style for the chart.\n */\n chart: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style for the legend container div\n */\n legendContainer: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: IStyle;\n\n /**\n * Style for the benchmark triangle\n */\n benchmark: IStyle;\n\n /**\n * Style for the target triangle\n */\n target: IStyle;\n}\n"]}
1
+ {"version":3,"file":"StackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\nexport interface IStackedBarChart {}\nimport { IChartProps, IChartDataPoint } from './index';\n\n/**\n * Stacked Bar Chart properties\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\n\n /**\n * Benchmark Data to render in the chart.\n */\n benchmarkData?: IChartDataPoint;\n\n /**\n * Target Data to render in the chart.\n */\n targetData?: IChartDataPoint;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Do not show the legend at the bottom of chart\n * when there are more than two datapoints\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show number/ratio on top of bar\n *\n * @default false\n */\n hideNumberDisplay?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\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<IStackedBarChartStyleProps, IStackedBarChartStyles>;\n\n /**\n * Color setting of bar background color, this will show while all data points value is 0\n */\n barBackgroundColor?: string;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set, the fixed display pattern for less than 2 data points chart will be ignore\n */\n ignoreFixStyle?: boolean;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n */\n hideDenominator?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /**\n * overflow props for the legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the chart.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Stacked Bar Chart style properties\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of bar in the chart.\n */\n barHeight?: number;\n\n /**\n * prop to show data of the chart with appropriate legend color\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check which specific section of the stacked bar chart is selected or hovered upon\n */\n isChartSelected?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * the color for the benchmark triangle\n */\n benchmarkColor?: string;\n\n /**\n * the ratio position for the benchmark triangle\n */\n benchmarkRatio?: number;\n\n /**\n * the color for the target triangle\n */\n targetColor?: string;\n\n /**\n * the ratio position for the target triangle\n */\n targetRatio?: number;\n\n /**\n * prop to check if benchmark data or target data is provided\n */\n showTriangle?: boolean;\n}\n\n/**\n * Stacked Bar Chart styles\n * {@docCategory StackedBarChart}\n */\nexport interface IStackedBarChartStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * Style for the chart.\n */\n chart: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style for the legend container div\n */\n legendContainer: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: IStyle;\n\n /**\n * Style for the benchmark triangle\n */\n benchmark: IStyle;\n\n /**\n * Style for the target triangle\n */\n target: IStyle;\n}\n"]}