@fluentui/react-charts 9.3.2 → 9.3.3
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 +27 -2
- package/dist/index.d.ts +147 -1
- package/lib/components/AreaChart/AreaChart.js +20 -24
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +2 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +16 -7
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +63 -18
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +394 -173
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +8 -7
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +16 -32
- 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 +4 -4
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +23 -45
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +21 -46
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +332 -114
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/Legends/Legends.js +1 -1
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +145 -97
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +7 -11
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/types/DataPoint.js +1 -3
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/utilities.js +14 -8
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +19 -23
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +16 -7
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +65 -18
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +393 -172
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -7
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +16 -32
- 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 +4 -4
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +23 -45
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +21 -46
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +329 -112
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js +1 -1
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +144 -96
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +6 -10
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +1 -3
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +17 -8
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/GroupedVerticalBarChart/GroupedVerticalBarChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport { useId, JSXElement } from '@fluentui/react-utilities';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n tooltipOfAxislabels,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n YAxisType,\n calcRequiredWidth,\n calcTotalWidth,\n calcBandwidth,\n calcTotalBandUnits,\n sortAxisCategories,\n} from '../../utilities/index';\n\nimport {\n AccessibilityProps,\n CartesianChart,\n Margins,\n Legend,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n Legends,\n YValueHover,\n ChartPopoverProps,\n Chart,\n ImageExportOptions,\n LegendContainer,\n} from '../../index';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype StringAxis = D3Axis<string>;\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\nconst MIN_DOMAIN_MARGIN = 8;\nconst X1_INNER_PADDING = 0.1;\nconst VERTICAL_BAR_GAP = 1;\nconst MIN_BAR_HEIGHT = 1;\n\n// This interface used for - While forming datapoints from given prop \"data\" in code\ninterface GVDataPoint {\n [key: string]: number | string;\n}\n\n// While forming datapoints from given prop \"data\" in code. These datapoints are used for to draw graph easily.\ninterface GVSingleDataPoint {\n [key: string]: GVDataPoint;\n}\n\nexport const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n GroupedVerticalBarChartProps\n>((_props, forwardedRef) => {\n const props: GroupedVerticalBarChartProps = {\n xAxisCategoryOrder: 'default',\n maxBarWidth: 24,\n ..._props,\n };\n const _tooltipId: string = useId('GVBCTooltipId_');\n const _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _xAxisLabels: string[] = [];\n let _datasetForBars: any[] = [];\n let _margins: Margins = { top: 0, right: 0, bottom: 0, left: 0 };\n let _groupedVerticalBarGraph: JSXElement[] = [];\n let _yMax: number = 0;\n let _calloutAnchorPoint: GVBarChartSeriesPoint | null = null;\n let _barWidth: number = 0;\n let _groupWidth: number = 0;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n let _legends: string[] = [];\n let _legendColorMap: Record<string, [string, string]> = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_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 [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\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, _useRtl, opts);\n },\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = _legends.length * bar_width + (_legends.length - 1) * space_between_bars\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n undefined,\n 2 / (2 + calcTotalBandUnits(_legends.length, X1_INNER_PADDING)),\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);\n };\n\n const _createDataset = (points: GroupedVerticalBarChartData[]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const datasetForBars: any = [];\n\n points.forEach((point: GroupedVerticalBarChartData, index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDatasetPointForBars: any = {};\n const legendToBarPoint: Record<string, GVBarChartSeriesPoint> = {};\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint) => {\n if (!singleDatasetPointForBars[seriesPoint.legend]) {\n singleDatasetPointForBars[seriesPoint.legend] = [{ ...seriesPoint }];\n legendToBarPoint[seriesPoint.legend] = { ...seriesPoint };\n } else {\n singleDatasetPointForBars[seriesPoint.legend].push({ ...seriesPoint });\n legendToBarPoint[seriesPoint.legend].data += seriesPoint.data;\n }\n });\n\n singleDatasetPointForBars.xAxisPoint = point.name;\n singleDatasetPointForBars.indexNum = index;\n singleDatasetPointForBars.groupSeries = Object.values(legendToBarPoint);\n singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;\n datasetForBars.push(singleDatasetPointForBars);\n });\n return datasetForBars;\n };\n\n const _createDataSetOfGVBC = (points: GroupedVerticalBarChartData[]) => {\n const legends = new Set<string>();\n const xAxisLabels: string[] = _getOrderedXAxisLabels(points);\n points.forEach((point: GroupedVerticalBarChartData) => {\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint) => {\n legends.add(seriesPoint.legend);\n });\n });\n const datasetForBars = _createDataset(points);\n return {\n legends: Array.from(legends),\n xAxisLabels,\n datasetForBars,\n };\n };\n\n const onLegendSelectionChange = (\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const _getLegendData = (points: GroupedVerticalBarChartData[]): JSXElement => {\n const actions: Legend[] = [];\n\n _legends.forEach((legendTitle: string) => {\n const legend: Legend = {\n title: legendTitle,\n color: _legendColorMap[legendTitle][0],\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n return (\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 };\n\n const _addDefaultColors = (data?: GroupedVerticalBarChartData[]): GroupedVerticalBarChartData[] => {\n _legendColorMap = {};\n let colorIndex = 0;\n\n return (\n data?.map(point => {\n return {\n ...point,\n series:\n point.series?.map(seriesPoint => {\n // TODO: Add support for gradient colors\n let startColor = seriesPoint.color ? seriesPoint.color : getNextColor(colorIndex, 0);\n let endColor = startColor;\n if (!_legendColorMap[seriesPoint.legend]) {\n _legendColorMap[seriesPoint.legend] = [startColor, endColor];\n }\n colorIndex += 1;\n\n return {\n ...seriesPoint,\n color: seriesPoint.color ?? _legendColorMap[seriesPoint.legend][0],\n };\n }) ?? [],\n };\n }) ?? []\n );\n };\n\n const _getOrderedXAxisLabels = (points: GroupedVerticalBarChartData[]) => {\n if (_xAxisType !== XAxisTypes.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(points), props.xAxisCategoryOrder);\n };\n\n const _mapCategoryToValues = (points: GroupedVerticalBarChartData[]) => {\n const categoryToValues: Record<string, number[]> = {};\n points.forEach(point => {\n if (!categoryToValues[point.name]) {\n categoryToValues[point.name] = [];\n }\n point.series.forEach(seriesPoint => {\n categoryToValues[point.name].push(seriesPoint.data);\n });\n });\n return categoryToValues;\n };\n\n const points = _addDefaultColors(props.data);\n const _xAxisType: XAxisTypes = getTypeOfAxis(points![0].name, true) as XAxisTypes;\n const { legends, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points!);\n _legends = legends;\n _xAxisLabels = xAxisLabels;\n _datasetForBars = datasetForBars;\n const legendBars: JSXElement = _getLegendData(points);\n _adjustProps();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Add commentMore actions\n function _getMinMaxOfYAxis(datasetForBars: any, yAxisType?: YAxisType, useSecondaryYScale?: boolean) {\n const values: number[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n datasetForBars.forEach((data: any) => {\n data.groupSeries.forEach((point: GVBarChartSeriesPoint) => {\n if (!useSecondaryYScale === !point.useSecondaryYScale) {\n values.push(point.data);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _getDomainNRangeValues(\n points: GroupedVerticalBarChartData[],\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 || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n // The maxOfYVal prop is only required for the primary y-axis, so yMax should be calculated\n // using only the data points associated with the primary y-axis.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const yMax = _getMinMaxOfYAxis(_datasetForBars).endValue;\n _yMax = Math.max(yMax, props.yMaxValue || 0);\n\n const calloutProps: ChartPopoverProps = {\n clickPosition,\n isPopoverOpen,\n color,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover,\n hoverXValue,\n culture: props.culture,\n isCartesian: true,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues!,\n tickFormat: props.tickFormat!,\n };\n\n const _getGraphData = (\n xScale: StringAxis | NumericAxis,\n yScalePrimary: ScaleLinear<number, number>,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) => {\n const xScale0 = _createX0Scale(containerWidth);\n\n // Setting the bar width here is safe because there are no dependencies earlier in the code\n // that rely on the width of bars in vertical bar charts with string x-axis.\n _barWidth = getBarWidth(\n props.barWidth,\n props.maxBarWidth,\n calcBandwidth(xScale0.bandwidth(), _legends.length, X1_INNER_PADDING),\n );\n _groupWidth = calcRequiredWidth(_barWidth, _legends.length, X1_INNER_PADDING);\n\n const xScale1 = _createX1Scale();\n const allGroupsBars: JSXElement[] = [];\n _datasetForBars.forEach((singleSet: GVSingleDataPoint) => {\n allGroupsBars.push(\n _buildGraph(singleSet, xScale0, xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement!),\n );\n });\n _groupedVerticalBarGraph = allGroupsBars;\n };\n\n const _getMargins = (margins: Margins) => {\n _margins = margins;\n };\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n const onBarHover = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint !== pointData) {\n _calloutAnchorPoint = pointData;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n };\n\n const _onBarLeave = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n };\n\n const onBarFocus = (\n event: React.FocusEvent<SVGRectElement, Element>,\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n ): void => {\n let x = 0;\n let y = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n updatePosition(x, y);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n };\n\n const _buildGraph = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n singleSet: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale0: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale1: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n containerHeight: number,\n xElement: SVGElement,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ): JSXElement => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const singleGroup: JSXElement[] = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const barLabelsForGroup: JSXElement[] = [];\n\n // Get the actual legends present at this x-axis point\n const presentLegends = Object.keys(singleSet).filter(key => key in _legendColorMap);\n const effectiveGroupWidth = calcRequiredWidth(_barWidth, presentLegends.length, X1_INNER_PADDING);\n\n // For stacked bars, center the single bar group in the available space\n // Instead of using the global legend position, use the local position within present legends\n const localScale = d3ScaleBand()\n .domain(presentLegends)\n .range(_useRtl ? [effectiveGroupWidth, 0] : [0, effectiveGroupWidth])\n .paddingInner(X1_INNER_PADDING);\n _legends.forEach((legendTitle: string, legendIndex: number) => {\n const barPoints = singleSet[legendTitle];\n if (barPoints) {\n const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n\n const xPoint = (localScale(legendTitle) ?? 0) + (localScale.bandwidth() - _barWidth) / 2;\n const isLegendActive = _legendHighlighted(legendTitle) || _noLegendHighlighted();\n const barOpacity = isLegendActive ? '' : '0.1';\n\n let barTotalValue = 0;\n const yBaseline = yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = Y_ORIGIN;\n\n barPoints.forEach((pointData: GVBarChartSeriesPoint, pointIndex: number) => {\n if (!pointData.data) {\n // Not rendering data with 0.\n return;\n }\n const barGap = (VERTICAL_BAR_GAP / 2) * (pointIndex > 0 ? 2 : 0);\n const height = Math.max(yBarScale(Y_ORIGIN) - yBarScale(Math.abs(pointData.data)), MIN_BAR_HEIGHT);\n const pointColor = pointData.color; // Use the color of the current point\n\n if (pointData.data >= Y_ORIGIN) {\n yPositiveStart -= height + barGap;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + barGap;\n yNegativeStart = yPoint + height;\n }\n\n singleGroup.push(\n <rect\n key={`${singleSet.indexNum}-${legendIndex}-${pointIndex}`}\n className={classes.opacityChangeOnHover}\n height={height}\n width={_barWidth}\n x={xPoint}\n y={yPoint}\n opacity={barOpacity}\n fill={pointColor}\n rx={props.roundCorners ? 3 : 0}\n onMouseOver={event => onBarHover(pointData, singleSet, event)}\n onMouseMove={event => onBarHover(pointData, singleSet, event)}\n onMouseOut={_onBarLeave}\n onFocus={event => onBarFocus(event, pointData, singleSet)}\n onBlur={_onBarLeave}\n onClick={pointData.onClick}\n aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}\n tabIndex={_legendHighlighted(pointData.legend) || _noLegendHighlighted() ? 0 : undefined}\n role=\"img\"\n />,\n );\n\n barTotalValue += pointData.data;\n });\n if (barTotalValue !== null && !props.hideLabels && Math.ceil(_barWidth) >= 16 && isLegendActive) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${legendIndex}`}\n x={xPoint + _barWidth / 2}\n y={barTotalValue >= Y_ORIGIN ? yPositiveStart - 6 : yNegativeStart + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(barTotalValue)\n : formatScientificLimitWidth(barTotalValue)}\n </text>,\n );\n }\n }\n });\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale0);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return (\n <g\n key={singleSet.indexNum}\n transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - effectiveGroupWidth) / 2}, 0)`}\n >\n {singleGroup}\n {barLabelsForGroup}\n </g>\n );\n };\n\n // For grouped vertical bar chart, First need to define total scale (from start to end)\n // From that need to define scale for single group of bars - done by createX1Scale\n const _createX0Scale = (containerWidth: number) => {\n const x0Axis = d3ScaleBand()\n .domain(xAxisLabels)\n .range(\n _useRtl\n ? [containerWidth! - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth! - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n return x0Axis;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _createX1Scale = (): any => {\n return (\n d3ScaleBand()\n .domain(_legends)\n // When there is only one group, xScale0 adds padding around it,\n // causing the bandwidth to become smaller than the actual group width.\n // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.\n .range(_useRtl ? [_groupWidth, 0] : [0, _groupWidth])\n .paddingInner(X1_INNER_PADDING)\n );\n };\n\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n\n const _getAxisData = React.useCallback(\n (yAxisData: IAxisData) => {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || 0);\n }\n },\n [props.yMaxValue],\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 const _legendHighlighted = (legendTitle: string) => {\n return _getHighlightedLegend().includes(legendTitle!);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return _getHighlightedLegend().length === 0;\n };\n\n const _getHighlightedLegend = () => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n };\n\n const getAriaLabel = (point: GVBarChartSeriesPoint, xAxisPoint: string): string => {\n const xValue = point.xAxisCalloutData || xAxisPoint;\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n };\n\n const _getDomainMargins = (containerWidth: number): Margins => {\n /** Total width available to render the bars */\n const totalWidth = calcTotalWidth(containerWidth, _margins, MIN_DOMAIN_MARGIN);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first group and after the last group.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const groupWidth = calcRequiredWidth(_barWidth, _legends.length, X1_INNER_PADDING);\n /** Total width required to render the groups. Directly proportional to group width */\n const reqWidth = calcRequiredWidth(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering groups at their maximum allowable width\n const groupBandwidth = calcBandwidth(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const barBandwidth = calcBandwidth(groupBandwidth, _legends.length, X1_INNER_PADDING);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);\n const groupWidth = calcRequiredWidth(barWidth, _legends.length, X1_INNER_PADDING);\n let reqWidth = calcRequiredWidth(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const margin1 = (totalWidth - reqWidth) / 2;\n\n let margin2 = Number.POSITIVE_INFINITY;\n if (!props.hideTickOverlap) {\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(_xAxisLabels) + 20;\n reqWidth = (_xAxisLabels.length - _xAxisInnerPadding) * step;\n margin2 = (totalWidth - reqWidth) / 2;\n }\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n };\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.filter((item: GroupedVerticalBarChartData) => item.series.length).length > 0\n );\n };\n\n const _getChartTitle = (): string => {\n return (\n (props.chartTitle ? `${props.chartTitle}. ` : '') +\n `Vertical bar chart with ${_xAxisLabels.length} groups of ${_legends.length} bars each. `\n );\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_datasetForBars}\n chartType={ChartTypes.GroupedVerticalBarChart}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n createStringYAxis={createStringYAxis}\n calloutProps={calloutProps}\n legendBars={legendBars}\n xAxisType={_xAxisType}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_xAxisLabels}\n tickParams={tickParams}\n tickPadding={props.tickPadding || 5}\n maxOfYVal={_yMax}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n barwidth={_barWidth}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["React","useGroupedVerticalBarChartStyles_unstable","select","d3Select","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","tooltipOfAxislabels","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","calcRequiredWidth","calcTotalWidth","calcBandwidth","calcTotalBandUnits","sortAxisCategories","CartesianChart","Legends","toImage","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","_props","forwardedRef","props","xAxisCategoryOrder","maxBarWidth","_tooltipId","_emptyChartId","_useRtl","_domainMargin","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","_legends","_legendColorMap","cartesianChartRef","useRef","Y_ORIGIN","_legendsRef","color","setColor","useState","dataForHoverCard","setDataForHoverCard","selectedLegends","setSelectedLegends","legendProps","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","YValueHover","setYValueHover","hoverXValue","setHoverXValue","calloutLegend","setCalloutLegend","activeLegend","setActiveLegend","callOutAccessibilityData","setCallOutAccessibilityData","undefined","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","classes","useEffect","useImperativeHandle","componentRef","chartContainer","current","opts","toSVG","_adjustProps","barWidth","xAxisInnerPadding","length","xAxisOuterPadding","_createDataset","points","datasetForBars","forEach","point","index","singleDatasetPointForBars","legendToBarPoint","series","seriesPoint","legend","push","data","xAxisPoint","name","indexNum","groupSeries","Object","values","stackCallOutAccessibilityData","_createDataSetOfGVBC","legends","Set","xAxisLabels","_getOrderedXAxisLabels","add","Array","from","onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","actions","legendTitle","title","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","legendRef","_addDefaultColors","colorIndex","map","startColor","endColor","_xAxisType","StringAxis","_mapCategoryToValues","categoryToValues","legendBars","_getMinMaxOfYAxis","yAxisType","useSecondaryYScale","startValue","endValue","_getDomainNRangeValues","margins","width","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","yMax","Math","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","tickParams","tickFormat","_getGraphData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","xScale0","_createX0Scale","bandwidth","xScale1","_createX1Scale","allGroupsBars","singleSet","_buildGraph","_getMargins","updatePosition","newX","newY","threshold","distance","sqrt","pow","onBarHover","pointData","groupData","mouseEvent","persist","clientX","clientY","_noLegendHighlighted","_legendHighlighted","xAxisCalloutData","yAxisCalloutData","isCalloutForStack","_onBarLeave","onBarFocus","targetRect","target","getBoundingClientRect","height","singleGroup","barLabelsForGroup","presentLegends","keys","filter","key","effectiveGroupWidth","localScale","domain","range","paddingInner","legendIndex","barPoints","yBarScale","xPoint","isLegendActive","barOpacity","barTotalValue","yBaseline","yPositiveStart","yNegativeStart","yPoint","pointIndex","barGap","abs","pointColor","rect","className","opacityChangeOnHover","opacity","fill","rx","roundCorners","onMouseOver","onMouseMove","onMouseOut","onFocus","onBlur","onClick","aria-label","getAriaLabel","tabIndex","role","hideLabels","ceil","text","textAnchor","barLabel","aria-hidden","style","direction","unicodeBidi","yAxisTickFormat","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","call","document","getElementById","remove","e","tooltipProps","tooltipCls","tooltip","id","axis","g","transform","x0Axis","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","margin2","Number","POSITIVE_INFINITY","hideTickOverlap","step","_isChartEmpty","item","_getChartTitle","chartTitle","getDomainNRangeValues","getMinMaxOfYAxis","createYAxis","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","div","displayName"],"mappings":"AAAA;;;;;+BAwEauC;;;;;;;iEAtEU,QAAQ;wDAC2B,4CAA4C;6BACnE,eAAe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sBAAAA,EAAAA;QACE,GAAGW,KAAK;QACTuS,YAAYD;QACZhO,QAAQ9D;QACR+H,WAAWvK,iBAAAA,CAAW4B,uBAAuB;QAC7C4S,uBAAuBpK;QACvBqK,kBAAkB1K;QAClBpJ,mBAAmBA,wBAAAA;QACnB2K,cAAcA;QACdxB,YAAYA;QACZW,WAAWf;QACXgL,aAAajU,yBAAAA;QACbkU,uBAAuBpS;QACvBoJ,YAAYA;QACZiJ,aAAa5S,MAAM4S,WAAW,IAAI;QAClCC,WAAW9R;QACX+R,YAAYjI;QACZkI,cAAclJ;QACdmJ,aAAanC;QACboC,mBAAmBrM;QACnBsM,kBAAkB3B;QACjB,GAAI7J,eAAevJ,iBAAAA,CAAWwJ,UAAU,IAAI;YAC3CzD,mBAAmB/C;YACnBiD,mBAAmBhD;QACrB,CAAC;QACD+R,UAAUlS;QACV0C,cAAcpC;QACd,oCAAoC,GACpC6R,UAAU;YACR,OAAA,WAAA,GAAO,OAAA,aAAA,CAAC3C,KAAAA,MAAG3P;QACb;uBAGF,OAAA,aAAA,CAACuS,OAAAA;QAAI9C,IAAInQ;QAAe6O,MAAM;QAASO,OAAO;YAAEpB,SAAS;QAAI;QAAGU,cAAY;;AAEhF,GAAG;AACHlP,wBAAwB0T,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/GroupedVerticalBarChart/GroupedVerticalBarChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';\nimport { select as d3Select, pointer as d3Pointer } from 'd3-selection';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleBand, ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport { useId, JSXElement } from '@fluentui/react-utilities';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n tooltipOfAxislabels,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n YAxisType,\n calcRequiredWidth,\n calcTotalWidth,\n calcBandwidth,\n calcTotalBandUnits,\n sortAxisCategories,\n} from '../../utilities/index';\n\nimport {\n AccessibilityProps,\n CartesianChart,\n Margins,\n Legend,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n Legends,\n YValueHover,\n ChartPopoverProps,\n Chart,\n ImageExportOptions,\n LegendContainer,\n LineSeries,\n getColorFromToken,\n BarSeries,\n ChildProps,\n} from '../../index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { tokens } from '@fluentui/react-theme';\n\ntype NumericScale = ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\n\nconst MIN_DOMAIN_MARGIN = 8;\nconst X1_INNER_PADDING = 0.1;\nconst VERTICAL_BAR_GAP = 1;\nconst MIN_BAR_HEIGHT = 1;\n\n// This interface used for - While forming datapoints from given prop \"data\" in code\ninterface GVDataPoint {\n [key: string]: number | string;\n}\n\n// While forming datapoints from given prop \"data\" in code. These datapoints are used for to draw graph easily.\ninterface GVSingleDataPoint {\n [key: string]: GVDataPoint;\n}\n\ntype GVBCLineSeries = LineSeries<string, number>;\n\nexport const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n GroupedVerticalBarChartProps\n>((_props, forwardedRef) => {\n const props: GroupedVerticalBarChartProps = {\n xAxisCategoryOrder: 'default',\n maxBarWidth: 24,\n ..._props,\n };\n const _tooltipId: string = useId('GVBCTooltipId_');\n const _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _xAxisLabels: string[] = [];\n let _datasetForBars: any[] = [];\n let _margins: Margins = { top: 0, right: 0, bottom: 0, left: 0 };\n let _groupedVerticalBarGraph: JSXElement[] = [];\n let _yMax: number = 0;\n let _calloutAnchorPoint: GVBarChartSeriesPoint | null = null;\n let _barWidth: number = 0;\n let _groupWidth: number = 0;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n let _barLegends: string[] = [];\n let _lineLegends: string[] = [];\n let _legendColorMap: Record<string, [string, string]> = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_ORIGIN: number = 0;\n const _legendsRef = React.useRef<LegendContainer>(null);\n const _rectRef = React.useRef<SVGRectElement>(null);\n const _uniqDotId = useId('gvbc_dot_');\n\n const [color, setColor] = React.useState<string | undefined>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string | undefined>('');\n const [yValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [popoverTarget, setPopoverTarget] = React.useState<SVGElement | null>(null);\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [activeLinePoint, setActiveLinePoint] = React.useState<string>('');\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\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, _useRtl, opts);\n },\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = _barLegends.length * bar_width + (_barLegends.length - 1) * space_between_bars\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n undefined,\n 2 / (2 + calcTotalBandUnits(_barLegends.length, X1_INNER_PADDING)),\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);\n };\n\n const _createDataset = (barData: GroupedVerticalBarChartData[], lineData: GVBCLineSeries[]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const datasetForBars: any = [];\n\n const linePointsByX: Record<string, YValueHover[]> = {};\n const visitedX = new Set<string>();\n lineData.forEach(series => {\n series.data.forEach(point => {\n if (!linePointsByX[point.x]) {\n linePointsByX[point.x] = [];\n }\n linePointsByX[point.x].push({\n ...point,\n legend: series.legend,\n color: series.color,\n data: point.y,\n useSecondaryYScale: series.useSecondaryYScale,\n } as YValueHover);\n });\n });\n\n barData.forEach((point: GroupedVerticalBarChartData, index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDatasetPointForBars: any = {};\n const legendToBarPoint: Record<string, GVBarChartSeriesPoint> = {};\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint) => {\n if (!singleDatasetPointForBars[seriesPoint.legend]) {\n singleDatasetPointForBars[seriesPoint.legend] = [{ ...seriesPoint }];\n legendToBarPoint[seriesPoint.legend] = { ...seriesPoint };\n } else {\n singleDatasetPointForBars[seriesPoint.legend].push({ ...seriesPoint });\n legendToBarPoint[seriesPoint.legend].data += seriesPoint.data;\n }\n });\n\n singleDatasetPointForBars.xAxisPoint = point.name;\n singleDatasetPointForBars.indexNum = index;\n singleDatasetPointForBars.groupSeries = [\n ...Object.values(legendToBarPoint),\n ...(linePointsByX[point.name] ?? []),\n ];\n singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;\n datasetForBars.push(singleDatasetPointForBars);\n visitedX.add(point.name);\n });\n\n Object.keys(linePointsByX).forEach(xPoint => {\n if (!visitedX.has(xPoint)) {\n datasetForBars.push({\n xAxisPoint: xPoint,\n groupSeries: linePointsByX[xPoint],\n });\n }\n });\n\n return datasetForBars;\n };\n\n const _createDataSetOfGVBC = (barData: GroupedVerticalBarChartData[], lineData: GVBCLineSeries[]) => {\n const barLegends = new Set<string>();\n barData.forEach((point: GroupedVerticalBarChartData) => {\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint) => {\n barLegends.add(seriesPoint.legend);\n });\n });\n const lineLegends = new Set<string>(lineData.map(series => series.legend));\n const xAxisLabels: string[] = _getOrderedXAxisLabels(barData, lineData);\n const datasetForBars = _createDataset(barData, lineData);\n return {\n barLegends: Array.from(barLegends),\n lineLegends: Array.from(lineLegends),\n xAxisLabels,\n datasetForBars,\n };\n };\n\n const onLegendSelectionChange = (\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const _getLegendData = (): JSXElement => {\n const actions: Legend[] = [];\n\n const addLegendButton = (legendTitle: string, isLineLegendInBarChart?: boolean) => {\n const legend: Legend = {\n title: legendTitle,\n color: _legendColorMap[legendTitle][0],\n isLineLegendInBarChart,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n };\n\n _lineLegends.forEach(legendTitle => addLegendButton(legendTitle, true));\n _barLegends.forEach(legendTitle => addLegendButton(legendTitle));\n\n return (\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 };\n\n const _processDataV2 = (dataV2: (BarSeries<string, number> | LineSeries<string, number>)[]) => {\n const barPointsByX: Record<string, GroupedVerticalBarChartData> = {};\n const lineData: GVBCLineSeries[] = [];\n\n dataV2.forEach(series => {\n if (series.type === 'bar') {\n series.data.forEach(point => {\n if (!barPointsByX[point.x]) {\n barPointsByX[point.x] = { name: point.x, series: [] };\n }\n\n barPointsByX[point.x].series.push({\n key: series.key ?? series.legend,\n data: point.y,\n color: point.color ?? series.color,\n // gradient: series.gradient,\n legend: series.legend,\n xAxisCalloutData: point.xAxisCalloutData,\n yAxisCalloutData: point.yAxisCalloutData,\n onClick: point.onClick,\n useSecondaryYScale: series.useSecondaryYScale,\n });\n });\n } else if (series.type === 'line') {\n lineData!.push(series);\n }\n });\n\n return { barData: Object.values(barPointsByX), lineData };\n };\n\n const _prepareChartData = () => {\n let barData = props.data;\n let lineData: GVBCLineSeries[] | undefined;\n\n if (Array.isArray(props.dataV2) && props.dataV2.length > 0) {\n ({ barData, lineData } = _processDataV2(props.dataV2));\n }\n\n _legendColorMap = {};\n let colorIndex = 0;\n\n return {\n barData:\n barData?.map(point => {\n return {\n ...point,\n series:\n point.series?.map(seriesPoint => {\n // TODO: Add support for gradient colors\n let startColor = seriesPoint.color ? seriesPoint.color : getNextColor(colorIndex, 0);\n let endColor = startColor;\n if (!_legendColorMap[seriesPoint.legend]) {\n _legendColorMap[seriesPoint.legend] = [startColor, endColor];\n }\n colorIndex += 1;\n\n return {\n ...seriesPoint,\n color: seriesPoint.color ?? _legendColorMap[seriesPoint.legend][0],\n };\n }) ?? [],\n };\n }) ?? [],\n\n lineData:\n lineData?.map(series => {\n let lineColor: string;\n if (typeof series.color === 'undefined') {\n lineColor = getNextColor(colorIndex, 0);\n } else {\n lineColor = getColorFromToken(series.color);\n }\n\n if (!_legendColorMap[series.legend]) {\n _legendColorMap[series.legend] = [lineColor, lineColor];\n }\n colorIndex += 1;\n\n return {\n ...series,\n color: _legendColorMap[series.legend][0],\n };\n }) ?? [],\n };\n };\n\n const _getOrderedXAxisLabels = (barData: GroupedVerticalBarChartData[], lineData: GVBCLineSeries[]) => {\n if (_xAxisType !== XAxisTypes.StringAxis) {\n return [];\n }\n\n return sortAxisCategories(_mapCategoryToValues(barData, lineData), props.xAxisCategoryOrder);\n };\n\n const _mapCategoryToValues = (barData: GroupedVerticalBarChartData[], lineData: GVBCLineSeries[]) => {\n const categoryToValues: Record<string, number[]> = {};\n barData.forEach(point => {\n if (!categoryToValues[point.name]) {\n categoryToValues[point.name] = [];\n }\n point.series.forEach(seriesPoint => {\n categoryToValues[point.name].push(seriesPoint.data);\n });\n });\n lineData.forEach(series => {\n series.data.forEach(point => {\n if (!categoryToValues[point.x]) {\n categoryToValues[point.x] = [];\n }\n categoryToValues[point.x].push(point.y);\n });\n });\n return categoryToValues;\n };\n\n const { barData, lineData } = _prepareChartData();\n const _xAxisType: XAxisTypes = getTypeOfAxis(barData[0].name, true) as XAxisTypes;\n const { barLegends, lineLegends, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(barData, lineData);\n _barLegends = barLegends;\n _lineLegends = lineLegends;\n _xAxisLabels = xAxisLabels;\n _datasetForBars = datasetForBars;\n const legendBars: JSXElement = _getLegendData();\n _adjustProps();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Add commentMore actions\n function _getMinMaxOfYAxis(datasetForBars: any, yAxisType?: YAxisType, useSecondaryYScale?: boolean) {\n const values: number[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n datasetForBars.forEach((data: any) => {\n data.groupSeries.forEach((point: GVBarChartSeriesPoint) => {\n if (!useSecondaryYScale === !point.useSecondaryYScale) {\n values.push(point.data);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _getDomainNRangeValues(\n points: GroupedVerticalBarChartData[],\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 || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n // The maxOfYVal prop is only required for the primary y-axis, so yMax should be calculated\n // using only the data points associated with the primary y-axis.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const yMax = _getMinMaxOfYAxis(_datasetForBars).endValue;\n _yMax = Math.max(yMax, props.yMaxValue || 0);\n\n const calloutProps: ChartPopoverProps = {\n positioning: { target: popoverTarget },\n isPopoverOpen,\n color,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover: yValueHover,\n hoverXValue,\n culture: props.culture,\n isCartesian: true,\n isCalloutForStack: props.isCalloutForStack,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues!,\n tickFormat: props.tickFormat!,\n };\n\n const _getGraphData = (\n xScale: StringScale | NumericScale,\n yScalePrimary: ScaleLinear<number, number>,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) => {\n const xScale0 = _createX0Scale(containerWidth);\n\n // Setting the bar width here is safe because there are no dependencies earlier in the code\n // that rely on the width of bars in vertical bar charts with string x-axis.\n _barWidth = getBarWidth(\n props.barWidth,\n props.maxBarWidth,\n calcBandwidth(xScale0.bandwidth(), _barLegends.length, X1_INNER_PADDING),\n );\n _groupWidth = calcRequiredWidth(_barWidth, _barLegends.length, X1_INNER_PADDING);\n\n const xScale1 = _createX1Scale();\n const allGroupsBars: JSXElement[] = [];\n _datasetForBars.forEach((singleSet: GVSingleDataPoint) => {\n allGroupsBars.push(\n _buildGraph(singleSet, xScale0, xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement!),\n );\n });\n _groupedVerticalBarGraph = allGroupsBars;\n };\n\n const _getMargins = (margins: Margins) => {\n _margins = margins;\n };\n\n const onBarHover = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint !== pointData) {\n _calloutAnchorPoint = pointData;\n _showCallout(mouseEvent.currentTarget, pointData, groupData);\n }\n };\n\n const _onBarLeave = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n };\n\n const onBarFocus = (\n focusEvent: React.FocusEvent<SVGRectElement, Element>,\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n ): void => {\n _showCallout(focusEvent.currentTarget, pointData, groupData);\n };\n\n const _buildGraph = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n singleSet: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale0: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale1: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n containerHeight: number,\n xElement: SVGElement,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ): JSXElement => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const singleGroup: JSXElement[] = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const barLabelsForGroup: JSXElement[] = [];\n\n // Get the actual legends present at this x-axis point\n const presentLegends = _barLegends.filter(key => key in singleSet);\n const effectiveGroupWidth = calcRequiredWidth(_barWidth, presentLegends.length, X1_INNER_PADDING);\n\n // For stacked bars, center the single bar group in the available space\n // Instead of using the global legend position, use the local position within present legends\n const localScale = d3ScaleBand()\n .domain(presentLegends)\n .range(_useRtl ? [effectiveGroupWidth, 0] : [0, effectiveGroupWidth])\n .paddingInner(X1_INNER_PADDING);\n _barLegends.forEach((legendTitle: string, legendIndex: number) => {\n const barPoints = singleSet[legendTitle];\n if (barPoints) {\n const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n\n const xPoint = (localScale(legendTitle) ?? 0) + (localScale.bandwidth() - _barWidth) / 2;\n const isLegendActive = _legendHighlighted(legendTitle) || _noLegendHighlighted();\n const barOpacity = isLegendActive ? '' : '0.1';\n\n let barTotalValue = 0;\n const yBaseline = yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = Y_ORIGIN;\n\n barPoints.forEach((pointData: GVBarChartSeriesPoint, pointIndex: number) => {\n if (!pointData.data) {\n // Not rendering data with 0.\n return;\n }\n const barGap = (VERTICAL_BAR_GAP / 2) * (pointIndex > 0 ? 2 : 0);\n const height = Math.max(yBarScale(Y_ORIGIN) - yBarScale(Math.abs(pointData.data)), MIN_BAR_HEIGHT);\n const pointColor = pointData.color; // Use the color of the current point\n\n if (pointData.data >= Y_ORIGIN) {\n yPositiveStart -= height + barGap;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + barGap;\n yNegativeStart = yPoint + height;\n }\n\n singleGroup.push(\n <rect\n key={`${singleSet.indexNum}-${legendIndex}-${pointIndex}`}\n className={classes.opacityChangeOnHover}\n height={height}\n width={_barWidth}\n x={xPoint}\n y={yPoint}\n opacity={barOpacity}\n fill={pointColor}\n rx={props.roundCorners ? 3 : 0}\n onMouseOver={event => onBarHover(pointData, singleSet, event)}\n onMouseMove={event => onBarHover(pointData, singleSet, event)}\n onMouseOut={_onBarLeave}\n onFocus={event => onBarFocus(event, pointData, singleSet)}\n onBlur={_onBarLeave}\n onClick={pointData.onClick}\n aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}\n tabIndex={_legendHighlighted(pointData.legend) || _noLegendHighlighted() ? 0 : undefined}\n role=\"img\"\n />,\n );\n\n barTotalValue += pointData.data;\n });\n if (barTotalValue !== null && !props.hideLabels && Math.ceil(_barWidth) >= 16 && isLegendActive) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${legendIndex}`}\n x={xPoint + _barWidth / 2}\n y={barTotalValue >= Y_ORIGIN ? yPositiveStart - 6 : yNegativeStart + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(barTotalValue)\n : formatScientificLimitWidth(barTotalValue)}\n </text>,\n );\n }\n }\n });\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale0);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return (\n <g\n key={singleSet.indexNum}\n transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - effectiveGroupWidth) / 2}, 0)`}\n >\n {singleGroup}\n {barLabelsForGroup}\n </g>\n );\n };\n\n // For grouped vertical bar chart, First need to define total scale (from start to end)\n // From that need to define scale for single group of bars - done by createX1Scale\n const _createX0Scale = (containerWidth: number) => {\n const x0Axis = d3ScaleBand()\n .domain(xAxisLabels)\n .range(\n _useRtl\n ? [containerWidth! - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth! - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n return x0Axis;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _createX1Scale = (): any => {\n return (\n d3ScaleBand()\n .domain(_barLegends)\n // When there is only one group, xScale0 adds padding around it,\n // causing the bandwidth to become smaller than the actual group width.\n // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.\n .range(_useRtl ? [_groupWidth, 0] : [0, _groupWidth])\n .paddingInner(X1_INNER_PADDING)\n );\n };\n\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n\n const _getAxisData = React.useCallback(\n (yAxisData: IAxisData) => {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || 0);\n }\n },\n [props.yMaxValue],\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 const _legendHighlighted = (legendTitle: string) => {\n return _getHighlightedLegend().includes(legendTitle!);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return _getHighlightedLegend().length === 0;\n };\n\n const _getHighlightedLegend = () => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n };\n\n const getAriaLabel = (point: GVBarChartSeriesPoint, xAxisPoint: string): string => {\n const xValue = point.xAxisCalloutData || xAxisPoint;\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n };\n\n const _getDomainMargins = (containerWidth: number): Margins => {\n /** Total width available to render the bars */\n const totalWidth = calcTotalWidth(containerWidth, _margins, MIN_DOMAIN_MARGIN);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first group and after the last group.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const groupWidth = calcRequiredWidth(_barWidth, _barLegends.length, X1_INNER_PADDING);\n /** Total width required to render the groups. Directly proportional to group width */\n const reqWidth = calcRequiredWidth(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering groups at their maximum allowable width\n const groupBandwidth = calcBandwidth(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const barBandwidth = calcBandwidth(groupBandwidth, _barLegends.length, X1_INNER_PADDING);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);\n const groupWidth = calcRequiredWidth(barWidth, _barLegends.length, X1_INNER_PADDING);\n let reqWidth = calcRequiredWidth(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);\n const margin1 = (totalWidth - reqWidth) / 2;\n\n let margin2 = Number.POSITIVE_INFINITY;\n if (!props.hideTickOverlap) {\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(_xAxisLabels) + 20;\n reqWidth = (_xAxisLabels.length - _xAxisInnerPadding) * step;\n margin2 = (totalWidth - reqWidth) / 2;\n }\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n };\n\n const _isChartEmpty = (_barData: GroupedVerticalBarChartData[], _lineData: GVBCLineSeries[]): boolean => {\n return !(\n (_barData &&\n _barData.length > 0 &&\n _barData.filter((item: GroupedVerticalBarChartData) => item.series.length).length > 0) ||\n (_lineData && _lineData.length > 0 && _lineData.some(series => series.data.length > 0))\n );\n };\n\n const _getChartTitle = (): string => {\n return (\n (props.chartTitle ? `${props.chartTitle}. ` : '') +\n `Vertical bar chart with ${_barLegends.length} grouped bar series` +\n (_lineLegends.length > 0 ? ` and ${_lineLegends.length} line series. ` : '. ')\n );\n };\n\n const _createLines = (\n _lineData: GVBCLineSeries[],\n xScale: StringScale,\n yScalePrimary: NumericScale,\n yScaleSecondary?: NumericScale,\n ): React.ReactNode => {\n const lineBorders: React.ReactNode[] = [];\n const lines: React.ReactNode[] = [];\n const dots: React.ReactNode[] = [];\n\n const scaleLineX = (x: string) => xScale(x)! + xScale.bandwidth() / 2;\n\n _lineData.forEach((series, seriesIdx) => {\n const lineBorderGroup: React.ReactNode[] = [];\n const lineGroup: React.ReactNode[] = [];\n const dotGroup: React.ReactNode[] = [];\n const lineBorderWidth = series.lineOptions?.lineBorderWidth\n ? Number.parseFloat(series.lineOptions.lineBorderWidth.toString())\n : 0;\n const yScale = series.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n const shouldHighlight = _legendHighlighted(series.legend) || _noLegendHighlighted();\n\n series.data.forEach((point, pointIdx) => {\n const x2 = scaleLineX(point.x);\n const y2 = yScale(point.y);\n\n if (pointIdx > 0) {\n const x1 = scaleLineX(series.data[pointIdx - 1].x);\n const y1 = yScale(series.data[pointIdx - 1].y);\n\n if (lineBorderWidth > 0) {\n lineBorderGroup.push(\n <line\n key={`lineBorder-${seriesIdx}-${pointIdx}`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n fill=\"transparent\"\n stroke={series.lineOptions?.lineBorderColor ?? tokens.colorNeutralBackground1}\n strokeWidth={3 + lineBorderWidth * 2}\n strokeLinecap=\"round\"\n opacity={shouldHighlight ? 1 : 0.1}\n />,\n );\n }\n\n lineGroup.push(\n <line\n key={`line-${seriesIdx}-${pointIdx}`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={series.color}\n strokeWidth={series.lineOptions?.strokeWidth ?? 3}\n strokeLinecap={series.lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={series.lineOptions?.strokeDasharray}\n opacity={shouldHighlight ? 1 : 0.1}\n onMouseOver={e => _onLineHover(e, series, seriesIdx, pointIdx, scaleLineX)}\n onMouseLeave={_onBarLeave}\n />,\n );\n }\n\n const dotId = _getDotId(seriesIdx, pointIdx);\n const isLinePointActive = activeLinePoint === point.x || activeLinePoint === dotId;\n\n dotGroup.push(\n <circle\n key={dotId}\n id={dotId}\n cx={x2}\n cy={y2}\n r={shouldHighlight && isLinePointActive ? 8 : 0.3}\n fill={tokens.colorNeutralBackground1}\n stroke={series.color}\n strokeWidth={3}\n opacity={shouldHighlight ? 1 : 0.1}\n onMouseOver={e => _onLineHover(e, series, seriesIdx, pointIdx, scaleLineX)}\n onMouseLeave={_onBarLeave}\n data-is-focusable={shouldHighlight}\n onFocus={e => _onLineFocus(e, series, seriesIdx, pointIdx)}\n onBlur={_onBarLeave}\n role=\"img\"\n aria-label={getAriaLabel(\n {\n xAxisCalloutData: point.xAxisCalloutData,\n legend: series.legend,\n yAxisCalloutData: point.yAxisCalloutData,\n data: point.y,\n callOutAccessibilityData: point.callOutAccessibilityData,\n } as GVBarChartSeriesPoint,\n point.x,\n )}\n />,\n );\n });\n\n lineBorders.push(<g key={`lineBorderGroup-${seriesIdx}`}>{lineBorderGroup}</g>);\n lines.push(<g key={`lineGroup-${seriesIdx}`}>{lineGroup}</g>);\n dots.push(<g key={`dotGroup-${seriesIdx}`}>{dotGroup}</g>);\n });\n\n return dots.length > 0 ? (\n <g>\n {lineBorders.length > 0 ? <g>{lineBorders}</g> : null}\n {lines.length > 0 ? <g>{lines}</g> : null}\n <g>{dots}</g>\n </g>\n ) : null;\n };\n\n const _onLineHover = (\n event: React.MouseEvent<SVGElement>,\n series: GVBCLineSeries,\n seriesIdx: number,\n pointIdx: number,\n scaleLineX: (x: string) => number,\n ) => {\n const pointerX = d3Pointer(event, _rectRef.current)[0];\n\n let closestPointIdx = pointIdx;\n if (pointIdx > 0) {\n const currPointPos = scaleLineX(series.data[pointIdx].x);\n const prevPointPos = scaleLineX(series.data[pointIdx - 1].x);\n\n if (Math.abs(prevPointPos - pointerX) < Math.abs(currPointPos - pointerX)) {\n closestPointIdx = pointIdx - 1;\n }\n }\n\n event.persist();\n _showCalloutForLines(event.currentTarget, series, seriesIdx, closestPointIdx);\n };\n\n const _onLineFocus = (\n event: React.FocusEvent<SVGElement>,\n series: GVBCLineSeries,\n seriesIdx: number,\n pointIdx: number,\n ) => {\n _showCalloutForLines(event.currentTarget, series, seriesIdx, pointIdx);\n };\n\n const _showCalloutForLines = (target: SVGElement, series: GVBCLineSeries, seriesIdx: number, pointIdx: number) => {\n const point = series.data[pointIdx];\n const pointData = {\n ...point,\n legend: series.legend,\n color: series.color!,\n key: series.legend,\n data: point.y,\n yAxisCalloutData: point.yAxisCalloutData as string | undefined,\n };\n const groupData = _datasetForBars.find((singleSet: { xAxisPoint: string }) => singleSet.xAxisPoint === point.x);\n\n _showCallout(target, pointData, groupData, _getDotId(seriesIdx, pointIdx));\n };\n\n const _showCallout = (\n target: SVGElement,\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n _activeLinePoint = '',\n ) => {\n setPopoverTarget(target);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData ?? groupData.xAxisPoint);\n setYCalloutValue(pointData.yAxisCalloutData);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(\n groupData.groupSeries.filter((item: YValueHover) => _noLegendHighlighted() || _legendHighlighted(item.legend!)),\n );\n setHoverXValue(pointData.xAxisCalloutData ?? groupData.xAxisPoint);\n setActiveLinePoint(props.isCalloutForStack ? groupData.xAxisPoint : _activeLinePoint);\n };\n\n const _getDotId = (seriesIdx: number, pointIdx: number) => {\n return _uniqDotId + `-${seriesIdx}-${pointIdx}`;\n };\n\n return !_isChartEmpty(barData, lineData) ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_datasetForBars}\n chartType={ChartTypes.GroupedVerticalBarChart}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n createStringYAxis={createStringYAxis}\n calloutProps={calloutProps}\n legendBars={legendBars}\n xAxisType={_xAxisType}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_xAxisLabels}\n tickParams={tickParams}\n tickPadding={props.tickPadding || 5}\n maxOfYVal={_yMax}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n barwidth={_barWidth}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={(childProps: ChildProps) => {\n return (\n <>\n <rect ref={_rectRef} width=\"100%\" height=\"100%\" fill=\"transparent\" style={{ pointerEvents: 'none' }} />\n <g>{_groupedVerticalBarGraph}</g>\n {_createLines(lineData, childProps.xScale, childProps.yScalePrimary, childProps.yScaleSecondary)}\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["React","useGroupedVerticalBarChartStyles_unstable","select","d3Select","pointer","d3Pointer","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","tooltipOfAxislabels","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","calcRequiredWidth","calcTotalWidth","calcBandwidth","calcTotalBandUnits","sortAxisCategories","CartesianChart","Legends","getColorFromToken","toImage","tokens","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","_props","forwardedRef","props","xAxisCategoryOrder","maxBarWidth","_tooltipId","_emptyChartId","_useRtl","_domainMargin","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","_barLegends","_lineLegends","_legendColorMap","cartesianChartRef","useRef","Y_ORIGIN","_legendsRef","_rectRef","_uniqDotId","color","setColor","useState","dataForHoverCard","setDataForHoverCard","selectedLegends","setSelectedLegends","legendProps","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","yValueHover","setYValueHover","hoverXValue","setHoverXValue","calloutLegend","setCalloutLegend","activeLegend","setActiveLegend","callOutAccessibilityData","setCallOutAccessibilityData","undefined","popoverTarget","setPopoverTarget","isPopoverOpen","setPopoverOpen","activeLinePoint","setActiveLinePoint","classes","useEffect","useImperativeHandle","componentRef","chartContainer","current","opts","toSVG","_adjustProps","barWidth","xAxisInnerPadding","length","xAxisOuterPadding","_createDataset","barData","lineData","datasetForBars","linePointsByX","visitedX","Set","forEach","series","data","point","x","push","legend","y","useSecondaryYScale","index","singleDatasetPointForBars","legendToBarPoint","seriesPoint","xAxisPoint","name","indexNum","groupSeries","Object","values","stackCallOutAccessibilityData","add","keys","xPoint","has","_createDataSetOfGVBC","barLegends","lineLegends","map","xAxisLabels","_getOrderedXAxisLabels","Array","from","onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","actions","addLegendButton","legendTitle","isLineLegendInBarChart","title","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","legendRef","_processDataV2","dataV2","barPointsByX","type","key","xAxisCalloutData","yAxisCalloutData","onClick","_prepareChartData","isArray","colorIndex","startColor","endColor","lineColor","_xAxisType","StringAxis","_mapCategoryToValues","categoryToValues","legendBars","_getMinMaxOfYAxis","yAxisType","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","yMax","Math","yMaxValue","calloutProps","positioning","target","XValue","YValue","YValueHover","culture","isCartesian","isCalloutForStack","tickParams","tickFormat","_getGraphData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","xScale0","_createX0Scale","bandwidth","xScale1","_createX1Scale","allGroupsBars","singleSet","_buildGraph","_getMargins","onBarHover","pointData","groupData","mouseEvent","persist","_showCallout","currentTarget","_onBarLeave","onBarFocus","focusEvent","singleGroup","barLabelsForGroup","presentLegends","filter","effectiveGroupWidth","localScale","domain","range","paddingInner","legendIndex","barPoints","yBarScale","isLegendActive","_legendHighlighted","_noLegendHighlighted","barOpacity","barTotalValue","yBaseline","yPositiveStart","yNegativeStart","yPoint","pointIndex","barGap","height","abs","pointColor","rect","className","opacityChangeOnHover","opacity","fill","rx","roundCorners","onMouseOver","onMouseMove","onMouseOut","onFocus","onBlur","aria-label","getAriaLabel","tabIndex","role","hideLabels","ceil","text","textAnchor","barLabel","aria-hidden","style","direction","unicodeBidi","yAxisTickFormat","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","call","document","getElementById","remove","e","tooltipProps","tooltipCls","tooltip","id","axis","g","transform","x0Axis","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","margin2","Number","POSITIVE_INFINITY","hideTickOverlap","step","_isChartEmpty","_barData","_lineData","item","some","_getChartTitle","chartTitle","_createLines","lineBorders","lines","dots","scaleLineX","seriesIdx","lineBorderGroup","lineGroup","dotGroup","lineBorderWidth","lineOptions","parseFloat","toString","yScale","shouldHighlight","pointIdx","x2","y2","x1","y1","line","stroke","lineBorderColor","colorNeutralBackground1","strokeWidth","strokeLinecap","strokeDasharray","_onLineHover","onMouseLeave","dotId","_getDotId","isLinePointActive","circle","cx","cy","r","data-is-focusable","_onLineFocus","pointerX","closestPointIdx","currPointPos","prevPointPos","_showCalloutForLines","find","_activeLinePoint","getDomainNRangeValues","getMinMaxOfYAxis","createYAxis","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","childProps","ref","pointerEvents","div","displayName"],"mappings":"AAAA;;;;;+BA8Ea2C;;;;;;;iEA5EU,QAAQ;wDAC2B,4CAA4C;6BAC7C,eAAe;yBAC7B,WAAW;yBACW,WAAW;gCAE1C,4BAA4B;uBA0BvD,wBAAwB;wBAoBxB,cAAc;kCACG,qCAAqC;4BACtC,wBAAwB;AAK/C,MAAMJ,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,MAAMC,mBAAmB;AACzB,MAAMC,iBAAiB;AAchB,gCAAMC,WAAAA,GAAkE3C,OAAM4C,UAAU,CAG7F,CAACC,QAAQC;QA+B8DC,oBAmBnEA;IAjDJ,MAAMA,QAAsC;QAC1CC,oBAAoB;QACpBC,aAAa;QACb,GAAGJ,MAAM;IACX;IACA,MAAMK,iBAAqBtC,qBAAAA,EAAM;IACjC,MAAMuC,oBAAwBvC,qBAAAA,EAAM;IACpC,MAAMwC,cA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AAA,WAAA,GACE,OAAA,aAAA,CAAA,OAAA,QAAA,EAAA,MAAA,WAAA,GACE,OAAA,aAAA,CAACnI,QAAAA;gBAAKoI,KAAKxV;gBAAUoI,OAAM;gBAAO6E,QAAO;gBAAOO,MAAK;gBAAckB,OAAO;oBAAE+G,eAAe;gBAAO;8BAClG,OAAA,aAAA,CAAC9F,KAAAA,MAAGzQ,2BACH2S,aAAa/O,UAAUyS,WAAWvL,MAAM,EAAEuL,WAAWtL,aAAa,EAAEsL,WAAWjL,eAAe;QAGrG;uBAGF,OAAA,aAAA,CAACoL,OAAAA;QAAIjG,IAAIjR;QAAe2P,MAAM;QAASO,OAAO;YAAEnB,SAAS;QAAI;QAAGS,cAAY;;AAEhF,GAAG;AACHhQ,wBAAwB2X,WAAW,GAAG"}
|
package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.ts"],"sourcesContent":["import {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n GroupedVerticalBarChartData,\n} from '../../index';\n\n/**\n * Vertical Bar Chart properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: GroupedVerticalBarChartData[];\n\n /**\n * Width of each bar in the chart. When set to `undefined` or `'default'`, the bar width defaults to 16px,\n * which may decrease to prevent overlap. When set to `'auto'`, the bar width is calculated from padding values.\n * @default 16\n */\n barWidth?: number | 'default' | 'auto';\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: GroupedVerticalBarChartStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * To display multi stack callout or single callout\n * @default false\n */\n isCalloutForStack?: boolean;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * Maximum width of a bar, in pixels.\n * @default 24\n */\n maxBarWidth?: number;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1]. Only applicable to string x-axis.\n * @default 2/3\n */\n xAxisInnerPadding?: number;\n\n /**\n * Padding before the first bar and after the last bar as a fraction of\n * the [step](https://d3js.org/d3-scale/band#band_step). Takes a number in the range [0, 1].\n * Only applicable to string x-axis.\n */\n xAxisOuterPadding?: number;\n\n /**\n * Specifies the mode of the chart.\n * @default 'default'\n */\n mode?: 'default' | 'plotly';\n\n /**\n * @default false\n * The prop used to enable rounded corners for the chart.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Vertical Bar Chart style properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Vertical Bar Chart styles\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyles extends CartesianChartStyles {\n /**\n * Style for the bar labels\n */\n barLabel: string;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.ts"],"sourcesContent":["import {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n GroupedVerticalBarChartData,\n BarSeries,\n LineSeries,\n} from '../../index';\n\n/**\n * Vertical Bar Chart properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: GroupedVerticalBarChartData[];\n\n /**\n * Width of each bar in the chart. When set to `undefined` or `'default'`, the bar width defaults to 16px,\n * which may decrease to prevent overlap. When set to `'auto'`, the bar width is calculated from padding values.\n * @default 16\n */\n barWidth?: number | 'default' | 'auto';\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: GroupedVerticalBarChartStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * To display multi stack callout or single callout\n * @default false\n */\n isCalloutForStack?: boolean;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * Maximum width of a bar, in pixels.\n * @default 24\n */\n maxBarWidth?: number;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1]. Only applicable to string x-axis.\n * @default 2/3\n */\n xAxisInnerPadding?: number;\n\n /**\n * Padding before the first bar and after the last bar as a fraction of\n * the [step](https://d3js.org/d3-scale/band#band_step). Takes a number in the range [0, 1].\n * Only applicable to string x-axis.\n */\n xAxisOuterPadding?: number;\n\n /**\n * Specifies the mode of the chart.\n * @default 'default'\n */\n mode?: 'default' | 'plotly';\n\n /**\n * @default false\n * The prop used to enable rounded corners for the chart.\n */\n roundCorners?: boolean;\n\n /**\n * New flexible data prop - supports both bar and line series.\n * Use `dataV2` instead of `data` when line series are included.\n */\n dataV2?: (BarSeries<string, number> | LineSeries<string, number>)[];\n}\n\n/**\n * Vertical Bar Chart style properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Vertical Bar Chart styles\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyles extends CartesianChartStyles {\n /**\n * Style for the bar labels\n */\n barLabel: string;\n}\n"],"names":[],"mappings":"AA+GA;;;CAGC,GACD,WAKC"}
|
|
@@ -79,7 +79,7 @@ const Legends = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
79
79
|
const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;
|
|
80
80
|
const itemIds = dataToRender.map((_item, index)=>index.toString());
|
|
81
81
|
const overflowHoverCardLegends = [];
|
|
82
|
-
|
|
82
|
+
dataToRender.map((legend, index)=>{
|
|
83
83
|
const hoverCardElement = _renderButton(legend, index);
|
|
84
84
|
overflowHoverCardLegends.push(hoverCardElement);
|
|
85
85
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Legends/Legends.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\nimport { cloneLegendsToSVG } from '../../utilities/image-export-utils';\nimport { mergeClasses } from '@griffel/react';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n legendAnnotation?: () => React.ReactNode;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n let _rootElem = React.useRef<HTMLDivElement | null>(null);\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n const classes = useLegendStyles(props);\n const toSVG = React.useCallback(\n (svgWidth: number, isRTL: boolean = false) => {\n return cloneLegendsToSVG(\n props.legends,\n svgWidth,\n {\n selectedLegends,\n centerLegends: !!props.centerLegends,\n textClassName: classes.text!,\n isRTL,\n },\n _rootElem.current,\n );\n },\n [props.legends, props.centerLegends, selectedLegends, classes.text],\n );\n\n React.useImperativeHandle(props.legendRef, () => ({\n toSVG,\n }));\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSXElement[] = [];\n props.legends.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n ref={el => (_rootElem.current = el)}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map(item => (\n <div\n className={mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation)}\n key={item.key}\n >\n {_renderButton(item)}\n {item.legendAnnotation && <div>{item.legendAnnotation()}</div>}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n legendAnnotation: legend.legendAnnotation,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","cloneLegendsToSVG","mergeClasses","Legends","forwardRef","props","forwardedRef","_isLegendSelected","_rootElem","useRef","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","classes","toSVG","useCallback","svgWidth","isRTL","legends","centerLegends","textClassName","text","current","useImperativeHandle","legendRef","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","itemIds","map","_item","index","toString","overflowHoverCardLegends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","ref","el","resizableArea","style","textAlign","item","id","title","items","justifyContent","flexWrap","display","overflow","legendContainer","legendAnnotation","annotation","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA;;;;;+BAyCaY;;;;;;;iEAvCU,QAAQ;6BAGR,yBAAyB;uBAE1B,UAAU;wCACA,4BAA4B;+BACrB,2BAA2B;8BACP,0BAA0B;8BACxD,iBAAiB;4BACvB,wBAAwB;kCACb,qCAAqC;wBAC1C,iBAAiB;AA2BvC,gBAAMA,WAAAA,GAAiDZ,OAAMa,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IACxB,IAAIC,YAAYjB,OAAMkB,MAAM,CAAwB;IAEpD,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGpB,OAAMqB,QAAQ,CAAC;IACvD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGvB,OAAMqB,QAAQ,CAAY,CAAC;IACzE,MAAM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AAA,GACE,OAAA,aAAA,CAACjG,YAAAA,EAAAA;YACCmI,UAAUL;YACVM,WAAWL;YACXnC,OAAO7B,OAAO6B,KAAK;YACnByC,oBAAoB3G,QAAQ4G,IAAI;YAChCvD,OACE;gBACEwD,QAAQxE,OAAOoC,sBAAsB,GAAG,QAAQ;gBAChDqC,iBAAiBzE,OAAOmC,aAAa,GAAG,KAAKD;gBAC7CwC,aAAa1E,OAAOkC,KAAK,GAAGlC,OAAOkC,KAAK,GAAG1F,kBAAAA,CAAOqH,mBAAmB;gBACrEc,SAAS3E,OAAOmC,aAAa,GAEzB,CAAC,gEAAgE,EAAED,MAAM,MAAM,EAAEA,MAAM,KAAK,CAAC,GAC7F;gBACJ,gCAAgC,CAAC,0BAA0B,EAAEA,MAAM,EAAE,EAAEA,MAAM,CAAC,CAAC;gBAC/E,gCAAgCA,UAAU1F,kBAAAA,CAAOsH,uBAAuB,GAAG,QAAQ;YACrF;;IAIR;IAEA,SAASb,UAAU7B,KAAa,EAAEc,KAAa;QAC7C,IAAI0C,cAAc1C;QAClB,sCAAsC;QACtC,IAAInF,mBAAmB;YACrB,6DAA6D;YAC7D,IAAIM,eAAe,CAAC+D,MAAM,EAAE;gBAC1BwD,cAAc1C;YAChB,OAEK;gBACH0C,cAAcpI,kBAAAA,CAAOsH,uBAAuB;YAC9C;QACF,OAEK;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAI5G,iBAAiBkE,SAASlE,iBAAiB,IAAI;gBACjD0H,cAAc1C;YAChB,OAEK;gBACH0C,cAAcpI,kBAAAA,CAAOsH,uBAAuB;YAC9C;QACF;QACA,OAAOc;IACT;AACF,GACA;AACFjI,QAAQkI,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/Legends/Legends.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport { Button } from '@fluentui/react-button';\nimport { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\nimport { cloneLegendsToSVG } from '../../utilities/image-export-utils';\nimport { mergeClasses } from '@griffel/react';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n legendAnnotation?: () => React.ReactNode;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n let _rootElem = React.useRef<HTMLDivElement | null>(null);\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n const classes = useLegendStyles(props);\n const toSVG = React.useCallback(\n (svgWidth: number, isRTL: boolean = false) => {\n return cloneLegendsToSVG(\n props.legends,\n svgWidth,\n {\n selectedLegends,\n centerLegends: !!props.centerLegends,\n textClassName: classes.text!,\n isRTL,\n },\n _rootElem.current,\n );\n },\n [props.legends, props.centerLegends, selectedLegends, classes.text],\n );\n\n React.useImperativeHandle(props.legendRef, () => ({\n toSVG,\n }));\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSXElement[] = [];\n dataToRender.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n className={classes.root}\n ref={el => (_rootElem.current = el)}\n >\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item)}\n </OverflowItem>\n ))}\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map(item => (\n <div\n className={mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation)}\n key={item.key}\n >\n {_renderButton(item)}\n {item.legendAnnotation && <div>{item.legendAnnotation()}</div>}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n legendAnnotation: legend.legendAnnotation,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number) {\n const { allowFocusOnLegends = true } = props;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLButtonElement>) => {\n _onClick(legend, event);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n return (\n <Button\n {...(allowFocusOnLegends && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n 'aria-setsize': data['aria-setsize'],\n 'aria-posinset': data['aria-posinset'],\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n className={classes.legend}\n onClick={onClickHandler}\n onMouseOver={onHoverHandler}\n onMouseOut={onMouseOut}\n onFocus={onHoverHandler}\n onBlur={onMouseOut}\n appearance={'outline'}\n size=\"small\"\n style={{\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n }} /* eslint-enable react/jsx-no-bind */\n >\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? // eslint-disable-next-line @fluentui/max-len\n `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","cloneLegendsToSVG","mergeClasses","Legends","forwardRef","props","forwardedRef","_isLegendSelected","_rootElem","useRef","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","classes","toSVG","useCallback","svgWidth","isRTL","legends","centerLegends","textClassName","text","current","useImperativeHandle","legendRef","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","itemIds","map","_item","index","toString","overflowHoverCardLegends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","role","className","root","ref","el","resizableArea","style","textAlign","item","id","title","items","justifyContent","flexWrap","display","overflow","legendContainer","legendAnnotation","annotation","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","nativeButtonProps","onClick","onMouseOver","onFocus","onBlur","appearance","size","colorNeutralStroke1","colorNeutralBackground1","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA;;;;;+BAyCaY;;;;;;;iEAvCU,QAAQ;6BAGR,yBAAyB;uBAE1B,UAAU;wCACA,4BAA4B;+BACrB,2BAA2B;8BACP,0BAA0B;8BACxD,iBAAiB;4BACvB,wBAAwB;kCACb,qCAAqC;wBAC1C,iBAAiB;AA2BvC,gBAAMA,WAAAA,GAAiDZ,OAAMa,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IACxB,IAAIC,YAAYjB,OAAMkB,MAAM,CAAwB;IAEpD,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGpB,OAAMqB,QAAQ,CAAC;IACvD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGvB,OAAMqB,QAAQ,CAAY,CAAC;IACzE,MAAMG,sBAAkBlB,+BAAAA;IACxB,MAAMmB,sBAAkBlB,qCAAAA,EAAwB;QAAEmB,MAAM;QAAcC,iBAAiB;IAAK;IAC5F,MAAMC,UAAUzB,2CAAAA,EAAgBW;IAChC,MAAMe,QAAQ7B,OAAM8B,WAAW,CAC7B,CAACC,UAAkBC,QAAiB,KAAK;QACvC,WAAOtB,mCAAAA,EACLI,MAAMmB,OAAO,EACbF,UACA;YACET;YACAY,eAAe,CAAC,CAACpB,MAAMoB,aAAa;YACpCC,eAAeP,QAAQQ,IAAI;YAC3BJ;QACF,GACAf,UAAUoB,OAAO;IAErB,GACA;QAACvB,MAAMmB,OAAO;QAAEnB,MAAMoB,aAAa;QAAEZ;QAAiBM,QAAQQ,IAAI;KAAC;IAGrEpC,OAAMsC,mBAAmB,CAACxB,MAAMyB,SAAS,EAAE,IAAO;YAChDV;SACF,CAAA;IAEA7B,OAAMwC,SAAS,CAAC;YACiB1B;QAA/B,MAAM2B,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