@fluentui/react-charting 5.23.83 → 5.23.85

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 (95) hide show
  1. package/CHANGELOG.json +55 -1
  2. package/CHANGELOG.md +24 -2
  3. package/dist/react-charting.d.ts +7 -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 +2 -0
  7. package/lib/components/CommonComponents/CartesianChart.base.js +1 -1
  8. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.types.d.ts +2 -0
  10. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +10 -5
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  13. package/lib/components/DonutChart/Arc/Arc.js +2 -2
  14. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  15. package/lib/components/GaugeChart/GaugeChart.base.js +3 -3
  16. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  17. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  18. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +19 -9
  19. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  20. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +2 -2
  21. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  22. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +5 -0
  23. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +78 -16
  24. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  25. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +2 -2
  26. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  27. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +2 -2
  28. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  29. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +2 -2
  30. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  31. package/lib/types/IDataPoint.d.ts +5 -0
  32. package/lib/types/IDataPoint.js.map +1 -1
  33. package/lib/utilities/utilities.d.ts +8 -1
  34. package/lib/utilities/utilities.js +151 -51
  35. package/lib/utilities/utilities.js.map +1 -1
  36. package/lib-amd/components/CommonComponents/CartesianChart.base.js +1 -1
  37. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  38. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +2 -0
  39. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  40. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +10 -5
  41. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  42. package/lib-amd/components/DonutChart/Arc/Arc.js +1 -1
  43. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  44. package/lib-amd/components/GaugeChart/GaugeChart.base.js +2 -2
  45. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  46. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  47. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +18 -8
  48. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  49. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -1
  50. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  51. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +5 -0
  52. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +77 -16
  53. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  54. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +1 -1
  55. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  56. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  57. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  58. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  59. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  60. package/lib-amd/types/IDataPoint.d.ts +5 -0
  61. package/lib-amd/types/IDataPoint.js.map +1 -1
  62. package/lib-amd/utilities/utilities.d.ts +8 -1
  63. package/lib-amd/utilities/utilities.js +154 -53
  64. package/lib-amd/utilities/utilities.js.map +1 -1
  65. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +1 -1
  66. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  67. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +2 -0
  68. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  69. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +10 -5
  70. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  71. package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -1
  72. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  73. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +2 -2
  74. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  75. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +1 -0
  76. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +18 -8
  77. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  78. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +1 -1
  79. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  80. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +5 -0
  81. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +77 -15
  82. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  83. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +1 -1
  84. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  85. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  86. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  87. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  88. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  89. package/lib-commonjs/types/IDataPoint.d.ts +5 -0
  90. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  91. package/lib-commonjs/utilities/utilities.d.ts +8 -1
  92. package/lib-commonjs/utilities/utilities.js +155 -54
  93. package/lib-commonjs/utilities/utilities.js.map +1 -1
  94. package/package.json +2 -2
  95. package/src/components/CommonComponents/CartesianChart.types.ts +3 -0
@@ -4,7 +4,7 @@ import { classNamesFunction, find, getId, getRTL } from '@fluentui/react/lib/Uti
4
4
  import { HorizontalBarChartVariant, } from './index';
