@fluentui/react-charts 9.1.6 → 9.1.7

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 (69) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/dist/index.d.ts +4 -2
  3. package/lib/components/CommonComponents/ChartPopover.js +2 -1
  4. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  5. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  6. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
  7. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  8. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +11 -5
  9. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  10. package/lib/components/DonutChart/Arc/Arc.js +10 -3
  11. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  12. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  13. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +7 -2
  14. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  15. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -6
  16. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  17. package/lib/components/HeatMapChart/HeatMapChart.js +4 -1
  18. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  19. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  20. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +7 -2
  21. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  22. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +14 -3
  23. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  24. package/lib/components/SankeyChart/SankeyChart.js +18 -22
  25. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  26. package/lib/components/ScatterChart/ScatterChart.js +2 -2
  27. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  28. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  29. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  30. package/lib/components/VerticalBarChart/VerticalBarChart.js +12 -14
  31. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  32. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  33. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +14 -11
  34. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  35. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  36. package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
  37. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  38. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  39. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
  40. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  41. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +14 -5
  42. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  43. package/lib-commonjs/components/DonutChart/Arc/Arc.js +10 -3
  44. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  45. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  46. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +10 -2
  47. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  48. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +0 -14
  49. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  50. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +4 -1
  51. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  52. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  53. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +8 -2
  54. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  55. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +14 -3
  56. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  57. package/lib-commonjs/components/SankeyChart/SankeyChart.js +18 -22
  58. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  59. package/lib-commonjs/components/ScatterChart/ScatterChart.js +1 -1
  60. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  61. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +3 -3
  62. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  63. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +12 -14
  64. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  65. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  66. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +14 -11
  67. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  68. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  69. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["VerticalStackedBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { useVerticalStackedBarChartStyles } from './useVerticalStackedBarChartStyles.styles';\nimport {\n scaleLinear as d3ScaleLinear,\n ScaleLinear as D3ScaleLinear,\n scaleBand as d3ScaleBand,\n scaleUtc as d3ScaleUtc,\n scaleTime as d3ScaleTime,\n} from 'd3-scale';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n VerticalStackedBarDataPoint,\n Margins,\n VerticalStackedBarChartProps,\n VerticalStackedChartProps,\n VSChartDataPoint,\n LineDataInVerticalStackedBarChart,\n ModifiedCartesianChartProps,\n Legend,\n ChartPopover,\n Legends,\n Chart,\n DataPoint,\n} from '../../index';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfAxislabels,\n formatScientificLimitWidth,\n getBarWidth,\n getScalePadding,\n isScalePaddingDefined,\n calculateAppropriateBarWidth,\n formatDate,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n findVSBCNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\ntype NumericScale = D3ScaleLinear<number, number>;\nconst barGapMultiplier = 0.2;\nconst barGapMin = 1;\nconst MIN_DOMAIN_MARGIN = 8;\n\ninterface RefArrayData {\n refElement?: SVGGElement | null;\n}\n\ntype LinePoint = LineDataInVerticalStackedBarChart & { index: number; xItem: VerticalStackedChartProps };\ntype LineObject = { [key: string]: LinePoint[] };\ntype LineLegends = {\n title: string;\n color: string;\n};\nenum CircleVisbility {\n show = 'visibility',\n hide = 'hidden',\n}\ntype CalloutAnchorPointData = {\n xAxisDataPoint: string;\n chartDataPoint: VSChartDataPoint;\n};\n\nexport const VerticalStackedBarChart: React.FunctionComponent<VerticalStackedBarChartProps> = props => {\n const _isRtl: boolean = useRtl();\n const _createLegendsForLine: (data: VerticalStackedChartProps[]) => LineLegends[] = (\n data: VerticalStackedChartProps[],\n ) => _getLineLegends(data);\n const _tooltipId: string = useId('VSBCTooltipId_');\n const _emptyChartId: string = useId('_VSBC_empty');\n let _points: VerticalStackedChartProps[] = [];\n let _dataset: VerticalStackedBarDataPoint[];\n let _xAxisLabels: string[] = [];\n let _bars: JSX.Element[];\n let _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data[0]!.xAxisPoint, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n let _barWidth: number = 0;\n let _colors: string[];\n let _margins: Margins;\n let _lineObject: LineObject;\n let _yMax: number;\n let _yMin: number;\n let _calloutAnchorPoint: CalloutAnchorPointData | null;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_ORIGIN: number = 0;\n\n const [selectedLegends, setSelectedLegends] = React.useState(props.legendProps?.selectedLegends || []);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [dataForHoverCard, setDataForHoverCard] = React.useState(0);\n const [color, setColor] = React.useState('');\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [YValueHover, setYValueHover] = React.useState<(LineDataInVerticalStackedBarChart | VSChartDataPoint)[]>([]);\n const [xCalloutValue, setXCalloutValue] = React.useState('');\n const [yCalloutValue, setYCalloutValue] = React.useState('');\n const [activeXAxisDataPoint, setActiveXAxisDataPoint] = React.useState<number | string | Date>('');\n const [calloutLegend, setCalloutLegend] = React.useState('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<VerticalStackedChartProps>();\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<VSChartDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<VerticalStackedBarChartProps | null>(null);\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n if (prevProps.height !== props.height || prevProps.width !== props.width || prevProps.data !== props.data) {\n _adjustProps();\n _dataset = _createDataSetLayer();\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _getLegendData(data: VerticalStackedChartProps[], lineLegends: LineLegends[]): JSX.Element {\n if (props.hideLegend) {\n return <></>;\n }\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n getColorFromToken(DataVizPalette.color10),\n ];\n const actions: Legend[] = [];\n const { allowHoverOnLegend = true } = props;\n\n data.forEach((singleChartData: VerticalStackedChartProps) => {\n singleChartData.chartData.forEach((point: VSChartDataPoint) => {\n const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n const checkSimilarLegends = actions.filter((leg: Legend) => leg.title === point.legend && leg.color === color);\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: Legend = {\n title: point.legend,\n color,\n hoverAction: allowHoverOnLegend\n ? () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend);\n }\n : undefined,\n onMouseOutAction: allowHoverOnLegend ? () => _onLegendLeave() : undefined,\n };\n\n actions.push(legend);\n });\n });\n const legendsOfLine: Legend[] = [];\n if (lineLegends && lineLegends.length > 0) {\n lineLegends.forEach((point: LineLegends) => {\n const legend: Legend = {\n title: point.title,\n color: point.color,\n isLineLegendInBarChart: true,\n hoverAction: allowHoverOnLegend\n ? () => {\n _handleChartMouseLeave();\n _onLegendHover(point.title);\n }\n : undefined,\n onMouseOutAction: allowHoverOnLegend ? () => _onLegendLeave() : undefined,\n };\n legendsOfLine.push(legend);\n });\n }\n const totalLegends: Legend[] = legendsOfLine.concat(actions);\n return (\n <Legends\n legends={totalLegends}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n />\n );\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _lineHoverOut() {\n setPopoverOpen(false);\n setXCalloutValue('');\n setYCalloutValue('');\n setActiveXAxisDataPoint('');\n setColor('');\n }\n\n function _lineHoverFocus(lineData: LinePoint) {\n setPopoverOpen(true);\n setXCalloutValue(`${lineData.xItem.xAxisPoint}`);\n setYCalloutValue(`${lineData.yAxisCalloutData || lineData.data || lineData.y}`);\n setActiveXAxisDataPoint(lineData.xItem.xAxisPoint);\n setColor(lineData.color);\n }\n\n function _onStackHoverFocus(\n stack: VerticalStackedChartProps,\n mouseEvent: React.MouseEvent<SVGElement> | SVGGElement,\n ): void {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in mouseEvent) {\n clientX = mouseEvent.clientX;\n clientY = mouseEvent.clientY;\n } else {\n // Handle case where mouseEvent is an SVGGElement\n const boundingRect = mouseEvent.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (!_noLegendHighlighted()) {\n stack = {\n ...stack,\n chartData: stack.chartData.filter((dataPoint: { legend: any }) => _isLegendHighlighted(dataPoint.legend)),\n lineData: stack.lineData?.filter((dataPoint: { legend: any }) => _isLegendHighlighted(dataPoint.legend)),\n };\n }\n const lineData = stack.lineData;\n const isLinesPresent: boolean = lineData !== undefined && lineData.length > 0;\n if (isLinesPresent) {\n lineData!.forEach((item: LineDataInVerticalStackedBarChart & { shouldDrawBorderBottom?: boolean }) => {\n item.data = item.data || item.y;\n item.shouldDrawBorderBottom = true;\n });\n }\n _updatePosition(clientX, clientY);\n setPopoverOpen(stack.chartData.length > 0 || (stack.lineData?.length ?? 0) > 0);\n setYValueHover(\n isLinesPresent\n ? [...lineData!.sort((a, b) => (a.data! < b.data! ? 1 : -1)), ...stack.chartData.slice().reverse()]\n : stack.chartData.slice().reverse(),\n );\n setHoverXValue(stack.xAxisPoint instanceof Date ? formatDate(stack.xAxisPoint, props.useUTC) : stack.xAxisPoint);\n setStackCalloutProps(stack);\n setActiveXAxisDataPoint(stack.xAxisPoint);\n setCallOutAccessibilityData(stack.stackCallOutAccessibilityData);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n setActiveXAxisDataPoint('');\n }\n\n const _onClick = (\n data: VerticalStackedChartProps | VSChartDataPoint,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n props.onBarClick?.(mouseEvent, data);\n props.href ? (window.location.href = props.href) : '';\n };\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const defaultColors: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n getColorFromToken(DataVizPalette.color10),\n ];\n _colors = defaultColors;\n _xAxisType = getTypeOfAxis(props.data[0].xAxisPoint, true) as XAxisTypes;\n _lineObject = _getFormattedLineData(props.data);\n _xAxisInnerPadding = getScalePadding(props.xAxisInnerPadding, props.xAxisPadding, 2 / 3);\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding, props.xAxisPadding, 0);\n }\n\n function _createDataSetLayer(): VerticalStackedBarDataPoint[] {\n const tempArr: string[] = [];\n const dataset: VerticalStackedBarDataPoint[] = _points.map(singlePointData => {\n let total: number = 0;\n singlePointData.chartData!.forEach((point: VSChartDataPoint) => {\n total = total + point.data;\n });\n tempArr.push(singlePointData.xAxisPoint as string);\n return {\n x: singlePointData.xAxisPoint,\n y: total,\n };\n });\n _xAxisLabels = tempArr;\n return dataset;\n }\n\n function _onLegendHover(legendTitle: string): void {\n setActiveLegend(legendTitle);\n }\n\n function _onLegendLeave(): void {\n setActiveLegend(undefined);\n }\n\n function _onLegendSelectionChange(\n _selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _getGraphData(\n xScale: any,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth);\n return (_bars = _createBar(xBarScale, yBarScale, containerHeight, xElement!));\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || Y_ORIGIN);\n _yMin = Math.min(domainValue[0], props.yMinValue || Y_ORIGIN);\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 function _isLegendHighlighted(legendTitle: string) {\n return _getHighlightedLegend().includes(legendTitle);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getAriaLabel(singleChartData: VerticalStackedChartProps, point?: VSChartDataPoint): string {\n if (!point) {\n /** if shouldFocusWholeStack is true */\n const xValue =\n singleChartData.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDate(singleChartData.xAxisPoint)\n : singleChartData.xAxisPoint);\n const pointValues = singleChartData.chartData\n .map(pt => {\n const legend = pt.legend;\n const yValue = pt.yAxisCalloutData || pt.data;\n return `${legend}, ${yValue}.`;\n })\n .join(' ');\n const lineValues = singleChartData.lineData\n ?.map(ln => {\n const legend = ln.legend;\n const yValue = ln.yAxisCalloutData || ln.data || ln.y;\n return `${legend}, ${yValue}.`;\n })\n .join(' ');\n return (\n singleChartData.stackCallOutAccessibilityData?.ariaLabel ||\n `${xValue}. ${pointValues}` + (lineValues ? ` ${lineValues}` : '')\n );\n }\n /** if shouldFocusWholeStack is false */\n const xValue =\n singleChartData.xAxisCalloutData ||\n point.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDate(singleChartData.xAxisPoint)\n : singleChartData.xAxisPoint);\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _getCustomizedCallout() {\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint && !_isHavingLines\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _toFocusWholeStack(_isHavingLines: boolean): boolean {\n const { isCalloutForStack = false } = props;\n let shouldFocusStackOnly: boolean = false;\n if (_isHavingLines) {\n if (_getHighlightedLegend().length === 1) {\n shouldFocusStackOnly = false;\n } else {\n shouldFocusStackOnly = true;\n }\n } else {\n shouldFocusStackOnly = isCalloutForStack;\n }\n return shouldFocusStackOnly;\n }\n\n function _getFormattedLineData(data: VerticalStackedChartProps[]): LineObject {\n const linesData: LinePoint[] = [];\n const formattedLineData: LineObject = {};\n data.forEach((item: VerticalStackedChartProps, index: number) => {\n if (item.lineData) {\n item.lineData.forEach((line: any) => {\n linesData.push({\n ...line,\n index,\n xItem: item,\n });\n });\n }\n });\n linesData.forEach(item => {\n if (formattedLineData[item.legend]) {\n formattedLineData[item.legend].push(item);\n } else {\n formattedLineData[item.legend] = [item];\n }\n });\n return formattedLineData;\n }\n\n function _getLineLegends(data: VerticalStackedChartProps[]): LineLegends[] {\n const lineObject: LineObject = _lineObject;\n const lineLegends: LineLegends[] = [];\n Object.keys(lineObject).forEach((item: string) => {\n lineLegends.push({\n title: item,\n color: lineObject[item][0].color,\n });\n });\n return lineLegends;\n }\n\n function _createLines(\n xScale: any,\n yScalePrimary: NumericScale,\n containerHeight: number,\n containerWidth: number,\n yScaleSecondary?: NumericScale,\n ): JSX.Element {\n const lineObject: LineObject = _getFormattedLineData(props.data);\n const lines: React.ReactNode[] = [];\n const borderForLines: React.ReactNode[] = [];\n const dots: React.ReactNode[] = [];\n //const { theme } = props;\n const lineBorderWidth = props.lineOptions?.lineBorderWidth\n ? Number.parseFloat(props.lineOptions!.lineBorderWidth!.toString())\n : 0;\n const xScaleBandwidthTranslate = _xAxisType !== XAxisTypes.StringAxis ? 0 : xScale.bandwidth() / 2;\n Object.keys(lineObject).forEach((item: string, index: number) => {\n const shouldHighlight = _isLegendHighlighted(item) || _noLegendHighlighted();\n for (let i = 1; i < lineObject[item].length; i++) {\n const x1 = xScale(lineObject[item][i - 1].xItem.xAxisPoint);\n const useSecondaryYScale =\n lineObject[item][i - 1].useSecondaryYScale && lineObject[item][i].useSecondaryYScale && yScaleSecondary;\n const y1 = useSecondaryYScale\n ? yScaleSecondary!(lineObject[item][i - 1].y)\n : yScalePrimary(lineObject[item][i - 1].y);\n const x2 = xScale(lineObject[item][i].xItem.xAxisPoint);\n const y2 = useSecondaryYScale ? yScaleSecondary!(lineObject[item][i].y) : yScalePrimary(lineObject[item][i].y);\n if (lineBorderWidth > 0) {\n borderForLines.push(\n <line\n key={`${index}-${i}-BorderLine`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n opacity={shouldHighlight ? 1 : 0.1}\n strokeWidth={3 + lineBorderWidth * 2}\n fill=\"transparent\"\n strokeLinecap=\"round\"\n stroke={tokens.colorNeutralBackground1}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />,\n );\n }\n lines.push(\n <line\n key={`${index}-${i}-line`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n opacity={shouldHighlight ? 1 : 0.1}\n strokeWidth={lineObject[item][0].lineOptions?.strokeWidth ?? 3}\n strokeLinecap={lineObject[item][0].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={lineObject[item][0].lineOptions?.strokeDasharray}\n stroke={lineObject[item][i].color}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n {...(_isLegendHighlighted(item) && {\n onMouseOver: _lineHover.bind(lineObject[item][i - 1]),\n onMouseLeave: _lineHoverOut,\n })}\n />,\n );\n }\n });\n Object.keys(lineObject).forEach((item: string, index: number) => {\n lineObject[item].forEach((circlePoint: LinePoint, subIndex: number) => {\n const circleRef: { refElement: SVGCircleElement | null } = { refElement: null };\n dots.push(\n <circle\n key={`${index}-${subIndex}-dot`}\n cx={xScale(circlePoint.xItem.xAxisPoint)}\n cy={\n circlePoint.useSecondaryYScale && yScaleSecondary\n ? yScaleSecondary(circlePoint.y)\n : yScalePrimary(circlePoint.y)\n }\n onMouseOver={\n _isLegendHighlighted(item)\n ? (event: React.MouseEvent<SVGElement, MouseEvent>) => _lineHover(circlePoint, event)\n : (event: React.MouseEvent<SVGElement, MouseEvent>) => _onStackHover(circlePoint.xItem, event)\n }\n {...(_isLegendHighlighted(item) && {\n onMouseLeave: _lineHoverOut,\n })}\n r={_getCircleVisibilityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).radius}\n stroke={circlePoint.color}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={3}\n visibility={_getCircleVisibilityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).visibility}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n data-is-focusable={_isLegendHighlighted(item)}\n ref={e => (circleRef.refElement = e)}\n onFocus={_lineFocus.bind(circlePoint, circleRef)}\n onBlur={_lineHoverOut}\n tabIndex={circlePoint.legend !== '' ? 0 : undefined}\n />,\n );\n });\n });\n return (\n <>\n {borderForLines}\n {lines}\n {dots}\n </>\n );\n }\n\n function _getCircleVisibilityAndRadius(\n xAxisPoint: string | number | Date,\n legend: string,\n ): { visibility: CircleVisbility; radius: number } {\n if (!_noLegendHighlighted()) {\n if (xAxisPoint === activeXAxisDataPoint && _isLegendHighlighted(legend)) {\n return { visibility: CircleVisbility.show, radius: 8 };\n } else if (_isLegendHighlighted(legend)) {\n return { visibility: CircleVisbility.show, radius: 0.3 };\n } else {\n return { visibility: CircleVisbility.hide, radius: 0 };\n }\n } else {\n return {\n visibility: activeXAxisDataPoint === xAxisPoint ? CircleVisbility.show : CircleVisbility.hide,\n radius: 8,\n };\n }\n }\n\n function _renderCallout(props?: VSChartDataPoint): JSX.Element | null {\n return props ? (\n <ChartPopover\n culture={props.culture ?? 'en-us'}\n XValue={props.xAxisCalloutData}\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n legend={props.legend}\n YValue={props.yAxisCalloutData}\n color={props.color}\n />\n ) : null;\n }\n\n function _onRectHover(\n xAxisPoint: string | number | Date,\n point: VSChartDataPoint,\n color: string,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void {\n mouseEvent.persist();\n _onRectFocusHover(xAxisPoint, point, color, mouseEvent);\n }\n\n function _onRectFocusHover(\n xAxisPoint: string | number | Date,\n point: VSChartDataPoint,\n color: string,\n mouseEvent: React.MouseEvent<SVGElement> | SVGGElement,\n ) {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in mouseEvent) {\n clientX = mouseEvent.clientX;\n clientY = mouseEvent.clientY;\n } else {\n // Handle case where mouseEvent is an SVGGElement\n const boundingRect = mouseEvent.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (_calloutAnchorPoint?.chartDataPoint !== point || _calloutAnchorPoint?.xAxisDataPoint !== xAxisPoint) {\n _calloutAnchorPoint = {\n chartDataPoint: point,\n xAxisDataPoint: `${xAxisPoint}`,\n };\n _updatePosition(clientX, clientY);\n setPopoverOpen(_noLegendHighlighted() || _isLegendHighlighted(point.legend));\n setCalloutLegend(point.legend);\n setDataForHoverCard(point.data);\n setColor(color);\n setXCalloutValue(point.xAxisCalloutData ? point.xAxisCalloutData : `${xAxisPoint}`);\n setYCalloutValue(point.yAxisCalloutData!);\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _lineHover(lineData: LinePoint, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n _lineHoverFocus(lineData);\n }\n\n function _lineFocus(lineData: LinePoint, ref: { refElement: SVGCircleElement | null }) {\n if (ref.refElement) {\n _lineHoverFocus(lineData);\n }\n }\n\n function _onStackHover(stack: VerticalStackedChartProps, mouseEvent: React.MouseEvent<SVGElement>): void {\n mouseEvent.persist();\n _onStackHoverFocus(stack, mouseEvent);\n }\n\n function _onRectFocus(point: VSChartDataPoint, xAxisPoint: string, color: string, ref: RefArrayData): void {\n if (ref.refElement) {\n _onRectFocusHover(xAxisPoint, point, color, ref.refElement);\n }\n }\n\n function _onStackFocus(stack: VerticalStackedChartProps, groupRef: RefArrayData): void {\n if (groupRef.refElement) {\n _onStackHoverFocus(stack, groupRef.refElement);\n }\n }\n\n function _handleMouseOut(): void {\n setPopoverOpen(false);\n }\n\n function _getBarGapAndScale(\n bars: VSChartDataPoint[],\n yBarScale: NumericScale,\n defaultTotalHeight?: number,\n ): {\n readonly gapHeight: number;\n readonly heightValueScale: number;\n readonly absStackTotal: number;\n } {\n const { barGapMax = 0 } = props;\n // When displaying gaps between the bars, the height of each bar is\n // adjusted so that the total of all bars is not changed by the gaps\n const totalData = bars.reduce((iter, value) => iter + Math.abs(value.data), 0);\n const totalHeight = defaultTotalHeight ?? Math.abs(yBarScale(totalData) - yBarScale(Y_ORIGIN));\n let sumOfPercent = 0;\n bars.forEach(point => {\n let value = (Math.abs(point.data) / totalData) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n });\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / 100 : 1;\n const gaps = barGapMax && bars.length - 1;\n const gapHeight = gaps && Math.max(barGapMin, Math.min(barGapMax, (totalHeight * barGapMultiplier) / gaps));\n const heightValueScale = (totalHeight - gapHeight * gaps) / (totalData * scalingRatio);\n return {\n gapHeight,\n heightValueScale,\n absStackTotal: totalData,\n } as const;\n }\n\n function _getScales(containerHeight: number, containerWidth: number) {\n const yDomain = [Math.min(Y_ORIGIN, _yMin), Math.max(Y_ORIGIN, _yMax)];\n const yBarScale = d3ScaleLinear()\n .domain(yDomain)\n .range([0, containerHeight - _margins.bottom! - _margins.top!]);\n if (_xAxisType === XAxisTypes.NumericAxis) {\n const xMax = d3Max(_dataset, (point: VerticalStackedBarDataPoint) => point.x as number)!;\n const xMin = d3Min(_dataset, (point: VerticalStackedBarDataPoint) => point.x as number)!;\n\n const xBarScale = d3ScaleLinear()\n .domain(_isRtl ? [xMax, xMin] : [xMin, xMax])\n .nice()\n .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n\n return { xBarScale, yBarScale };\n }\n if (_xAxisType === XAxisTypes.DateAxis) {\n const sDate = d3Min(_dataset, (point: VerticalStackedBarDataPoint) => {\n return point.x as Date;\n })!;\n const lDate = d3Max(_dataset, (point: VerticalStackedBarDataPoint) => {\n return point.x as Date;\n })!;\n const xBarScale = props.useUTC ? d3ScaleUtc() : d3ScaleTime();\n xBarScale\n .domain(_isRtl ? [lDate, sDate] : [sDate, lDate])\n .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n\n return { xBarScale, yBarScale };\n }\n const xBarScale = d3ScaleBand()\n .domain(_xAxisLabels)\n .range(\n _isRtl\n ? [containerWidth - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n\n return { xBarScale, yBarScale };\n }\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.some(item => item.chartData.length > 0 || (item.lineData && item.lineData.length > 0))\n );\n };\n\n function _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getDomainMargins(containerWidth: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n\n /** Total width available to render the bars */\n const totalWidth = containerWidth - (_margins.left! + MIN_DOMAIN_MARGIN) - (_margins.right! + MIN_DOMAIN_MARGIN);\n /** Rate at which the space between the bars changes wrt the bar width */\n const barGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding, props.xAxisPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first bar and after the last bar.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n /** Total width required to render the bars. Directly proportional to bar width */\n const reqWidth = (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate) * _barWidth;\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && _xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering bars at their maximum allowable width\n const bandwidth = totalWidth / (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, bandwidth);\n let reqWidth = (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate) * barWidth;\n const margin1 = (totalWidth - reqWidth) / 2;\n\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(_xAxisLabels) + 20;\n reqWidth = (_xAxisLabels.length - _xAxisInnerPadding) * step;\n const margin2 = (totalWidth - reqWidth) / 2;\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n } else {\n const data = (props.data?.map(point => point.xAxisPoint) as number[] | Date[] | undefined) || [];\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth, calculateAppropriateBarWidth(data, totalWidth));\n _domainMargin = MIN_DOMAIN_MARGIN + _barWidth / 2;\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n const numLines = Object.keys(_lineObject).length;\n return (\n (chartTitle ? `${chartTitle}. ` : '') +\n `Vertical bar chart with ${data?.length || 0} stacked bars` +\n (numLines > 0 ? ` and ${numLines} lines` : '') +\n '. '\n );\n }\n\n const classes = useVerticalStackedBarChartStyles(props);\n function _createBar(\n xBarScale: any,\n yBarScale: NumericScale,\n containerHeight: number,\n xElement: SVGElement,\n ): JSX.Element[] {\n const { barCornerRadius = 0, barMinimumHeight = 0 } = props;\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n const shouldFocusWholeStack = _toFocusWholeStack(_isHavingLines);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth, xBarScale.bandwidth());\n }\n\n const bars = _points.map((singleChartData: VerticalStackedChartProps, indexNumber: number) => {\n const xPoint = xBarScale(\n _xAxisType === XAxisTypes.NumericAxis\n ? (singleChartData.xAxisPoint as number)\n : _xAxisType === XAxisTypes.DateAxis\n ? (singleChartData.xAxisPoint as Date)\n : (singleChartData.xAxisPoint as string),\n );\n const xScaleBandwidthTranslate =\n _xAxisType !== XAxisTypes.StringAxis ? -_barWidth / 2 : (xBarScale.bandwidth() - _barWidth) / 2;\n\n let barTotalValue = 0;\n\n const barsToDisplay = singleChartData.chartData.filter(point => point.data !== 0);\n\n if (!barsToDisplay.length) {\n return undefined;\n }\n\n const { gapHeight, heightValueScale, absStackTotal } = _getBarGapAndScale(barsToDisplay, yBarScale);\n\n if (heightValueScale < 0) {\n return undefined;\n }\n\n const yBaseline = containerHeight - _margins.bottom! - yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = 0;\n let heightOfLastBar = 0;\n\n const singleBar = barsToDisplay.map((point: VSChartDataPoint, index: number) => {\n const startColor = point.color ? point.color : _colors[index];\n const ref: RefArrayData = {};\n const shouldHighlight = _isLegendHighlighted(point.legend) || _noLegendHighlighted() ? true : false;\n const rectFocusProps = !shouldFocusWholeStack && {\n 'data-is-focusable': !props.hideTooltip && shouldHighlight,\n 'aria-label': _getAriaLabel(singleChartData, point),\n onMouseOver: (event: React.MouseEvent<SVGElement, MouseEvent>) =>\n _onRectHover(singleChartData.xAxisPoint, point, startColor, event),\n onMouseMove: (event: React.MouseEvent<SVGElement, MouseEvent>) =>\n _onRectHover(singleChartData.xAxisPoint, point, startColor, event),\n onMouseLeave: _handleMouseOut,\n onFocus: () => _onRectFocus(point, singleChartData.xAxisPoint as string, startColor, ref),\n onBlur: _handleMouseOut,\n onClick: (event: React.MouseEvent<SVGElement, MouseEvent>) => _onClick(point, event),\n role: 'img',\n };\n\n let barHeight = Math.abs(heightValueScale * point.data);\n // FIXME: The current scaling logic may produce different min and gap heights for each bar stack.\n const minHeight = Math.max((heightValueScale * absStackTotal) / 100.0, barMinimumHeight);\n if (barHeight < minHeight) {\n barHeight = minHeight;\n }\n const gapOffset = index ? gapHeight : 0;\n if (point.data >= Y_ORIGIN) {\n yPositiveStart -= barHeight + gapOffset;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + gapOffset;\n yNegativeStart = yPoint + barHeight;\n }\n\n barTotalValue += point.data;\n heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;\n\n if (barCornerRadius && barHeight > barCornerRadius && index === barsToDisplay.length - 1) {\n return (\n <React.Fragment key={index + indexNumber + `${shouldFocusWholeStack}`}>\n <path\n className={classes.opacityChangeOnHover}\n d={`\n M ${xPoint} ${yPoint + barCornerRadius}\n a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${-barCornerRadius}\n h ${_barWidth - 2 * barCornerRadius}\n a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${barCornerRadius}\n v ${barHeight - barCornerRadius}\n h ${-_barWidth}\n z\n `}\n fill={startColor}\n rx={props.roundCorners ? 3 : 0}\n ref={e => (ref.refElement = e)}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n cursor={props.href ? 'pointer' : 'default'}\n {...rectFocusProps}\n />\n </React.Fragment>\n );\n }\n if (barHeight < 0) {\n return <React.Fragment key={index + indexNumber}> </React.Fragment>;\n }\n return (\n <React.Fragment key={index + indexNumber}>\n <rect\n className={classes.opacityChangeOnHover}\n x={xPoint}\n y={yPoint}\n width={_barWidth}\n height={barHeight}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n cursor={props.href ? 'pointer' : 'default'}\n rx={props.roundCorners ? 3 : 0}\n ref={e => (ref.refElement = e)}\n {...rectFocusProps}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />\n </React.Fragment>\n );\n });\n const groupRef: RefArrayData = {};\n const stackFocusProps = shouldFocusWholeStack && {\n 'data-is-focusable': !props.hideTooltip,\n 'aria-label': _getAriaLabel(singleChartData),\n onMouseOver: (event: any) => _onStackHover(singleChartData, event),\n onMouseMove: (event: any) => _onStackHover(singleChartData, event),\n onMouseLeave: _handleMouseOut,\n onFocus: () => _onStackFocus(singleChartData, groupRef),\n onBlur: _handleMouseOut,\n onClick: (event: any) => _onClick(singleChartData, event),\n role: 'img',\n };\n let showLabel = false;\n let barLabel = 0;\n if (!props.hideLabels) {\n if (_noLegendHighlighted()) {\n showLabel = true;\n barLabel = barTotalValue;\n } else {\n barsToDisplay.forEach(point => {\n if (_isLegendHighlighted(point.legend)) {\n showLabel = true;\n barLabel += point.data;\n }\n });\n }\n }\n return (\n <g key={indexNumber + `${shouldFocusWholeStack}`}>\n <g\n id={`${indexNumber}-singleBar`}\n ref={e => (groupRef.refElement = e)}\n {...stackFocusProps}\n tabIndex={!props.hideTooltip ? 0 : undefined}\n >\n {singleBar}\n </g>\n {!props.hideLabels && _barWidth >= 16 && showLabel && (\n <text\n x={xPoint + _barWidth / 2}\n //if total bar value >=0, show label above top bar, otherwise below bottom bar\n y={barLabel >= Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-label={`Total: ${barLabel}`}\n role=\"img\"\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(barLabel)\n : formatScientificLimitWidth(barLabel)}\n </text>\n )}\n </g>\n );\n });\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xBarScale);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return bars.filter((bar): bar is JSX.Element => !!bar);\n }\n\n function _getMinMaxOfYAxis(\n dataset: DataPoint[],\n yAxisType?: YAxisType,\n useSecondaryYScale?: boolean,\n ): { startValue: number; endValue: number } {\n if (!useSecondaryYScale) {\n return findVSBCNumericMinMaxOfY(dataset);\n }\n\n const values: number[] = [];\n props.data.forEach(xPoint => {\n xPoint.lineData?.forEach(point => {\n // useSecondaryYScale is applicable only for lines in VSBC\n if (point.useSecondaryYScale) {\n values.push(point.y);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n const shouldFocusWholeStack = _toFocusWholeStack(_isHavingLines);\n _dataset = _createDataSetLayer();\n const legendBars: JSX.Element = _getLegendData(_points, _createLegendsForLine(props.data));\n const calloutProps: ModifiedCartesianChartProps['calloutProps'] = {\n color: color,\n legend: calloutLegend,\n XValue: xCalloutValue!,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack:\n props.isCalloutForStack || (_isHavingLines && (_noLegendHighlighted() || _getHighlightedLegend().length > 1)),\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_dataset}\n chartType={ChartTypes.VerticalStackedBarChart}\n xAxisType={_xAxisType}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n datasetForXAxisDomain={_xAxisLabels}\n isCalloutForStack={shouldFocusWholeStack}\n barwidth={_barWidth}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n <g>\n {_isHavingLines &&\n _createLines(\n props.xScale!,\n props.yScalePrimary!,\n props.containerHeight!,\n props.containerWidth!,\n props.yScaleSecondary,\n )}\n </g>\n </>\n );\n }}\n />\n );\n }\n return <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />;\n};\nVerticalStackedBarChart.displayName = 'VerticalStackedBarChart';\n"],"names":["VerticalStackedBarChart","barGapMultiplier","barGapMin","MIN_DOMAIN_MARGIN","CircleVisbility","props","_isRtl","useRtl","_createLegendsForLine","data","_getLineLegends","_tooltipId","useId","_emptyChartId","_points","_dataset","_xAxisLabels","_bars","_xAxisType","length","getTypeOfAxis","xAxisPoint","XAxisTypes","StringAxis","_barWidth","_colors","_margins","_lineObject","_yMax","_yMin","_calloutAnchorPoint","_domainMargin","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","React","useRef","Y_ORIGIN","selectedLegends","setSelectedLegends","useState","legendProps","activeLegend","setActiveLegend","undefined","dataForHoverCard","setDataForHoverCard","color","setColor","hoverXValue","setHoverXValue","YValueHover","setYValueHover","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","activeXAxisDataPoint","setActiveXAxisDataPoint","calloutLegend","setCalloutLegend","stackCalloutProps","setStackCalloutProps","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","prevPropsRef","useEffect","current","prevProps","areArraysEqual","height","width","_adjustProps","_createDataSetLayer","useImperativeHandle","componentRef","chartContainer","_getLegendData","lineLegends","hideLegend","createElement","Fragment","defaultPalette","getColorFromToken","DataVizPalette","color6","color1","color5","color7","color10","actions","allowHoverOnLegend","forEach","singleChartData","chartData","point","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","push","legendsOfLine","isLineLegendInBarChart","totalLegends","concat","Legends","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","_getHighlightedLegend","_lineHoverOut","_lineHoverFocus","lineData","xItem","yAxisCalloutData","_onStackHoverFocus","stack","mouseEvent","clientX","clientY","boundingRect","getBoundingClientRect","left","top","_noLegendHighlighted","dataPoint","_isLegendHighlighted","isLinesPresent","item","shouldDrawBorderBottom","_updatePosition","sort","a","b","slice","reverse","Date","formatDate","useUTC","stackCallOutAccessibilityData","_onClick","onBarClick","href","window","location","getBarWidth","barWidth","maxBarWidth","defaultColors","_getFormattedLineData","getScalePadding","xAxisInnerPadding","xAxisPadding","xAxisOuterPadding","tempArr","dataset","map","singlePointData","total","legendTitle","_selectedLegends","event","currentLegend","canSelectMultipleLegends","_getMargins","margins","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","xBarScale","yBarScale","_getScales","_createBar","_getAxisData","yAxisData","yAxisDomainValues","domainValue","max","yMaxValue","min","yMinValue","includes","_getAriaLabel","xValue","xAxisCalloutData","pointValues","pt","yValue","join","lineValues","ln","ariaLabel","_getCustomizedCallout","_isHavingLines","some","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_renderCallout","_toFocusWholeStack","isCalloutForStack","shouldFocusStackOnly","linesData","formattedLineData","index","line","lineObject","Object","keys","_createLines","yScalePrimary","yScaleSecondary","lines","borderForLines","dots","lineBorderWidth","lineOptions","Number","parseFloat","toString","xScaleBandwidthTranslate","bandwidth","shouldHighlight","i","x1","useSecondaryYScale","y1","x2","y2","key","opacity","strokeWidth","fill","strokeLinecap","stroke","tokens","colorNeutralBackground1","transform","strokeDasharray","onMouseOver","_lineHover","bind","onMouseLeave","circlePoint","subIndex","circleRef","refElement","circle","cx","cy","_onStackHover","r","_getCircleVisibilityAndRadius","radius","visibility","data-is-focusable","ref","e","onFocus","_lineFocus","onBlur","tabIndex","ChartPopover","culture","XValue","YValue","_onRectHover","persist","_onRectFocusHover","chartDataPoint","xAxisDataPoint","_onRectFocus","_onStackFocus","groupRef","_handleMouseOut","_getBarGapAndScale","bars","defaultTotalHeight","barGapMax","totalData","reduce","iter","value","abs","totalHeight","sumOfPercent","scalingRatio","gaps","gapHeight","heightValueScale","absStackTotal","yDomain","d3ScaleLinear","domain","range","bottom","NumericAxis","xMax","d3Max","xMin","d3Min","nice","right","DateAxis","sDate","lDate","d3ScaleUtc","d3ScaleTime","d3ScaleBand","paddingInner","paddingOuter","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainMargins","totalWidth","barGapRate","isScalePaddingDefined","reqWidth","mode","margin1","step","calculateLongestLabelWidth","margin2","calculateAppropriateBarWidth","_getChartTitle","chartTitle","numLines","classes","useVerticalStackedBarChartStyles","barCornerRadius","barMinimumHeight","shouldFocusWholeStack","indexNumber","xPoint","barTotalValue","barsToDisplay","yBaseline","yPositiveStart","yNegativeStart","yPoint","heightOfLastBar","singleBar","startColor","rectFocusProps","hideTooltip","onMouseMove","onClick","role","barHeight","minHeight","gapOffset","path","className","opacityChangeOnHover","d","rx","roundCorners","cursor","rect","stackFocusProps","showLabel","barLabel","hideLabels","g","id","text","textAnchor","aria-label","yAxisTickFormat","formatScientificLimitWidth","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","d3Select","call","tooltipProps","tooltipCls","tooltip","axis","tooltipOfAxislabels","bar","_getMinMaxOfYAxis","yAxisType","findVSBCNumericMinMaxOfY","values","startValue","endValue","legendBars","calloutProps","getAccessibleDataObject","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","tickValues","tickFormat","CartesianChart","points","chartType","ChartTypes","xAxisType","getMinMaxOfYAxis","datasetForXAxisDomain","barwidth","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","children","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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x"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { useVerticalStackedBarChartStyles } from './useVerticalStackedBarChartStyles.styles';\nimport {\n scaleLinear as d3ScaleLinear,\n ScaleLinear as D3ScaleLinear,\n scaleBand as d3ScaleBand,\n scaleUtc as d3ScaleUtc,\n scaleTime as d3ScaleTime,\n} from 'd3-scale';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n VerticalStackedBarDataPoint,\n Margins,\n VerticalStackedBarChartProps,\n VerticalStackedChartProps,\n VSChartDataPoint,\n LineDataInVerticalStackedBarChart,\n ModifiedCartesianChartProps,\n Legend,\n ChartPopover,\n Legends,\n Chart,\n DataPoint,\n} from '../../index';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfAxislabels,\n formatScientificLimitWidth,\n getBarWidth,\n getScalePadding,\n isScalePaddingDefined,\n calculateAppropriateBarWidth,\n formatDate,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n findVSBCNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\ntype NumericScale = D3ScaleLinear<number, number>;\nconst barGapMultiplier = 0.2;\nconst barGapMin = 1;\nconst MIN_DOMAIN_MARGIN = 8;\n\ninterface RefArrayData {\n refElement?: SVGGElement | null;\n}\n\ntype LinePoint = LineDataInVerticalStackedBarChart & { index: number; xItem: VerticalStackedChartProps };\ntype LineObject = { [key: string]: LinePoint[] };\ntype LineLegends = {\n title: string;\n color: string;\n};\nenum CircleVisbility {\n show = 'visibility',\n hide = 'hidden',\n}\ntype CalloutAnchorPointData = {\n xAxisDataPoint: string;\n chartDataPoint: VSChartDataPoint;\n};\n\nexport const VerticalStackedBarChart: React.FunctionComponent<VerticalStackedBarChartProps> = props => {\n const _isRtl: boolean = useRtl();\n const _createLegendsForLine: (data: VerticalStackedChartProps[]) => LineLegends[] = (\n data: VerticalStackedChartProps[],\n ) => _getLineLegends(data);\n const _tooltipId: string = useId('VSBCTooltipId_');\n const _emptyChartId: string = useId('_VSBC_empty');\n let _points: VerticalStackedChartProps[] = [];\n let _dataset: VerticalStackedBarDataPoint[];\n let _xAxisLabels: string[] = [];\n let _bars: JSX.Element[];\n let _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data[0]!.xAxisPoint, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n let _barWidth: number = 0;\n let _colors: string[];\n let _margins: Margins;\n let _lineObject: LineObject;\n let _yMax: number;\n let _yMin: number;\n let _calloutAnchorPoint: CalloutAnchorPointData | null;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_ORIGIN: number = 0;\n\n const [selectedLegends, setSelectedLegends] = React.useState(props.legendProps?.selectedLegends || []);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [dataForHoverCard, setDataForHoverCard] = React.useState(0);\n const [color, setColor] = React.useState('');\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [YValueHover, setYValueHover] = React.useState<(LineDataInVerticalStackedBarChart | VSChartDataPoint)[]>([]);\n const [xCalloutValue, setXCalloutValue] = React.useState('');\n const [yCalloutValue, setYCalloutValue] = React.useState('');\n const [activeXAxisDataPoint, setActiveXAxisDataPoint] = React.useState<number | string | Date>('');\n const [calloutLegend, setCalloutLegend] = React.useState('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<VerticalStackedChartProps>();\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<VSChartDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<VerticalStackedBarChartProps | null>(null);\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n if (prevProps.height !== props.height || prevProps.width !== props.width || prevProps.data !== props.data) {\n _adjustProps();\n _dataset = _createDataSetLayer();\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _getLegendData(data: VerticalStackedChartProps[], lineLegends: LineLegends[]): JSX.Element {\n if (props.hideLegend) {\n return <></>;\n }\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n getColorFromToken(DataVizPalette.color10),\n ];\n const actions: Legend[] = [];\n const { allowHoverOnLegend = true } = props;\n\n data.forEach((singleChartData: VerticalStackedChartProps) => {\n singleChartData.chartData.forEach((point: VSChartDataPoint) => {\n const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n const checkSimilarLegends = actions.filter((leg: Legend) => leg.title === point.legend && leg.color === color);\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: Legend = {\n title: point.legend,\n color,\n hoverAction: allowHoverOnLegend\n ? () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend);\n }\n : undefined,\n onMouseOutAction: allowHoverOnLegend ? () => _onLegendLeave() : undefined,\n };\n\n actions.push(legend);\n });\n });\n const legendsOfLine: Legend[] = [];\n if (lineLegends && lineLegends.length > 0) {\n lineLegends.forEach((point: LineLegends) => {\n const legend: Legend = {\n title: point.title,\n color: point.color,\n isLineLegendInBarChart: true,\n hoverAction: allowHoverOnLegend\n ? () => {\n _handleChartMouseLeave();\n _onLegendHover(point.title);\n }\n : undefined,\n onMouseOutAction: allowHoverOnLegend ? () => _onLegendLeave() : undefined,\n };\n legendsOfLine.push(legend);\n });\n }\n const totalLegends: Legend[] = legendsOfLine.concat(actions);\n return (\n <Legends\n legends={totalLegends}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n />\n );\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _lineHoverOut() {\n setPopoverOpen(false);\n setXCalloutValue('');\n setYCalloutValue('');\n setActiveXAxisDataPoint('');\n setColor('');\n }\n\n function _lineHoverFocus(lineData: LinePoint) {\n setPopoverOpen(true);\n setXCalloutValue(`${lineData.xItem.xAxisPoint}`);\n setYCalloutValue(`${lineData.yAxisCalloutData || lineData.data || lineData.y}`);\n setActiveXAxisDataPoint(lineData.xItem.xAxisPoint);\n setColor(lineData.color);\n }\n\n function _onStackHoverFocus(\n stack: VerticalStackedChartProps,\n mouseEvent: React.MouseEvent<SVGElement> | SVGGElement,\n ): void {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in mouseEvent) {\n clientX = mouseEvent.clientX;\n clientY = mouseEvent.clientY;\n } else {\n // Handle case where mouseEvent is an SVGGElement\n const boundingRect = mouseEvent.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (!_noLegendHighlighted()) {\n stack = {\n ...stack,\n chartData: stack.chartData.filter((dataPoint: { legend: any }) => _isLegendHighlighted(dataPoint.legend)),\n lineData: stack.lineData?.filter((dataPoint: { legend: any }) => _isLegendHighlighted(dataPoint.legend)),\n };\n }\n const lineData = stack.lineData;\n const isLinesPresent: boolean = lineData !== undefined && lineData.length > 0;\n if (isLinesPresent) {\n lineData!.forEach((item: LineDataInVerticalStackedBarChart & { shouldDrawBorderBottom?: boolean }) => {\n item.data = item.data || item.y;\n item.shouldDrawBorderBottom = true;\n });\n }\n _updatePosition(clientX, clientY);\n setPopoverOpen(stack.chartData.length > 0 || (stack.lineData?.length ?? 0) > 0);\n setYValueHover(\n isLinesPresent\n ? [...lineData!.sort((a, b) => (a.data! < b.data! ? 1 : -1)), ...stack.chartData.slice().reverse()]\n : stack.chartData.slice().reverse(),\n );\n setHoverXValue(stack.xAxisPoint instanceof Date ? formatDate(stack.xAxisPoint, props.useUTC) : stack.xAxisPoint);\n setStackCalloutProps(stack);\n setActiveXAxisDataPoint(stack.xAxisPoint);\n setCallOutAccessibilityData(stack.stackCallOutAccessibilityData);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n setActiveXAxisDataPoint('');\n }\n\n const _onClick = (\n data: VerticalStackedChartProps | VSChartDataPoint,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n props.onBarClick?.(mouseEvent, data);\n props.href ? (window.location.href = props.href) : '';\n };\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const defaultColors: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n getColorFromToken(DataVizPalette.color10),\n ];\n _colors = defaultColors;\n _xAxisType = getTypeOfAxis(props.data[0].xAxisPoint, true) as XAxisTypes;\n _lineObject = _getFormattedLineData(props.data);\n _xAxisInnerPadding = getScalePadding(props.xAxisInnerPadding, props.xAxisPadding, 2 / 3);\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding, props.xAxisPadding, 0);\n }\n\n function _createDataSetLayer(): VerticalStackedBarDataPoint[] {\n const tempArr: string[] = [];\n const dataset: VerticalStackedBarDataPoint[] = _points.map(singlePointData => {\n let total: number = 0;\n singlePointData.chartData!.forEach((point: VSChartDataPoint) => {\n total = total + point.data;\n });\n tempArr.push(singlePointData.xAxisPoint as string);\n return {\n x: singlePointData.xAxisPoint,\n y: total,\n };\n });\n _xAxisLabels = tempArr;\n return dataset;\n }\n\n function _onLegendHover(legendTitle: string): void {\n setActiveLegend(legendTitle);\n }\n\n function _onLegendLeave(): void {\n setActiveLegend(undefined);\n }\n\n function _onLegendSelectionChange(\n _selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _getGraphData(\n xScale: any,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth);\n return (_bars = _createBar(xBarScale, yBarScale, containerHeight, xElement!));\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || Y_ORIGIN);\n _yMin = Math.min(domainValue[0], props.yMinValue || Y_ORIGIN);\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 function _isLegendHighlighted(legendTitle: string) {\n return _getHighlightedLegend().includes(legendTitle);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getAriaLabel(singleChartData: VerticalStackedChartProps, point?: VSChartDataPoint): string {\n if (!point) {\n /** if shouldFocusWholeStack is true */\n const xValue =\n singleChartData.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDate(singleChartData.xAxisPoint)\n : singleChartData.xAxisPoint);\n const pointValues = singleChartData.chartData\n .map(pt => {\n const legend = pt.legend;\n const yValue = pt.yAxisCalloutData || pt.data;\n return `${legend}, ${yValue}.`;\n })\n .join(' ');\n const lineValues = singleChartData.lineData\n ?.map(ln => {\n const legend = ln.legend;\n const yValue = ln.yAxisCalloutData || ln.data || ln.y;\n return `${legend}, ${yValue}.`;\n })\n .join(' ');\n return (\n singleChartData.stackCallOutAccessibilityData?.ariaLabel ||\n `${xValue}. ${pointValues}` + (lineValues ? ` ${lineValues}` : '')\n );\n }\n /** if shouldFocusWholeStack is false */\n const xValue =\n singleChartData.xAxisCalloutData ||\n point.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDate(singleChartData.xAxisPoint)\n : singleChartData.xAxisPoint);\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _getCustomizedCallout() {\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint && !_isHavingLines\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _toFocusWholeStack(_isHavingLines: boolean): boolean {\n const { isCalloutForStack = false } = props;\n let shouldFocusStackOnly: boolean = false;\n if (_isHavingLines) {\n if (_getHighlightedLegend().length === 1) {\n shouldFocusStackOnly = false;\n } else {\n shouldFocusStackOnly = true;\n }\n } else {\n shouldFocusStackOnly = isCalloutForStack;\n }\n return shouldFocusStackOnly;\n }\n\n function _getFormattedLineData(data: VerticalStackedChartProps[]): LineObject {\n const linesData: LinePoint[] = [];\n const formattedLineData: LineObject = {};\n data.forEach((item: VerticalStackedChartProps, index: number) => {\n if (item.lineData) {\n item.lineData.forEach((line: any) => {\n linesData.push({\n ...line,\n index,\n xItem: item,\n });\n });\n }\n });\n linesData.forEach(item => {\n if (formattedLineData[item.legend]) {\n formattedLineData[item.legend].push(item);\n } else {\n formattedLineData[item.legend] = [item];\n }\n });\n return formattedLineData;\n }\n\n function _getLineLegends(data: VerticalStackedChartProps[]): LineLegends[] {\n const lineObject: LineObject = _lineObject;\n const lineLegends: LineLegends[] = [];\n Object.keys(lineObject).forEach((item: string) => {\n lineLegends.push({\n title: item,\n color: lineObject[item][0].color,\n });\n });\n return lineLegends;\n }\n\n function _createLines(\n xScale: any,\n yScalePrimary: NumericScale,\n containerHeight: number,\n containerWidth: number,\n yScaleSecondary?: NumericScale,\n ): JSX.Element {\n const lineObject: LineObject = _getFormattedLineData(props.data);\n const lines: React.ReactNode[] = [];\n const borderForLines: React.ReactNode[] = [];\n const dots: React.ReactNode[] = [];\n //const { theme } = props;\n const lineBorderWidth = props.lineOptions?.lineBorderWidth\n ? Number.parseFloat(props.lineOptions!.lineBorderWidth!.toString())\n : 0;\n const xScaleBandwidthTranslate = _xAxisType !== XAxisTypes.StringAxis ? 0 : xScale.bandwidth() / 2;\n Object.keys(lineObject).forEach((item: string, index: number) => {\n const shouldHighlight = _isLegendHighlighted(item) || _noLegendHighlighted();\n for (let i = 1; i < lineObject[item].length; i++) {\n const x1 = xScale(lineObject[item][i - 1].xItem.xAxisPoint);\n const useSecondaryYScale =\n lineObject[item][i - 1].useSecondaryYScale && lineObject[item][i].useSecondaryYScale && yScaleSecondary;\n const y1 = useSecondaryYScale\n ? yScaleSecondary!(lineObject[item][i - 1].y)\n : yScalePrimary(lineObject[item][i - 1].y);\n const x2 = xScale(lineObject[item][i].xItem.xAxisPoint);\n const y2 = useSecondaryYScale ? yScaleSecondary!(lineObject[item][i].y) : yScalePrimary(lineObject[item][i].y);\n if (lineBorderWidth > 0) {\n borderForLines.push(\n <line\n key={`${index}-${i}-BorderLine`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n opacity={shouldHighlight ? 1 : 0.1}\n strokeWidth={3 + lineBorderWidth * 2}\n fill=\"transparent\"\n strokeLinecap=\"round\"\n stroke={tokens.colorNeutralBackground1}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />,\n );\n }\n lines.push(\n <line\n key={`${index}-${i}-line`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n opacity={shouldHighlight ? 1 : 0.1}\n strokeWidth={lineObject[item][0].lineOptions?.strokeWidth ?? 3}\n strokeLinecap={lineObject[item][0].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={lineObject[item][0].lineOptions?.strokeDasharray}\n stroke={lineObject[item][i].color}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n {...(_isLegendHighlighted(item) && {\n onMouseOver: _lineHover.bind(lineObject[item][i - 1]),\n onMouseLeave: _lineHoverOut,\n })}\n />,\n );\n }\n });\n Object.keys(lineObject).forEach((item: string, index: number) => {\n lineObject[item].forEach((circlePoint: LinePoint, subIndex: number) => {\n const circleRef: { refElement: SVGCircleElement | null } = { refElement: null };\n const noBarsAndLinesActive =\n circlePoint.xItem.chartData.filter(\n dataPoint => _noLegendHighlighted() || _isLegendHighlighted(dataPoint.legend),\n ).length === 0;\n dots.push(\n <circle\n key={`${index}-${subIndex}-dot`}\n cx={xScale(circlePoint.xItem.xAxisPoint)}\n cy={\n circlePoint.useSecondaryYScale && yScaleSecondary\n ? yScaleSecondary(circlePoint.y)\n : yScalePrimary(circlePoint.y)\n }\n onMouseOver={\n _isLegendHighlighted(item)\n ? (event: React.MouseEvent<SVGElement, MouseEvent>) => _lineHover(circlePoint, event)\n : (event: React.MouseEvent<SVGElement, MouseEvent>) => _onStackHover(circlePoint.xItem, event)\n }\n {...(_isLegendHighlighted(item) && {\n onMouseLeave: _lineHoverOut,\n })}\n r={_getCircleVisibilityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).radius}\n stroke={circlePoint.color}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={3}\n visibility={_getCircleVisibilityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).visibility}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n ref={e => (circleRef.refElement = e)}\n {...(noBarsAndLinesActive\n ? {\n tabIndex: !props.hideTooltip ? 0 : undefined,\n onFocus: event => _lineFocus(event, circlePoint, circleRef),\n onBlur: _handleMouseOut,\n role: 'img',\n 'aria-label': _getAriaLabel(circlePoint.xItem, circlePoint as VSChartDataPoint),\n }\n : {})}\n />,\n );\n });\n });\n return (\n <>\n {borderForLines}\n {lines}\n {dots}\n </>\n );\n }\n\n function _getCircleVisibilityAndRadius(\n xAxisPoint: string | number | Date,\n legend: string,\n ): { visibility: CircleVisbility; radius: number } {\n if (!_noLegendHighlighted()) {\n if (xAxisPoint === activeXAxisDataPoint && _isLegendHighlighted(legend)) {\n return { visibility: CircleVisbility.show, radius: 8 };\n } else if (_isLegendHighlighted(legend)) {\n return { visibility: CircleVisbility.show, radius: 0.3 };\n } else {\n return { visibility: CircleVisbility.hide, radius: 0 };\n }\n } else {\n return {\n visibility: activeXAxisDataPoint === xAxisPoint ? CircleVisbility.show : CircleVisbility.hide,\n radius: 8,\n };\n }\n }\n\n function _renderCallout(props?: VSChartDataPoint): JSX.Element | null {\n return props ? (\n <ChartPopover\n culture={props.culture ?? 'en-us'}\n XValue={props.xAxisCalloutData}\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n legend={props.legend}\n YValue={props.yAxisCalloutData}\n color={props.color}\n />\n ) : null;\n }\n\n function _onRectHover(\n xAxisPoint: string | number | Date,\n point: VSChartDataPoint,\n color: string,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void {\n mouseEvent.persist();\n _onRectFocusHover(xAxisPoint, point, color, mouseEvent);\n }\n\n function _onRectFocusHover(\n xAxisPoint: string | number | Date,\n point: VSChartDataPoint,\n color: string,\n mouseEvent: React.MouseEvent<SVGElement> | SVGGElement,\n ) {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in mouseEvent) {\n clientX = mouseEvent.clientX;\n clientY = mouseEvent.clientY;\n } else {\n // Handle case where mouseEvent is an SVGGElement\n const boundingRect = mouseEvent.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (_calloutAnchorPoint?.chartDataPoint !== point || _calloutAnchorPoint?.xAxisDataPoint !== xAxisPoint) {\n _calloutAnchorPoint = {\n chartDataPoint: point,\n xAxisDataPoint: `${xAxisPoint}`,\n };\n _updatePosition(clientX, clientY);\n setPopoverOpen(_noLegendHighlighted() || _isLegendHighlighted(point.legend));\n setCalloutLegend(point.legend);\n setDataForHoverCard(point.data);\n setColor(color);\n setXCalloutValue(point.xAxisCalloutData ? point.xAxisCalloutData : `${xAxisPoint}`);\n setYCalloutValue(point.yAxisCalloutData!);\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _lineHover(lineData: LinePoint, mouseEvent: React.MouseEvent<SVGElement>) {\n mouseEvent.persist();\n _lineHoverFocus(lineData);\n }\n\n function _lineFocus(\n event: React.FocusEvent<SVGCircleElement, Element>,\n lineData: LinePoint,\n ref: { refElement: SVGCircleElement | null },\n ) {\n if (ref.refElement) {\n _lineHoverFocus(lineData);\n }\n }\n\n function _onStackHover(stack: VerticalStackedChartProps, mouseEvent: React.MouseEvent<SVGElement>): void {\n mouseEvent.persist();\n _onStackHoverFocus(stack, mouseEvent);\n }\n\n function _onRectFocus(point: VSChartDataPoint, xAxisPoint: string, color: string, ref: RefArrayData): void {\n if (ref.refElement) {\n _onRectFocusHover(xAxisPoint, point, color, ref.refElement);\n }\n }\n\n function _onStackFocus(stack: VerticalStackedChartProps, groupRef: RefArrayData): void {\n if (groupRef.refElement) {\n _onStackHoverFocus(stack, groupRef.refElement);\n }\n }\n\n function _handleMouseOut(): void {\n setPopoverOpen(false);\n }\n\n function _getBarGapAndScale(\n bars: VSChartDataPoint[],\n yBarScale: NumericScale,\n defaultTotalHeight?: number,\n ): {\n readonly gapHeight: number;\n readonly heightValueScale: number;\n readonly absStackTotal: number;\n } {\n const { barGapMax = 0 } = props;\n // When displaying gaps between the bars, the height of each bar is\n // adjusted so that the total of all bars is not changed by the gaps\n const totalData = bars.reduce((iter, value) => iter + Math.abs(value.data), 0);\n const totalHeight = defaultTotalHeight ?? Math.abs(yBarScale(totalData) - yBarScale(Y_ORIGIN));\n let sumOfPercent = 0;\n bars.forEach(point => {\n let value = (Math.abs(point.data) / totalData) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n });\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / 100 : 1;\n const gaps = barGapMax && bars.length - 1;\n const gapHeight = gaps && Math.max(barGapMin, Math.min(barGapMax, (totalHeight * barGapMultiplier) / gaps));\n const heightValueScale = (totalHeight - gapHeight * gaps) / (totalData * scalingRatio);\n return {\n gapHeight,\n heightValueScale,\n absStackTotal: totalData,\n } as const;\n }\n\n function _getScales(containerHeight: number, containerWidth: number) {\n const yDomain = [Math.min(Y_ORIGIN, _yMin), Math.max(Y_ORIGIN, _yMax)];\n const yBarScale = d3ScaleLinear()\n .domain(yDomain)\n .range([0, containerHeight - _margins.bottom! - _margins.top!]);\n if (_xAxisType === XAxisTypes.NumericAxis) {\n const xMax = d3Max(_dataset, (point: VerticalStackedBarDataPoint) => point.x as number)!;\n const xMin = d3Min(_dataset, (point: VerticalStackedBarDataPoint) => point.x as number)!;\n\n const xBarScale = d3ScaleLinear()\n .domain(_isRtl ? [xMax, xMin] : [xMin, xMax])\n .nice()\n .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n\n return { xBarScale, yBarScale };\n }\n if (_xAxisType === XAxisTypes.DateAxis) {\n const sDate = d3Min(_dataset, (point: VerticalStackedBarDataPoint) => {\n return point.x as Date;\n })!;\n const lDate = d3Max(_dataset, (point: VerticalStackedBarDataPoint) => {\n return point.x as Date;\n })!;\n const xBarScale = props.useUTC ? d3ScaleUtc() : d3ScaleTime();\n xBarScale\n .domain(_isRtl ? [lDate, sDate] : [sDate, lDate])\n .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n\n return { xBarScale, yBarScale };\n }\n const xBarScale = d3ScaleBand()\n .domain(_xAxisLabels)\n .range(\n _isRtl\n ? [containerWidth - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n\n return { xBarScale, yBarScale };\n }\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.some(item => item.chartData.length > 0 || (item.lineData && item.lineData.length > 0))\n );\n };\n\n function _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getDomainMargins(containerWidth: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n\n /** Total width available to render the bars */\n const totalWidth = containerWidth - (_margins.left! + MIN_DOMAIN_MARGIN) - (_margins.right! + MIN_DOMAIN_MARGIN);\n /** Rate at which the space between the bars changes wrt the bar width */\n const barGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding, props.xAxisPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first bar and after the last bar.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n /** Total width required to render the bars. Directly proportional to bar width */\n const reqWidth = (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate) * _barWidth;\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && _xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering bars at their maximum allowable width\n const bandwidth = totalWidth / (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, bandwidth);\n let reqWidth = (_xAxisLabels.length + (_xAxisLabels.length - 1) * barGapRate) * barWidth;\n const margin1 = (totalWidth - reqWidth) / 2;\n\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(_xAxisLabels) + 20;\n reqWidth = (_xAxisLabels.length - _xAxisInnerPadding) * step;\n const margin2 = (totalWidth - reqWidth) / 2;\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n } else {\n const data = (props.data?.map(point => point.xAxisPoint) as number[] | Date[] | undefined) || [];\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth, calculateAppropriateBarWidth(data, totalWidth));\n _domainMargin = MIN_DOMAIN_MARGIN + _barWidth / 2;\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n const numLines = Object.keys(_lineObject).length;\n return (\n (chartTitle ? `${chartTitle}. ` : '') +\n `Vertical bar chart with ${data?.length || 0} stacked bars` +\n (numLines > 0 ? ` and ${numLines} lines` : '') +\n '. '\n );\n }\n\n const classes = useVerticalStackedBarChartStyles(props);\n function _createBar(\n xBarScale: any,\n yBarScale: NumericScale,\n containerHeight: number,\n xElement: SVGElement,\n ): JSX.Element[] {\n const { barCornerRadius = 0, barMinimumHeight = 0 } = props;\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n const shouldFocusWholeStack = _toFocusWholeStack(_isHavingLines);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth, xBarScale.bandwidth());\n }\n\n const bars = _points.map((singleChartData: VerticalStackedChartProps, indexNumber: number) => {\n const xPoint = xBarScale(\n _xAxisType === XAxisTypes.NumericAxis\n ? (singleChartData.xAxisPoint as number)\n : _xAxisType === XAxisTypes.DateAxis\n ? (singleChartData.xAxisPoint as Date)\n : (singleChartData.xAxisPoint as string),\n );\n const xScaleBandwidthTranslate =\n _xAxisType !== XAxisTypes.StringAxis ? -_barWidth / 2 : (xBarScale.bandwidth() - _barWidth) / 2;\n\n let barTotalValue = 0;\n\n const barsToDisplay = singleChartData.chartData.filter(point => point.data !== 0);\n\n if (!barsToDisplay.length) {\n return undefined;\n }\n\n const { gapHeight, heightValueScale, absStackTotal } = _getBarGapAndScale(barsToDisplay, yBarScale);\n\n if (heightValueScale < 0) {\n return undefined;\n }\n\n const yBaseline = containerHeight - _margins.bottom! - yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = 0;\n let heightOfLastBar = 0;\n\n const singleBar = barsToDisplay.map((point: VSChartDataPoint, index: number) => {\n const startColor = point.color ? point.color : _colors[index];\n const ref: RefArrayData = {};\n const shouldHighlight = _isLegendHighlighted(point.legend) || _noLegendHighlighted() ? true : false;\n const rectFocusProps = !shouldFocusWholeStack && {\n 'aria-label': _getAriaLabel(singleChartData, point),\n onMouseOver: (event: React.MouseEvent<SVGElement, MouseEvent>) =>\n _onRectHover(singleChartData.xAxisPoint, point, startColor, event),\n onMouseMove: (event: React.MouseEvent<SVGElement, MouseEvent>) =>\n _onRectHover(singleChartData.xAxisPoint, point, startColor, event),\n onMouseLeave: _handleMouseOut,\n onFocus: () => _onRectFocus(point, singleChartData.xAxisPoint as string, startColor, ref),\n onBlur: _handleMouseOut,\n onClick: (event: React.MouseEvent<SVGElement, MouseEvent>) => _onClick(point, event),\n role: 'img',\n tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined,\n };\n\n let barHeight = Math.abs(heightValueScale * point.data);\n // FIXME: The current scaling logic may produce different min and gap heights for each bar stack.\n const minHeight = Math.max((heightValueScale * absStackTotal) / 100.0, barMinimumHeight);\n if (barHeight < minHeight) {\n barHeight = minHeight;\n }\n const gapOffset = index ? gapHeight : 0;\n if (point.data >= Y_ORIGIN) {\n yPositiveStart -= barHeight + gapOffset;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + gapOffset;\n yNegativeStart = yPoint + barHeight;\n }\n\n barTotalValue += point.data;\n heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;\n\n if (barCornerRadius && barHeight > barCornerRadius && index === barsToDisplay.length - 1) {\n return (\n <React.Fragment key={index + indexNumber + `${shouldFocusWholeStack}`}>\n <path\n className={classes.opacityChangeOnHover}\n d={`\n M ${xPoint} ${yPoint + barCornerRadius}\n a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${-barCornerRadius}\n h ${_barWidth - 2 * barCornerRadius}\n a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${barCornerRadius}\n v ${barHeight - barCornerRadius}\n h ${-_barWidth}\n z\n `}\n fill={startColor}\n rx={props.roundCorners ? 3 : 0}\n ref={e => (ref.refElement = e)}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n cursor={props.href ? 'pointer' : 'default'}\n {...rectFocusProps}\n />\n </React.Fragment>\n );\n }\n if (barHeight < 0) {\n return <React.Fragment key={index + indexNumber}> </React.Fragment>;\n }\n return (\n <React.Fragment key={index + indexNumber}>\n <rect\n className={classes.opacityChangeOnHover}\n x={xPoint}\n y={yPoint}\n width={_barWidth}\n height={barHeight}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n cursor={props.href ? 'pointer' : 'default'}\n rx={props.roundCorners ? 3 : 0}\n ref={e => (ref.refElement = e)}\n {...rectFocusProps}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />\n </React.Fragment>\n );\n });\n const groupRef: RefArrayData = {};\n const stackFocusProps = shouldFocusWholeStack && {\n 'aria-label': _getAriaLabel(singleChartData),\n onMouseOver: (event: any) => _onStackHover(singleChartData, event),\n onMouseMove: (event: any) => _onStackHover(singleChartData, event),\n onMouseLeave: _handleMouseOut,\n onFocus: () => _onStackFocus(singleChartData, groupRef),\n onBlur: _handleMouseOut,\n onClick: (event: any) => _onClick(singleChartData, event),\n role: 'img',\n tabIndex: !props.hideTooltip ? 0 : undefined,\n };\n let showLabel = false;\n let barLabel = 0;\n if (!props.hideLabels) {\n if (_noLegendHighlighted()) {\n showLabel = true;\n barLabel = barTotalValue;\n } else {\n barsToDisplay.forEach(point => {\n if (_isLegendHighlighted(point.legend)) {\n showLabel = true;\n barLabel += point.data;\n }\n });\n }\n }\n return (\n <g key={indexNumber + `${shouldFocusWholeStack}`}>\n <g id={`${indexNumber}-singleBar`} ref={e => (groupRef.refElement = e)} {...stackFocusProps}>\n {singleBar}\n </g>\n {!props.hideLabels && _barWidth >= 16 && showLabel && (\n <text\n x={xPoint + _barWidth / 2}\n //if total bar value >=0, show label above top bar, otherwise below bottom bar\n y={barLabel >= Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-label={`Total: ${barLabel}`}\n role=\"img\"\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(barLabel)\n : formatScientificLimitWidth(barLabel)}\n </text>\n )}\n </g>\n );\n });\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xBarScale);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return bars.filter((bar): bar is JSX.Element => !!bar);\n }\n\n function _getMinMaxOfYAxis(\n dataset: DataPoint[],\n yAxisType?: YAxisType,\n useSecondaryYScale?: boolean,\n ): { startValue: number; endValue: number } {\n if (!useSecondaryYScale) {\n return findVSBCNumericMinMaxOfY(dataset);\n }\n\n const values: number[] = [];\n props.data.forEach(xPoint => {\n xPoint.lineData?.forEach(point => {\n // useSecondaryYScale is applicable only for lines in VSBC\n if (point.useSecondaryYScale) {\n values.push(point.y);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const _isHavingLines = props.data.some(\n (item: VerticalStackedChartProps) => item.lineData && item.lineData.length > 0,\n );\n const shouldFocusWholeStack = _toFocusWholeStack(_isHavingLines);\n _dataset = _createDataSetLayer();\n const legendBars: JSX.Element = _getLegendData(_points, _createLegendsForLine(props.data));\n const calloutProps: ModifiedCartesianChartProps['calloutProps'] = {\n color: color,\n legend: calloutLegend,\n XValue: xCalloutValue!,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack:\n props.isCalloutForStack || (_isHavingLines && (_noLegendHighlighted() || _getHighlightedLegend().length > 1)),\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_dataset}\n chartType={ChartTypes.VerticalStackedBarChart}\n xAxisType={_xAxisType}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n datasetForXAxisDomain={_xAxisLabels}\n isCalloutForStack={shouldFocusWholeStack}\n barwidth={_barWidth}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n <g>\n {_isHavingLines &&\n _createLines(\n props.xScale!,\n props.yScalePrimary!,\n props.containerHeight!,\n props.containerWidth!,\n props.yScaleSecondary,\n )}\n </g>\n </>\n );\n }}\n />\n );\n }\n return <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />;\n};\nVerticalStackedBarChart.displayName = 'VerticalStackedBarChart';\n"],"names":["VerticalStackedBarChart","barGapMultiplier","barGapMin","MIN_DOMAIN_MARGIN","CircleVisbility","props","_isRtl","useRtl","_createLegendsForLine","data","_getLineLegends","_tooltipId","useId","_emptyChartId","_points","_dataset","_xAxisLabels","_bars","_xAxisType","length","getTypeOfAxis","xAxisPoint","XAxisTypes","StringAxis","_barWidth","_colors","_margins","_lineObject","_yMax","_yMin","_calloutAnchorPoint","_domainMargin","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","React","useRef","Y_ORIGIN","selectedLegends","setSelectedLegends","useState","legendProps","activeLegend","setActiveLegend","undefined","dataForHoverCard","setDataForHoverCard","color","setColor","hoverXValue","setHoverXValue","YValueHover","setYValueHover","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","activeXAxisDataPoint","setActiveXAxisDataPoint","calloutLegend","setCalloutLegend","stackCalloutProps","setStackCalloutProps","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","prevPropsRef","useEffect","current","prevProps","areArraysEqual","height","width","_adjustProps","_createDataSetLayer","useImperativeHandle","componentRef","chartContainer","_getLegendData","lineLegends","hideLegend","createElement","Fragment","defaultPalette","getColorFromToken","DataVizPalette","color6","color1","color5","color7","color10","actions","allowHoverOnLegend","forEach","singleChartData","chartData","point","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","push","legendsOfLine","isLineLegendInBarChart","totalLegends","concat","Legends","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","_getHighlightedLegend","_lineHoverOut","_lineHoverFocus","lineData","xItem","yAxisCalloutData","_onStackHoverFocus","stack","mouseEvent","clientX","clientY","boundingRect","getBoundingClientRect","left","top","_noLegendHighlighted","dataPoint","_isLegendHighlighted","isLinesPresent","item","shouldDrawBorderBottom","_updatePosition","sort","a","b","slice","reverse","Date","formatDate","useUTC","stackCallOutAccessibilityData","_onClick","onBarClick","href","window","location","getBarWidth","barWidth","maxBarWidth","defaultColors","_getFormattedLineData","getScalePadding","xAxisInnerPadding","xAxisPadding","xAxisOuterPadding","tempArr","dataset","map","singlePointData","total","legendTitle","_selectedLegends","event","currentLegend","canSelectMultipleLegends","_getMargins","margins","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","xBarScale","yBarScale","_getScales","_createBar","_getAxisData","yAxisData","yAxisDomainValues","domainValue","max","yMaxValue","min","yMinValue","includes","_getAriaLabel","xValue","xAxisCalloutData","pointValues","pt","yValue","join","lineValues","ln","ariaLabel","_getCustomizedCallout","_isHavingLines","some","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_renderCallout","_toFocusWholeStack","isCalloutForStack","shouldFocusStackOnly","linesData","formattedLineData","index","line","lineObject","Object","keys","_createLines","yScalePrimary","yScaleSecondary","lines","borderForLines","dots","lineBorderWidth","lineOptions","Number","parseFloat","toString","xScaleBandwidthTranslate","bandwidth","shouldHighlight","i","x1","useSecondaryYScale","y1","x2","y2","key","opacity","strokeWidth","fill","strokeLinecap","stroke","tokens","colorNeutralBackground1","transform","strokeDasharray","onMouseOver","_lineHover","bind","onMouseLeave","circlePoint","subIndex","circleRef","refElement","noBarsAndLinesActive","circle","cx","cy","_onStackHover","r","_getCircleVisibilityAndRadius","radius","visibility","ref","e","tabIndex","hideTooltip","onFocus","_lineFocus","onBlur","_handleMouseOut","role","ChartPopover","culture","XValue","YValue","_onRectHover","persist","_onRectFocusHover","chartDataPoint","xAxisDataPoint","_onRectFocus","_onStackFocus","groupRef","_getBarGapAndScale","bars","defaultTotalHeight","barGapMax","totalData","reduce","iter","value","abs","totalHeight","sumOfPercent","scalingRatio","gaps","gapHeight","heightValueScale","absStackTotal","yDomain","d3ScaleLinear","domain","range","bottom","NumericAxis","xMax","d3Max","xMin","d3Min","nice","right","DateAxis","sDate","lDate","d3ScaleUtc","d3ScaleTime","d3ScaleBand","paddingInner","paddingOuter","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainMargins","totalWidth","barGapRate","isScalePaddingDefined","reqWidth","mode","margin1","step","calculateLongestLabelWidth","margin2","calculateAppropriateBarWidth","_getChartTitle","chartTitle","numLines","classes","useVerticalStackedBarChartStyles","barCornerRadius","barMinimumHeight","shouldFocusWholeStack","indexNumber","xPoint","barTotalValue","barsToDisplay","yBaseline","yPositiveStart","yNegativeStart","yPoint","heightOfLastBar","singleBar","startColor","rectFocusProps","onMouseMove","onClick","barHeight","minHeight","gapOffset","path","className","opacityChangeOnHover","d","rx","roundCorners","cursor","rect","stackFocusProps","showLabel","barLabel","hideLabels","g","id","text","textAnchor","aria-label","yAxisTickFormat","formatScientificLimitWidth","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","d3Select","call","tooltipProps","tooltipCls","tooltip","axis","tooltipOfAxislabels","bar","_getMinMaxOfYAxis","yAxisType","findVSBCNumericMinMaxOfY","values","startValue","endValue","legendBars","calloutProps","getAccessibleDataObject","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","tickValues","tickFormat","CartesianChart","points","chartType","ChartTypes","xAxisType","getMinMaxOfYAxis","datasetForXAxisDomain","barwidth","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","children","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAc3P;YACd4P,aAAalP;YACbmP,mBAAmBvU;YACnBwU,kBAAkBlG;YACjB,GAAIrU,eAAeI,kBAAAA,CAAWC,UAAU,IAAI;gBAC3CqJ,mBAAmB5I;gBACnB8I,mBAAmB7I;YACrB,CAAC;YACDkD,cAAcjD;YACd,oCAAoC,GACpCwZ,UAAU,CAACrb;gBACT,OAAA,WAAA,GACE8B,OAAAqD,aAAA,CAAArD,OAAAsD,QAAA,EAAA,MAAA,WAAA,GACEtD,OAAAqD,aAAA,CAAC+S,KAAAA,MAAGtX,QAAAA,WAAAA,GACJkB,OAAAqD,aAAA,CAAC+S,KAAAA,MACE9K,kBACCe,aACEnO,MAAMuL,MAAM,EACZvL,MAAMoO,aAAa,EACnBpO,MAAMyL,eAAe,EACrBzL,MAAM0L,cAAc,EACpB1L,MAAMqO,eAAe;YAKjC;;IAGN;IACA,OAAA,WAAA,GAAOvM,OAAAqD,aAAA,CAACmW,OAAAA;QAAInD,IAAI3X;QAAekR,MAAM;QAAS6J,OAAO;YAAE/L,SAAS;QAAI;QAAG8I,cAAY;;AACrF;AACA3Y,wBAAwB6b,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["VerticalStackedBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\n//import { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { RenderFunction } from '../../utilities/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n LineChartLineOptions,\n VerticalStackedChartProps,\n VSChartDataPoint,\n} from '../../index';\n\n/**\n * Vertical Stacked Bar Chart properties\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: VerticalStackedChartProps[];\n\n /**\n * Width of each bar in the chart. When set to `undefined` or `'default'`, the bar width defaults to 16px,\n * which may decrease to prevent overlap. When set to `'auto'`, the bar width is calculated from padding values.\n */\n barWidth?: number | 'default' | 'auto';\n\n /**\n * Gap (max) between bars in a stack. When non-zero, the bars in a stack will\n * be separated by gaps. The actual size of each gap is calculated as 20% of\n * the height of that stack, with a minimum size of 1px and a maximum given by\n * this prop.\n * @default 0\n */\n barGapMax?: number;\n\n /**\n * Corner radius of the bars\n * @default 0\n */\n barCornerRadius?: number;\n\n /**\n * The minimum height of a bar; bars below this height will be displayed at\n * this height. Note that this setting will result in the height of these data\n * points not being to scale.\n * @default 0\n */\n barMinimumHeight?: number;\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * To display multi stack callout or single callout\n * @default flase\n */\n isCalloutForStack?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: VerticalStackedBarChartStyles;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<VerticalStackedChartProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<VSChartDataPoint>;\n\n /**\n * yMinValue is supported for bar charts that has only lines\n */\n yMinValue?: number | undefined;\n\n /**\n * Allow hover actions on the legend\n * @default true\n */\n allowHoverOnLegend?: boolean;\n\n /**\n * Click handler for bars; type of data is dependant on isCalloutForStack\n */\n onBarClick?: (event: React.MouseEvent<SVGElement>, data: VerticalStackedChartProps | VSChartDataPoint) => void;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n xAxisPadding?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * Maximum width of a bar, in pixels.\n * @default 24\n */\n maxBarWidth?: number;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1]. Only applicable to string x-axis.\n * @default 2/3\n */\n xAxisInnerPadding?: number;\n\n /**\n * Padding before the first bar and after the last bar as a fraction of\n * the [step](https://d3js.org/d3-scale/band#band_step). Takes a number in the range [0, 1].\n * Only applicable to string x-axis.\n */\n xAxisOuterPadding?: number;\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 * Specifies the mode of the chart.\n * @default 'default'\n */\n mode?: 'default' | 'plotly';\n}\n\n/**\n * Vertical Stacked Bar Chart style properties\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Vertical Stacked Bar Chart styles\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartStyles extends CartesianChartStyles {\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover?: string;\n\n /**\n * Style for the bar labels\n */\n barLabel: string;\n}\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["VerticalStackedBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\n//import { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { RenderFunction } from '../../utilities/index';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n LineChartLineOptions,\n VerticalStackedChartProps,\n VSChartDataPoint,\n} from '../../index';\n\n/**\n * Vertical Stacked Bar Chart properties\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: VerticalStackedChartProps[];\n\n /**\n * Width of each bar in the chart. When set to `undefined` or `'default'`, the bar width defaults to 16px,\n * which may decrease to prevent overlap. When set to `'auto'`, the bar width is calculated from padding values.\n */\n barWidth?: number | 'default' | 'auto';\n\n /**\n * Gap (max) between bars in a stack. When non-zero, the bars in a stack will\n * be separated by gaps. The actual size of each gap is calculated as 20% of\n * the height of that stack, with a minimum size of 1px and a maximum given by\n * this prop.\n * @default 0\n */\n barGapMax?: number;\n\n /**\n * Corner radius of the bars\n * @default 0\n */\n barCornerRadius?: number;\n\n /**\n * The minimum height of a bar; bars below this height will be displayed at\n * this height. Note that this setting will result in the height of these data\n * points not being to scale.\n * @default 0\n */\n barMinimumHeight?: number;\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * To display multi stack callout or single callout\n * @default flase\n */\n isCalloutForStack?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: Partial<VerticalStackedBarChartStyles>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<VerticalStackedChartProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<VSChartDataPoint>;\n\n /**\n * yMinValue is supported for bar charts that has only lines\n */\n yMinValue?: number | undefined;\n\n /**\n * Allow hover actions on the legend\n * @default true\n */\n allowHoverOnLegend?: boolean;\n\n /**\n * Click handler for bars; type of data is dependant on isCalloutForStack\n */\n onBarClick?: (event: React.MouseEvent<SVGElement>, data: VerticalStackedChartProps | VSChartDataPoint) => void;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n xAxisPadding?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: LineChartLineOptions;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * Maximum width of a bar, in pixels.\n * @default 24\n */\n maxBarWidth?: number;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1]. Only applicable to string x-axis.\n * @default 2/3\n */\n xAxisInnerPadding?: number;\n\n /**\n * Padding before the first bar and after the last bar as a fraction of\n * the [step](https://d3js.org/d3-scale/band#band_step). Takes a number in the range [0, 1].\n * Only applicable to string x-axis.\n */\n xAxisOuterPadding?: number;\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 * Specifies the mode of the chart.\n * @default 'default'\n */\n mode?: 'default' | 'plotly';\n}\n\n/**\n * Vertical Stacked Bar Chart style properties\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Vertical Stacked Bar Chart styles\n * {@docCategory VerticalStackedBarChart}\n */\nexport interface VerticalStackedBarChartStyles extends CartesianChartStyles {\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover?: string;\n\n /**\n * Style for the bar labels\n */\n barLabel: string;\n}\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-charts",
3
- "version": "9.1.6",
3
+ "version": "9.1.7",
4
4
  "description": "React web chart controls for Microsoft fluentui v9 system.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -37,15 +37,15 @@
37
37
  "@fluentui/scripts-tasks": "*"
38
38
  },
39
39
  "dependencies": {
40
- "@fluentui/chart-utilities": "^1.1.20",
40
+ "@fluentui/chart-utilities": "^1.1.21",
41
41
  "@fluentui/react-button": "^9.5.3",
42
42
  "@fluentui/react-jsx-runtime": "^9.1.2",
43
- "@fluentui/react-overflow": "^9.4.6",
44
- "@fluentui/react-popover": "^9.11.6",
43
+ "@fluentui/react-overflow": "^9.4.7",
44
+ "@fluentui/react-popover": "^9.11.7",
45
45
  "@fluentui/react-shared-contexts": "^9.24.0",
46
46
  "@fluentui/react-tabster": "^9.25.3",
47
47
  "@fluentui/react-theme": "^9.1.24",
48
- "@fluentui/react-tooltip": "^9.7.6",
48
+ "@fluentui/react-tooltip": "^9.7.7",
49
49
  "@fluentui/react-utilities": "^9.22.0",
50
50
  "@griffel/react": "^1.5.22",
51
51
  "@swc/helpers": "^0.5.1",