@fluentui/react-charts 9.2.0 → 9.2.2
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 +38 -3
- package/dist/index.d.ts +84 -5
- package/lib/ChartTable.js +1 -0
- package/lib/ChartTable.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +57 -0
- package/lib/components/ChartTable/ChartTable.js.map +1 -0
- package/lib/components/ChartTable/ChartTable.types.js +1 -0
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -0
- package/lib/components/ChartTable/index.js +3 -0
- package/lib/components/ChartTable/index.js.map +1 -0
- package/lib/components/ChartTable/useChartTableStyles.styles.js +93 -0
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -0
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +55 -0
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +110 -81
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +20 -10
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +95 -0
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -87
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +161 -141
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +12 -11
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +57 -51
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/utilities.js +26 -37
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js +24 -0
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/ChartTable.js +6 -0
- package/lib-commonjs/ChartTable.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +68 -0
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -0
- package/lib-commonjs/components/ChartTable/ChartTable.types.js +6 -0
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -0
- package/lib-commonjs/components/ChartTable/index.js +8 -0
- package/lib-commonjs/components/ChartTable/index.js.map +1 -0
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +196 -0
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +69 -0
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +109 -80
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +19 -9
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +120 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -87
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +159 -139
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +11 -10
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +56 -50
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +29 -37
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.js +27 -0
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/HorizontalBarChart/HorizontalBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useHorizontalBarChartStyles } from './useHorizontalBarChartStyles.styles';\nimport { ChartProps, HorizontalBarChartProps, ChartDataPoint, RefArrayData, HorizontalBarChartVariant } from './index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { formatScientificLimitWidth, getAccessibleDataObject, useRtl } from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { Legend, Legends } from '../../index';\n\n/**\n * HorizontalBarChart is the context wrapper and container for all HorizontalBarChart content/controls,\n * It has no direct style or slot opinions.\n *\n * HorizontalBarChart also provides API interfaces for callbacks that will occur on navigation events.\n */\nexport const HorizontalBarChart: React.FunctionComponent<HorizontalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartProps\n>((props, forwardedRef) => {\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const _uniqLineText: string = useId('_HorizontalLine_');\n const _refArray: RefArrayData[] = [];\n const _isRTL: boolean = useRtl();\n const barChartSvgRef: React.RefObject<SVGSVGElement> = React.createRef<SVGSVGElement>();\n const _emptyChartId: string = useId('_HBC_empty');\n let _barHeight: number;\n let _calloutAnchorPoint: ChartDataPoint | null;\n let isSingleBar: boolean = true;\n let _showToolTipOnSegment: boolean = !props.hideTooltip;\n\n const [hoverValue, setHoverValue] = React.useState<string | number | Date | null>('');\n const [lineColor, setLineColor] = React.useState<string>('');\n const [legend, setLegend] = React.useState<string | null>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string | undefined>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string | undefined>('');\n const [barCalloutProps, setBarCalloutProps] = React.useState<ChartDataPoint>();\n const [barSpacingInPercent, setBarSpacingInPercent] = React.useState<number>(0);\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n\n function _refCallback(element: SVGGElement, legendTitle: string | undefined): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _hoverOn(\n event: React.FocusEvent<SVGRectElement> | React.MouseEvent<SVGRectElement>,\n hoverVal: string | number | Date,\n point: ChartDataPoint,\n ): void {\n if (\n (!isPopoverOpen || legend !== point.legend!) &&\n _calloutAnchorPoint !== point &&\n (_legendHighlighted(point.legend) || _noLegendHighlighted())\n ) {\n _calloutAnchorPoint = point;\n let x = 0;\n let y = 0;\n\n if ('clientX' in event && event.clientX && event.clientY) {\n // Mouse event\n x = event.clientX;\n y = event.clientY;\n } else {\n // Focus event\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n }\n\n updatePosition(x, y);\n setHoverValue(hoverVal);\n setLineColor(point.color!);\n setLegend(point.legend!);\n setXCalloutValue(point.xAxisCalloutData!);\n setYCalloutValue(point.yAxisCalloutData!);\n setBarCalloutProps(point);\n // ToDo - Confirm setting multiple state variables like this is performant.\n }\n }\n\n function _hoverOff(): void {\n /*ToDo. To fix*/\n }\n\n const _handleChartMouseLeave = () => {\n _calloutAnchorPoint = null;\n if (isPopoverOpen) {\n setPopoverOpen(false);\n setHoverValue('');\n setLineColor('');\n setLegend('');\n }\n };\n\n const _adjustProps = (): void => {\n _barHeight = props.barHeight || 12;\n };\n\n const _getChartDataText = (data: ChartProps) => {\n /* return props.barChartCustomData ? (\n <div role=\"text\">{props.barChartCustomData(data)}</div>\n ) : ( */\n return _getDefaultTextData(data);\n //)\n };\n\n function _createLegends(chartProps: ChartProps[]): JSX.Element {\n const legendItems: Legend[] = chartProps.flatMap(\n point =>\n point.chartData?.map((dataPoint): Legend => {\n const legend = dataPoint.legend ?? '';\n const color = dataPoint.color ?? '';\n\n return {\n title: legend,\n color,\n action: () => setSelectedLegend(selectedLegend === legend ? '' : legend),\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legend);\n },\n onMouseOutAction: () => setActiveLegend(''),\n };\n }) ?? [],\n );\n\n return (\n <Legends legends={legendItems} centerLegends overflowText={props.legendsOverflowText} {...props.legendProps} />\n );\n }\n\n function _getDefaultTextData(data: ChartProps): JSX.Element {\n const chartDataMode = props.chartDataMode || 'default';\n\n if (chartDataMode === 'hidden') {\n return <></>; // No text data for hidden mode\n }\n\n const { culture } = props;\n const accessibilityData = getAccessibleDataObject(data.chartDataAccessibilityData!, 'text', false);\n if (!isSingleBar) {\n const total = data.chartData!.reduce(\n (acc: number, point: ChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0),\n 0,\n );\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {formatToLocaleString(total, culture) as React.ReactNode}\n </div>\n );\n }\n\n const chartData: ChartDataPoint = data!.chartData![0];\n const x = chartData.horizontalBarChartdata!.x;\n const y = chartData.horizontalBarChartdata!.total!;\n\n switch (chartDataMode) {\n case 'default':\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {formatToLocaleString(x, culture) as React.ReactNode}\n </div>\n );\n case 'fraction':\n return (\n <div {...accessibilityData}>\n <span className={classes.chartTitleRight}>{formatToLocaleString(x, culture) as React.ReactNode}</span>\n <span className={classes.chartDataTextDenominator}>{' / ' + formatToLocaleString(y, culture)}</span>\n </div>\n );\n case 'percentage':\n const dataRatioPercentage = `${formatToLocaleString(Math.round((x / y) * 100), culture)}%`;\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {dataRatioPercentage}\n </div>\n );\n }\n }\n\n function _createBenchmark(data: ChartProps): JSX.Element {\n if (data.chartData![0].horizontalBarChartdata!.total === undefined) {\n return <></>;\n }\n const totalData = data.chartData![0].horizontalBarChartdata!.total!;\n const benchmarkData = data.chartData![0].data;\n const benchmarkRatio = Math.round(((benchmarkData ? benchmarkData : 0) / totalData) * 100);\n\n const benchmarkStyles = {\n left: 'calc(' + benchmarkRatio + '% - 4px)',\n };\n\n return (\n <div className={classes.benchmarkContainer}>\n <div className={classes.triangle} style={benchmarkStyles} />\n </div>\n );\n }\n\n /**\n * This functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing in between the bars\n */\n\n function _createBars(data: ChartProps): JSX.Element[] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: ChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = barSpacingInPercent * (noOfBars - 1);\n const defaultColors: string[] = [\n tokens.colorPaletteBlueForeground2,\n tokens.colorPaletteCornflowerForeground2,\n tokens.colorPaletteDarkGreenForeground2,\n tokens.colorPaletteNavyForeground2,\n tokens.colorPaletteDarkOrangeForeground2,\n ];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: ChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n data.chartData!.map((point: ChartDataPoint, index: number) => {\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? (sumOfPercent - totalMarginPercent) / 100 : 1;\n\n const bars = data.chartData!.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color ? point.color : defaultColors[Math.floor(Math.random() * 4 + 1)];\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n startingPoint.push(prevPosition);\n\n const xValue = point.horizontalBarChartdata!.x;\n const placeholderIndex = 1;\n const isLegendSelected: boolean = _legendHighlighted(point.legend) || _noLegendHighlighted();\n\n // Render bar label instead of placeholder bar for absolute-scale variant\n if (index === placeholderIndex && props.variant === HorizontalBarChartVariant.AbsoluteScale) {\n if (props.hideLabels) {\n return <text key={index} />;\n }\n\n const barValue = data.chartData![0].horizontalBarChartdata!.x;\n\n return (\n <text\n key={index}\n x={`${_isRTL ? 100 - startingPoint[index] : startingPoint[index]}%`}\n y={_barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${_isRTL ? -4 : 4})`}\n className={classes.barLabel}\n aria-hidden={true}\n >\n {formatScientificLimitWidth(barValue)}\n </text>\n );\n }\n\n return (\n <rect\n key={index}\n x={`${\n _isRTL\n ? 100 - startingPoint[index] - value - index * barSpacingInPercent\n : startingPoint[index] + index * barSpacingInPercent\n }%`}\n y={0}\n width={value + '%'}\n height={_barHeight}\n fill={color}\n onMouseOver={\n _showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined\n }\n onFocus={_showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n onBlur={_hoverOff}\n onMouseLeave={_hoverOff}\n className={classes.barWrapper}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n );\n });\n return bars;\n }\n\n const _getAriaLabel = (point: ChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue =\n point.yAxisCalloutData ||\n (point.horizontalBarChartdata\n ? `${point.horizontalBarChartdata.x}/${point.horizontalBarChartdata.total ?? ''}`\n : 0);\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 React.useEffect(() => {\n const svgWidth = barChartSvgRef?.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n setBarSpacingInPercent(currentBarSpacing);\n }\n }, [barChartSvgRef]);\n\n function _legendHighlighted(barLegend?: string) {\n if (barLegend === undefined) {\n return false;\n }\n return selectedLegend === barLegend || (selectedLegend === '' && activeLegend === barLegend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n const { data } = props;\n _adjustProps();\n const classes = useHorizontalBarChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const legendButtons = _createLegends(data!);\n\n let datapoint: number | undefined = 0;\n return !_isChartEmpty() ? (\n <div className={classes.root} onMouseLeave={_handleChartMouseLeave}>\n {data!.map((points: ChartProps, index: number) => {\n if (points.chartData && points.chartData![0] && points.chartData![0].horizontalBarChartdata!.x) {\n datapoint = points.chartData![0].horizontalBarChartdata!.x;\n } else {\n datapoint = 0;\n }\n isSingleBar = props.showLegendForSinglePointBar\n ? false\n : points.chartData!.length === 1 || (points.chartData!.length > 1 && points.chartData![1].legend === '');\n if (isSingleBar) {\n points.chartData![1] = {\n legend: '',\n horizontalBarChartdata: {\n x: points.chartData![0].horizontalBarChartdata!.total! - datapoint!,\n total: points.chartData![0].horizontalBarChartdata!.total!,\n },\n color: tokens.colorBackgroundOverlay,\n };\n }\n\n // Hide right side text of chart title for absolute-scale variant\n const chartDataText =\n props.variant === HorizontalBarChartVariant.AbsoluteScale ? null : _getChartDataText(points!);\n const bars = _createBars(points!);\n const keyVal = _uniqLineText + '_' + index;\n // ToDo - Showtriangle property is per data series. How to account for it in the new stylesheet\n /* const classes = useHorizontalBarChartStyles(props.styles!, {\n width: props.width,\n showTriangle: !!points!.chartData![0].data,\n variant: props.variant,\n }); */\n\n return (\n <div key={index}>\n <div className={classes.items} {...focusAttributes}>\n <div className={classes.chartTitle}>\n {points!.chartTitle && (\n <FocusableTooltipText\n className={classes.chartTitleLeft}\n content={points!.chartTitle}\n accessibilityData={points!.chartTitleAccessibilityData}\n />\n )}\n {chartDataText}\n </div>\n {points!.chartData![0].data && _createBenchmark(points!)}\n <svg ref={barChartSvgRef} className={classes.chart} aria-label={points!.chartTitle}>\n <g\n id={keyVal}\n ref={(e: SVGGElement) => {\n _refCallback(e, points!.chartData![0].legend);\n }}\n // NOTE: points.chartData![0] contains current data value\n onClick={() => {\n const p = points!.chartData![0];\n if (p && p.onClick) {\n p.onClick();\n }\n }}\n >\n {bars}\n </g>\n </svg>\n </div>\n </div>\n );\n })}\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n legend={legend!}\n YValue={hoverValue!}\n color={lineColor}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerHorizontalBar\n ? props.onRenderCalloutPerHorizontalBar(barCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(barCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!isSingleBar && (\n <div ref={(e: HTMLDivElement) => (legendContainer.current = e)} className={classes.legendContainer}>\n {legendButtons}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n //TODO validate and fix focus border for issue for popover\n});\nHorizontalBarChart.displayName = 'HorizontalBarChart';\n"],"names":["React","useHorizontalBarChartStyles","HorizontalBarChartVariant","formatToLocaleString","formatScientificLimitWidth","getAccessibleDataObject","useRtl","useId","tokens","useFocusableGroup","ChartPopover","FocusableTooltipText","Legends","HorizontalBarChart","forwardRef","props","forwardedRef","legendContainer","useRef","_uniqLineText","_refArray","_isRTL","barChartSvgRef","createRef","_emptyChartId","_barHeight","_calloutAnchorPoint","isSingleBar","_showToolTipOnSegment","hideTooltip","hoverValue","setHoverValue","useState","lineColor","setLineColor","legend","setLegend","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","barCalloutProps","setBarCalloutProps","barSpacingInPercent","setBarSpacingInPercent","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","x","y","selectedLegend","setSelectedLegend","activeLegend","setActiveLegend","_refCallback","element","legendTitle","push","index","refElement","_hoverOn","event","hoverVal","point","_legendHighlighted","_noLegendHighlighted","clientX","clientY","targetRect","target","getBoundingClientRect","left","width","top","height","updatePosition","color","xAxisCalloutData","yAxisCalloutData","_hoverOff","_handleChartMouseLeave","_adjustProps","barHeight","_getChartDataText","data","_getDefaultTextData","_createLegends","chartProps","legendItems","flatMap","chartData","map","dataPoint","title","action","hoverAction","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","legendProps","chartDataMode","culture","accessibilityData","chartDataAccessibilityData","total","reduce","acc","horizontalBarChartdata","div","className","classes","chartTitleRight","span","chartDataTextDenominator","dataRatioPercentage","Math","round","_createBenchmark","undefined","totalData","benchmarkData","benchmarkRatio","benchmarkStyles","benchmarkContainer","triangle","style","_createBars","noOfBars","count","totalMarginPercent","defaultColors","colorPaletteBlueForeground2","colorPaletteCornflowerForeground2","colorPaletteDarkGreenForeground2","colorPaletteNavyForeground2","colorPaletteDarkOrangeForeground2","startingPoint","prevPosition","value","sumOfPercent","pointData","scalingRatio","bars","floor","random","xValue","placeholderIndex","isLegendSelected","variant","AbsoluteScale","hideLabels","text","key","barValue","dominantBaseline","transform","barLabel","aria-hidden","rect","fill","onMouseOver","onFocus","role","aria-label","_getAriaLabel","onBlur","onMouseLeave","barWrapper","opacity","tabIndex","yValue","callOutAccessibilityData","ariaLabel","_isChartEmpty","length","newX","newY","threshold","distance","sqrt","pow","useEffect","svgWidth","current","MARGIN_WIDTH_IN_PX","currentBarSpacing","barLegend","focusAttributes","legendButtons","datapoint","root","points","showLegendForSinglePointBar","colorBackgroundOverlay","chartDataText","keyVal","items","chartTitle","chartTitleLeft","content","chartTitleAccessibilityData","svg","ref","chart","g","id","e","onClick","p","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerHorizontalBar","customCalloutProps","calloutP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QACAkG,aAAa;QAEd,CAAChM,6BACA,oBAACoF;QAAI8F,KAAK,CAACI,IAAuBhM,gBAAgByK,OAAO,GAAGuB;QAAIjG,WAAWC,QAAQhG,eAAe;OAC/F8K,gCAKP,oBAAChF;QAAIiG,IAAIxL;QAAe6I,MAAM;QAASrC,OAAO;YAAE2C,SAAS;QAAI;QAAGL,cAAY;;AAE9E,0DAA0D;AAC5D,GAAG;AACHzJ,mBAAmB+M,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/HorizontalBarChart/HorizontalBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useHorizontalBarChartStyles } from './useHorizontalBarChartStyles.styles';\nimport { ChartProps, HorizontalBarChartProps, ChartDataPoint, RefArrayData, HorizontalBarChartVariant } from './index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { formatScientificLimitWidth, getAccessibleDataObject, useRtl } from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { Legend, Legends } from '../../index';\n\n/**\n * HorizontalBarChart is the context wrapper and container for all HorizontalBarChart content/controls,\n * It has no direct style or slot opinions.\n *\n * HorizontalBarChart also provides API interfaces for callbacks that will occur on navigation events.\n */\nexport const HorizontalBarChart: React.FunctionComponent<HorizontalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartProps\n>((props, forwardedRef) => {\n const legendContainer = React.useRef<HTMLDivElement | null>(null);\n const _uniqLineText: string = useId('_HorizontalLine_');\n const _refArray: RefArrayData[] = [];\n const _isRTL: boolean = useRtl();\n const barChartSvgRef: React.RefObject<SVGSVGElement> = React.createRef<SVGSVGElement>();\n const _emptyChartId: string = useId('_HBC_empty');\n let _barHeight: number;\n let _calloutAnchorPoint: ChartDataPoint | null;\n let isSingleBar: boolean = true;\n let _showToolTipOnSegment: boolean = !props.hideTooltip;\n\n const [hoverValue, setHoverValue] = React.useState<string | number | Date | null>('');\n const [lineColor, setLineColor] = React.useState<string>('');\n const [legend, setLegend] = React.useState<string | null>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string | undefined>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string | undefined>('');\n const [barCalloutProps, setBarCalloutProps] = React.useState<ChartDataPoint>();\n const [barSpacingInPercent, setBarSpacingInPercent] = React.useState<number>(0);\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n\n function _refCallback(element: SVGGElement, legendTitle: string | undefined): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _hoverOn(\n event: React.FocusEvent<SVGRectElement> | React.MouseEvent<SVGRectElement>,\n hoverVal: string | number | Date,\n point: ChartDataPoint,\n ): void {\n if (\n (!isPopoverOpen || legend !== point.legend!) &&\n _calloutAnchorPoint !== point &&\n (_legendHighlighted(point.legend) || _noLegendHighlighted())\n ) {\n _calloutAnchorPoint = point;\n let x = 0;\n let y = 0;\n\n if ('clientX' in event && event.clientX && event.clientY) {\n // Mouse event\n x = event.clientX;\n y = event.clientY;\n } else {\n // Focus event\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n }\n\n updatePosition(x, y);\n setHoverValue(hoverVal);\n setLineColor(point.color!);\n setLegend(point.legend!);\n setXCalloutValue(point.xAxisCalloutData!);\n setYCalloutValue(point.yAxisCalloutData!);\n setBarCalloutProps(point);\n // ToDo - Confirm setting multiple state variables like this is performant.\n }\n }\n\n function _hoverOff(): void {\n /*ToDo. To fix*/\n }\n\n const _handleChartMouseLeave = () => {\n _calloutAnchorPoint = null;\n if (isPopoverOpen) {\n setPopoverOpen(false);\n setHoverValue('');\n setLineColor('');\n setLegend('');\n }\n };\n\n const _adjustProps = (): void => {\n _barHeight = props.barHeight || 12;\n };\n\n const _getChartDataText = (data: ChartProps) => {\n /* return props.barChartCustomData ? (\n <div role=\"text\">{props.barChartCustomData(data)}</div>\n ) : ( */\n return _getDefaultTextData(data);\n //)\n };\n\n function _createLegends(chartProps: ChartProps[]): JSXElement {\n const legendItems: Legend[] = chartProps.flatMap(\n point =>\n point.chartData?.map((dataPoint): Legend => {\n const legend = dataPoint.legend ?? '';\n const color = dataPoint.color ?? '';\n\n return {\n title: legend,\n color,\n action: () => setSelectedLegend(selectedLegend === legend ? '' : legend),\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legend);\n },\n onMouseOutAction: () => setActiveLegend(''),\n };\n }) ?? [],\n );\n\n return (\n <Legends legends={legendItems} centerLegends overflowText={props.legendsOverflowText} {...props.legendProps} />\n );\n }\n\n function _getDefaultTextData(data: ChartProps): JSXElement {\n const chartDataMode = props.chartDataMode || 'default';\n\n if (chartDataMode === 'hidden') {\n return <></>; // No text data for hidden mode\n }\n\n const { culture } = props;\n const accessibilityData = getAccessibleDataObject(data.chartDataAccessibilityData!, 'text', false);\n if (!isSingleBar) {\n const total = data.chartData!.reduce(\n (acc: number, point: ChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0),\n 0,\n );\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {formatToLocaleString(total, culture) as React.ReactNode}\n </div>\n );\n }\n\n const chartData: ChartDataPoint = data!.chartData![0];\n const x = chartData.horizontalBarChartdata!.x;\n const y = chartData.horizontalBarChartdata!.total!;\n\n switch (chartDataMode) {\n case 'default':\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {formatToLocaleString(x, culture) as React.ReactNode}\n </div>\n );\n case 'fraction':\n return (\n <div {...accessibilityData}>\n <span className={classes.chartTitleRight}>{formatToLocaleString(x, culture) as React.ReactNode}</span>\n <span className={classes.chartDataTextDenominator}>{' / ' + formatToLocaleString(y, culture)}</span>\n </div>\n );\n case 'percentage':\n const dataRatioPercentage = `${formatToLocaleString(Math.round((x / y) * 100), culture)}%`;\n return (\n <div className={classes.chartTitleRight} {...accessibilityData}>\n {dataRatioPercentage}\n </div>\n );\n }\n }\n\n function _createBenchmark(data: ChartProps): JSXElement {\n if (data.chartData![0].horizontalBarChartdata!.total === undefined) {\n return <></>;\n }\n const totalData = data.chartData![0].horizontalBarChartdata!.total!;\n const benchmarkData = data.chartData![0].data;\n const benchmarkRatio = Math.round(((benchmarkData ? benchmarkData : 0) / totalData) * 100);\n\n const benchmarkStyles = {\n left: 'calc(' + benchmarkRatio + '% - 4px)',\n };\n\n return (\n <div className={classes.benchmarkContainer}>\n <div className={classes.triangle} style={benchmarkStyles} />\n </div>\n );\n }\n\n /**\n * This functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing in between the bars\n */\n\n function _createBars(data: ChartProps): JSXElement[] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: ChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = barSpacingInPercent * (noOfBars - 1);\n const defaultColors: string[] = [\n tokens.colorPaletteBlueForeground2,\n tokens.colorPaletteCornflowerForeground2,\n tokens.colorPaletteDarkGreenForeground2,\n tokens.colorPaletteNavyForeground2,\n tokens.colorPaletteDarkOrangeForeground2,\n ];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: ChartDataPoint) =>\n acc + (point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n data.chartData!.map((point: ChartDataPoint, index: number) => {\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? (sumOfPercent - totalMarginPercent) / 100 : 1;\n\n const bars = data.chartData!.map((point: ChartDataPoint, index: number) => {\n const color: string = point.color ? point.color : defaultColors[Math.floor(Math.random() * 4 + 1)];\n const pointData = point.horizontalBarChartdata!.x ? point.horizontalBarChartdata!.x : 0;\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 0) {\n value = 0;\n } else if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n startingPoint.push(prevPosition);\n\n const xValue = point.horizontalBarChartdata!.x;\n const placeholderIndex = 1;\n const isLegendSelected: boolean = _legendHighlighted(point.legend) || _noLegendHighlighted();\n\n // Render bar label instead of placeholder bar for absolute-scale variant\n if (index === placeholderIndex && props.variant === HorizontalBarChartVariant.AbsoluteScale) {\n if (props.hideLabels) {\n return <text key={index} />;\n }\n\n const barValue = data.chartData![0].horizontalBarChartdata!.x;\n\n return (\n <text\n key={index}\n x={`${_isRTL ? 100 - startingPoint[index] : startingPoint[index]}%`}\n y={_barHeight / 2}\n dominantBaseline=\"central\"\n transform={`translate(${_isRTL ? -4 : 4})`}\n className={classes.barLabel}\n aria-hidden={true}\n >\n {formatScientificLimitWidth(barValue)}\n </text>\n );\n }\n\n return (\n <rect\n key={index}\n x={`${\n _isRTL\n ? 100 - startingPoint[index] - value - index * barSpacingInPercent\n : startingPoint[index] + index * barSpacingInPercent\n }%`}\n y={0}\n width={value + '%'}\n height={_barHeight}\n fill={color}\n onMouseOver={\n _showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined\n }\n onFocus={_showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n onBlur={_hoverOff}\n onMouseLeave={_hoverOff}\n className={classes.barWrapper}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n );\n });\n return bars;\n }\n\n const _getAriaLabel = (point: ChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue =\n point.yAxisCalloutData ||\n (point.horizontalBarChartdata\n ? `${point.horizontalBarChartdata.x}/${point.horizontalBarChartdata.total ?? ''}`\n : 0);\n return point.callOutAccessibilityData?.ariaLabel || (legend ? `${legend}, ` : '') + `${yValue}.`;\n };\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 React.useEffect(() => {\n const svgWidth = barChartSvgRef?.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n setBarSpacingInPercent(currentBarSpacing);\n }\n }, [barChartSvgRef]);\n\n function _legendHighlighted(barLegend?: string) {\n if (barLegend === undefined) {\n return false;\n }\n return selectedLegend === barLegend || (selectedLegend === '' && activeLegend === barLegend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n const { data } = props;\n _adjustProps();\n const classes = useHorizontalBarChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const legendButtons = _createLegends(data!);\n\n let datapoint: number | undefined = 0;\n return !_isChartEmpty() ? (\n <div className={classes.root} onMouseLeave={_handleChartMouseLeave}>\n {data!.map((points: ChartProps, index: number) => {\n if (points.chartData && points.chartData![0] && points.chartData![0].horizontalBarChartdata!.x) {\n datapoint = points.chartData![0].horizontalBarChartdata!.x;\n } else {\n datapoint = 0;\n }\n isSingleBar = props.showLegendForSinglePointBar\n ? false\n : points.chartData!.length === 1 || (points.chartData!.length > 1 && points.chartData![1].legend === '');\n if (isSingleBar) {\n points.chartData![1] = {\n legend: '',\n horizontalBarChartdata: {\n x: points.chartData![0].horizontalBarChartdata!.total! - datapoint!,\n total: points.chartData![0].horizontalBarChartdata!.total!,\n },\n color: tokens.colorBackgroundOverlay,\n };\n }\n\n // Hide right side text of chart title for absolute-scale variant\n const chartDataText =\n props.variant === HorizontalBarChartVariant.AbsoluteScale ? null : _getChartDataText(points!);\n const bars = _createBars(points!);\n const keyVal = _uniqLineText + '_' + index;\n // ToDo - Showtriangle property is per data series. How to account for it in the new stylesheet\n /* const classes = useHorizontalBarChartStyles(props.styles!, {\n width: props.width,\n showTriangle: !!points!.chartData![0].data,\n variant: props.variant,\n }); */\n\n return (\n <div key={index}>\n <div className={classes.items} {...focusAttributes}>\n <div className={classes.chartTitle}>\n {points!.chartTitle && (\n <FocusableTooltipText\n className={classes.chartTitleLeft}\n content={points!.chartTitle}\n accessibilityData={points!.chartTitleAccessibilityData}\n />\n )}\n {chartDataText}\n </div>\n {points!.chartData![0].data && _createBenchmark(points!)}\n <svg ref={barChartSvgRef} className={classes.chart} aria-label={points!.chartTitle}>\n <g\n id={keyVal}\n ref={(e: SVGGElement) => {\n _refCallback(e, points!.chartData![0].legend);\n }}\n // NOTE: points.chartData![0] contains current data value\n onClick={() => {\n const p = points!.chartData![0];\n if (p && p.onClick) {\n p.onClick();\n }\n }}\n >\n {bars}\n </g>\n </svg>\n </div>\n </div>\n );\n })}\n <ChartPopover\n xCalloutValue={xCalloutValue}\n yCalloutValue={yCalloutValue}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n legend={legend!}\n YValue={hoverValue!}\n color={lineColor}\n isCalloutForStack={false}\n customCallout={{\n customizedCallout: props.onRenderCalloutPerHorizontalBar\n ? props.onRenderCalloutPerHorizontalBar(barCalloutProps!)\n : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(barCalloutProps!)\n : undefined,\n }}\n isCartesian={false}\n />\n {!isSingleBar && (\n <div ref={(e: HTMLDivElement) => (legendContainer.current = e)} className={classes.legendContainer}>\n {legendButtons}\n </div>\n )}\n </div>\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n //TODO validate and fix focus border for issue for popover\n});\nHorizontalBarChart.displayName = 'HorizontalBarChart';\n"],"names":["React","useHorizontalBarChartStyles","HorizontalBarChartVariant","formatToLocaleString","formatScientificLimitWidth","getAccessibleDataObject","useRtl","useId","tokens","useFocusableGroup","ChartPopover","FocusableTooltipText","Legends","HorizontalBarChart","forwardRef","props","forwardedRef","legendContainer","useRef","_uniqLineText","_refArray","_isRTL","barChartSvgRef","createRef","_emptyChartId","_barHeight","_calloutAnchorPoint","isSingleBar","_showToolTipOnSegment","hideTooltip","hoverValue","setHoverValue","useState","lineColor","setLineColor","legend","setLegend","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","barCalloutProps","setBarCalloutProps","barSpacingInPercent","setBarSpacingInPercent","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","x","y","selectedLegend","setSelectedLegend","activeLegend","setActiveLegend","_refCallback","element","legendTitle","push","index","refElement","_hoverOn","event","hoverVal","point","_legendHighlighted","_noLegendHighlighted","clientX","clientY","targetRect","target","getBoundingClientRect","left","width","top","height","updatePosition","color","xAxisCalloutData","yAxisCalloutData","_hoverOff","_handleChartMouseLeave","_adjustProps","barHeight","_getChartDataText","data","_getDefaultTextData","_createLegends","chartProps","legendItems","flatMap","chartData","map","dataPoint","title","action","hoverAction","onMouseOutAction","legends","centerLegends","overflowText","legendsOverflowText","legendProps","chartDataMode","culture","accessibilityData","chartDataAccessibilityData","total","reduce","acc","horizontalBarChartdata","div","className","classes","chartTitleRight","span","chartDataTextDenominator","dataRatioPercentage","Math","round","_createBenchmark","undefined","totalData","benchmarkData","benchmarkRatio","benchmarkStyles","benchmarkContainer","triangle","style","_createBars","noOfBars","count","totalMarginPercent","defaultColors","colorPaletteBlueForeground2","colorPaletteCornflowerForeground2","colorPaletteDarkGreenForeground2","colorPaletteNavyForeground2","colorPaletteDarkOrangeForeground2","startingPoint","prevPosition","value","sumOfPercent","pointData","scalingRatio","bars","floor","random","xValue","placeholderIndex","isLegendSelected","variant","AbsoluteScale","hideLabels","text","key","barValue","dominantBaseline","transform","barLabel","aria-hidden","rect","fill","onMouseOver","onFocus","role","aria-label","_getAriaLabel","onBlur","onMouseLeave","barWrapper","opacity","tabIndex","yValue","callOutAccessibilityData","ariaLabel","_isChartEmpty","length","newX","newY","threshold","distance","sqrt","pow","useEffect","svgWidth","current","MARGIN_WIDTH_IN_PX","currentBarSpacing","barLegend","focusAttributes","legendButtons","datapoint","root","points","showLegendForSinglePointBar","colorBackgroundOverlay","chartDataText","keyVal","items","chartTitle","chartTitleLeft","content","chartTitleAccessibilityData","svg","ref","chart","g","id","e","onClick","p","YValue","isCalloutForStack","customCallout","customizedCallout","onRenderCalloutPerHorizontalBar","customCalloutProps","calloutPropsPerDataPoint","isCartesian","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uCAAuC;AACnF,SAA4EC,yBAAyB,QAAQ,UAAU;AACvH,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,0BAA0B,EAAEC,uBAA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C,SAAS;QAAI;QAAGL,cAAY;;AAE9E,0DAA0D;AAC5D,GAAG;AACHzJ,mBAAmB+M,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/HorizontalBarChart/HorizontalBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { ChartDataPoint, ChartProps } from './index';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Horizontal Bar Chart properties\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * An array of chart data points for the Horizontal bar chart\n */\n data?: ChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * This property tells how to show data text on top right of bar chart.\n * If barChartCustomData props added, then this props will be overrided.\n * @default 'default'\n */\n chartDataMode?: ChartDataMode;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartStyles;\n\n /**\n * Define a custom callout renderer for a horizontal bar\n */\n // onRenderCalloutPerHorizontalBar?: IRenderFunction<IChartDataPoint>; ToDo - Need to use slots here.\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Custom text to the chart (right side of the chart)\n * IChartProps will be available as props to the method prop.\n * If this method not given, default values (IHorizontalDataPoint \\{x,y\\})\n * will be used to display the data/text based on given chartModeData prop.\n */\n // barChartCustomData?: IRenderFunction<IChartProps>; ToDo - Need to use slots here.\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of HorizontalBarChart to render\n * @default HorizontalBarChartVariant.PartToWhole\n */\n variant?: HorizontalBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * line color for callout\n */\n color?: string;\n\n /**\n * prop to check if benchmark data is provided\n */\n showTriangle?: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * prop to render the custom callout\n */\n onRenderCalloutPerHorizontalBar?: (props: ChartDataPoint) =>
|
|
1
|
+
{"version":3,"sources":["../src/components/HorizontalBarChart/HorizontalBarChart.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport { ChartDataPoint, ChartProps } from './index';\nimport { LegendsProps } from '../Legends/index';\n\n/**\n * Horizontal Bar Chart properties\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * An array of chart data points for the Horizontal bar chart\n */\n data?: ChartProps[];\n\n /**\n * Width of bar chart\n */\n width?: number;\n\n /**\n * Height of bar chart\n * @default 15\n */\n barHeight?: number;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * This property tells whether to show ratio on top of stacked bar chart or not.\n */\n hideRatio?: boolean[];\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * This property tells how to show data text on top right of bar chart.\n * If barChartCustomData props added, then this props will be overrided.\n * @default 'default'\n */\n chartDataMode?: ChartDataMode;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: HorizontalBarChartStyles;\n\n /**\n * Define a custom callout renderer for a horizontal bar\n */\n // onRenderCalloutPerHorizontalBar?: IRenderFunction<IChartDataPoint>; ToDo - Need to use slots here.\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: ChartPopoverProps;\n\n /**\n * Custom text to the chart (right side of the chart)\n * IChartProps will be available as props to the method prop.\n * If this method not given, default values (IHorizontalDataPoint \\{x,y\\})\n * will be used to display the data/text based on given chartModeData prop.\n */\n // barChartCustomData?: IRenderFunction<IChartProps>; ToDo - Need to use slots here.\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop to define the variant of HorizontalBarChart to render\n * @default HorizontalBarChartVariant.PartToWhole\n */\n variant?: HorizontalBarChartVariant;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * line color for callout\n */\n color?: string;\n\n /**\n * prop to check if benchmark data is provided\n */\n showTriangle?: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * prop to render the custom callout\n */\n onRenderCalloutPerHorizontalBar?: (props: ChartDataPoint) => JSXElement | undefined;\n\n /**\n * Define a custom callout props override\n */\n calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;\n\n /**\n * When true, chart will display legends even if a bar ( row ) has only one data point.\n * @default false\n */\n showLegendForSinglePointBar?: boolean;\n}\n\n/**\n * Horizontal Bar Chart styles\n * {@docCategory HorizontalBarChart}\n */\nexport interface HorizontalBarChartStyles {\n /**\n * Styling for the root container\n */\n root: string;\n\n /**\n * Styling for each item in the container\n */\n items: string;\n\n /**\n * Style for the chart.\n */\n chart: string;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: string;\n\n /**\n * Style for the bars.\n */\n barWrapper: string;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: string;\n\n /**\n * Style for right side text of the chart title\n */\n chartTitleRight: string;\n\n /**\n * Style for the chart data text denominator.\n */\n chartDataTextDenominator: string;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: string;\n\n /**\n * Style for the benchmark triangle\n */\n triangle: string;\n\n /**\n * Style for the bar labels\n */\n barLabel: string;\n\n /**\n * Style for the div containing the chart\n */\n chartWrapper: string;\n\n /**\n * Style for the legend container.\n */\n legendContainer: string;\n}\n\n/**\n * Chart data mode for chart data text\n * default: show the datapoint.x value\n * fraction: show the fraction of datapoint.x/datapoint.y\n * percentage: show the percentage of (datapoint.x/datapoint.y)%\n * hidden: do not show any data text\n * {@docCategory HorizontalBarChart}\n */\nexport type ChartDataMode = 'default' | 'fraction' | 'percentage' | 'hidden';\n\n/**\n * {@docCategory HorizontalBarChart}\n */\nexport enum HorizontalBarChartVariant {\n PartToWhole = 'part-to-whole',\n AbsoluteScale = 'absolute-scale',\n}\n"],"names":["React","HorizontalBarChartVariant"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AA+M/B;;CAEC,GACD,OAAO,IAAA,AAAKC,mDAAAA;;;WAAAA;MAGX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear, ScaleLinear as D3ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\nimport { Legend, LegendContainer } from '../../components/Legends/Legends.types';\nimport { Legends } from '../../components/Legends/Legends';\nimport { useId } from '@fluentui/react-utilities';\nimport {\n AccessibilityProps,\n HorizontalBarChartWithAxisDataPoint,\n RefArrayData,\n Margins,\n ChartPopoverProps,\n Chart,\n ImageExportOptions,\n} from '../../index';\nimport { ChildProps } from '../CommonComponents/CartesianChart.types';\nimport { CartesianChart } from '../CommonComponents/CartesianChart';\nimport { HorizontalBarChartWithAxisProps } from './HorizontalBarChartWithAxis.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n YAxisType,\n XAxisTypes,\n NumericAxis,\n StringAxis,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n domainRangeOfNumericForHorizontalBarChartWithAxis,\n createStringYAxisForHorizontalBarChartWithAxis,\n areArraysEqual,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n computeLongestBars,\n groupChartDataByYValue,\n MIN_DOMAIN_MARGIN,\n} from '../../utilities/index';\nimport { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';\nimport { toImage } from '../../utilities/image-export-utils';\ntype ColorScale = (_p?: number) => string;\n\nexport const HorizontalBarChartWithAxis: React.FunctionComponent<HorizontalBarChartWithAxisProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartWithAxisProps\n>((props, forwardedRef) => {\n const _refArray: RefArrayData[] = [];\n const _calloutId: string = useId('callout');\n const _isRtl: boolean = useRtl();\n const _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].x, true) as XAxisTypes)\n : XAxisTypes.NumericAxis;\n const _yAxisType: YAxisType =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].y, false) as YAxisType)\n : YAxisType.StringAxis;\n const _emptyChartId: string = useId('_HBCWithAxis_empty');\n let _points: HorizontalBarChartWithAxisDataPoint[] = [];\n let _barHeight: number = 0;\n let _colors: string[] = [];\n let _margins: Margins;\n let _bars: JSX.Element[];\n let _yAxisLabels: string[];\n let _xMax: number;\n let _calloutAnchorPoint: HorizontalBarChartWithAxisDataPoint | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _longestBarPositiveTotalValue: number;\n let _longestBarNegativeTotalValue: number;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _yAxisPadding: number = props.yAxisPadding ?? 0.5;\n const cartesianChartRef = React.useRef<Chart>(null);\n const X_ORIGIN: number = 0;\n const _legendsRef = React.useRef<LegendContainer>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [isLegendSelected, setIsLegendSelected] = React.useState<boolean>(\n (props.legendProps?.selectedLegends && props.legendProps.selectedLegends.length > 0) ||\n props.legendProps?.selectedLegend !== undefined,\n );\n const [isLegendHovered, setIsLegendHovered] = React.useState<boolean>(false);\n const [selectedLegendTitle, setSelectedLegendTitle] = React.useState<string>(props.legendProps?.selectedLegend ?? '');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<HorizontalBarChartWithAxisDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const prevPropsRef = React.useRef<HorizontalBarChartWithAxisProps | null>(null);\n\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 }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barHeight = props.barHeight || 32;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n ];\n _colors = props.colors! || defaultPalette;\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _renderContentForOnlyBars(point: HorizontalBarChartWithAxisDataPoint): JSX.Element {\n const { useSingleColor = false } = props;\n let selectedPointIndex = 0;\n props.data!.forEach((yDataPoint: HorizontalBarChartWithAxisDataPoint, index: number) => {\n if (yDataPoint.y === point.y) {\n selectedPointIndex = index;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let color: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n color = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n color = point.color ? point.color : props.colors ? _createColors()(point.x) : getNextColor(selectedPointIndex, 0);\n }\n return (\n <>\n <ChartPopover\n XValue={point.xAxisCalloutData || point.x.toString()}\n legend={point.legend}\n YValue={point.yAxisCalloutData || point.y}\n color={color}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n />\n </>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _renderCallout(props?: HorizontalBarChartWithAxisDataPoint): JSX.Element | null {\n return props ? _renderContentForOnlyBars(props) : null;\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _getGraphData(\n xScale: NumericAxis,\n yScale: NumericAxis | StringAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yElement?: SVGElement | null,\n ) {\n const stackedChartData = groupChartDataByYValue(_points);\n const longestBars = computeLongestBars(stackedChartData, X_ORIGIN);\n _longestBarPositiveTotalValue = longestBars.longestPositiveBar;\n _longestBarNegativeTotalValue = longestBars.longestNegativeBar;\n\n const { xBarScale, yBarScale } =\n _yAxisType === YAxisType.NumericAxis\n ? _getScales(containerHeight, containerWidth, true)\n : _getScales(containerHeight, containerWidth, false);\n const xRange = xBarScale.range();\n let allBars: JSX.Element[] = [];\n // when the chart mounts, the xRange[1] is sometimes seen to be < 0 (like -40) while xRange[0] > 0.\n if (xRange[0] < xRange[1]) {\n allBars = stackedChartData\n .map(singleBarData =>\n _yAxisType === YAxisType.NumericAxis\n ? _createNumericBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n )\n : _createStringBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n ),\n )\n .flat();\n }\n\n return (_bars = allBars);\n }\n\n function _createColors(): D3ScaleLinear<string, string> | ColorScale {\n const increment = _colors.length <= 1 ? 1 : 1 / (_colors.length - 1);\n const { useSingleColor = false } = props;\n if (useSingleColor) {\n return (_p?: number) => {\n const { colors } = props;\n return colors && colors.length > 0 ? colors[0] : getColorFromToken(DataVizPalette.color16);\n };\n }\n const domainValues = [];\n for (let i = 0; i < _colors.length; i++) {\n domainValues.push(increment * i * _xMax);\n }\n const colorScale = d3ScaleLinear<string>().domain(domainValues).range(_colors);\n return colorScale;\n }\n\n function _refCallback(element: SVGRectElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _onBarHover(\n point: HorizontalBarChartWithAxisDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n color: string,\n mouseEvent: React.MouseEvent<SVGElement, MouseEvent>,\n ): void {\n mouseEvent.persist();\n // eslint-disable-next-line @typescript-eslint/no-shadow\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n _calloutAnchorPoint = point;\n setPopoverOpen(true);\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setDataForHoverCard(point.x);\n setSelectedLegendTitle(point.legend!);\n setColor(props.useSingleColor || props.enableGradient ? color : point.color!);\n // To display callout value, if no callout value given, taking given point.x value as a string.\n setXCalloutValue(point.yAxisCalloutData! || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _onBarLeave(): void {\n setPopoverOpen(false);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _onBarFocus(\n event: React.FocusEvent<SVGRectElement, Element>,\n point: HorizontalBarChartWithAxisDataPoint,\n refArrayIndexNumber: number,\n color: string,\n ): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (refArrayIndexNumber === index) {\n setPopoverOpen(true);\n setSelectedLegendTitle(point.legend!);\n setDataForHoverCard(point.x);\n setColor(props.useSingleColor ? color : point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n });\n }\n }\n\n function _getScales(\n containerHeight: number,\n containerWidth: number,\n isNumericScale: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): { xBarScale: any; yBarScale: any } {\n const xMax = _longestBarPositiveTotalValue;\n const xMin = _longestBarNegativeTotalValue;\n const xDomain = [Math.min(X_ORIGIN, xMin), Math.max(X_ORIGIN, xMax)];\n if (isNumericScale) {\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yMin = d3Min(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yDomainMax = Math.max(yMax, props.yMaxValue || 0);\n // Default to 0 if yMinValue is not provided.\n const yMinProp = props.yMinValue || 0;\n const yDomainMin = Math.min(yMin, yMinProp);\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n const yBarScale = d3ScaleLinear()\n .domain([yDomainMin, yDomainMax])\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin]);\n return { xBarScale, yBarScale };\n } else {\n // please note these padding default values must be consistent in here\n // and CatrtesianChartBase w for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n const yBarScale = d3ScaleBand()\n .domain(_yAxisLabels)\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin])\n .padding(_yAxisPadding);\n\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n return { xBarScale, yBarScale };\n }\n }\n\n function _createNumericBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n const sortedBars: HorizontalBarChartWithAxisDataPoint[] = [...singleBarData];\n sortedBars.sort((a, b) => {\n const aValue = typeof a.y === 'number' ? a.y : parseFloat(a.y);\n const bValue = typeof b.y === 'number' ? b.y : parseFloat(b.y);\n return bValue - aValue;\n });\n\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n\n const bars = sortedBars.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > X_ORIGIN ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n prevPoint = point.x;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n key={point.y}\n x={xStart}\n y={yBarScale(point.y) - _barHeight / 2}\n data-is-focusable={shouldHighlight}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n rx={props.roundCorners ? 3 : 0}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n aria-labelledby={`toolTip${_calloutId}`}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n onBlur={_onBarLeave}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _getUniqueYValues() {\n const mapY: Record<string, number | string> = {};\n props.data?.forEach((point: HorizontalBarChartWithAxisDataPoint) => {\n mapY[point.y] = point.y;\n });\n const uniqueY = Object.values(mapY);\n return uniqueY;\n }\n\n function _calculateAppropriateBarHeight(data: number[] | Date[], totalWidth: number, innerPadding: number) {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const closestPairDiff = result[0];\n let range = result[1];\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n // Since we are always rendering from 0 to yMax, we need to ensure that the range is at least yMax\n // to calculate the bar height correctly.\n range = Math.max(range, yMax);\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n }\n\n function _getDomainMarginsForHorizontalBarChart(containerHeight: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n const uniqueY = _getUniqueYValues();\n /** Rate at which the space between the bars changes wrt the bar height */\n _yAxisPadding = _yAxisPadding === 1 ? 0.99 : _yAxisPadding;\n const barGapRate = _yAxisPadding / (1 - _yAxisPadding);\n const numBars = uniqueY.length + (uniqueY.length - 1) * barGapRate;\n // Total height available to render the bars\n const totalHeight = containerHeight - (_margins.top! + MIN_DOMAIN_MARGIN) - (_margins.bottom! + MIN_DOMAIN_MARGIN);\n if (_yAxisType !== YAxisType.StringAxis) {\n // Calculate bar height dynamically\n _barHeight =\n props.barHeight || _calculateAppropriateBarHeight(uniqueY as number[] | Date[], totalHeight, _yAxisPadding);\n _barHeight = Math.max(_barHeight, 1);\n _domainMargin += _barHeight / 2;\n } else {\n // Calculate the appropriate bar height\n _barHeight = props.barHeight || totalHeight / numBars;\n /** Total height required to render the bars. Directly proportional to bar height */\n const reqHeight = numBars * _barHeight;\n if (totalHeight >= reqHeight) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalHeight - reqHeight) / 2;\n }\n }\n\n return {\n ..._margins,\n top: _margins.top! + _domainMargin,\n bottom: _margins.bottom! + _domainMargin,\n };\n }\n\n function _createStringBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSX.Element[] {\n const { useSingleColor = false } = props;\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n const bars = singleBarData.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > 0 ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n prevPoint = point.x;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n transform={`translate(0,${0.5 * (yBarScale.bandwidth() - _barHeight)})`}\n key={point.x}\n x={xStart}\n y={yBarScale(point.y)}\n rx={props.roundCorners ? 3 : 0}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n aria-labelledby={`toolTip${_calloutId}`}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n onMouseLeave={_onBarLeave}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n opacity={shouldHighlight ? 1 : 0.1}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n fill={startColor}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _onLegendHover(customMessage: string): void {\n if (!_isLegendSelected()) {\n setIsLegendHovered(true);\n setSelectedLegendTitle(customMessage);\n }\n }\n\n function _onLegendLeave(isLegendFocused?: boolean): void {\n if (!!isLegendFocused || !_isLegendSelected()) {\n setIsLegendHovered(false);\n setSelectedLegendTitle('');\n setIsLegendSelected(isLegendFocused ? false : _isLegendSelected());\n }\n }\n\n function _getLegendData(data: HorizontalBarChartWithAxisDataPoint[]): JSX.Element {\n const { useSingleColor } = props;\n const actions: Legend[] = [];\n const mapLegendToColor: Record<string, string> = {};\n\n data.forEach((point: HorizontalBarChartWithAxisDataPoint, _index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const color: string = useSingleColor ? (props.colors ? _createColors()(1) : getNextColor(1, 0)) : point.color!;\n\n mapLegendToColor[point.legend!] = color;\n });\n Object.entries(mapLegendToColor).forEach(([legendTitle, color]) => {\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: legendTitle,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n // eslint-disable-next-line @typescript-eslint/no-shadow\n onMouseOutAction: (isLegendSelected?: boolean) => {\n _onLegendLeave(isLegendSelected);\n },\n };\n actions.push(legend);\n });\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n\n function _isLegendSelected(): boolean {\n return isLegendSelected!;\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(legend?: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : selectedLegendTitle ? [selectedLegendTitle] : [];\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n setSelectedLegendTitle(currentLegend?.title!);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n setSelectedLegendTitle(currentLegend?.title!);\n }\n setIsLegendSelected(selectedLegends.length > 0);\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n // For HBCWA x and y Values are swapped\n const { yAxisDomainValues: domainValue } = yAxisData;\n _xMax = Math.max(domainValue[domainValue.length - 1], props.xMaxValue || 0);\n }\n }\n function _getAriaLabel(point: HorizontalBarChartWithAxisDataPoint): string {\n const xValue = point.xAxisCalloutData || point.x;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ` + `${yValue}.`;\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Horizontal bar chart with ${data?.length || 0} bars. `;\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function _updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 _getDomainNRangeValues(\n points: HorizontalBarChartWithAxisDataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(\n points,\n margins,\n width,\n isRTL,\n shiftX,\n X_ORIGIN,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const calloutProps: ChartPopoverProps = {\n color: color,\n legend: selectedLegendTitle,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCartesian: true,\n isPopoverOpen,\n clickPosition,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const reversedBars = [..._points].reverse();\n _yAxisLabels = reversedBars.map((point: HorizontalBarChartWithAxisDataPoint) => point.y as string);\n _xMax = Math.max(d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x)!, props.xMaxValue || 0);\n const legendBars: JSX.Element = _getLegendData(_points);\n return (\n <CartesianChart\n yAxisPadding={_yAxisPadding}\n {...props}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.HorizontalBarChartWithAxis}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n getDomainNRangeValues={_getDomainNRangeValues}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n barwidth={_barHeight}\n getmargins={_getMargins}\n getYDomainMargins={_getDomainMarginsForHorizontalBarChart}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n </>\n );\n }}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n});\nHorizontalBarChartWithAxis.displayName = 'HorizontalBarChartWithAxis';\n"],"names":["React","max","d3Max","min","d3Min","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","Legends","useId","CartesianChart","ChartPopover","ChartTypes","getAccessibleDataObject","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","findHBCWANumericMinMaxOfY","createYAxisForHorizontalBarChartWithAxis","domainRangeOfNumericForHorizontalBarChartWithAxis","createStringYAxisForHorizontalBarChartWithAxis","areArraysEqual","useRtl","DataVizPalette","getColorFromToken","computeLongestBars","groupChartDataByYValue","MIN_DOMAIN_MARGIN","getClosestPairDiffAndRange","toImage","HorizontalBarChartWithAxis","forwardRef","props","forwardedRef","_refArray","_calloutId","_isRtl","_xAxisType","data","length","x","NumericAxis","_yAxisType","y","StringAxis","_emptyChartId","_points","_barHeight","_colors","_margins","_bars","_yAxisLabels","_xMax","_calloutAnchorPoint","_longestBarPositiveTotalValue","_longestBarNegativeTotalValue","_domainMargin","_yAxisPadding","yAxisPadding","cartesianChartRef","useRef","X_ORIGIN","_legendsRef","color","setColor","useState","dataForHoverCard","setDataForHoverCard","isLegendSelected","setIsLegendSelected","legendProps","selectedLegends","selectedLegend","undefined","isLegendHovered","setIsLegendHovered","selectedLegendTitle","setSelectedLegendTitle","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","setSelectedLegends","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","prevPropsRef","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_adjustProps","barHeight","defaultPalette","color6","color1","color5","color7","colors","_getMargins","margins","_renderContentForOnlyBars","point","useSingleColor","selectedPointIndex","forEach","yDataPoint","index","_createColors","XValue","xAxisCalloutData","toString","legend","YValue","yAxisCalloutData","culture","_renderCallout","_getCustomizedCallout","onRenderCalloutPerDataPoint","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","yElement","stackedChartData","longestBars","longestPositiveBar","longestNegativeBar","xBarScale","yBarScale","_getScales","xRange","range","allBars","map","singleBarData","_createNumericBars","_createStringBars","flat","increment","_p","color16","domainValues","i","push","colorScale","domain","_refCallback","element","legendTitle","refElement","_onBarHover","mouseEvent","persist","_isLegendHighlighted","_updatePosition","clientX","clientY","enableGradient","_onBarLeave","_handleChartMouseLeave","_onBarFocus","event","refArrayIndexNumber","cx","cy","targetRect","target","getBoundingClientRect","left","width","top","height","obj","isNumericScale","xMax","xMin","xDomain","Math","yMax","yMin","yDomainMax","yMaxValue","yMinProp","yMinValue","yDomainMin","nice","right","bottom","padding","sortedBars","sort","a","b","aValue","parseFloat","bValue","prevWidthPositive","prevWidthNegative","prevPoint","totalPositiveBars","filter","totalNegativeBars","currPositiveCounter","currNegativeCounter","bars","shouldHighlight","barStartX","Fragment","key","startColor","prevBarWidth","abs","currentWidth","gapWidthLTR","gapWidthRTL","xStart","rect","data-is-focusable","ref","e","rx","roundCorners","onClick","onMouseOver","aria-label","_getAriaLabel","role","aria-labelledby","onMouseLeave","onFocus","onBlur","fill","opacity","tabIndex","_getUniqueYValues","mapY","uniqueY","Object","values","_calculateAppropriateBarHeight","totalWidth","innerPadding","result","closestPairDiff","barWidth","floor","_getDomainMarginsForHorizontalBarChart","barGapRate","numBars","totalHeight","reqHeight","transform","bandwidth","_onLegendHover","customMessage","_isLegendSelected","_onLegendLeave","isLegendFocused","_getLegendData","actions","mapLegendToColor","_index","entries","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","_getHighlightedLegend","includes","currentLegend","canSelectMultipleLegends","slice","_getAxisData","yAxisData","yAxisDomainValues","domainValue","xMaxValue","xValue","yValue","ariaLabel","_getChartTitle","chartTitle","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","dStartValue","dEndValue","rStartValue","rEndValue","calloutProps","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCartesian","tickParams","tickFormat","reversedBars","reverse","legendBars","yAxisType","getDomainNRangeValues","stringDatasetForYAxisDomain","createYAxis","createStringYAxis","getMinMaxOfYAxis","barwidth","getmargins","getYDomainMargins","getGraphData","getAxisData","onChartMouseLeave","children","g","div","id","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AACtD,SAASC,eAAeC,aAAa,EAAgCC,aAAaC,WAAW,QAAQ,WAAW;AAEhH,SAASC,OAAO,QAAQ,mCAAmC;AAC3D,SAAS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R;YAC7B6Q,cAAcA;YACdM,YAAYA;YACZI,YAAYA;YACZI,aAAa5T;YACb6T,mBAAmB3T;YACnB4T,kBAAkB/T;YAClBgU,UAAUlS;YACVmS,YAAYtO;YACZuO,mBAAmBjF;YACnBkF,cAAcpN;YACdqN,aAAalD;YACbmD,mBAAmB3K;YACnB3E,cAAcrC;YACd,oCAAoC,GACpC,wDAAwD;YACxD4R,UAAU,CAACvT;gBACT,qBACE,wDACE,oBAACwT,WAAGtS;YAGV;;IAGN,OAAO;QACL,qBACE,oBAACuS;YAAIC,IAAI7S;YAAeiM,MAAM;YAAS6G,OAAO;gBAAEvG,SAAS;YAAI;YAAGR,cAAY;;IAEhF;AACF,GAAG;AACH9M,2BAA2B8T,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.tsx"],"sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { scaleLinear as d3ScaleLinear, ScaleLinear as D3ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\nimport { Legend, LegendContainer } from '../../components/Legends/Legends.types';\nimport { Legends } from '../../components/Legends/Legends';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport {\n AccessibilityProps,\n HorizontalBarChartWithAxisDataPoint,\n RefArrayData,\n Margins,\n ChartPopoverProps,\n Chart,\n ImageExportOptions,\n} from '../../index';\nimport { ChildProps } from '../CommonComponents/CartesianChart.types';\nimport { CartesianChart } from '../CommonComponents/CartesianChart';\nimport { HorizontalBarChartWithAxisProps } from './HorizontalBarChartWithAxis.types';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n YAxisType,\n XAxisTypes,\n NumericAxis,\n StringAxis,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n domainRangeOfNumericForHorizontalBarChartWithAxis,\n createStringYAxisForHorizontalBarChartWithAxis,\n areArraysEqual,\n useRtl,\n DataVizPalette,\n getColorFromToken,\n computeLongestBars,\n groupChartDataByYValue,\n MIN_DOMAIN_MARGIN,\n} from '../../utilities/index';\nimport { getClosestPairDiffAndRange } from '../../utilities/vbc-utils';\nimport { toImage } from '../../utilities/image-export-utils';\ntype ColorScale = (_p?: number) => string;\n\nexport const HorizontalBarChartWithAxis: React.FunctionComponent<HorizontalBarChartWithAxisProps> = React.forwardRef<\n HTMLDivElement,\n HorizontalBarChartWithAxisProps\n>((props, forwardedRef) => {\n const _refArray: RefArrayData[] = [];\n const _calloutId: string = useId('callout');\n const _isRtl: boolean = useRtl();\n const _xAxisType: XAxisTypes =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].x, true) as XAxisTypes)\n : XAxisTypes.NumericAxis;\n const _yAxisType: YAxisType =\n props.data! && props.data!.length > 0\n ? (getTypeOfAxis(props.data![0].y, false) as YAxisType)\n : YAxisType.StringAxis;\n const _emptyChartId: string = useId('_HBCWithAxis_empty');\n let _points: HorizontalBarChartWithAxisDataPoint[] = [];\n let _barHeight: number = 0;\n let _colors: string[] = [];\n let _margins: Margins;\n let _bars: JSXElement[];\n let _yAxisLabels: string[];\n let _xMax: number;\n let _calloutAnchorPoint: HorizontalBarChartWithAxisDataPoint | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _longestBarPositiveTotalValue: number;\n let _longestBarNegativeTotalValue: number;\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _yAxisPadding: number = props.yAxisPadding ?? 0.5;\n const cartesianChartRef = React.useRef<Chart>(null);\n const X_ORIGIN: number = 0;\n const _legendsRef = React.useRef<LegendContainer>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [isLegendSelected, setIsLegendSelected] = React.useState<boolean>(\n (props.legendProps?.selectedLegends && props.legendProps.selectedLegends.length > 0) ||\n props.legendProps?.selectedLegend !== undefined,\n );\n const [isLegendHovered, setIsLegendHovered] = React.useState<boolean>(false);\n const [selectedLegendTitle, setSelectedLegendTitle] = React.useState<string>(props.legendProps?.selectedLegend ?? '');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<HorizontalBarChartWithAxisDataPoint>();\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const prevPropsRef = React.useRef<HorizontalBarChartWithAxisProps | null>(null);\n\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 }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _adjustProps(): void {\n _points = props.data || [];\n _barHeight = props.barHeight || 32;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color6),\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color5),\n getColorFromToken(DataVizPalette.color7),\n ];\n _colors = props.colors! || defaultPalette;\n }\n\n function _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _renderContentForOnlyBars(point: HorizontalBarChartWithAxisDataPoint): JSXElement {\n const { useSingleColor = false } = props;\n let selectedPointIndex = 0;\n props.data!.forEach((yDataPoint: HorizontalBarChartWithAxisDataPoint, index: number) => {\n if (yDataPoint.y === point.y) {\n selectedPointIndex = index;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let color: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n color = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n color = point.color ? point.color : props.colors ? _createColors()(point.x) : getNextColor(selectedPointIndex, 0);\n }\n return (\n <>\n <ChartPopover\n XValue={point.xAxisCalloutData || point.x.toString()}\n legend={point.legend}\n YValue={point.yAxisCalloutData || point.y}\n color={color}\n culture={props.culture ?? 'en-us'}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n />\n </>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _renderCallout(props?: HorizontalBarChartWithAxisDataPoint): JSXElement | null {\n return props ? _renderContentForOnlyBars(props) : null;\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n }\n\n function _getGraphData(\n xScale: NumericAxis,\n yScale: NumericAxis | StringAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yElement?: SVGElement | null,\n ) {\n const stackedChartData = groupChartDataByYValue(_points);\n const longestBars = computeLongestBars(stackedChartData, X_ORIGIN);\n _longestBarPositiveTotalValue = longestBars.longestPositiveBar;\n _longestBarNegativeTotalValue = longestBars.longestNegativeBar;\n\n const { xBarScale, yBarScale } =\n _yAxisType === YAxisType.NumericAxis\n ? _getScales(containerHeight, containerWidth, true)\n : _getScales(containerHeight, containerWidth, false);\n const xRange = xBarScale.range();\n let allBars: JSXElement[] = [];\n // when the chart mounts, the xRange[1] is sometimes seen to be < 0 (like -40) while xRange[0] > 0.\n if (xRange[0] < xRange[1]) {\n allBars = stackedChartData\n .map(singleBarData =>\n _yAxisType === YAxisType.NumericAxis\n ? _createNumericBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n )\n : _createStringBars(\n containerHeight,\n containerWidth,\n xElement!,\n yElement!,\n singleBarData,\n xBarScale,\n yBarScale,\n ),\n )\n .flat();\n }\n\n return (_bars = allBars);\n }\n\n function _createColors(): D3ScaleLinear<string, string> | ColorScale {\n const increment = _colors.length <= 1 ? 1 : 1 / (_colors.length - 1);\n const { useSingleColor = false } = props;\n if (useSingleColor) {\n return (_p?: number) => {\n const { colors } = props;\n return colors && colors.length > 0 ? colors[0] : getColorFromToken(DataVizPalette.color16);\n };\n }\n const domainValues = [];\n for (let i = 0; i < _colors.length; i++) {\n domainValues.push(increment * i * _xMax);\n }\n const colorScale = d3ScaleLinear<string>().domain(domainValues).range(_colors);\n return colorScale;\n }\n\n function _refCallback(element: SVGRectElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n function _onBarHover(\n point: HorizontalBarChartWithAxisDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-shadow\n color: string,\n mouseEvent: React.MouseEvent<SVGElement, MouseEvent>,\n ): void {\n mouseEvent.persist();\n // eslint-disable-next-line @typescript-eslint/no-shadow\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n _calloutAnchorPoint = point;\n setPopoverOpen(true);\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setDataForHoverCard(point.x);\n setSelectedLegendTitle(point.legend!);\n setColor(props.useSingleColor || props.enableGradient ? color : point.color!);\n // To display callout value, if no callout value given, taking given point.x value as a string.\n setXCalloutValue(point.yAxisCalloutData! || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n }\n\n function _onBarLeave(): void {\n setPopoverOpen(false);\n }\n\n function _handleChartMouseLeave(): void {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _onBarFocus(\n event: React.FocusEvent<SVGRectElement, Element>,\n point: HorizontalBarChartWithAxisDataPoint,\n refArrayIndexNumber: number,\n color: string,\n ): void {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n if ((isLegendSelected === false || _isLegendHighlighted(point.legend)) && _calloutAnchorPoint !== point) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (refArrayIndexNumber === index) {\n setPopoverOpen(true);\n setSelectedLegendTitle(point.legend!);\n setDataForHoverCard(point.x);\n setColor(props.useSingleColor ? color : point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || point.x.toString());\n setDataPointCalloutProps(point);\n setCallOutAccessibilityData(point.callOutAccessibilityData);\n }\n });\n }\n }\n\n function _getScales(\n containerHeight: number,\n containerWidth: number,\n isNumericScale: boolean,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): { xBarScale: any; yBarScale: any } {\n const xMax = _longestBarPositiveTotalValue;\n const xMin = _longestBarNegativeTotalValue;\n const xDomain = [Math.min(X_ORIGIN, xMin), Math.max(X_ORIGIN, xMax)];\n if (isNumericScale) {\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yMin = d3Min(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n const yDomainMax = Math.max(yMax, props.yMaxValue || 0);\n // Default to 0 if yMinValue is not provided.\n const yMinProp = props.yMinValue || 0;\n const yDomainMin = Math.min(yMin, yMinProp);\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n const yBarScale = d3ScaleLinear()\n .domain([yDomainMin, yDomainMax])\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin]);\n return { xBarScale, yBarScale };\n } else {\n // please note these padding default values must be consistent in here\n // and CatrtesianChartBase w for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n const yBarScale = d3ScaleBand()\n .domain(_yAxisLabels)\n .range([containerHeight - (_margins.bottom! + _domainMargin), _margins.top! + _domainMargin])\n .padding(_yAxisPadding);\n\n const xBarScale = d3ScaleLinear()\n .domain(xDomain)\n .nice()\n .range([_margins.left!, containerWidth - _margins.right!]);\n return { xBarScale, yBarScale };\n }\n }\n\n function _createNumericBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSXElement[] {\n const { useSingleColor = false } = props;\n const sortedBars: HorizontalBarChartWithAxisDataPoint[] = [...singleBarData];\n sortedBars.sort((a, b) => {\n const aValue = typeof a.y === 'number' ? a.y : parseFloat(a.y);\n const bValue = typeof b.y === 'number' ? b.y : parseFloat(b.y);\n return bValue - aValue;\n });\n\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n\n const bars = sortedBars.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > X_ORIGIN ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n prevPoint = point.x;\n\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n key={point.y}\n x={xStart}\n y={yBarScale(point.y) - _barHeight / 2}\n data-is-focusable={shouldHighlight}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n rx={props.roundCorners ? 3 : 0}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n aria-labelledby={`toolTip${_calloutId}`}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n onBlur={_onBarLeave}\n fill={startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _getUniqueYValues() {\n const mapY: Record<string, number | string> = {};\n props.data?.forEach((point: HorizontalBarChartWithAxisDataPoint) => {\n mapY[point.y] = point.y;\n });\n const uniqueY = Object.values(mapY);\n return uniqueY;\n }\n\n function _calculateAppropriateBarHeight(data: number[] | Date[], totalWidth: number, innerPadding: number) {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const closestPairDiff = result[0];\n let range = result[1];\n const yMax = d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.y as number)!;\n // Since we are always rendering from 0 to yMax, we need to ensure that the range is at least yMax\n // to calculate the bar height correctly.\n range = Math.max(range, yMax);\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n }\n\n function _getDomainMarginsForHorizontalBarChart(containerHeight: number): Margins {\n _domainMargin = MIN_DOMAIN_MARGIN;\n const uniqueY = _getUniqueYValues();\n /** Rate at which the space between the bars changes wrt the bar height */\n _yAxisPadding = _yAxisPadding === 1 ? 0.99 : _yAxisPadding;\n const barGapRate = _yAxisPadding / (1 - _yAxisPadding);\n const numBars = uniqueY.length + (uniqueY.length - 1) * barGapRate;\n // Total height available to render the bars\n const totalHeight = containerHeight - (_margins.top! + MIN_DOMAIN_MARGIN) - (_margins.bottom! + MIN_DOMAIN_MARGIN);\n if (_yAxisType !== YAxisType.StringAxis) {\n // Calculate bar height dynamically\n _barHeight =\n props.barHeight || _calculateAppropriateBarHeight(uniqueY as number[] | Date[], totalHeight, _yAxisPadding);\n _barHeight = Math.max(_barHeight, 1);\n _domainMargin += _barHeight / 2;\n } else {\n // Calculate the appropriate bar height\n _barHeight = props.barHeight || totalHeight / numBars;\n /** Total height required to render the bars. Directly proportional to bar height */\n const reqHeight = numBars * _barHeight;\n if (totalHeight >= reqHeight) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalHeight - reqHeight) / 2;\n }\n }\n\n return {\n ..._margins,\n top: _margins.top! + _domainMargin,\n bottom: _margins.bottom! + _domainMargin,\n };\n }\n\n function _createStringBars(\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement,\n yElement: SVGElement,\n singleBarData: HorizontalBarChartWithAxisDataPoint[],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xBarScale: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yBarScale: any,\n ): JSXElement[] {\n const { useSingleColor = false } = props;\n let prevWidthPositive = 0;\n let prevWidthNegative = 0;\n let prevPoint = 0;\n const totalPositiveBars = singleBarData.filter(\n (point: HorizontalBarChartWithAxisDataPoint) => point.x >= X_ORIGIN,\n ).length;\n const totalNegativeBars = singleBarData.length - totalPositiveBars;\n let currPositiveCounter = 0;\n let currNegativeCounter = 0;\n const bars = singleBarData.map((point: HorizontalBarChartWithAxisDataPoint, index: number) => {\n let shouldHighlight = true;\n if (isLegendHovered || isLegendSelected) {\n shouldHighlight = _isLegendHighlighted(point.legend);\n }\n if (point.x >= X_ORIGIN) {\n ++currPositiveCounter;\n }\n if (point.x < X_ORIGIN) {\n ++currNegativeCounter;\n }\n const barStartX = _isRtl\n ? containerWidth -\n (_margins.right! + Math.max(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN)) - _margins.left!)\n : Math.min(xBarScale(point.x + X_ORIGIN), xBarScale(X_ORIGIN));\n const barHeight: number = Math.max(yBarScale(point.y), 0);\n if (barHeight < 1) {\n return <React.Fragment key={point.x}> </React.Fragment>;\n }\n let startColor: string;\n if (useSingleColor) {\n //if useSingle color , then check if user has given a palette or not\n // and pick the first color from that or else from our paltette.\n startColor = props.colors ? _createColors()(1) : getNextColor(1, 0);\n } else {\n startColor = props.colors ? _createColors()(point.x) : getNextColor(index, 0);\n }\n\n startColor = point.color && !useSingleColor ? point.color : startColor;\n const prevBarWidth = Math.abs(xBarScale(prevPoint + X_ORIGIN) - xBarScale(X_ORIGIN));\n prevPoint > 0 ? (prevWidthPositive += prevBarWidth) : (prevWidthNegative += prevBarWidth);\n const currentWidth = Math.abs(xBarScale(point.x + X_ORIGIN) - xBarScale(X_ORIGIN));\n const gapWidthLTR =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && currPositiveCounter !== totalPositiveBars) ||\n (point.x < X_ORIGIN && (totalPositiveBars !== 0 || currNegativeCounter > 1)))\n ? 2\n : 0;\n const gapWidthRTL =\n currentWidth > 2 &&\n ((point.x > X_ORIGIN && (totalNegativeBars !== 0 || currPositiveCounter > 1)) ||\n (point.x < X_ORIGIN && currNegativeCounter !== totalNegativeBars))\n ? 2\n : 0;\n prevPoint = point.x;\n let xStart = X_ORIGIN;\n if (_isRtl) {\n xStart = point.x > X_ORIGIN ? barStartX - prevWidthPositive : barStartX + prevWidthNegative;\n } else {\n xStart = point.x > X_ORIGIN ? barStartX + prevWidthPositive : barStartX - prevWidthNegative;\n }\n return (\n <React.Fragment key={`${index}_${point.x}`}>\n <rect\n transform={`translate(0,${0.5 * (yBarScale.bandwidth() - _barHeight)})`}\n key={point.x}\n x={xStart}\n y={yBarScale(point.y)}\n rx={props.roundCorners ? 3 : 0}\n width={currentWidth - (_isRtl ? gapWidthRTL : gapWidthLTR)}\n height={_barHeight}\n aria-labelledby={`toolTip${_calloutId}`}\n aria-label={_getAriaLabel(point)}\n role=\"img\"\n ref={(e: SVGRectElement) => {\n _refCallback(e, point.legend!);\n }}\n onClick={point.onClick}\n onMouseOver={(event: React.MouseEvent<SVGElement, MouseEvent>) => _onBarHover(point, startColor, event)}\n onMouseLeave={_onBarLeave}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n opacity={shouldHighlight ? 1 : 0.1}\n onFocus={event => _onBarFocus(event, point, index, startColor)}\n fill={startColor}\n tabIndex={point.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n });\n return bars;\n }\n\n function _onLegendHover(customMessage: string): void {\n if (!_isLegendSelected()) {\n setIsLegendHovered(true);\n setSelectedLegendTitle(customMessage);\n }\n }\n\n function _onLegendLeave(isLegendFocused?: boolean): void {\n if (!!isLegendFocused || !_isLegendSelected()) {\n setIsLegendHovered(false);\n setSelectedLegendTitle('');\n setIsLegendSelected(isLegendFocused ? false : _isLegendSelected());\n }\n }\n\n function _getLegendData(data: HorizontalBarChartWithAxisDataPoint[]): JSXElement {\n const { useSingleColor } = props;\n const actions: Legend[] = [];\n const mapLegendToColor: Record<string, string> = {};\n\n data.forEach((point: HorizontalBarChartWithAxisDataPoint, _index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const color: string = useSingleColor ? (props.colors ? _createColors()(1) : getNextColor(1, 0)) : point.color!;\n\n mapLegendToColor[point.legend!] = color;\n });\n Object.entries(mapLegendToColor).forEach(([legendTitle, color]) => {\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: legendTitle,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n // eslint-disable-next-line @typescript-eslint/no-shadow\n onMouseOutAction: (isLegendSelected?: boolean) => {\n _onLegendLeave(isLegendSelected);\n },\n };\n actions.push(legend);\n });\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n return legends;\n }\n\n function _isLegendSelected(): boolean {\n return isLegendSelected!;\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(legend?: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : selectedLegendTitle ? [selectedLegendTitle] : [];\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n setSelectedLegendTitle(currentLegend?.title!);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n setSelectedLegendTitle(currentLegend?.title!);\n }\n setIsLegendSelected(selectedLegends.length > 0);\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _getAxisData(yAxisData: IAxisData) {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n // For HBCWA x and y Values are swapped\n const { yAxisDomainValues: domainValue } = yAxisData;\n _xMax = Math.max(domainValue[domainValue.length - 1], props.xMaxValue || 0);\n }\n }\n function _getAriaLabel(point: HorizontalBarChartWithAxisDataPoint): string {\n const xValue = point.xAxisCalloutData || point.x;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ` + `${yValue}.`;\n }\n\n function _getChartTitle(): string {\n const { chartTitle, data } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Horizontal bar chart with ${data?.length || 0} bars. `;\n }\n\n function _isChartEmpty(): boolean {\n return !(props.data && props.data.length > 0);\n }\n\n function _updatePosition(newX: number, newY: number): void {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n\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 _getDomainNRangeValues(\n points: HorizontalBarChartWithAxisDataPoint[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(\n points,\n margins,\n width,\n isRTL,\n shiftX,\n X_ORIGIN,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n if (!_isChartEmpty()) {\n _adjustProps();\n const calloutProps: ChartPopoverProps = {\n color: color,\n legend: selectedLegendTitle,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData),\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCartesian: true,\n isPopoverOpen,\n clickPosition,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const reversedBars = [..._points].reverse();\n _yAxisLabels = reversedBars.map((point: HorizontalBarChartWithAxisDataPoint) => point.y as string);\n _xMax = Math.max(d3Max(_points, (point: HorizontalBarChartWithAxisDataPoint) => point.x)!, props.xMaxValue || 0);\n const legendBars: JSXElement = _getLegendData(_points);\n return (\n <CartesianChart\n yAxisPadding={_yAxisPadding}\n {...props}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.HorizontalBarChartWithAxis}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n getDomainNRangeValues={_getDomainNRangeValues}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n barwidth={_barHeight}\n getmargins={_getMargins}\n getYDomainMargins={_getDomainMarginsForHorizontalBarChart}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n return (\n <>\n <g>{_bars}</g>\n </>\n );\n }}\n />\n );\n } else {\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n }\n});\nHorizontalBarChartWithAxis.displayName = 'HorizontalBarChartWithAxis';\n"],"names":["React","max","d3Max","min","d3Min","scaleLinear","d3ScaleLinear","scaleBand","d3ScaleBand","Legends","useId","CartesianChart","ChartPopover","ChartTypes","getAccessibleDataObject","YAxisType","XAxisTypes","getTypeOfAxis","getNextColor","findHBCWANumericMinMaxOfY","createYAxisForHorizontalBarChartWithAxis","domainRangeOfNumericForHorizontalBarChartWithAxis","createStringYAxisForHorizontalBarChartWithAxis","areArraysEqual","useRtl","DataVizPalette","getColorFromToken","computeLongestBars","groupChartDataByYValue","MIN_DOMAIN_MARGIN","getClosestPairDiffAndRange","toImage","HorizontalBarChartWithAxis","forwardRef","props","forwardedRef","_refArray","_calloutId","_isRtl","_xAxisType","data","length","x","NumericAxis","_yAxisType","y","StringAxis","_emptyChartId","_points","_barHeight","_colors","_margins","_bars","_yAxisLabels","_xMax","_calloutAnchorPoint","_longestBarPositiveTotalValue","_longestBarNegativeTotalValue","_domainMargin","_yAxisPadding","yAxisPadding","cartesianChartRef","useRef","X_ORIGIN","_legendsRef","color","setColor","useState","dataForHoverCard","setDataForHoverCard","isLegendSelected","setIsLegendSelected","legendProps","selectedLegends","selectedLegend","undefined","isLegendHovered","setIsLegendHovered","selectedLegendTitle","setSelectedLegendTitle","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","setSelectedLegends","dataPointCalloutProps","setDataPointCalloutProps","callOutAccessibilityData","setCallOutAccessibilityData","isPopoverOpen","setPopoverOpen","clickPosition","setClickPosition","prevPropsRef","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","opts","toSVG","_adjustProps","barHeight","defaultPalette","color6","color1","color5","color7","colors","_getMargins","margins","_renderContentForOnlyBars","point","useSingleColor","selectedPointIndex","forEach","yDataPoint","index","_createColors","XValue","xAxisCalloutData","toString","legend","YValue","yAxisCalloutData","culture","_renderCallout","_getCustomizedCallout","onRenderCalloutPerDataPoint","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","yElement","stackedChartData","longestBars","longestPositiveBar","longestNegativeBar","xBarScale","yBarScale","_getScales","xRange","range","allBars","map","singleBarData","_createNumericBars","_createStringBars","flat","increment","_p","color16","domainValues","i","push","colorScale","domain","_refCallback","element","legendTitle","refElement","_onBarHover","mouseEvent","persist","_isLegendHighlighted","_updatePosition","clientX","clientY","enableGradient","_onBarLeave","_handleChartMouseLeave","_onBarFocus","event","refArrayIndexNumber","cx","cy","targetRect","target","getBoundingClientRect","left","width","top","height","obj","isNumericScale","xMax","xMin","xDomain","Math","yMax","yMin","yDomainMax","yMaxValue","yMinProp","yMinValue","yDomainMin","nice","right","bottom","padding","sortedBars","sort","a","b","aValue","parseFloat","bValue","prevWidthPositive","prevWidthNegative","prevPoint","totalPositiveBars","filter","totalNegativeBars","currPositiveCounter","currNegativeCounter","bars","shouldHighlight","barStartX","Fragment","key","startColor","prevBarWidth","abs","currentWidth","gapWidthLTR","gapWidthRTL","xStart","rect","data-is-focusable","ref","e","rx","roundCorners","onClick","onMouseOver","aria-label","_getAriaLabel","role","aria-labelledby","onMouseLeave","onFocus","onBlur","fill","opacity","tabIndex","_getUniqueYValues","mapY","uniqueY","Object","values","_calculateAppropriateBarHeight","totalWidth","innerPadding","result","closestPairDiff","barWidth","floor","_getDomainMarginsForHorizontalBarChart","barGapRate","numBars","totalHeight","reqHeight","transform","bandwidth","_onLegendHover","customMessage","_isLegendSelected","_onLegendLeave","isLegendFocused","_getLegendData","actions","mapLegendToColor","_index","entries","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onChange","_onLegendSelectionChange","legendRef","_getHighlightedLegend","includes","currentLegend","canSelectMultipleLegends","slice","_getAxisData","yAxisData","yAxisDomainValues","domainValue","xMaxValue","xValue","yValue","ariaLabel","_getChartTitle","chartTitle","_isChartEmpty","newX","newY","threshold","distance","sqrt","pow","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","dStartValue","dEndValue","rStartValue","rEndValue","calloutProps","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCartesian","tickParams","tickFormat","reversedBars","reverse","legendBars","yAxisType","getDomainNRangeValues","stringDatasetForYAxisDomain","createYAxis","createStringYAxis","getMinMaxOfYAxis","barwidth","getmargins","getYDomainMargins","getGraphData","getAxisData","onChartMouseLeave","children","g","div","id","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AACtD,SAASC,eAAeC,aAAa,EAAgCC,aAAaC,WAAW,QAAQ,WAAW;AAEhH,SAASC,OAAO,QAAQ,mCAAmC;AAC3D,SAASC,KAAK,QAAQ,4BAA4B;AAYlD,SAASC,cAAc,QAAQ,qCAAqC;AAEpE,SAASC,YAAY,QAAQ,mCAAmC;AAChE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