@fluentui/react-charts 9.3.26 → 9.3.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +34 -2
  2. package/dist/index.d.cts +61 -5
  3. package/dist/index.d.ts +61 -5
  4. package/lib/components/AreaChart/AreaChart.js +33 -3
  5. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  6. package/lib/components/CommonComponents/CartesianChart.js +6 -0
  7. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  8. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  9. package/lib/components/CommonComponents/ChartPopover.js +2 -1
  10. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  11. package/lib/components/GanttChart/GanttChart.js +1 -0
  12. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  13. package/lib/components/GaugeChart/GaugeChart.js +33 -12
  14. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  15. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  16. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +25 -25
  17. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  18. package/lib/components/HeatMapChart/HeatMapChart.js +1 -0
  19. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  20. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -1
  21. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  22. package/lib/components/Legends/Legends.js +15 -18
  23. package/lib/components/Legends/Legends.js.map +1 -1
  24. package/lib/components/Legends/OverflowMenu.js +13 -10
  25. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  26. package/lib/components/LineChart/LineChart.js +17 -13
  27. package/lib/components/LineChart/LineChart.js.map +1 -1
  28. package/lib/components/ScatterChart/ScatterChart.js +2 -1
  29. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  30. package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +1 -0
  31. package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -1
  32. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +52 -44
  33. package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
  34. package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -1
  35. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  36. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +1 -0
  37. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  38. package/lib/types/DataPoint.js.map +1 -1
  39. package/lib/utilities/test-data/specialChartNames.js +11 -0
  40. package/lib/utilities/test-data/specialChartNames.js.map +1 -0
  41. package/lib/utilities/utilities.js +4 -1
  42. package/lib/utilities/utilities.js.map +1 -1
  43. package/lib-commonjs/components/AreaChart/AreaChart.cjs +33 -3
  44. package/lib-commonjs/components/AreaChart/AreaChart.cjs.map +1 -1
  45. package/lib-commonjs/components/CommonComponents/CartesianChart.cjs +6 -0
  46. package/lib-commonjs/components/CommonComponents/CartesianChart.cjs.map +1 -1
  47. package/lib-commonjs/components/CommonComponents/CartesianChart.types.cjs.map +1 -1
  48. package/lib-commonjs/components/CommonComponents/ChartPopover.cjs +2 -1
  49. package/lib-commonjs/components/CommonComponents/ChartPopover.cjs.map +1 -1
  50. package/lib-commonjs/components/GanttChart/GanttChart.cjs +1 -0
  51. package/lib-commonjs/components/GanttChart/GanttChart.cjs.map +1 -1
  52. package/lib-commonjs/components/GaugeChart/GaugeChart.cjs +33 -12
  53. package/lib-commonjs/components/GaugeChart/GaugeChart.cjs.map +1 -1
  54. package/lib-commonjs/components/GaugeChart/GaugeChart.types.cjs.map +1 -1
  55. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs +24 -23
  56. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs.map +1 -1
  57. package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs +1 -0
  58. package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs.map +1 -1
  59. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs +2 -1
  60. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs.map +1 -1
  61. package/lib-commonjs/components/Legends/Legends.cjs +15 -17
  62. package/lib-commonjs/components/Legends/Legends.cjs.map +1 -1
  63. package/lib-commonjs/components/Legends/OverflowMenu.cjs +12 -9
  64. package/lib-commonjs/components/Legends/OverflowMenu.cjs.map +1 -1
  65. package/lib-commonjs/components/LineChart/LineChart.cjs +17 -13
  66. package/lib-commonjs/components/LineChart/LineChart.cjs.map +1 -1
  67. package/lib-commonjs/components/ScatterChart/ScatterChart.cjs +2 -1
  68. package/lib-commonjs/components/ScatterChart/ScatterChart.cjs.map +1 -1
  69. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs +1 -0
  70. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs.map +1 -1
  71. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs +52 -44
  72. package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs.map +1 -1
  73. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs +2 -1
  74. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs.map +1 -1
  75. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs +1 -0
  76. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs.map +1 -1
  77. package/lib-commonjs/types/DataPoint.cjs.map +1 -1
  78. package/lib-commonjs/utilities/test-data/specialChartNames.cjs +21 -0
  79. package/lib-commonjs/utilities/test-data/specialChartNames.cjs.map +1 -0
  80. package/lib-commonjs/utilities/utilities.cjs +4 -1
  81. package/lib-commonjs/utilities/utilities.cjs.map +1 -1
  82. package/package.json +9 -9
