@fluentui/react-charts 0.0.0-nightly-20251121-0407.1 → 0.0.0-nightly-20251125-0407.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -13
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +18 -17
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +5 -2
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +8 -2
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +20 -5
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +18 -17
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +5 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +8 -2
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +19 -4
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +3 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/VerticalStackedBarChart/VerticalStackedBarChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\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 ScaleBand,\n} from 'd3-scale';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } 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 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 areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n findVSBCNumericMinMaxOfY,\n YAxisType,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfVSBCNumeric,\n domainRangeOfXStringAxis,\n createStringYAxis,\n calcTotalWidth,\n calcBandwidth,\n calcRequiredWidth,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { useImageExport } from '../../utilities/hooks';\n\ntype NumericScale = D3ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\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};\ntype CalloutAnchorPointData = {\n xAxisDataPoint: string;\n chartDataPoint: VSChartDataPoint;\n};\n\nexport const VerticalStackedBarChart: React.FunctionComponent<VerticalStackedBarChartProps> = React.forwardRef<\n HTMLDivElement,\n VerticalStackedBarChartProps\n>((_props, forwardedRef) => {\n const props: VerticalStackedBarChartProps = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n maxBarWidth: 24,\n ..._props,\n };\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: JSXElement[];\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, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n const Y_ORIGIN: number = 0;\n let _yAxisType: YAxisType;\n let _yAxisLabels: string[] = [];\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 function _getLegendData(data: VerticalStackedChartProps[], lineLegends: LineLegends[]): JSXElement {\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[] = actions.concat(legendsOfLine);\n return (\n <Legends\n legends={totalLegends}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _lineHoverFocus(\n lineData: LinePoint,\n event: React.MouseEvent<SVGElement> | React.FocusEvent<SVGCircleElement, Element>,\n ): void {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n const boundingRect = event.target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (_getHighlightedLegend().length === 1) {\n if (_noLegendHighlighted() || _isLegendHighlighted(lineData.legend)) {\n _updatePosition(clientX, clientY);\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 } else {\n _onStackHoverFocus(lineData.xItem, event as React.MouseEvent<SVGElement>);\n }\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(\n stack.xAxisPoint instanceof Date\n ? formatDateToLocaleString(stack.xAxisPoint, props.culture, props.useUTC as boolean)\n : stack.xAxisPoint,\n );\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(\n props.xAxisInnerPadding,\n props.xAxisPadding,\n _xAxisType === XAxisTypes.StringAxis ? 2 / 3 : 1 / 2,\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding, props.xAxisPadding, 0);\n _initYAxisParams();\n }\n\n function _createDataSetLayer(): VerticalStackedBarDataPoint[] {\n const dataset: VerticalStackedBarDataPoint[] = _points.map(singlePointData => {\n if (_yAxisType === YAxisType.StringAxis) {\n return {\n x: singlePointData.xAxisPoint,\n y: 0,\n };\n }\n let total: number = 0;\n singlePointData.chartData!.forEach((point: VSChartDataPoint) => {\n total = total + (point.data as number);\n });\n return {\n x: singlePointData.xAxisPoint,\n y: total,\n };\n });\n _xAxisLabels = _getOrderedXAxisLabels();\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: NumericScale | StringScale,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth);\n return (_bars = _createBar(\n xBarScale,\n _yAxisType === YAxisType.StringAxis ? yScale : yBarScale,\n containerHeight,\n xElement!,\n ));\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(\n singleChartData: VerticalStackedChartProps,\n point?: VSChartDataPoint | LineDataInVerticalStackedBarChart,\n isLinePoint?: boolean,\n ): string {\n if (!point) {\n /** if shouldFocusWholeStack is true */\n const xValue =\n singleChartData.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC as boolean)\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 _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';\n })\n .filter(str => str !== '')\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 _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';\n })\n .filter(str => str !== '')\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 (!isLinePoint && (point as VSChartDataPoint).xAxisCalloutData) ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC as boolean)\n : singleChartData.xAxisPoint);\n const legend = point.legend;\n const yValue =\n point.yAxisCalloutData ||\n (isLinePoint ? point.data || (point as LineDataInVerticalStackedBarChart).y : point.data);\n return (\n (!isLinePoint && (point as VSChartDataPoint).callOutAccessibilityData?.ariaLabel) ||\n `${xValue}. ${legend}, ${yValue}.`\n );\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 _getDomainNRangeValues(\n points: DataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth!);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n margins,\n width,\n isRTL,\n tickValues! as Date[],\n chartType,\n barWidth,\n );\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\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 | StringScale,\n containerHeight: number,\n containerWidth: number,\n yScaleSecondary?: NumericScale,\n ): JSXElement {\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 as number)\n : //eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(lineObject[item][i - 1].y as any);\n const x2 = xScale(lineObject[item][i].xItem.xAxisPoint);\n const y2 = useSecondaryYScale\n ? yScaleSecondary!(lineObject[item][i].y as number)\n : //eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(lineObject[item][i].y as any);\n const yScaleBandwidthTranslate =\n !useSecondaryYScale && _yAxisType === YAxisType.StringAxis\n ? (yScalePrimary as StringScale).bandwidth() / 2\n : 0;\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}, ${yScaleBandwidthTranslate})`}\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}, ${yScaleBandwidthTranslate})`}\n onMouseOver={event => _lineHover(lineObject[item][i - 1], event)}\n onMouseLeave={_handleMouseOut}\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 const yScaleBandwidthTranslate =\n !circlePoint.useSecondaryYScale && _yAxisType === YAxisType.StringAxis\n ? (yScalePrimary as StringScale).bandwidth() / 2\n : 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 as number)\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(circlePoint.y as any)\n }\n onMouseOver={event => _lineHover(circlePoint, event)}\n onMouseLeave={_handleMouseOut}\n r={_getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).radius}\n stroke={circlePoint.color}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={3}\n // Elements with visibility: hidden cannot receive focus, so use opacity: 0 instead to hide them.\n // For more information, see https://fuzzbomb.github.io/accessibility-demos/visually-hidden-focus-test.html\n opacity={_getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).opacity}\n transform={`translate(${xScaleBandwidthTranslate}, ${yScaleBandwidthTranslate})`}\n ref={e => {\n circleRef.refElement = e;\n }}\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 _getCircleOpacityAndRadius(\n xAxisPoint: string | number | Date,\n legend: string,\n ): { opacity: number; radius: number } {\n if (!_noLegendHighlighted()) {\n if (xAxisPoint === activeXAxisDataPoint && _isLegendHighlighted(legend)) {\n return { opacity: 1, radius: 8 };\n } else if (_isLegendHighlighted(legend)) {\n return { opacity: 1, radius: 0.3 };\n } else {\n return { opacity: 0, radius: 0 };\n }\n } else {\n return {\n opacity: activeXAxisDataPoint === xAxisPoint ? 1 : 0,\n radius: 8,\n };\n }\n }\n\n function _renderCallout(props?: VSChartDataPoint): JSXElement | null {\n return props ? (\n <ChartPopover\n culture={props.culture}\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:\n xAxisPoint instanceof Date\n ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC as boolean)\n : xAxisPoint.toString(),\n };\n const xCalloutValue =\n point.xAxisCalloutData ||\n (xAxisPoint instanceof Date\n ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC as boolean)\n : xAxisPoint.toString());\n\n _updatePosition(clientX, clientY);\n setPopoverOpen(_noLegendHighlighted() || _isLegendHighlighted(point.legend));\n setCalloutLegend(point.legend);\n setDataForHoverCard(point.data as number);\n setColor(color);\n setXCalloutValue(xCalloutValue);\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, mouseEvent);\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, event);\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 /**/\n }\n\n function _getBarGapAndScale(\n bars: VSChartDataPoint[],\n yBarScale: NumericScale | StringScale,\n defaultTotalHeight?: number,\n ): {\n readonly gapHeight: number;\n readonly heightValueScale: number;\n readonly absStackTotal: number;\n } {\n const { barGapMax = 0 } = props;\n let totalData = 0;\n let totalHeight: number;\n let sumOfPercent = 0;\n let scalingRatio: number;\n if (_yAxisType === YAxisType.StringAxis) {\n totalHeight =\n defaultTotalHeight ?? bars.reduce((total, bar) => total + (yBarScale as StringScale)(bar.data as string)!, 0);\n } else {\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 totalData = bars.reduce((iter, value) => iter + Math.abs(value.data as number), 0);\n totalHeight =\n defaultTotalHeight ?? Math.abs((yBarScale as NumericScale)(totalData) - (yBarScale as NumericScale)(Y_ORIGIN));\n bars.forEach(point => {\n let value = (Math.abs(point.data as number) / totalData) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n });\n scalingRatio = sumOfPercent !== 0 ? sumOfPercent / 100 : 1;\n }\n const gaps = barGapMax && bars.length - 1;\n const gapHeight = gaps && Math.max(barGapMin, Math.min(barGapMax, (totalHeight * barGapMultiplier) / gaps));\n const heightValueScale =\n _yAxisType === YAxisType.StringAxis ? 0 : (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 .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n if (!isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding)) {\n xBarScale.nice();\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 const totalWidth = calcTotalWidth(containerWidth, _margins, MIN_DOMAIN_MARGIN);\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 = calcRequiredWidth(_barWidth, _xAxisLabels.length, _xAxisInnerPadding);\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 = calcBandwidth(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, bandwidth);\n let reqWidth = calcRequiredWidth(barWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const margin1 = (totalWidth - reqWidth) / 2;\n\n let margin2 = Number.POSITIVE_INFINITY;\n if (!props.hideTickOverlap) {\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 margin2 = (totalWidth - reqWidth) / 2;\n }\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(\n props.barWidth,\n props.maxBarWidth,\n calculateAppropriateBarWidth(data, totalWidth, _xAxisInnerPadding),\n );\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 | StringScale,\n containerHeight: number,\n xElement: SVGElement,\n ): JSXElement[] {\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(\n point =>\n point.data !== 0 &&\n point.data !== '' &&\n !(\n _yAxisType === YAxisType.StringAxis &&\n typeof (yBarScale as StringScale)(point.data as string) === 'undefined'\n ),\n );\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 =\n containerHeight -\n _margins.bottom! -\n (_yAxisType === YAxisType.StringAxis ? 0 : (yBarScale as NumericScale)(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 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 tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined,\n };\n\n let barHeight: number;\n const gapOffset = index ? gapHeight : 0;\n if (_yAxisType === YAxisType.StringAxis) {\n barHeight = Math.max(\n containerHeight -\n _margins.bottom! -\n ((yBarScale as StringScale)(point.data as string)! + (yBarScale as StringScale).bandwidth() / 2) -\n gapOffset,\n barMinimumHeight,\n 1,\n );\n yPositiveStart -= barHeight + gapOffset;\n yPoint = yPositiveStart;\n } else {\n barHeight = Math.abs(heightValueScale * (point.data as number));\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 if ((point.data as number) >= 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 as number;\n heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;\n }\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 => {\n ref.refElement = e;\n }}\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 => {\n ref.refElement = e;\n }}\n {...rectFocusProps}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />\n </React.Fragment>\n );\n });\n const groupRef: RefArrayData = {};\n const someBarsActive =\n singleChartData.chartData.filter(dataPoint => _noLegendHighlighted() || _isLegendHighlighted(dataPoint.legend))\n .length > 0;\n // FIXME: Making the entire stack focusable when stack callout is enabled adds unnecessary complexity\n // and can reduce usability in certain scenarios. Instead, each individual element within the stack\n // should be focusable on its own, with its own aria-label. This behavior is also seen in Highcharts.\n const stackFocusProps = shouldFocusWholeStack &&\n someBarsActive && {\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 && _yAxisType !== YAxisType.StringAxis) {\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 as number;\n }\n });\n }\n }\n return (\n <g key={indexNumber + `${shouldFocusWholeStack}`}>\n <g\n id={`${indexNumber}-singleBar`}\n ref={e => {\n groupRef.refElement = e;\n }}\n {...stackFocusProps}\n >\n {singleBar}\n </g>\n {/*\n Note: No need to check hideLabels here, as showLabel is only set to true\n when hideLabels is false earlier in the code.\n */}\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 style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\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 JSXElement => !!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 as number);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _initYAxisParams() {\n if (_points[0].chartData.length > 0) {\n _yAxisType = getTypeOfAxis(_points[0].chartData[0].data, false) as YAxisType;\n } else {\n Object.keys(_lineObject).forEach(lineLegend => {\n if (!_lineObject[lineLegend][0].useSecondaryYScale) {\n _yAxisType = getTypeOfAxis(_lineObject[lineLegend][0].y, false) as YAxisType;\n }\n });\n }\n\n _yAxisLabels = _getOrderedYAxisLabels();\n }\n\n function _getYDomainMargins(containerHeight: number): Margins {\n /**\n * Specifies the extra top margin to apply above the highest y-axis tick label.\n * Useful when stacked bars extend beyond the combined height of all y-axis labels (or categories).\n */\n let yAxisTickMarginTop = 0;\n\n /** Total height available to render the bars */\n const totalHeight = containerHeight - _margins.bottom! - _margins.top!;\n\n if (_yAxisType === YAxisType.StringAxis) {\n /** Maximum height of the stacked bars, expressed in multiples of the height of a y-axis label (or category) */\n let maxBarHeightInLabels = 0;\n _points.forEach(xPoint => {\n /** Height of the stacked bar, expressed in multiples of the height of a y-axis label (or category) */\n let barHeightInLabels = 0;\n xPoint.chartData.forEach(bar => {\n barHeightInLabels += _yAxisLabels.indexOf(`${bar.data}`) + 1;\n });\n maxBarHeightInLabels = Math.max(maxBarHeightInLabels, barHeightInLabels);\n });\n /** Height of a y-axis label (or category) */\n const yAxisLabelHeight = maxBarHeightInLabels === 0 ? 0 : totalHeight / maxBarHeightInLabels;\n yAxisTickMarginTop += yAxisLabelHeight * (maxBarHeightInLabels - _yAxisLabels.length);\n }\n\n return {\n ..._margins,\n top: _margins.top! + yAxisTickMarginTop,\n };\n }\n\n function _getOrderedXAxisLabels() {\n if (_xAxisType !== XAxisTypes.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n }\n\n function _getOrderedYAxisLabels() {\n if (_yAxisType !== YAxisType.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n }\n\n function _mapCategoryToValues(isYAxis = false) {\n const categoryToValues: Record<string, number[]> = {};\n _points.forEach(point => {\n point.chartData.forEach(bar => {\n const category = (isYAxis ? bar.data : point.xAxisPoint) as string;\n const value = isYAxis ? point.xAxisPoint : bar.data;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n if (typeof value === 'number') {\n categoryToValues[category].push(value);\n }\n });\n point.lineData?.forEach(linePoint => {\n if (isYAxis && linePoint.useSecondaryYScale) {\n return;\n }\n const category = (isYAxis ? linePoint.y : point.xAxisPoint) as string;\n const value = isYAxis ? point.xAxisPoint : linePoint.y;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n if (typeof value === 'number') {\n categoryToValues[category].push(value);\n }\n });\n });\n return categoryToValues;\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: JSXElement = _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 createYAxis={createNumericYAxis}\n tickParams={tickParams}\n legendBars={legendBars}\n datasetForXAxisDomain={_xAxisLabels}\n isCalloutForStack={shouldFocusWholeStack}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxis}\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 showRoundOffXTickValues={!isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding)}\n yAxisType={_yAxisType!}\n stringDatasetForYAxisDomain={['', ..._yAxisLabels]}\n getYDomainMargins={_getYDomainMargins}\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":["React","max","d3Max","min","d3Min","select","d3Select","useVerticalStackedBarChartStyles","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","scaleUtc","d3ScaleUtc","scaleTime","d3ScaleTime","useId","tokens","CartesianChart","ChartPopover","Legends","ChartTypes","getAccessibleDataObject","XAxisTypes","getTypeOfAxis","tooltipOfAxislabels","formatScientificLimitWidth","getBarWidth","getScalePadding","isScalePaddingDefined","calculateAppropriateBarWidth","areArraysEqual","calculateLongestLabelWidth","useRtl","DataVizPalette","getColorFromToken","findVSBCNumericMinMaxOfY","YAxisType","createNumericYAxis","domainRangeOfDateForAreaLineScatterVerticalBarCharts","domainRangeOfVSBCNumeric","domainRangeOfXStringAxis","createStringYAxis","calcTotalWidth","calcBandwidth","calcRequiredWidth","sortAxisCategories","formatDateToLocaleString","useImageExport","barGapMultiplier","barGapMin","MIN_DOMAIN_MARGIN","VerticalStackedBarChart","forwardRef","_props","forwardedRef","props","xAxisCategoryOrder","yAxisCategoryOrder","maxBarWidth","_isRtl","_createLegendsForLine","data","_getLineLegends","_tooltipId","_emptyChartId","_points","_dataset","_xAxisLabels","_bars","_xAxisType","length","xAxisPoint","StringAxis","_barWidth","_colors","_margins","_lineObject","_yMax","_yMin","_calloutAnchorPoint","_domainMargin","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","Y_ORIGIN","_yAxisType","_yAxisLabels","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","useRef","useEffect","current","prevProps","height","width","_adjustProps","_createDataSetLayer","_getLegendData","lineLegends","defaultPalette","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","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","_getHighlightedLegend","_lineHoverFocus","lineData","event","clientX","clientY","boundingRect","target","getBoundingClientRect","left","top","_noLegendHighlighted","_isLegendHighlighted","_updatePosition","xItem","yAxisCalloutData","_onStackHoverFocus","stack","mouseEvent","dataPoint","isLinesPresent","item","shouldDrawBorderBottom","sort","a","b","slice","reverse","Date","culture","useUTC","stackCallOutAccessibilityData","_onClick","onBarClick","href","window","location","barWidth","defaultColors","_getFormattedLineData","xAxisInnerPadding","xAxisPadding","xAxisOuterPadding","_initYAxisParams","dataset","map","singlePointData","total","_getOrderedXAxisLabels","legendTitle","_selectedLegends","currentLegend","canSelectMultipleLegends","_getMargins","margins","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","xBarScale","yBarScale","_getScales","_createBar","_getAxisData","yAxisData","yAxisDomainValues","domainValue","yMaxValue","yMinValue","includes","_getAriaLabel","isLinePoint","xValue","xAxisCalloutData","pointValues","pt","yValue","str","join","lineValues","ln","ariaLabel","_getCustomizedCallout","_isHavingLines","some","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_renderCallout","_toFocusWholeStack","isCalloutForStack","shouldFocusStackOnly","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","domainNRangeValue","NumericAxis","DateAxis","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","yScaleBandwidthTranslate","key","opacity","strokeWidth","fill","strokeLinecap","stroke","colorNeutralBackground1","transform","strokeDasharray","onMouseOver","_lineHover","onMouseLeave","_handleMouseOut","circlePoint","subIndex","circleRef","refElement","noBarsAndLinesActive","circle","cx","cy","r","_getCircleOpacityAndRadius","radius","ref","e","tabIndex","hideTooltip","onFocus","_lineFocus","onBlur","role","XValue","YValue","_onRectHover","persist","_onRectFocusHover","chartDataPoint","xAxisDataPoint","_onStackHover","_onRectFocus","_onStackFocus","groupRef","_getBarGapAndScale","bars","defaultTotalHeight","barGapMax","totalData","totalHeight","sumOfPercent","scalingRatio","reduce","bar","iter","value","abs","gaps","gapHeight","heightValueScale","absStackTotal","yDomain","domain","range","bottom","xMax","xMin","right","nice","sDate","lDate","paddingInner","paddingOuter","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainMargins","totalWidth","reqWidth","mode","margin1","margin2","POSITIVE_INFINITY","hideTickOverlap","step","_getChartTitle","chartTitle","numLines","classes","barCornerRadius","barMinimumHeight","shouldFocusWholeStack","indexNumber","xPoint","barTotalValue","barsToDisplay","yBaseline","yPositiveStart","yNegativeStart","yPoint","heightOfLastBar","singleBar","startColor","rectFocusProps","onMouseMove","onClick","barHeight","gapOffset","minHeight","Fragment","path","className","opacityChangeOnHover","d","rx","roundCorners","cursor","rect","someBarsActive","stackFocusProps","showLabel","barLabel","hideLabels","g","id","text","textAnchor","aria-label","style","direction","unicodeBidi","yAxisTickFormat","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","_getMinMaxOfYAxis","yAxisType","values","startValue","endValue","lineLegend","_getOrderedYAxisLabels","_getYDomainMargins","yAxisTickMarginTop","maxBarHeightInLabels","barHeightInLabels","indexOf","yAxisLabelHeight","_mapCategoryToValues","isYAxis","categoryToValues","category","linePoint","legendBars","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","tickFormat","getMinMaxOfYAxis","createYAxis","datasetForXAxisDomain","getDomainNRangeValues","barwidth","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","showRoundOffXTickValues","stringDatasetForYAxisDomain","getYDomainMargins","children","div","displayName"],"mappings":"AAAA;;;;;+BAuFaoD;;;;;;;iEArFU,QAAQ;yBACY,WAAW;6BACnB,eAAe;wDACD,4CAA4C;yBAQtF,WAAW;gCACI,4BAA4B;4BAE3B,wBAAwB;uBAgBxC,cAAc;wBA8Bd,wBAAwB;gCACU,4BAA4B;uBAC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
|
+
{"version":3,"sources":["../src/components/VerticalStackedBarChart/VerticalStackedBarChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\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 ScaleBand,\n} from 'd3-scale';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } 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 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 areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n findVSBCNumericMinMaxOfY,\n YAxisType,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n domainRangeOfVSBCNumeric,\n domainRangeOfXStringAxis,\n createStringYAxis,\n calcTotalWidth,\n calcBandwidth,\n calcRequiredWidth,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatDateToLocaleString, isInvalidValue } from '@fluentui/chart-utilities';\nimport { useImageExport } from '../../utilities/hooks';\n\ntype NumericScale = D3ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\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};\ntype CalloutAnchorPointData = {\n xAxisDataPoint: string;\n chartDataPoint: VSChartDataPoint;\n};\n\nexport const VerticalStackedBarChart: React.FunctionComponent<VerticalStackedBarChartProps> = React.forwardRef<\n HTMLDivElement,\n VerticalStackedBarChartProps\n>((_props, forwardedRef) => {\n const props: VerticalStackedBarChartProps = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n maxBarWidth: 24,\n ..._props,\n };\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: JSXElement[];\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, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n const Y_ORIGIN: number = 0;\n let _yAxisType: YAxisType;\n let _yAxisLabels: string[] = [];\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 function _getLegendData(data: VerticalStackedChartProps[], lineLegends: LineLegends[]): JSXElement {\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[] = actions.concat(legendsOfLine);\n return (\n <Legends\n legends={totalLegends}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _lineHoverFocus(\n lineData: LinePoint,\n event: React.MouseEvent<SVGElement> | React.FocusEvent<SVGCircleElement, Element>,\n ): void {\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n const boundingRect = event.target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n if (_getHighlightedLegend().length === 1) {\n if (_noLegendHighlighted() || _isLegendHighlighted(lineData.legend)) {\n _updatePosition(clientX, clientY);\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 } else {\n _onStackHoverFocus(lineData.xItem, event as React.MouseEvent<SVGElement>);\n }\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(\n stack.xAxisPoint instanceof Date\n ? formatDateToLocaleString(stack.xAxisPoint, props.culture, props.useUTC as boolean)\n : stack.xAxisPoint,\n );\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 const firstXValue = _points[0]?.xAxisPoint;\n _xAxisType = isInvalidValue(firstXValue) ? XAxisTypes.StringAxis : (getTypeOfAxis(firstXValue, true) as XAxisTypes);\n _lineObject = _getFormattedLineData(props.data);\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n props.xAxisPadding,\n _xAxisType === XAxisTypes.StringAxis ? 2 / 3 : 1 / 2,\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding, props.xAxisPadding, 0);\n _initYAxisParams();\n }\n\n function _createDataSetLayer(): VerticalStackedBarDataPoint[] {\n const dataset: VerticalStackedBarDataPoint[] = _points.map(singlePointData => {\n if (_yAxisType === YAxisType.StringAxis) {\n return {\n x: singlePointData.xAxisPoint,\n y: 0,\n };\n }\n let total: number = 0;\n singlePointData.chartData!.forEach((point: VSChartDataPoint) => {\n total = total + (point.data as number);\n });\n return {\n x: singlePointData.xAxisPoint,\n y: total,\n };\n });\n _xAxisLabels = _getOrderedXAxisLabels();\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: NumericScale | StringScale,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth);\n return (_bars = _createBar(\n xBarScale,\n _yAxisType === YAxisType.StringAxis ? yScale : yBarScale,\n containerHeight,\n xElement!,\n ));\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(\n singleChartData: VerticalStackedChartProps,\n point?: VSChartDataPoint | LineDataInVerticalStackedBarChart,\n isLinePoint?: boolean,\n ): string {\n if (!point) {\n /** if shouldFocusWholeStack is true */\n const xValue =\n singleChartData.xAxisCalloutData ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC as boolean)\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 _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';\n })\n .filter(str => str !== '')\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 _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';\n })\n .filter(str => str !== '')\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 (!isLinePoint && (point as VSChartDataPoint).xAxisCalloutData) ||\n (singleChartData.xAxisPoint instanceof Date\n ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC as boolean)\n : singleChartData.xAxisPoint);\n const legend = point.legend;\n const yValue =\n point.yAxisCalloutData ||\n (isLinePoint ? point.data || (point as LineDataInVerticalStackedBarChart).y : point.data);\n return (\n (!isLinePoint && (point as VSChartDataPoint).callOutAccessibilityData?.ariaLabel) ||\n `${xValue}. ${legend}, ${yValue}.`\n );\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 _getDomainNRangeValues(\n points: DataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth!);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(\n points,\n margins,\n width,\n isRTL,\n tickValues! as Date[],\n chartType,\n barWidth,\n );\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\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 | StringScale,\n containerHeight: number,\n containerWidth: number,\n yScaleSecondary?: NumericScale,\n ): JSXElement {\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 as number)\n : //eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(lineObject[item][i - 1].y as any);\n const x2 = xScale(lineObject[item][i].xItem.xAxisPoint);\n const y2 = useSecondaryYScale\n ? yScaleSecondary!(lineObject[item][i].y as number)\n : //eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(lineObject[item][i].y as any);\n const yScaleBandwidthTranslate =\n !useSecondaryYScale && _yAxisType === YAxisType.StringAxis\n ? (yScalePrimary as StringScale).bandwidth() / 2\n : 0;\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}, ${yScaleBandwidthTranslate})`}\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}, ${yScaleBandwidthTranslate})`}\n onMouseOver={event => _lineHover(lineObject[item][i - 1], event)}\n onMouseLeave={_handleMouseOut}\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 const yScaleBandwidthTranslate =\n !circlePoint.useSecondaryYScale && _yAxisType === YAxisType.StringAxis\n ? (yScalePrimary as StringScale).bandwidth() / 2\n : 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 as number)\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary(circlePoint.y as any)\n }\n onMouseOver={event => _lineHover(circlePoint, event)}\n onMouseLeave={_handleMouseOut}\n r={_getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).radius}\n stroke={circlePoint.color}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={3}\n // Elements with visibility: hidden cannot receive focus, so use opacity: 0 instead to hide them.\n // For more information, see https://fuzzbomb.github.io/accessibility-demos/visually-hidden-focus-test.html\n opacity={_getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).opacity}\n transform={`translate(${xScaleBandwidthTranslate}, ${yScaleBandwidthTranslate})`}\n ref={e => {\n circleRef.refElement = e;\n }}\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 _getCircleOpacityAndRadius(\n xAxisPoint: string | number | Date,\n legend: string,\n ): { opacity: number; radius: number } {\n if (!_noLegendHighlighted()) {\n if (xAxisPoint === activeXAxisDataPoint && _isLegendHighlighted(legend)) {\n return { opacity: 1, radius: 8 };\n } else if (_isLegendHighlighted(legend)) {\n return { opacity: 1, radius: 0.3 };\n } else {\n return { opacity: 0, radius: 0 };\n }\n } else {\n return {\n opacity: activeXAxisDataPoint === xAxisPoint ? 1 : 0,\n radius: 8,\n };\n }\n }\n\n function _renderCallout(props?: VSChartDataPoint): JSXElement | null {\n return props ? (\n <ChartPopover\n culture={props.culture}\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:\n xAxisPoint instanceof Date\n ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC as boolean)\n : xAxisPoint.toString(),\n };\n const xCalloutValue =\n point.xAxisCalloutData ||\n (xAxisPoint instanceof Date\n ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC as boolean)\n : xAxisPoint.toString());\n\n _updatePosition(clientX, clientY);\n setPopoverOpen(_noLegendHighlighted() || _isLegendHighlighted(point.legend));\n setCalloutLegend(point.legend);\n setDataForHoverCard(point.data as number);\n setColor(color);\n setXCalloutValue(xCalloutValue);\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, mouseEvent);\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, event);\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 /**/\n }\n\n function _getBarGapAndScale(\n bars: VSChartDataPoint[],\n yBarScale: NumericScale | StringScale,\n defaultTotalHeight?: number,\n ): {\n readonly gapHeight: number;\n readonly heightValueScale: number;\n readonly absStackTotal: number;\n } {\n const { barGapMax = 0 } = props;\n let totalData = 0;\n let totalHeight: number;\n let sumOfPercent = 0;\n let scalingRatio: number;\n if (_yAxisType === YAxisType.StringAxis) {\n totalHeight =\n defaultTotalHeight ?? bars.reduce((total, bar) => total + (yBarScale as StringScale)(bar.data as string)!, 0);\n } else {\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 totalData = bars.reduce((iter, value) => iter + Math.abs(value.data as number), 0);\n totalHeight =\n defaultTotalHeight ?? Math.abs((yBarScale as NumericScale)(totalData) - (yBarScale as NumericScale)(Y_ORIGIN));\n bars.forEach(point => {\n let value = (Math.abs(point.data as number) / totalData) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n });\n scalingRatio = sumOfPercent !== 0 ? sumOfPercent / 100 : 1;\n }\n const gaps = barGapMax && bars.length - 1;\n const gapHeight = gaps && Math.max(barGapMin, Math.min(barGapMax, (totalHeight * barGapMultiplier) / gaps));\n const heightValueScale =\n _yAxisType === YAxisType.StringAxis ? 0 : (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 .range([_margins.left! + _domainMargin, containerWidth - _margins.right! - _domainMargin]);\n if (!isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding)) {\n xBarScale.nice();\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 const totalWidth = calcTotalWidth(containerWidth, _margins, MIN_DOMAIN_MARGIN);\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 = calcRequiredWidth(_barWidth, _xAxisLabels.length, _xAxisInnerPadding);\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 = calcBandwidth(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, bandwidth);\n let reqWidth = calcRequiredWidth(barWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const margin1 = (totalWidth - reqWidth) / 2;\n\n let margin2 = Number.POSITIVE_INFINITY;\n if (!props.hideTickOverlap) {\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 margin2 = (totalWidth - reqWidth) / 2;\n }\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(\n props.barWidth,\n props.maxBarWidth,\n calculateAppropriateBarWidth(data, totalWidth, _xAxisInnerPadding),\n );\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 | StringScale,\n containerHeight: number,\n xElement: SVGElement,\n ): JSXElement[] {\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(\n point =>\n point.data !== 0 &&\n point.data !== '' &&\n !(\n _yAxisType === YAxisType.StringAxis &&\n typeof (yBarScale as StringScale)(point.data as string) === 'undefined'\n ),\n );\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 =\n containerHeight -\n _margins.bottom! -\n (_yAxisType === YAxisType.StringAxis ? 0 : (yBarScale as NumericScale)(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 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 tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined,\n };\n\n let barHeight: number;\n const gapOffset = index ? gapHeight : 0;\n if (_yAxisType === YAxisType.StringAxis) {\n barHeight = Math.max(\n containerHeight -\n _margins.bottom! -\n ((yBarScale as StringScale)(point.data as string)! + (yBarScale as StringScale).bandwidth() / 2) -\n gapOffset,\n barMinimumHeight,\n 1,\n );\n yPositiveStart -= barHeight + gapOffset;\n yPoint = yPositiveStart;\n } else {\n barHeight = Math.abs(heightValueScale * (point.data as number));\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 if ((point.data as number) >= 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 as number;\n heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;\n }\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 => {\n ref.refElement = e;\n }}\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 => {\n ref.refElement = e;\n }}\n {...rectFocusProps}\n transform={`translate(${xScaleBandwidthTranslate}, 0)`}\n />\n </React.Fragment>\n );\n });\n const groupRef: RefArrayData = {};\n const someBarsActive =\n singleChartData.chartData.filter(dataPoint => _noLegendHighlighted() || _isLegendHighlighted(dataPoint.legend))\n .length > 0;\n // FIXME: Making the entire stack focusable when stack callout is enabled adds unnecessary complexity\n // and can reduce usability in certain scenarios. Instead, each individual element within the stack\n // should be focusable on its own, with its own aria-label. This behavior is also seen in Highcharts.\n const stackFocusProps = shouldFocusWholeStack &&\n someBarsActive && {\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 && _yAxisType !== YAxisType.StringAxis) {\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 as number;\n }\n });\n }\n }\n return (\n <g key={indexNumber + `${shouldFocusWholeStack}`}>\n <g\n id={`${indexNumber}-singleBar`}\n ref={e => {\n groupRef.refElement = e;\n }}\n {...stackFocusProps}\n >\n {singleBar}\n </g>\n {/*\n Note: No need to check hideLabels here, as showLabel is only set to true\n when hideLabels is false earlier in the code.\n */}\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 style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\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 JSXElement => !!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 as number);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _initYAxisParams() {\n if (_points[0].chartData.length > 0) {\n _yAxisType = getTypeOfAxis(_points[0].chartData[0].data, false) as YAxisType;\n } else {\n Object.keys(_lineObject).forEach(lineLegend => {\n if (!_lineObject[lineLegend][0].useSecondaryYScale) {\n _yAxisType = getTypeOfAxis(_lineObject[lineLegend][0].y, false) as YAxisType;\n }\n });\n }\n\n _yAxisLabels = _getOrderedYAxisLabels();\n }\n\n function _getYDomainMargins(containerHeight: number): Margins {\n /**\n * Specifies the extra top margin to apply above the highest y-axis tick label.\n * Useful when stacked bars extend beyond the combined height of all y-axis labels (or categories).\n */\n let yAxisTickMarginTop = 0;\n\n /** Total height available to render the bars */\n const totalHeight = containerHeight - _margins.bottom! - _margins.top!;\n\n if (_yAxisType === YAxisType.StringAxis) {\n /** Maximum height of the stacked bars, expressed in multiples of the height of a y-axis label (or category) */\n let maxBarHeightInLabels = 0;\n _points.forEach(xPoint => {\n /** Height of the stacked bar, expressed in multiples of the height of a y-axis label (or category) */\n let barHeightInLabels = 0;\n xPoint.chartData.forEach(bar => {\n barHeightInLabels += _yAxisLabels.indexOf(`${bar.data}`) + 1;\n });\n maxBarHeightInLabels = Math.max(maxBarHeightInLabels, barHeightInLabels);\n });\n /** Height of a y-axis label (or category) */\n const yAxisLabelHeight = maxBarHeightInLabels === 0 ? 0 : totalHeight / maxBarHeightInLabels;\n yAxisTickMarginTop += yAxisLabelHeight * (maxBarHeightInLabels - _yAxisLabels.length);\n }\n\n return {\n ..._margins,\n top: _margins.top! + yAxisTickMarginTop,\n };\n }\n\n function _getOrderedXAxisLabels() {\n if (_xAxisType !== XAxisTypes.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n }\n\n function _getOrderedYAxisLabels() {\n if (_yAxisType !== YAxisType.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n }\n\n function _mapCategoryToValues(isYAxis = false) {\n const categoryToValues: Record<string, number[]> = {};\n _points.forEach(point => {\n point.chartData.forEach(bar => {\n const category = (isYAxis ? bar.data : point.xAxisPoint) as string;\n const value = isYAxis ? point.xAxisPoint : bar.data;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n if (typeof value === 'number') {\n categoryToValues[category].push(value);\n }\n });\n point.lineData?.forEach(linePoint => {\n if (isYAxis && linePoint.useSecondaryYScale) {\n return;\n }\n const category = (isYAxis ? linePoint.y : point.xAxisPoint) as string;\n const value = isYAxis ? point.xAxisPoint : linePoint.y;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n if (typeof value === 'number') {\n categoryToValues[category].push(value);\n }\n });\n });\n return categoryToValues;\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: JSXElement = _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 createYAxis={createNumericYAxis}\n tickParams={tickParams}\n legendBars={legendBars}\n datasetForXAxisDomain={_xAxisLabels}\n isCalloutForStack={shouldFocusWholeStack}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxis}\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 showRoundOffXTickValues={!isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding)}\n yAxisType={_yAxisType!}\n stringDatasetForYAxisDomain={['', ..._yAxisLabels]}\n getYDomainMargins={_getYDomainMargins}\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":["React","max","d3Max","min","d3Min","select","d3Select","useVerticalStackedBarChartStyles","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","scaleUtc","d3ScaleUtc","scaleTime","d3ScaleTime","useId","tokens","CartesianChart","ChartPopover","Legends","ChartTypes","getAccessibleDataObject","XAxisTypes","getTypeOfAxis","tooltipOfAxislabels","formatScientificLimitWidth","getBarWidth","getScalePadding","isScalePaddingDefined","calculateAppropriateBarWidth","areArraysEqual","calculateLongestLabelWidth","useRtl","DataVizPalette","getColorFromToken","findVSBCNumericMinMaxOfY","YAxisType","createNumericYAxis","domainRangeOfDateForAreaLineScatterVerticalBarCharts","domainRangeOfVSBCNumeric","domainRangeOfXStringAxis","createStringYAxis","calcTotalWidth","calcBandwidth","calcRequiredWidth","sortAxisCategories","formatDateToLocaleString","isInvalidValue","useImageExport","barGapMultiplier","barGapMin","MIN_DOMAIN_MARGIN","VerticalStackedBarChart","forwardRef","_props","forwardedRef","props","xAxisCategoryOrder","yAxisCategoryOrder","maxBarWidth","_isRtl","_createLegendsForLine","data","_getLineLegends","_tooltipId","_emptyChartId","_points","_dataset","_xAxisLabels","_bars","_xAxisType","length","xAxisPoint","StringAxis","_barWidth","_colors","_margins","_lineObject","_yMax","_yMin","_calloutAnchorPoint","_domainMargin","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","Y_ORIGIN","_yAxisType","_yAxisLabels","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","useRef","useEffect","current","prevProps","height","width","_adjustProps","_createDataSetLayer","_getLegendData","lineLegends","defaultPalette","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","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","_getHighlightedLegend","_lineHoverFocus","lineData","event","clientX","clientY","boundingRect","target","getBoundingClientRect","left","top","_noLegendHighlighted","_isLegendHighlighted","_updatePosition","xItem","yAxisCalloutData","_onStackHoverFocus","stack","mouseEvent","dataPoint","isLinesPresent","item","shouldDrawBorderBottom","sort","a","b","slice","reverse","Date","culture","useUTC","stackCallOutAccessibilityData","_onClick","onBarClick","href","window","location","barWidth","defaultColors","firstXValue","_getFormattedLineData","xAxisInnerPadding","xAxisPadding","xAxisOuterPadding","_initYAxisParams","dataset","map","singlePointData","total","_getOrderedXAxisLabels","legendTitle","_selectedLegends","currentLegend","canSelectMultipleLegends","_getMargins","margins","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","xBarScale","yBarScale","_getScales","_createBar","_getAxisData","yAxisData","yAxisDomainValues","domainValue","yMaxValue","yMinValue","includes","_getAriaLabel","isLinePoint","xValue","xAxisCalloutData","pointValues","pt","yValue","str","join","lineValues","ln","ariaLabel","_getCustomizedCallout","_isHavingLines","some","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_renderCallout","_toFocusWholeStack","isCalloutForStack","shouldFocusStackOnly","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","domainNRangeValue","NumericAxis","DateAxis","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","yScaleBandwidthTranslate","key","opacity","strokeWidth","fill","strokeLinecap","stroke","colorNeutralBackground1","transform","strokeDasharray","onMouseOver","_lineHover","onMouseLeave","_handleMouseOut","circlePoint","subIndex","circleRef","refElement","noBarsAndLinesActive","circle","cx","cy","r","_getCircleOpacityAndRadius","radius","ref","e","tabIndex","hideTooltip","onFocus","_lineFocus","onBlur","role","XValue","YValue","_onRectHover","persist","_onRectFocusHover","chartDataPoint","xAxisDataPoint","_onStackHover","_onRectFocus","_onStackFocus","groupRef","_getBarGapAndScale","bars","defaultTotalHeight","barGapMax","totalData","totalHeight","sumOfPercent","scalingRatio","reduce","bar","iter","value","abs","gaps","gapHeight","heightValueScale","absStackTotal","yDomain","domain","range","bottom","xMax","xMin","right","nice","sDate","lDate","paddingInner","paddingOuter","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainMargins","totalWidth","reqWidth","mode","margin1","margin2","POSITIVE_INFINITY","hideTickOverlap","step","_getChartTitle","chartTitle","numLines","classes","barCornerRadius","barMinimumHeight","shouldFocusWholeStack","indexNumber","xPoint","barTotalValue","barsToDisplay","yBaseline","yPositiveStart","yNegativeStart","yPoint","heightOfLastBar","singleBar","startColor","rectFocusProps","onMouseMove","onClick","barHeight","gapOffset","minHeight","Fragment","path","className","opacityChangeOnHover","d","rx","roundCorners","cursor","rect","someBarsActive","stackFocusProps","showLabel","barLabel","hideLabels","g","id","text","textAnchor","aria-label","style","direction","unicodeBidi","yAxisTickFormat","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","_getMinMaxOfYAxis","yAxisType","values","startValue","endValue","lineLegend","_getOrderedYAxisLabels","_getYDomainMargins","yAxisTickMarginTop","maxBarHeightInLabels","barHeightInLabels","indexOf","yAxisLabelHeight","_mapCategoryToValues","isYAxis","categoryToValues","category","linePoint","legendBars","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","tickFormat","getMinMaxOfYAxis","createYAxis","datasetForXAxisDomain","getDomainNRangeValues","barwidth","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","showRoundOffXTickValues","stringDatasetForYAxisDomain","getYDomainM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aAAA,CAAC4W,KAAAA,MACE3K,kBACCwB,aACEtO,MAAMiL,MAAM,EACZjL,MAAMuO,aAAa,EACnBvO,MAAMmL,eAAe,EACrBnL,MAAMoL,cAAc,EACpBpL,MAAMwO,eAAe;YAKjC;;IAGN;IACA,OAAA,WAAA,GAAO,OAAA,aAAA,CAAC8M,OAAAA;QAAI5D,IAAIjX;QAAeiR,MAAM;QAASoG,OAAO;YAAElI,SAAS;QAAI;QAAGiI,cAAY;;AACrF,GAAG;AACHjY,wBAAwB2b,WAAW,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-charts",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20251125-0407.1",
|
|
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",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@fluentui/eslint-plugin": "*",
|
|
25
|
-
"@fluentui/react-conformance": "0.0.0-nightly-
|
|
26
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
|
25
|
+
"@fluentui/react-conformance": "0.0.0-nightly-20251125-0407.0",
|
|
26
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20251125-0407.0",
|
|
27
27
|
"@fluentui/scripts-api-extractor": "*"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@fluentui/chart-utilities": "^1.1.36",
|
|
31
|
-
"@fluentui/react-button": "0.0.0-nightly-
|
|
32
|
-
"@fluentui/react-jsx-runtime": "0.0.0-nightly-
|
|
33
|
-
"@fluentui/react-overflow": "0.0.0-nightly-
|
|
34
|
-
"@fluentui/react-popover": "0.0.0-nightly-
|
|
35
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
36
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
|
37
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
38
|
-
"@fluentui/react-tooltip": "0.0.0-nightly-
|
|
39
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
31
|
+
"@fluentui/react-button": "0.0.0-nightly-20251125-0407.1",
|
|
32
|
+
"@fluentui/react-jsx-runtime": "0.0.0-nightly-20251125-0407.1",
|
|
33
|
+
"@fluentui/react-overflow": "0.0.0-nightly-20251125-0407.1",
|
|
34
|
+
"@fluentui/react-popover": "0.0.0-nightly-20251125-0407.1",
|
|
35
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20251125-0407.1",
|
|
36
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20251125-0407.1",
|
|
37
|
+
"@fluentui/react-theme": "0.0.0-nightly-20251125-0407.1",
|
|
38
|
+
"@fluentui/react-tooltip": "0.0.0-nightly-20251125-0407.1",
|
|
39
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20251125-0407.1",
|
|
40
40
|
"@griffel/react": "^1.5.32",
|
|
41
41
|
"@swc/helpers": "^0.5.1",
|
|
42
42
|
"@types/d3-array": "^3.0.0",
|