5
5
  import { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';
6
6
  import { convertToLocaleString } from '../../utilities/locale-util';
7
- import { ChartHoverCard, formatValueWithSIPrefix, getAccessibleDataObject, getNextGradient, } from '../../utilities/index';
7
+ import { ChartHoverCard, formatValueLimitWidth, getAccessibleDataObject, getNextGradient } from '../../utilities/index';
8
8
  import { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';
9
9
  import { FocusableTooltipText } from '../../utilities/FocusableTooltipText';
10
10
  var getClassNames = classNamesFunction();
@@ -270,7 +270,7 @@ var HorizontalBarChartBase = /** @class */ (function (_super) {
270
270
  return React.createElement("text", { key: index });
271
271
  }
272
272
  var barValue = data.chartData[0].horizontalBarChartdata.x;
273
- return (React.createElement("text", { key: index, x: "".concat(_this._isRTL ? 100 - startingPoint[index] : startingPoint[index], "%"), y: _this._barHeight / 2, dominantBaseline: "central", transform: "translate(".concat(_this._isRTL ? -4 : 4, ")"), className: _this._classNames.barLabel, "aria-hidden": true }, formatValueWithSIPrefix(barValue)));
273
+ return (React.createElement("text", { key: index, x: "".concat(_this._isRTL ? 100 - startingPoint[index] : startingPoint[index], "%"), y: _this._barHeight / 2, dominantBaseline: "central", transform: "translate(".concat(_this._isRTL ? -4 : 4, ")"), className: _this._classNames.barLabel, "aria-hidden": true }, formatValueLimitWidth(barValue)));
274
274
  }
275
275
  var gradientId = getId('HBC_Gradient') + "_".concat(dataPointIndex, "_").concat(index);
276
276
  return (React.createElement(React.Fragment, { key: index },
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalBarChart.base.js","sourceRoot":"../src/","sources":["components/HorizontalBarChart/HorizontalBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAExF,OAAO,EAQL,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,E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/Utilities';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport {\n IAccessibilityProps,\n IChartProps,\n IHorizontalBarChartProps,\n IHorizontalBarChartStyleProps,\n IHorizontalBarChartStyles,\n IChartDataPoint,\n IRefArrayData,\n HorizontalBarChartVariant,\n} from './index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport {\n ChartHoverCard,\n formatValueWithSIPrefix,\n getAccessibleDataObject,\n getNextGradient,\n} from '../../utilities/index';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\n\nconst getClassNames = classNamesFunction<IHorizontalBarChartStyleProps, IHorizontalBarChartStyles>();\n\nexport interface IHorizontalBarChartState {\n isCalloutVisible: boolean;\n refSelected: SVGGElement | null | undefined;\n color: string;\n hoverValue: string | number | Date | null;\n lineColor: string;\n legend: string | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n barCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n barSpacingInPercent: number;\n}\n\nexport class HorizontalBarChartBase extends React.Component<IHorizontalBarChartProps, IHorizontalBarChartState> {\n private _barHeight: number;\n private _classNames: IProcessedStyleSet<IHorizontalBarChartStyles>;\n private _uniqLineText: string;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _isRTL: boolean = getRTL();\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _emptyChartId: string;\n\n constructor(props: IHorizontalBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n hoverValue: '',\n lineColor: '',\n legend: '',\n refSelected: null,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._uniqLineText = '_HorizontalLine_' + Math.random().toString(36).substring(7);\n this._hoverOff = this._hoverOff.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_HBC_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 const { data, theme } = this.props;\n this._adjustProps();\n const { palette } = theme!;\n let datapoint: number | undefined = 0;\n\n return !this._isChartEmpty() ? (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n {data!.map((points: IChartProps, index: number) => {\n if (points.chartData && points.chartData![0] && points.chartData![0].horizontalBarChartdata!.x) {\n datapoint = points.chartData![0].horizontalBarChartdata!.x;\n } else {\n datapoint = 0;\n }\n points.chartData![1] = {\n legend: '',\n horizontalBarChartdata: {\n x: points.chartData![0].horizontalBarChartdata!.y - datapoint!,\n y: points.chartData![0].horizontalBarChartdata!.y,\n },\n color: palette.neutralLight,\n };\n\n // Hide right side text of chart title for absolute-scale variant\n const chartDataText =\n this.props.variant === HorizontalBarChartVariant.AbsoluteScale ? null : this._getChartDataText(points!);\n const bars = this._createBars(points!, palette, index);\n const keyVal = this._uniqLineText + '_' + index;\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n width: this.props.width,\n showTriangle: !!points!.chartData![0].data,\n variant: this.props.variant,\n });\n\n return (\n <div key={index}>\n <div className={classNames.items}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {points!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={points!.chartTitle}\n accessibilityData={points!.chartTitleAccessibilityData}\n />\n )}\n {chartDataText}\n </div>\n </FocusZone>\n {points!.chartData![0].data && this._createBenchmark(points!)}\n <FocusZone direction={FocusZoneDirection.horizontal} className={this._classNames.chartWrapper}>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={points!.chartTitle}>\n <g\n id={keyVal}\n key={keyVal}\n ref={(e: SVGGElement) => {\n this._refCallback(e, points!.chartData![0].legend);\n }}\n // NOTE: points.chartData![0] contains current data value\n onClick={() => {\n const p = points!.chartData![0];\n if (p && p.onClick) {\n p.onClick();\n }\n }}\n >\n {bars}\n </g>\n </svg>\n </FocusZone>\n </div>\n </div>\n );\n })}\n <Callout\n target={this.state.refSelected}\n coverTarget={true}\n isBeakVisible={false}\n gapSpace={30}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData)}\n >\n <>\n {this.props.onRenderCalloutPerHorizontalBar ? (\n this.props.onRenderCalloutPerHorizontalBar(this.state.barCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend!}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.hoverValue!}\n color={this.state.lineColor}\n culture={this.props.culture}\n />\n )}\n </>\n </Callout>\n </div>\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string | undefined): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _hoverOn(hoverValue: string | number | Date | null, point: IChartDataPoint): void {\n if ((!this.state.isCalloutVisible || this.state.legend !== point.legend!) && this._calloutAnchorPoint !== point) {\n const currentHoveredElement = find(\n this._refArray,\n (currentElement: IRefArrayData) => currentElement.index === point.legend,\n );\n this._calloutAnchorPoint = point;\n let color = point.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(\n this.props.data\n ?.map(v => v.chartData)\n ?.findIndex(item => item?.[0].data === point.data && item?.[0].legend === point.legend) || 0,\n 0,\n );\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n isCalloutVisible: true,\n hoverValue,\n lineColor: color,\n legend: point.legend!,\n refSelected: currentHoveredElement!.refElement,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n barCalloutProps: point,\n callOutAccessibilityData: point.callOutAccessibilityData,\n });\n }\n }\n\n private _hoverOff(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n if (this.state.isCalloutVisible) {\n this.setState({\n isCalloutVisible: false,\n hoverValue: '',\n refSelected: null,\n lineColor: '',\n legend: '',\n });\n }\n };\n\n private _adjustProps = (): void => {\n this._barHeight = this.props.barHeight || 12;\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n width: this.props.width,\n className: this.props.className,\n barHeight: this._barHeight,\n color: this.state.lineColor,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n };\n\n private _getChartDataText = (data: IChartProps) => {\n return this.props.barChartCustomData ? (\n <div role=\"text\">{this.props.barChartCustomData(data)}</div>\n ) : (\n this._getDefaultTextData(data)\n );\n };\n\n private _getDefaultTextData(data: IChartProps): JSX.Element {\n const { culture } = this.props;\n const chartDataMode = this.props.chartDataMode || 'default';\n const chartData: IChartDataPoint = data!.chartData![0];\n const x = chartData.horizontalBarChartdata!.x;\n const y = chartData.horizontalBarChartdata!.y;\n\n const accessibilityData = getAccessibleDataObject(data.chartDataAccessibilityData!, 'text', false);\n switch (chartDataMode) {\n case 'default':\n return (\n <div className={this._classNames.chartTitleRight} {...accessibilityData}>\n {convertToLocaleString(x, culture)}\n </div>\n );\n case 'fraction':\n return (\n <div {...accessibilityData}>\n <span className={this._classNames.chartTitleRight}>{convertToLocaleString(x, culture)}</span>\n <span className={this._classNames.chartDataTextDenominator}>\n {' / ' + convertToLocaleString(y, culture)}\n </span>\n </div>\n );\n case 'percentage':\n const dataRatioPercentage = `${convertToLocaleString(Math.round((x / y) * 100), culture)}%`;\n return (\n <div className={this._classNames.chartTitleRight} {...accessibilityData}>\n {dataRatioPercentage}\n </div>\n );\n }\n }\n\n private _createBenchmark(data: IChartProps): JSX.Element {\n const totalData = data.chartData![0].horizontalBarChartdata!.y;\n const benchmarkData = data.chartData![0].data;\n const benchmarkRatio = Math.round(((benchmarkData ? benchmarkData : 0) / totalData) * 100);\n\n const benchmarkStyles = {\n left: 'calc(' + benchmarkRatio + '% - 4px)',\n };\n\n return (\n <div className={this._classNames.benchmarkContainer}>\n <div className={this._classNames.triangle} style={benchmarkStyles} />\n </div>\n );\n }\n\n /**\n * This 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 in between the bars\n */\n\n private _createBars(data: IChartProps, palette: IPalette, dataPointIndex: number): 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 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 total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 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.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1;\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 - totalMarginPercent) / 100 : 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 = startColor;\n\n if (this.props.enableGradient && index !== 1) {\n startColor = point.gradient?.[0] || getNextGradient(dataPointIndex, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(dataPointIndex, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n startingPoint.push(prevPosition);\n\n const xValue = point.horizontalBarChartdata!.x;\n const placeholderIndex = 1;\n\n // Render bar label instead of placeholder bar for absolute-scale variant\n if (index === placeholderIndex && this.props.variant === HorizontalBarChartVariant.AbsoluteScale) {\n if (this.props.hideLabels) {\n return <text key={index} />;\n }\n\n const barValue = data.chartData![0].horizontalBarChartdata!.x;\n\n return (\n <text\n key={index}\n x={`${this._isRTL ? 100 - startingPoint[index] : startingPoint[index]}%`}\n y={this._barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${this._isRTL ? -4 : 4})`}\n className={this._classNames.barLabel}\n aria-hidden={true}\n >\n {formatValueWithSIPrefix(barValue)}\n </text>\n );\n }\n\n const gradientId = getId('HBC_Gradient') + `_${dataPointIndex}_${index}`;\n\n return (\n <React.Fragment key={index}>\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 x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - index * this.state.barSpacingInPercent\n : startingPoint[index] + index * this.state.barSpacingInPercent\n }%`}\n y={0}\n rx={this.props.roundCorners ? 3 : 0}\n data-is-focusable={point.legend !== '' ? true : false}\n width={value + '%'}\n height={this._barHeight}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n onMouseOver={point.legend !== '' ? this._hoverOn.bind(this, xValue, point) : undefined}\n onFocus={point.legend !== '' ? this._hoverOn.bind(this, xValue, point) : undefined}\n role=\"img\"\n aria-label={this._getAriaLabel(point)}\n onBlur={this._hoverOff}\n onMouseLeave={this._hoverOff}\n className={this._classNames.barWrapper}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const benchMark = point.data;\n const yValue =\n point.yAxisCalloutData ||\n (point.horizontalBarChartdata ? `${point.horizontalBarChartdata.x}/${point.horizontalBarChartdata.y}` : 0);\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : '') + `${yValue}.` + (benchMark ? 'with benchmark at ' + `${benchMark}, ` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n}\n"]}
1
+ {"version":3,"file":"HorizontalBarChart.base.js","sourceRoot":"../src/","sources":["components/HorizontalBarChart/HorizontalBarChart.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAExF,OAAO,EAQL,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAA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E,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IACH,6BAAC;AAAD,CAAC,AAnbD,CAA4C,KAAK,CAAC,SAAS,GAmb1D","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction, find, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport {\n IAccessibilityProps,\n IChartProps,\n IHorizontalBarChartProps,\n IHorizontalBarChartStyleProps,\n IHorizontalBarChartStyles,\n IChartDataPoint,\n IRefArrayData,\n HorizontalBarChartVariant,\n} from './index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport { ChartHoverCard, formatValueLimitWidth, getAccessibleDataObject, getNextGradient } from '../../utilities/index';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\n\nconst getClassNames = classNamesFunction<IHorizontalBarChartStyleProps, IHorizontalBarChartStyles>();\n\nexport interface IHorizontalBarChartState {\n isCalloutVisible: boolean;\n refSelected: SVGGElement | null | undefined;\n color: string;\n hoverValue: string | number | Date | null;\n lineColor: string;\n legend: string | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n barCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n barSpacingInPercent: number;\n}\n\nexport class HorizontalBarChartBase extends React.Component<IHorizontalBarChartProps, IHorizontalBarChartState> {\n private _barHeight: number;\n private _classNames: IProcessedStyleSet<IHorizontalBarChartStyles>;\n private _uniqLineText: string;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _isRTL: boolean = getRTL();\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _emptyChartId: string;\n\n constructor(props: IHorizontalBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n hoverValue: '',\n lineColor: '',\n legend: '',\n refSelected: null,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._uniqLineText = '_HorizontalLine_' + Math.random().toString(36).substring(7);\n this._hoverOff = this._hoverOff.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_HBC_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 const { data, theme } = this.props;\n this._adjustProps();\n const { palette } = theme!;\n let datapoint: number | undefined = 0;\n\n return !this._isChartEmpty() ? (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n {data!.map((points: IChartProps, index: number) => {\n if (points.chartData && points.chartData![0] && points.chartData![0].horizontalBarChartdata!.x) {\n datapoint = points.chartData![0].horizontalBarChartdata!.x;\n } else {\n datapoint = 0;\n }\n points.chartData![1] = {\n legend: '',\n horizontalBarChartdata: {\n x: points.chartData![0].horizontalBarChartdata!.y - datapoint!,\n y: points.chartData![0].horizontalBarChartdata!.y,\n },\n color: palette.neutralLight,\n };\n\n // Hide right side text of chart title for absolute-scale variant\n const chartDataText =\n this.props.variant === HorizontalBarChartVariant.AbsoluteScale ? null : this._getChartDataText(points!);\n const bars = this._createBars(points!, palette, index);\n const keyVal = this._uniqLineText + '_' + index;\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n width: this.props.width,\n showTriangle: !!points!.chartData![0].data,\n variant: this.props.variant,\n });\n\n return (\n <div key={index}>\n <div className={classNames.items}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {points!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={points!.chartTitle}\n accessibilityData={points!.chartTitleAccessibilityData}\n />\n )}\n {chartDataText}\n </div>\n </FocusZone>\n {points!.chartData![0].data && this._createBenchmark(points!)}\n <FocusZone direction={FocusZoneDirection.horizontal} className={this._classNames.chartWrapper}>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={points!.chartTitle}>\n <g\n id={keyVal}\n key={keyVal}\n ref={(e: SVGGElement) => {\n this._refCallback(e, points!.chartData![0].legend);\n }}\n // NOTE: points.chartData![0] contains current data value\n onClick={() => {\n const p = points!.chartData![0];\n if (p && p.onClick) {\n p.onClick();\n }\n }}\n >\n {bars}\n </g>\n </svg>\n </FocusZone>\n </div>\n </div>\n );\n })}\n <Callout\n target={this.state.refSelected}\n coverTarget={true}\n isBeakVisible={false}\n gapSpace={30}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n {...this.props.calloutProps!}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData)}\n >\n <>\n {this.props.onRenderCalloutPerHorizontalBar ? (\n this.props.onRenderCalloutPerHorizontalBar(this.state.barCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.legend!}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.hoverValue!}\n color={this.state.lineColor}\n culture={this.props.culture}\n />\n )}\n </>\n </Callout>\n </div>\n ) : (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string | undefined): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _hoverOn(hoverValue: string | number | Date | null, point: IChartDataPoint): void {\n if ((!this.state.isCalloutVisible || this.state.legend !== point.legend!) && this._calloutAnchorPoint !== point) {\n const currentHoveredElement = find(\n this._refArray,\n (currentElement: IRefArrayData) => currentElement.index === point.legend,\n );\n this._calloutAnchorPoint = point;\n let color = point.color!;\n\n if (this.props.enableGradient) {\n const pointIndex = Math.max(\n this.props.data\n ?.map(v => v.chartData)\n ?.findIndex(item => item?.[0].data === point.data && item?.[0].legend === point.legend) || 0,\n 0,\n );\n color = point.gradient?.[0] || getNextGradient(pointIndex, 0, this.props.theme?.isInverted)[0];\n }\n\n this.setState({\n isCalloutVisible: true,\n hoverValue,\n lineColor: color,\n legend: point.legend!,\n refSelected: currentHoveredElement!.refElement,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n barCalloutProps: point,\n callOutAccessibilityData: point.callOutAccessibilityData,\n });\n }\n }\n\n private _hoverOff(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n if (this.state.isCalloutVisible) {\n this.setState({\n isCalloutVisible: false,\n hoverValue: '',\n refSelected: null,\n lineColor: '',\n legend: '',\n });\n }\n };\n\n private _adjustProps = (): void => {\n this._barHeight = this.props.barHeight || 12;\n this._classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n width: this.props.width,\n className: this.props.className,\n barHeight: this._barHeight,\n color: this.state.lineColor,\n variant: this.props.variant,\n hideLabels: this.props.hideLabels,\n });\n };\n\n private _getChartDataText = (data: IChartProps) => {\n return this.props.barChartCustomData ? (\n <div role=\"text\">{this.props.barChartCustomData(data)}</div>\n ) : (\n this._getDefaultTextData(data)\n );\n };\n\n private _getDefaultTextData(data: IChartProps): JSX.Element {\n const { culture } = this.props;\n const chartDataMode = this.props.chartDataMode || 'default';\n const chartData: IChartDataPoint = data!.chartData![0];\n const x = chartData.horizontalBarChartdata!.x;\n const y = chartData.horizontalBarChartdata!.y;\n\n const accessibilityData = getAccessibleDataObject(data.chartDataAccessibilityData!, 'text', false);\n switch (chartDataMode) {\n case 'default':\n return (\n <div className={this._classNames.chartTitleRight} {...accessibilityData}>\n {convertToLocaleString(x, culture)}\n </div>\n );\n case 'fraction':\n return (\n <div {...accessibilityData}>\n <span className={this._classNames.chartTitleRight}>{convertToLocaleString(x, culture)}</span>\n <span className={this._classNames.chartDataTextDenominator}>\n {' / ' + convertToLocaleString(y, culture)}\n </span>\n </div>\n );\n case 'percentage':\n const dataRatioPercentage = `${convertToLocaleString(Math.round((x / y) * 100), culture)}%`;\n return (\n <div className={this._classNames.chartTitleRight} {...accessibilityData}>\n {dataRatioPercentage}\n </div>\n );\n }\n }\n\n private _createBenchmark(data: IChartProps): JSX.Element {\n const totalData = data.chartData![0].horizontalBarChartdata!.y;\n const benchmarkData = data.chartData![0].data;\n const benchmarkRatio = Math.round(((benchmarkData ? benchmarkData : 0) / totalData) * 100);\n\n const benchmarkStyles = {\n left: 'calc(' + benchmarkRatio + '% - 4px)',\n };\n\n return (\n <div className={this._classNames.benchmarkContainer}>\n <div className={this._classNames.triangle} style={benchmarkStyles} />\n </div>\n );\n }\n\n /**\n * This 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 in between the bars\n */\n\n private _createBars(data: IChartProps, palette: IPalette, dataPointIndex: number): 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 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 total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 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.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1;\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 - totalMarginPercent) / 100 : 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 = startColor;\n\n if (this.props.enableGradient && index !== 1) {\n startColor = point.gradient?.[0] || getNextGradient(dataPointIndex, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(dataPointIndex, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n startingPoint.push(prevPosition);\n\n const xValue = point.horizontalBarChartdata!.x;\n const placeholderIndex = 1;\n\n // Render bar label instead of placeholder bar for absolute-scale variant\n if (index === placeholderIndex && this.props.variant === HorizontalBarChartVariant.AbsoluteScale) {\n if (this.props.hideLabels) {\n return <text key={index} />;\n }\n\n const barValue = data.chartData![0].horizontalBarChartdata!.x;\n\n return (\n <text\n key={index}\n x={`${this._isRTL ? 100 - startingPoint[index] : startingPoint[index]}%`}\n y={this._barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${this._isRTL ? -4 : 4})`}\n className={this._classNames.barLabel}\n aria-hidden={true}\n >\n {formatValueLimitWidth(barValue)}\n </text>\n );\n }\n\n const gradientId = getId('HBC_Gradient') + `_${dataPointIndex}_${index}`;\n\n return (\n <React.Fragment key={index}>\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 x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - index * this.state.barSpacingInPercent\n : startingPoint[index] + index * this.state.barSpacingInPercent\n }%`}\n y={0}\n rx={this.props.roundCorners ? 3 : 0}\n data-is-focusable={point.legend !== '' ? true : false}\n width={value + '%'}\n height={this._barHeight}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n onMouseOver={point.legend !== '' ? this._hoverOn.bind(this, xValue, point) : undefined}\n onFocus={point.legend !== '' ? this._hoverOn.bind(this, xValue, point) : undefined}\n role=\"img\"\n aria-label={this._getAriaLabel(point)}\n onBlur={this._hoverOff}\n onMouseLeave={this._hoverOff}\n className={this._classNames.barWrapper}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const benchMark = point.data;\n const yValue =\n point.yAxisCalloutData ||\n (point.horizontalBarChartdata ? `${point.horizontalBarChartdata.x}/${point.horizontalBarChartdata.y}` : 0);\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : '') + `${yValue}.` + (benchMark ? 'with benchmark at ' + `${benchMark}, ` : '')\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.length > 0);\n }\n}\n"]}
@@ -36,6 +36,8 @@ export declare class HorizontalBarChartWithAxisBase extends React.Component<IHor
36
36
  private _longestBarPositiveTotalValue;
37
37
  private _longestBarNegativeTotalValue;
38
38
  private readonly X_ORIGIN;
39
+ private _domainMargin;
40
+ private _yAxisPadding;
39
41
  constructor(props: IHorizontalBarChartWithAxisProps);
40
42
  componentDidUpdate(prevProps: IHorizontalBarChartWithAxisProps): void;
41
43
  render(): JSX.Element;
@@ -57,6 +59,9 @@ export declare class HorizontalBarChartWithAxisBase extends React.Component<IHor
57
59
  private _onBarFocus;
58
60
  private _getScales;
59
61
  private _createNumericBars;
62
+ private _getUniqueYValues;
63
+ private _calculateAppropriateBarHeight;
64
+ private _getDomainMarginsForHorizontalBarChart;
60
65
  private _tooltipOfYAxislabels;
61
66
  private _createStringBars;
62
67
  private _closeCallout;
@@ -8,13 +8,14 @@ import { DirectionalHint } from '@fluentui/react/lib/Callout';
8
8
  import { Legends } from '../../components/Legends/Legends';
9
9
  import { CartesianChart } from '../CommonComponents/CartesianChart';
10
10
  import { FocusZoneDirection } from '@fluentui/react-focus';
11
- import { ChartHoverCard, ChartTypes, getAccessibleDataObject, YAxisType, XAxisTypes, getTypeOfAxis, getNextColor, findHBCWANumericMinMaxOfY, createYAxisForHorizontalBarChartWithAxis, domainRangeOfNumericForHorizontalBarChartWithAxis, createStringYAxisForHorizontalBarChartWithAxis, getNextGradient, areArraysEqual, computeLongestBars, groupChartDataByYValue, } from '../../utilities/index';
11
+ import { ChartHoverCard, ChartTypes, getAccessibleDataObject, YAxisType, XAxisTypes, getTypeOfAxis, getNextColor, findHBCWANumericMinMaxOfY, createYAxisForHorizontalBarChartWithAxis, domainRangeOfNumericForHorizontalBarChartWithAxis, createStringYAxisForHorizontalBarChartWithAxis, getNextGradient, areArraysEqual, computeLongestBars, groupChartDataByYValue, MIN_DOMAIN_MARGIN, } from '../../utilities/index';
12
12
  import { toImage } from '../../utilities/image-export-utils';
13
+ import { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';
13
14
  var getClassNames = classNamesFunction();
14
15
  var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
15
16
  __extends(HorizontalBarChartWithAxisBase, _super);
16
17
  function HorizontalBarChartWithAxisBase(props) {
17
- var _a, _b, _c, _d, _e;
18
+ var _a, _b, _c, _d, _e, _f;
18
19
  var _this = _super.call(this, props) || this;
19
20
  _this._isRtl = getRTL();
20
21
  _this.X_ORIGIN = 0;
@@ -79,13 +80,18 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
79
80
  var _a = _this._yAxisType === YAxisType.NumericAxis
80
81
  ? _this._getScales(containerHeight, containerWidth, true)
81
82
  : _this._getScales(containerHeight, containerWidth, false), xBarScale = _a.xBarScale, yBarScale = _a.yBarScale;
82
- var allBars = stackedChartData
83
- .map(function (singleBarData) {
84
- return _this._yAxisType === YAxisType.NumericAxis
85
- ? _this._createNumericBars(containerHeight, containerWidth, xElement, yElement, singleBarData, xBarScale, yBarScale)
86
- : _this._createStringBars(containerHeight, containerWidth, xElement, yElement, singleBarData, xBarScale, yBarScale);
87
- })
88
- .flat();
83
+ var xRange = xBarScale.range();
84
+ var allBars = [];
85
+ // when the chart mounts, the xRange[1] is sometimes seen to be < 0 (like -40) while xRange[0] > 0.
86
+ if (xRange[0] < xRange[1]) {
87
+ allBars = stackedChartData
88
+ .map(function (singleBarData) {
89
+ return _this._yAxisType === YAxisType.NumericAxis
90
+ ? _this._createNumericBars(containerHeight, containerWidth, xElement, yElement, singleBarData, xBarScale, yBarScale)
91
+ : _this._createStringBars(containerHeight, containerWidth, xElement, yElement, singleBarData, xBarScale, yBarScale);
92
+ })
93
+ .flat();
94
+ }
89
95
  return (_this._bars = allBars);
90
96
  };
91
97
  _this._refCallback = function (element, legendTitle) {
@@ -174,16 +180,16 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
174
180
  var yMax = d3Max(_this._points, function (point) { return point.y; });
175
181
  var yMin = d3Min(_this._points, function (point) { return point.y; });
176
182
  var yDomainMax = Math.max(yMax, _this.props.yMaxValue || 0);
183
+ // Default to 0 if yMinValue is not provided.
177
184
  var yMinProp = _this.props.yMinValue || 0;
178
- var yDomainMin = yMin < yMinProp ? Math.min(0, yMin) : yMinProp;
179
- var yDomainPadding = Math.abs((yMax - yMin) * 0.1);
185
+ var yDomainMin = Math.min(yMin, yMinProp);
180
186
  var xBarScale = d3ScaleLinear()
181
187
  .domain(xDomain)
182
188
  .nice()
183
189
  .range([_this.margins.left, containerWidth - _this.margins.right]);
184
190
  var yBarScale = d3ScaleLinear()
185
- .domain([yDomainMin - yDomainPadding, yDomainMax + yDomainPadding])
186
- .range([containerHeight - _this.margins.bottom, _this.margins.top]);
191
+ .domain([yDomainMin, yDomainMax])
192
+ .range([containerHeight - (_this.margins.bottom + _this._domainMargin), _this.margins.top + _this._domainMargin]);
187
193
  return { xBarScale: xBarScale, yBarScale: yBarScale };
188
194
  }
189
195
  else {
@@ -192,8 +198,8 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
192
198
  // http://using-d3js.com/04_07_ordinal_scales.html
193
199
  var yBarScale = d3ScaleBand()
194
200
  .domain(_this._yAxisLabels)
195
- .range([containerHeight - _this.margins.bottom - _this._barHeight / 2, _this.margins.top + _this._barHeight / 2])
196
- .padding(_this.props.yAxisPadding || 0);
201
+ .range([containerHeight - (_this.margins.bottom + _this._domainMargin), _this.margins.top + _this._domainMargin])
202
+ .padding(_this._yAxisPadding);
197
203
  var xBarScale = d3ScaleLinear()
198
204
  .domain(xDomain)
199
205
  .nice()
@@ -201,6 +207,51 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
201
207
  return { xBarScale: xBarScale, yBarScale: yBarScale };
202
208
  }
203
209
  };
210
+ _this._calculateAppropriateBarHeight = function (data, totalWidth, innerPadding) {
211
+ var result = getClosestPairDiffAndRange(data);
212
+ if (!result || result[1] === 0) {
213
+ return 16;
214
+ }
215
+ var closestPairDiff = result[0];
216
+ var range = result[1];
217
+ var yMax = d3Max(_this._points, function (point) { return point.y; });
218
+ // Since we are always rendering from 0 to yMax, we need to ensure that the range is at least yMax
219
+ // to calculate the bar height correctly.
220
+ range = Math.max(range, yMax);
221
+ // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes
222
+ // for the derivation of the following formula.
223
+ var barWidth = Math.floor((totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)));
224
+ return barWidth;
225
+ };
226
+ _this._getDomainMarginsForHorizontalBarChart = function (containerHeight) {
227
+ _this._domainMargin = MIN_DOMAIN_MARGIN;
228
+ var uniqueY = _this._getUniqueYValues();
229
+ /** Rate at which the space between the bars changes wrt the bar height */
230
+ _this._yAxisPadding = _this._yAxisPadding === 1 ? 0.99 : _this._yAxisPadding;
231
+ var barGapRate = _this._yAxisPadding / (1 - _this._yAxisPadding);
232
+ var numBars = uniqueY.length + (uniqueY.length - 1) * barGapRate;
233
+ // Total height available to render the bars
234
+ var totalHeight = containerHeight - (_this.margins.top + MIN_DOMAIN_MARGIN) - (_this.margins.bottom + MIN_DOMAIN_MARGIN);
235
+ if (_this._yAxisType !== YAxisType.StringAxis) {
236
+ // Calculate bar height dynamically
237
+ _this._barHeight =
238
+ _this.props.barHeight ||
239
+ _this._calculateAppropriateBarHeight(uniqueY, totalHeight, _this._yAxisPadding);
240
+ _this._barHeight = Math.max(_this._barHeight, 1);
241
+ _this._domainMargin += _this._barHeight / 2;
242
+ }
243
+ else {
244
+ // Calculate the appropriate bar height
245
+ _this._barHeight = _this.props.barHeight || totalHeight / numBars;
246
+ /** Total height required to render the bars. Directly proportional to bar height */
247
+ var reqHeight = numBars * _this._barHeight;
248
+ if (totalHeight >= reqHeight) {
249
+ // Center align the chart by setting equal left and right margins for domain
250
+ _this._domainMargin = MIN_DOMAIN_MARGIN + (totalHeight - reqHeight) / 2;
251
+ }
252
+ }
253
+ return __assign(__assign({}, _this.margins), { top: _this.margins.top + _this._domainMargin, bottom: _this.margins.bottom + _this._domainMargin });
254
+ };
204
255
  _this._closeCallout = function () {
205
256
  _this.setState({
206
257
  isCalloutVisible: false,
@@ -303,6 +354,8 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
303
354
  : YAxisType.StringAxis;
304
355
  _this._cartesianChartRef = React.createRef();
305
356
  _this._legendsRef = React.createRef();
357
+ _this._domainMargin = MIN_DOMAIN_MARGIN;
358
+ _this._yAxisPadding = (_f = _this.props.yAxisPadding) !== null && _f !== void 0 ? _f : 0.5;
306
359
  return _this;
307
360
  }
308
361
  HorizontalBarChartWithAxisBase.prototype.componentDidUpdate = function (prevProps) {
@@ -329,7 +382,7 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
329
382
  tickValues: this.props.tickValues,
330
383
  tickFormat: this.props.tickFormat,
331
384
  };
332
- return (React.createElement(CartesianChart, __assign({}, this.props, { chartTitle: this._getChartTitle(), points: this._points, chartType: ChartTypes.HorizontalBarChartWithAxis, xAxisType: this._xAxisType, yAxisType: this._yAxisType, stringDatasetForYAxisDomain: this._yAxisLabels, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createYAxisForHorizontalBarChartWithAxis, getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxisForHorizontalBarChartWithAxis, getMinMaxOfYAxis: findHBCWANumericMinMaxOfY, barwidth: this._barHeight, focusZoneDirection: FocusZoneDirection.vertical, customizedCallout: this._getCustomizedCallout(), getmargins: this._getMargins, getGraphData: this._getGraphData, getAxisData: this._getAxisData, onChartMouseLeave: this._handleChartMouseLeave, ref: this._cartesianChartRef,
385
+ return (React.createElement(CartesianChart, __assign({}, this.props, { yAxisPadding: this._yAxisPadding, chartTitle: this._getChartTitle(), points: this._points, chartType: ChartTypes.HorizontalBarChartWithAxis, xAxisType: this._xAxisType, yAxisType: this._yAxisType, stringDatasetForYAxisDomain: this._yAxisLabels, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createYAxisForHorizontalBarChartWithAxis, getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxisForHorizontalBarChartWithAxis, getMinMaxOfYAxis: findHBCWANumericMinMaxOfY, barwidth: this._barHeight, focusZoneDirection: FocusZoneDirection.vertical, customizedCallout: this._getCustomizedCallout(), getmargins: this._getMargins, getYDomainMargins: this._getDomainMarginsForHorizontalBarChart, getGraphData: this._getGraphData, getAxisData: this._getAxisData, onChartMouseLeave: this._handleChartMouseLeave, ref: this._cartesianChartRef,
333
386
  /* eslint-disable react/jsx-no-bind */
334
387
  children: function (props) {
335
388
  return (React.createElement(React.Fragment, null,
@@ -493,6 +546,15 @@ var HorizontalBarChartWithAxisBase = /** @class */ (function (_super) {
493
546
  });
494
547
  return bars;
495
548
  };
549
+ HorizontalBarChartWithAxisBase.prototype._getUniqueYValues = function () {
550
+ var _a;
551
+ var mapY = {};
552
+ (_a = this.props.data) === null || _a === void 0 ? void 0 : _a.forEach(function (point) {
553
+ mapY[point.y] = point.y;
554
+ });
555
+ var uniqueY = Object.values(mapY);
556
+ return uniqueY;
557
+ };
496
558
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
497
559
  HorizontalBarChartWithAxisBase.prototype._tooltipOfYAxislabels = function (ytooltipProps) {
498
560
  var _this = this;