@@ -41,7 +41,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
41
41
  let _xAxisOuterPadding = 0;
42
42
  let _barLegends = [];
43
43
  let _lineLegends = [];
44
- let _legendColorMap = {};
44
+ let _legendColorMap = Object.create(null);
45
45
  const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);
46
46
  const Y_ORIGIN = 0;
47
47
  const _rectRef = React.useRef(null);
@@ -78,7 +78,6 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
78
78
  _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);
79
79
  };
80
80
  const _createDataset = (barData, lineData)=>{
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
81
  const datasetForBars = [];
83
82
  const linePointsByX = Object.create(null);
84
83
  const visitedX = new Set();
@@ -97,12 +96,11 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
97
96
  });
98
97
  });
99
98
  barData.forEach((point, index)=>{
100
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
- const singleDatasetPointForBars = Object.create(null);
99
+ const barPointsByLegend = Object.create(null);
102
100
  const legendToBarPoint = Object.create(null);
103
101
  point.series.forEach((seriesPoint)=>{
104
- if (!singleDatasetPointForBars[seriesPoint.legend]) {
105
- singleDatasetPointForBars[seriesPoint.legend] = [
102
+ if (!barPointsByLegend[seriesPoint.legend]) {
103
+ barPointsByLegend[seriesPoint.legend] = [
106
104
  {
107
105
  ...seriesPoint
108
106
  }
@@ -111,27 +109,31 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
111
109
  ...seriesPoint
112
110
  };
113
111
  } else {
114
- singleDatasetPointForBars[seriesPoint.legend].push({
112
+ barPointsByLegend[seriesPoint.legend].push({
115
113
  ...seriesPoint
116
114
  });
117
115
  legendToBarPoint[seriesPoint.legend].data += seriesPoint.data;
118
116
  }
119
117
  });
120
- singleDatasetPointForBars.xAxisPoint = point.name;
121
- singleDatasetPointForBars.indexNum = index;
122
118
  var _linePointsByX_point_name;
123
- singleDatasetPointForBars.groupSeries = [
124
- ...Object.values(legendToBarPoint),
125
- ...(_linePointsByX_point_name = linePointsByX[point.name]) !== null && _linePointsByX_point_name !== void 0 ? _linePointsByX_point_name : []
126
- ];
127
- singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;
128
- datasetForBars.push(singleDatasetPointForBars);
119
+ datasetForBars.push({
120
+ barPointsByLegend,
121
+ xAxisPoint: point.name,
122
+ indexNum: index,
123
+ groupSeries: [
124
+ ...Object.values(legendToBarPoint),
125
+ ...(_linePointsByX_point_name = linePointsByX[point.name]) !== null && _linePointsByX_point_name !== void 0 ? _linePointsByX_point_name : []
126
+ ],
127
+ stackCallOutAccessibilityData: point.stackCallOutAccessibilityData
128
+ });
129
129
  visitedX.add(point.name);
130
130
  });
131
131
  Object.keys(linePointsByX).forEach((xPoint)=>{
132
132
  if (!visitedX.has(xPoint)) {
133
133
  datasetForBars.push({
134
+ barPointsByLegend: Object.create(null),
134
135
  xAxisPoint: xPoint,
136
+ indexNum: datasetForBars.length,
135
137
  groupSeries: linePointsByX[xPoint]
136
138
  });
137
139
  }
@@ -195,7 +197,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
195
197
  });
196
198
  };
197
199
  const _processDataV2 = (dataV2)=>{
198
- const barPointsByX = {};
200
+ const barPointsByX = Object.create(null);
199
201
  const lineData = [];
200
202
  dataV2.forEach((series)=>{
201
203
  if (series.type === 'bar') {
@@ -234,7 +236,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
234
236
  if (Array.isArray(props.dataV2) && props.dataV2.length > 0) {
235
237
  ({ barData, lineData } = _processDataV2(props.dataV2));
236
238
  }
237
- _legendColorMap = {};
239
+ _legendColorMap = Object.create(null);
238
240
  let colorIndex = 0;
239
241
  var _barData_map, _lineData_map;
240
242
  return {
@@ -290,7 +292,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
290
292
  return sortAxisCategories(_mapCategoryToValues(barData, lineData), props.xAxisCategoryOrder);
291
293
  };
292
294
  const _mapCategoryToValues = (barData, lineData)=>{
293
- const categoryToValues = {};
295
+ const categoryToValues = Object.create(null);
294
296
  barData.forEach((point)=>{
295
297
  if (!categoryToValues[point.name]) {
296
298
  categoryToValues[point.name] = [];
@@ -320,10 +322,8 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
320
322
  _datasetForBars = datasetForBars;
321
323
  const legendBars = _getLegendData();
322
324
  _adjustProps();
323
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Add commentMore actions
324
325
  function _getMinMaxOfYAxis(datasetForBars, yAxisType, useSecondaryYScale) {
325
326
  const values = [];
326
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
327
327
  datasetForBars.forEach((data)=>{
328
328
  data.groupSeries.forEach((point)=>{
329
329
  if (!useSecondaryYScale === !point.useSecondaryYScale) {
@@ -409,14 +409,13 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
409
409
  groupData)=>{
410
410
  _showCallout(focusEvent.currentTarget, pointData, groupData);
411
411
  };
412
- const _buildGraph = (// eslint-disable-next-line @typescript-eslint/no-explicit-any
413
- singleSet, // eslint-disable-next-line @typescript-eslint/no-explicit-any
412
+ const _buildGraph = (singleSet, // eslint-disable-next-line @typescript-eslint/no-explicit-any
414
413
  xScale0, // eslint-disable-next-line @typescript-eslint/no-explicit-any
415
414
  xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement)=>{
416
415
  const singleGroup = [];
417
416
  const barLabelsForGroup = [];
418
417
  // Get the actual legends present at this x-axis point
419
- const presentLegends = _barLegends.filter((key)=>key in singleSet);
418
+ const presentLegends = _barLegends.filter((key)=>Object.prototype.hasOwnProperty.call(singleSet.barPointsByLegend, key));
420
419
  const effectiveGroupWidth = calcRequiredWidth(_barWidth, presentLegends.length, X1_INNER_PADDING);
421
420
  // For stacked bars, center the single bar group in the available space
422
421
  // Instead of using the global legend position, use the local position within present legends
@@ -428,7 +427,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
428
427
  effectiveGroupWidth
429
428
  ]).paddingInner(X1_INNER_PADDING);
430
429
  _barLegends.forEach((legendTitle, legendIndex)=>{
431
- const barPoints = singleSet[legendTitle];
430
+ const barPoints = singleSet.barPointsByLegend[legendTitle];
432
431
  if (barPoints) {
433
432
  const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
434
433
  var _localScale;
@@ -775,7 +774,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
775
774
  points: _datasetForBars,
776
775
  chartType: ChartTypes.GroupedVerticalBarChart,
777
776
  getDomainNRangeValues: _getDomainNRangeValues,
778
- getMinMaxOfYAxis: _getMinMaxOfYAxis,
777
+ getMinMaxOfYAxis: (_points, yAxisType, useSecondaryYScale)=>_getMinMaxOfYAxis(_datasetForBars, yAxisType, useSecondaryYScale),
779
778
  createStringYAxis: createStringYAxis,
780
779
  calloutProps: calloutProps,
781
780
  legendBars: legendBars,
@@ -789,6 +788,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
789
788
  getGraphData: _getGraphData,
790
789
  getAxisData: _getAxisData,
791
790
  onChartMouseLeave: _handleChartMouseLeave,
791
+ onChartBlur: _handleChartMouseLeave,
792
792
  getDomainMargins: _getDomainMargins,
793
793
  ..._xAxisType === XAxisTypes.StringAxis && {
794
794
  xAxisInnerPadding: _xAxisInnerPadding,
@@ -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 { pointer as d3Pointer } from 'd3-selection';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport type { ScaleBand, ScaleLinear } from 'd3-scale';\nimport { scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useId } from '@fluentui/react-utilities';\nimport type { IAxisData, IDomainNRange, YAxisType } from '../../utilities/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n calcRequiredWidth,\n calcTotalWidth,\n calcBandwidth,\n calcTotalBandUnits,\n sortAxisCategories,\n} from '../../utilities/index';\n\nimport type {\n AccessibilityProps,\n Margins,\n Legend,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n YValueHover,\n ChartPopoverProps,\n LineSeries,\n BarSeries,\n ChildProps,\n} from '../../index';\nimport { CartesianChart, Legends, getColorFromToken } from '../../index';\nimport { tokens } from '@fluentui/react-theme';\nimport { useImageExport } from '../../utilities/hooks';\nimport { isInvalidValue } from '@fluentui/chart-utilities';\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 _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, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n const Y_ORIGIN: number = 0;\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 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[]> = Object.create(null);\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 = Object.create(null);\n const legendToBarPoint: Record<string, GVBarChartSeriesPoint> = Object.create(null);\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 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 const startColor = seriesPoint.color ? seriesPoint.color : getNextColor(colorIndex, 0);\n const 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 firstXValue = barData[0]?.name ?? lineData[0]?.data[0]?.x;\n const _xAxisType: XAxisTypes = isInvalidValue(firstXValue)\n ? XAxisTypes.StringAxis\n : (getTypeOfAxis(firstXValue, 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 ) {\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\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 ): JSXElement => {\n const singleGroup: JSXElement[] = [];\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=\"option\"\n />,\n );\n\n // Render individual bar label if provided\n if (pointData.barLabel && isLegendActive) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${legendIndex}-${pointIndex}-label`}\n x={xPoint + _barWidth / 2}\n y={pointData.data >= Y_ORIGIN ? yPoint - 6 : yPoint + height + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\n >\n {pointData.barLabel}\n </text>,\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\n const categoryGroupAriaLabel = `${singleSet.xAxisPoint}, category ${singleSet.indexNum + 1} of ${\n _datasetForBars.length\n }, with ${presentLegends.length} bars`;\n\n return (\n <g\n role=\"listbox\"\n aria-label={categoryGroupAriaLabel}\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 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 tabIndex={shouldHighlight ? 0 : undefined}\n onFocus={e => _onLineFocus(e, series, seriesIdx, pointIdx)}\n onBlur={_onBarLeave}\n role=\"option\"\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 const dotGroupAriaLabel = `${series.legend || `Line ${seriesIdx + 1}`}, line with ${\n series.data.length\n } data points`;\n\n lineBorders.push(<g key={`lineBorderGroup-${seriesIdx}`}>{lineBorderGroup}</g>);\n lines.push(<g key={`lineGroup-${seriesIdx}`}>{lineGroup}</g>);\n dots.push(\n <g role=\"listbox\" key={`dotGroup-${seriesIdx}`} aria-label={dotGroupAriaLabel}>\n {dotGroup}\n </g>,\n );\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","pointer","d3Pointer","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","calcRequiredWidth","calcTotalWidth","calcBandwidth","calcTotalBandUnits","sortAxisCategories","CartesianChart","Legends","getColorFromToken","tokens","useImageExport","isInvalidValue","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","_props","forwardedRef","props","barData","lineData","xAxisCategoryOrder","maxBarWidth","_emptyChartId","_useRtl","_domainMargin","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","_barLegends","_lineLegends","_legendColorMap","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","Y_ORIGIN","_rectRef","useRef","_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","_adjustProps","barWidth","xAxisInnerPadding","length","xAxisOuterPadding","_createDataset","datasetForBars","linePointsByX","Object","create","visitedX","Set","forEach","series","data","point","x","push","legend","y","useSecondaryYScale","index","singleDatasetPointForBars","legendToBarPoint","seriesPoint","xAxisPoint","name","indexNum","groupSeries","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","firstXValue","legendBars","_getMinMaxOfYAxis","yAxisType","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","tickValues","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","barLabel","text","textAnchor","aria-hidden","style","direction","unicodeBidi","hideLabels","ceil","yAxisTickFormat","categoryGroupAriaLabel","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","e","_onLineHover","onMouseLeave","dotId","_getDotId","isLinePointActive","circle","id","cx","cy","r","_onLineFocus","dotGroupAriaLabel","pointerX","current","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;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yCAAyC,QAAQ,+CAA4C;AACtG,SAASC,WAAWC,SAAS,QAAQ,eAAe;AACpD,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AAEtD,SAASC,aAAaC,WAAW,QAAQ,WAAW;AAGpD,SAASC,KAAK,QAAQ,4BAA4B;AAElD,SACEC,UAAU,EACVC,uBAAuB,E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QACZyJ,cAAczK;QACd0K,aAAatF;QACbuF,mBAAmB1O;QACnB2O,kBAAkB9E;QACjB,GAAIrI,eAAejL,WAAWkL,UAAU,IAAI;YAC3C/E,mBAAmB/C;YACnBiD,mBAAmBhD;QACrB,CAAC;QACDgV,UAAUnV;QACVU,cAAcH;QACd,oCAAoC,GACpC6U,UAAU,CAACC;YACT,qBACE,wDACE,oBAAC1H;gBAAK2H,KAAKzU;gBAAU+H,OAAM;gBAAO4E,QAAO;gBAAOO,MAAK;gBAAcgB,OAAO;oBAAEwG,eAAe;gBAAO;8BAClG,oBAACjG,WAAGzP,2BACH2R,aAAaxS,UAAUqW,WAAW9K,MAAM,EAAE8K,WAAW7K,aAAa,EAAE6K,WAAWxK,eAAe;QAGrG;uBAGF,oBAAC2K;QAAI9B,IAAIvU;QAAeuP,MAAM;QAASK,OAAO;YAAEjB,SAAS;QAAI;QAAGS,cAAY;;AAEhF,GAAG;AACH7P,wBAAwB+W,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 { pointer as d3Pointer } from 'd3-selection';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport type { ScaleBand, ScaleLinear } from 'd3-scale';\nimport { scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { useId } from '@fluentui/react-utilities';\nimport type { IAxisData, IDomainNRange, YAxisType } from '../../utilities/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n calcRequiredWidth,\n calcTotalWidth,\n calcBandwidth,\n calcTotalBandUnits,\n sortAxisCategories,\n} from '../../utilities/index';\n\nimport type {\n AccessibilityProps,\n Margins,\n Legend,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n YValueHover,\n ChartPopoverProps,\n LineSeries,\n BarSeries,\n ChildProps,\n} from '../../index';\nimport { CartesianChart, Legends, getColorFromToken } from '../../index';\nimport { tokens } from '@fluentui/react-theme';\nimport { useImageExport } from '../../utilities/hooks';\nimport { isInvalidValue } from '@fluentui/chart-utilities';\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\ntype GVGroupSeriesPoint = YValueHover & { data: number; useSecondaryYScale?: boolean };\n\ninterface GVSingleDatasetPoint {\n barPointsByLegend: Record<string, GVBarChartSeriesPoint[]>;\n groupSeries: GVGroupSeriesPoint[];\n indexNum: number;\n stackCallOutAccessibilityData?: AccessibilityProps;\n xAxisPoint: string;\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 _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _xAxisLabels: string[] = [];\n let _datasetForBars: GVSingleDatasetPoint[] = [];\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]> = Object.create(null);\n const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n const Y_ORIGIN: number = 0;\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 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 const datasetForBars: GVSingleDatasetPoint[] = [];\n\n const linePointsByX: Record<string, GVGroupSeriesPoint[]> = Object.create(null);\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 });\n });\n });\n\n barData.forEach((point: GroupedVerticalBarChartData, index: number) => {\n const barPointsByLegend: Record<string, GVBarChartSeriesPoint[]> = Object.create(null);\n const legendToBarPoint: Record<string, GVBarChartSeriesPoint> = Object.create(null);\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint) => {\n if (!barPointsByLegend[seriesPoint.legend]) {\n barPointsByLegend[seriesPoint.legend] = [{ ...seriesPoint }];\n legendToBarPoint[seriesPoint.legend] = { ...seriesPoint };\n } else {\n barPointsByLegend[seriesPoint.legend].push({ ...seriesPoint });\n legendToBarPoint[seriesPoint.legend].data += seriesPoint.data;\n }\n });\n\n datasetForBars.push({\n barPointsByLegend,\n xAxisPoint: point.name,\n indexNum: index,\n groupSeries: [...Object.values(legendToBarPoint), ...(linePointsByX[point.name] ?? [])],\n stackCallOutAccessibilityData: point.stackCallOutAccessibilityData,\n });\n visitedX.add(point.name);\n });\n\n Object.keys(linePointsByX).forEach(xPoint => {\n if (!visitedX.has(xPoint)) {\n datasetForBars.push({\n barPointsByLegend: Object.create(null),\n xAxisPoint: xPoint,\n indexNum: datasetForBars.length,\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 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> = Object.create(null);\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 = Object.create(null);\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 const startColor = seriesPoint.color ? seriesPoint.color : getNextColor(colorIndex, 0);\n const 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[]> = Object.create(null);\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 firstXValue = barData[0]?.name ?? lineData[0]?.data[0]?.x;\n const _xAxisType: XAxisTypes = isInvalidValue(firstXValue)\n ? XAxisTypes.StringAxis\n : (getTypeOfAxis(firstXValue, 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 function _getMinMaxOfYAxis(\n datasetForBars: GVSingleDatasetPoint[],\n yAxisType?: YAxisType,\n useSecondaryYScale?: boolean,\n ) {\n const values: number[] = [];\n datasetForBars.forEach(data => {\n data.groupSeries.forEach(point => {\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 ) {\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\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 => {\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 singleSet: GVSingleDatasetPoint,\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 ): JSXElement => {\n const singleGroup: JSXElement[] = [];\n const barLabelsForGroup: JSXElement[] = [];\n\n // Get the actual legends present at this x-axis point\n const presentLegends = _barLegends.filter(key =>\n Object.prototype.hasOwnProperty.call(singleSet.barPointsByLegend, key),\n );\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.barPointsByLegend[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=\"option\"\n />,\n );\n\n // Render individual bar label if provided\n if (pointData.barLabel && isLegendActive) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${legendIndex}-${pointIndex}-label`}\n x={xPoint + _barWidth / 2}\n y={pointData.data >= Y_ORIGIN ? yPoint - 6 : yPoint + height + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n style={{ direction: 'ltr', unicodeBidi: 'isolate' }}\n >\n {pointData.barLabel}\n </text>,\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\n const categoryGroupAriaLabel = `${singleSet.xAxisPoint}, category ${singleSet.indexNum + 1} of ${\n _datasetForBars.length\n }, with ${presentLegends.length} bars`;\n\n return (\n <g\n role=\"listbox\"\n aria-label={categoryGroupAriaLabel}\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 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 tabIndex={shouldHighlight ? 0 : undefined}\n onFocus={e => _onLineFocus(e, series, seriesIdx, pointIdx)}\n onBlur={_onBarLeave}\n role=\"option\"\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 const dotGroupAriaLabel = `${series.legend || `Line ${seriesIdx + 1}`}, line with ${\n series.data.length\n } data points`;\n\n lineBorders.push(<g key={`lineBorderGroup-${seriesIdx}`}>{lineBorderGroup}</g>);\n lines.push(<g key={`lineGroup-${seriesIdx}`}>{lineGroup}</g>);\n dots.push(\n <g role=\"listbox\" key={`dotGroup-${seriesIdx}`} aria-label={dotGroupAriaLabel}>\n {dotGroup}\n </g>,\n );\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 => 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={(_points, yAxisType, useSecondaryYScale) =>\n _getMinMaxOfYAxis(_datasetForBars, yAxisType, useSecondaryYScale)\n }\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 onChartBlur={_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","pointer","d3Pointer","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","calcRequiredWidth","calcTotalWidth","calcBandwidth","calcTotalBandUnits","sortAxisCategories","CartesianChart","Legends","getColorFromToken","tokens","useImageExport","isInvalidValue","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","_props","forwardedRef","props","barData","lineData","xAxisCategoryOrder","maxBarWidth","_emptyChartId","_useRtl","_domainMargin","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","_barLegends","_lineLegends","_legendColorMap","Object","create","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","Y_ORIGIN","_rectRef","useRef","_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","_adjustProps","barWidth","xAxisInnerPadding","length","xAxisOuterPadding","_createDataset","datasetForBars","linePointsByX","visitedX","Set","forEach","series","data","point","x","push","legend","y","useSecondaryYScale","index","barPointsByLegend","legendToBarPoint","seriesPoint","xAxisPoint","name","indexNum","groupSeries","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","firstXValue","legendBars","_getMinMaxOfYAxis","yAxisType","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","tickValues","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","prototype","hasOwnProperty","call","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","barLabel","text","textAnchor","aria-hidden","style","direction","unicodeBidi","hideLabels","ceil","yAxisTickFormat","categoryGroupAriaLabel","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","e","_onLineHover","onMouseLeave","dotId","_getDotId","isLinePointActive","circle","id","cx","cy","r","_onLineFocus","dotGroupAriaLabel","pointerX","current","closestPointIdx","currPointPos","prevPointPos","_showCalloutForLines","find","_activeLinePoint","getDomainNRangeValues","getMinMaxOfYAxis","_points","createYAxis","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","onChartBlur","getDomainMargins","barwidth","children","childProps","ref","pointerEvents","div","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yCAAyC,QAAQ,+CAA4C;AACtG,SAASC,WAAWC,SAAS,QAAQ,eAAe;AACpD,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AAEtD,SAASC,aAAaC,WAAW,QAAQ,WAAW;AAGpD,SAASC,KAAK,QAAQ,4BAA4B;AAElD,SACEC,UAAU,EACVC,uBAAuB,EACvBC,UAAU,EACVC,aAAa,EACbC,0BAA0B,EAC1BC,eAAe,EACfC,WAAW,EACXC,qBAAqB,EACrBC,kBAAkB,EAClBC,wBAAwB,EACxBC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,EACdC,0BAA0B,EAC1BC,MAAM,EACNC,iBAAiB,EACjBC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,kBAAkB,QACb,2BAAwB;AAe/B,SAASC,cAAc,EAAEC,OAAO,EAAEC,iBAAiB,QAAQ,iBAAc;AACzE,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,cAAc,QAAQ,4BAA4B;AAK3D,MAAMC,oBAAoB;AAC1B,MAAMC,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AM;gBAAO+E,QAAO;gBAAOO,MAAK;gBAAcgB,OAAO;oBAAE0G,eAAe;gBAAO;8BAClG,oBAACnG,WAAG5P,2BACH8R,aAAa3S,UAAU0W,WAAWnL,MAAM,EAAEmL,WAAWlL,aAAa,EAAEkL,WAAW7K,eAAe;QAGrG;uBAGF,oBAACgL;QAAIhC,IAAI1U;QAAe0P,MAAM;QAASK,OAAO;YAAEjB,SAAS;QAAI;QAAGS,cAAY;;AAEhF,GAAG;AACHhQ,wBAAwBoX,WAAW,GAAG"}
@@ -664,6 +664,7 @@ export const HeatMapChart = /*#__PURE__*/ React.forwardRef((props = {
664
664
  yAxisPadding: 0.02,
665
665
  legendBars: _createLegendBars(),
666
666
  onChartMouseLeave: _handleChartMouseLeave,
667
+ onChartBlur: _handleChartMouseLeave,
667
668
  componentRef: cartesianChartRef,
668
669
  tickParams: tickParams,
669
670
  /* eslint-disable react/jsx-no-bind */ children: (p)=>{