@fluentui/react-charts 9.0.1 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/dist/index.d.ts +463 -36
  3. package/lib/GaugeChart.js +1 -0
  4. package/lib/GaugeChart.js.map +1 -0
  5. package/lib/GroupedVerticalBarChart.js +1 -0
  6. package/lib/GroupedVerticalBarChart.js.map +1 -0
  7. package/lib/ScatterChart.js +1 -0
  8. package/lib/ScatterChart.js.map +1 -0
  9. package/lib/components/GaugeChart/GaugeChart.js +589 -0
  10. package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
  11. package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
  12. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
  13. package/lib/components/GaugeChart/index.js +3 -0
  14. package/lib/components/GaugeChart/index.js.map +1 -0
  15. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +174 -0
  16. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  17. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +492 -0
  18. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  19. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
  20. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  21. package/lib/components/GroupedVerticalBarChart/index.js +3 -0
  22. package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
  23. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +90 -0
  24. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  25. package/lib/components/Legends/Legends.types.js.map +1 -1
  26. package/lib/components/LineChart/LineChart.js.map +1 -1
  27. package/lib/components/ScatterChart/ScatterChart.js +478 -0
  28. package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
  29. package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
  30. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
  31. package/lib/components/ScatterChart/index.js +3 -0
  32. package/lib/components/ScatterChart/index.js.map +1 -0
  33. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +65 -0
  34. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  35. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  36. package/lib/index.js +3 -0
  37. package/lib/index.js.map +1 -1
  38. package/lib/types/DataPoint.js.map +1 -1
  39. package/lib/utilities/utilities.js +123 -5
  40. package/lib/utilities/utilities.js.map +1 -1
  41. package/lib-commonjs/GaugeChart.js +6 -0
  42. package/lib-commonjs/GaugeChart.js.map +1 -0
  43. package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
  44. package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
  45. package/lib-commonjs/ScatterChart.js +6 -0
  46. package/lib-commonjs/ScatterChart.js.map +1 -0
  47. package/lib-commonjs/components/GaugeChart/GaugeChart.js +618 -0
  48. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
  49. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
  50. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
  51. package/lib-commonjs/components/GaugeChart/index.js +8 -0
  52. package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
  53. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +252 -0
  54. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
  55. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +498 -0
  56. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
  57. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
  58. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
  59. package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
  60. package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
  61. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +139 -0
  62. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
  63. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  64. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  65. package/lib-commonjs/components/ScatterChart/ScatterChart.js +484 -0
  66. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
  67. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
  68. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
  69. package/lib-commonjs/components/ScatterChart/index.js +8 -0
  70. package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
  71. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +96 -0
  72. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
  73. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  74. package/lib-commonjs/index.js +3 -0
  75. package/lib-commonjs/index.js.map +1 -1
  76. package/lib-commonjs/types/DataPoint.js.map +1 -1
  77. package/lib-commonjs/utilities/utilities.js +115 -5
  78. package/lib-commonjs/utilities/utilities.js.map +1 -1
  79. package/package.json +6 -6
@@ -0,0 +1,492 @@
1
+ import * as React from 'react';
2
+ import { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';
3
+ import { max as d3Max } from 'd3-array';
4
+ import { select as d3Select } from 'd3-selection';
5
+ import { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear } from 'd3-scale';
6
+ import { useId } from '@fluentui/react-utilities';
7
+ import { ChartTypes, getAccessibleDataObject, tooltipOfXAxislabels, XAxisTypes, getTypeOfAxis, formatValueWithSIPrefix, getScalePadding, getBarWidth, isScalePaddingDefined, getNextColor, areArraysEqual, calculateLongestLabelWidth, useRtl } from '../../utilities/index';
8
+ import { CartesianChart, Legends, DataVizPalette, getColorFromToken } from '../../index';
9
+ const MIN_DOMAIN_MARGIN = 8;
10
+ const X1_INNER_PADDING = 0.1;
11
+ // x1_inner_padding = space_between_bars / (space_between_bars + bar_width)
12
+ // => space_between_bars = (x1_inner_padding / (1 - x1_inner_padding)) * bar_width
13
+ /** Rate at which the space between the bars in a group changes wrt the bar width */ const BAR_GAP_RATE = X1_INNER_PADDING / (1 - X1_INNER_PADDING);
14
+ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((props = {
15
+ maxBarWidth: 24
16
+ }, forwardedRef)=>{
17
+ var _props_legendProps, _props_legendProps1;
18
+ const _tooltipId = useId('GVBCTooltipId_');
19
+ const _emptyChartId = useId('_GVBC_empty');
20
+ const _useRtl = useRtl();
21
+ let _domainMargin = MIN_DOMAIN_MARGIN;
22
+ let _dataset = [];
23
+ let _keys = [];
24
+ let _xAxisLabels = [];
25
+ let _datasetForBars = [];
26
+ let _margins = {
27
+ top: 0,
28
+ right: 0,
29
+ bottom: 0,
30
+ left: 0
31
+ };
32
+ let _groupedVerticalBarGraph = [];
33
+ let _refArray = [];
34
+ let _yMax = 0;
35
+ let _calloutAnchorPoint = null;
36
+ let _barWidth = 0;
37
+ let _groupWidth = 0;
38
+ let _xAxisInnerPadding = 0;
39
+ let _xAxisOuterPadding = 0;
40
+ const [color, setColor] = React.useState('');
41
+ const [dataForHoverCard, setDataForHoverCard] = React.useState(0);
42
+ const [selectedLegends, setSelectedLegends] = React.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
43
+ const [xCalloutValue, setXCalloutValue] = React.useState('');
44
+ const [yCalloutValue, setYCalloutValue] = React.useState('');
45
+ const [YValueHover, setYValueHover] = React.useState([]);
46
+ const [hoverXValue, setHoverXValue] = React.useState('');
47
+ const [calloutLegend, setCalloutLegend] = React.useState('');
48
+ const [activeLegend, setActiveLegend] = React.useState('');
49
+ const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState(undefined);
50
+ const [clickPosition, setClickPosition] = React.useState({
51
+ x: 0,
52
+ y: 0
53
+ });
54
+ const [isPopoverOpen, setPopoverOpen] = React.useState(false);
55
+ const classes = useGroupedVerticalBarChartStyles_unstable(props);
56
+ React.useEffect(()=>{
57
+ var _props_legendProps;
58
+ if (!areArraysEqual((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends, selectedLegends)) {
59
+ var _props_legendProps1;
60
+ setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
61
+ }
62
+ }, [
63
+ (_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends
64
+ ]);
65
+ const _adjustProps = ()=>{
66
+ _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);
67
+ // x0_inner_padding = space_between_groups / (space_between_groups + group_width)
68
+ // space_between_groups = 2 * bar_width
69
+ // group_width = keys.length * bar_width + (keys.length - 1) * space_between_bars
70
+ _xAxisInnerPadding = getScalePadding(props.xAxisInnerPadding, undefined, 2 / (2 + keys.length + (keys.length - 1) * BAR_GAP_RATE));
71
+ _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);
72
+ };
73
+ const _createDataset = (points)=>{
74
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
+ const datasetForBars = [];
76
+ const dataset = [];
77
+ points.forEach((point, index)=>{
78
+ const singleDatasetPoint = {};
79
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
80
+ const singleDatasetPointForBars = {};
81
+ const singleDataSeries = [];
82
+ point.series.forEach((seriesPoint, seriesIndex)=>{
83
+ singleDatasetPoint[seriesPoint.key] = seriesPoint.data;
84
+ singleDatasetPointForBars[seriesPoint.key] = {
85
+ ...seriesPoint
86
+ };
87
+ singleDataSeries.push(seriesPoint);
88
+ });
89
+ singleDatasetPointForBars.xAxisPoint = point.name;
90
+ singleDatasetPointForBars.indexNum = index;
91
+ singleDatasetPointForBars.groupSeries = singleDataSeries;
92
+ singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;
93
+ datasetForBars.push(singleDatasetPointForBars);
94
+ dataset.push(singleDatasetPoint);
95
+ });
96
+ _dataset = dataset;
97
+ return datasetForBars;
98
+ };
99
+ const _createDataSetOfGVBC = (points)=>{
100
+ const keys = [];
101
+ const xAxisLabels = points.map((singlePoint)=>singlePoint.name);
102
+ points[0].series.forEach((singleKey)=>{
103
+ keys.push(singleKey.key);
104
+ });
105
+ const datasetForBars = _createDataset(points);
106
+ return {
107
+ keys,
108
+ xAxisLabels,
109
+ datasetForBars
110
+ };
111
+ };
112
+ const onLegendSelectionChange = (selectedLegends, event, currentLegend)=>{
113
+ var _props_legendProps, _props_legendProps1;
114
+ if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
115
+ setSelectedLegends(selectedLegends);
116
+ } else {
117
+ setSelectedLegends(selectedLegends.slice(-1));
118
+ }
119
+ if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
120
+ props.legendProps.onChange(selectedLegends, event, currentLegend);
121
+ }
122
+ };
123
+ const _getLegendData = (points)=>{
124
+ const data = points;
125
+ const defaultPalette = [
126
+ getColorFromToken(DataVizPalette.color1),
127
+ getColorFromToken(DataVizPalette.color2),
128
+ getColorFromToken(DataVizPalette.color3),
129
+ getColorFromToken(DataVizPalette.color4),
130
+ getColorFromToken(DataVizPalette.color5)
131
+ ];
132
+ const actions = [];
133
+ data.forEach((singleChartData)=>{
134
+ singleChartData.series.forEach((point)=>{
135
+ let color = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];
136
+ const checkSimilarLegends = actions.filter((leg)=>leg.title === point.legend && leg.color === color);
137
+ if (checkSimilarLegends.length > 0) {
138
+ return;
139
+ }
140
+ const legend = {
141
+ title: point.legend,
142
+ color,
143
+ hoverAction: ()=>{
144
+ _handleChartMouseLeave();
145
+ _onLegendHover(point.legend);
146
+ },
147
+ onMouseOutAction: ()=>{
148
+ _onLegendLeave();
149
+ }
150
+ };
151
+ actions.push(legend);
152
+ });
153
+ });
154
+ return /*#__PURE__*/ React.createElement(Legends, {
155
+ legends: actions,
156
+ enabledWrapLines: props.enabledLegendsWrapLines,
157
+ overflowText: props.legendsOverflowText,
158
+ ...props.legendProps,
159
+ onChange: onLegendSelectionChange
160
+ });
161
+ };
162
+ const points = props.data;
163
+ const { keys, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points);
164
+ _keys = keys;
165
+ _xAxisLabels = xAxisLabels;
166
+ _datasetForBars = datasetForBars;
167
+ const _xAxisType = getTypeOfAxis(points[0].name, true);
168
+ const legends = _getLegendData(points);
169
+ _adjustProps();
170
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
+ const yMax = d3Max(_dataset, (point)=>d3Max(_keys, (key)=>point[key]));
172
+ _yMax = Math.max(yMax, props.yMaxValue || 0);
173
+ var _props_culture;
174
+ const calloutProps = {
175
+ clickPosition,
176
+ isPopoverOpen,
177
+ color,
178
+ legend: calloutLegend,
179
+ XValue: xCalloutValue,
180
+ YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,
181
+ YValueHover,
182
+ hoverXValue,
183
+ culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
184
+ isCartesian: true,
185
+ ...props.calloutProps,
186
+ ...getAccessibleDataObject(callOutAccessibilityData, 'text', false)
187
+ };
188
+ const tickParams = {
189
+ tickValues: props.tickValues,
190
+ tickFormat: props.tickFormat
191
+ };
192
+ const _getGraphData = (xScale, yScale, containerHeight, containerWidth, xElement)=>{
193
+ const xScale0 = _createX0Scale(containerWidth);
194
+ // Setting the bar width here is safe because there are no dependencies earlier in the code
195
+ // that rely on the width of bars in vertical bar charts with string x-axis.
196
+ _barWidth = getBarWidth(props.barWidth, props.maxBarWidth, xScale0.bandwidth() / (_keys.length + (_keys.length - 1) * BAR_GAP_RATE));
197
+ _groupWidth = (_keys.length + (_keys.length - 1) * BAR_GAP_RATE) * _barWidth;
198
+ const xScale1 = _createX1Scale();
199
+ const allGroupsBars = [];
200
+ _datasetForBars.forEach((singleSet)=>{
201
+ allGroupsBars.push(_buildGraph(singleSet, xScale0, xScale1, containerHeight, xElement));
202
+ });
203
+ _groupedVerticalBarGraph = allGroupsBars;
204
+ };
205
+ const _getMargins = (margins)=>{
206
+ _margins = margins;
207
+ };
208
+ const _getOpacity = (legendTitle)=>{
209
+ const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '' : '0.1';
210
+ return opacity;
211
+ };
212
+ function updatePosition(newX, newY) {
213
+ const threshold = 1; // Set a threshold for movement
214
+ const { x, y } = clickPosition;
215
+ // Calculate the distance moved
216
+ const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
217
+ // Update the position only if the distance moved is greater than the threshold
218
+ if (distance > threshold) {
219
+ setClickPosition({
220
+ x: newX,
221
+ y: newY
222
+ });
223
+ setPopoverOpen(true);
224
+ }
225
+ }
226
+ const onBarHover = (pointData, // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
+ groupData, mouseEvent)=>{
228
+ mouseEvent.persist();
229
+ if (_calloutAnchorPoint !== pointData) {
230
+ _calloutAnchorPoint = pointData;
231
+ updatePosition(mouseEvent.clientX, mouseEvent.clientY);
232
+ setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
233
+ setCalloutLegend(pointData.legend);
234
+ setDataForHoverCard(pointData.data);
235
+ setColor(pointData.color);
236
+ setXCalloutValue(pointData.xAxisCalloutData);
237
+ setYCalloutValue(pointData.yAxisCalloutData);
238
+ setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
239
+ setYValueHover(groupData.groupSeries);
240
+ setHoverXValue(pointData.xAxisCalloutData);
241
+ }
242
+ };
243
+ const _onBarLeave = ()=>{
244
+ /**/ };
245
+ const _handleChartMouseLeave = ()=>{
246
+ _calloutAnchorPoint = null;
247
+ setPopoverOpen(false);
248
+ };
249
+ const onBarFocus = (pointData, // eslint-disable-next-line @typescript-eslint/no-explicit-any
250
+ groupData, refArrayIndexNumber)=>{
251
+ _refArray.forEach((obj, index)=>{
252
+ if (obj.index === pointData.legend && refArrayIndexNumber === index) {
253
+ setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
254
+ setCalloutLegend(pointData.legend);
255
+ setDataForHoverCard(pointData.data);
256
+ setColor(pointData.color);
257
+ setXCalloutValue(pointData.xAxisCalloutData);
258
+ setYCalloutValue(pointData.yAxisCalloutData);
259
+ setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
260
+ setYValueHover(groupData.groupSeries);
261
+ setHoverXValue(pointData.xAxisCalloutData);
262
+ }
263
+ });
264
+ };
265
+ const _refCallback = (element, legendTitle, refIndexNumber)=>{
266
+ _refArray[refIndexNumber] = {
267
+ index: legendTitle,
268
+ refElement: element
269
+ };
270
+ };
271
+ const _buildGraph = (// eslint-disable-next-line @typescript-eslint/no-explicit-any
272
+ singleSet, // eslint-disable-next-line @typescript-eslint/no-explicit-any
273
+ xScale0, // eslint-disable-next-line @typescript-eslint/no-explicit-any
274
+ xScale1, containerHeight, xElement)=>{
275
+ const singleGroup = [];
276
+ const barLabelsForGroup = [];
277
+ const yBarScale = d3ScaleLinear().domain([
278
+ 0,
279
+ yMax
280
+ ]).range([
281
+ 0,
282
+ containerHeight - _margins.bottom - _margins.top
283
+ ]);
284
+ const tempDataSet = Object.keys(datasetForBars[0]).splice(0, keys.length);
285
+ tempDataSet.forEach((datasetKey, index)=>{
286
+ const refIndexNumber = singleSet.indexNum * tempDataSet.length + index;
287
+ const pointData = singleSet[datasetKey];
288
+ // To align the centers of the generated bandwidth and the calculated one when they differ,
289
+ // use the following addend.
290
+ const xPoint = xScale1(datasetKey) + (xScale1.bandwidth() - _barWidth) / 2;
291
+ const yPoint = Math.max(containerHeight - _margins.bottom - yBarScale(pointData.data), 0);
292
+ const startColor = pointData.color ? pointData.color : getNextColor(index, 0);
293
+ // Not rendering data with 0.
294
+ pointData.data && singleGroup.push(/*#__PURE__*/ React.createElement(React.Fragment, {
295
+ key: `${singleSet.indexNum}-${index}`
296
+ }, /*#__PURE__*/ React.createElement("rect", {
297
+ className: classes.opacityChangeOnHover,
298
+ height: Math.max(yBarScale(pointData.data), 0),
299
+ width: _barWidth,
300
+ x: xPoint,
301
+ y: yPoint,
302
+ "data-is-focusable": !props.hideTooltip && (_legendHighlighted(pointData.legend) || _noLegendHighlighted()),
303
+ opacity: _getOpacity(pointData.legend),
304
+ ref: (e)=>{
305
+ _refCallback(e, pointData.legend, refIndexNumber);
306
+ },
307
+ fill: startColor,
308
+ rx: 0,
309
+ onMouseOver: onBarHover.bind(null, pointData, singleSet),
310
+ onMouseMove: onBarHover.bind(null, pointData, singleSet),
311
+ onMouseOut: _onBarLeave,
312
+ onFocus: onBarFocus.bind(null, pointData, singleSet, refIndexNumber),
313
+ onBlur: _onBarLeave,
314
+ onClick: pointData.onClick,
315
+ "aria-label": getAriaLabel(pointData, singleSet.xAxisPoint),
316
+ tabIndex: pointData.legend !== '' ? 0 : undefined,
317
+ role: "img"
318
+ })));
319
+ if (pointData.data && !props.hideLabels && _barWidth >= 16 && (_legendHighlighted(pointData.legend) || _noLegendHighlighted())) {
320
+ barLabelsForGroup.push(/*#__PURE__*/ React.createElement("text", {
321
+ key: `${singleSet.indexNum}-${index}`,
322
+ x: xPoint + _barWidth / 2,
323
+ y: yPoint - 6,
324
+ textAnchor: "middle",
325
+ className: classes.barLabel,
326
+ "aria-hidden": true
327
+ }, formatValueWithSIPrefix(pointData.data)));
328
+ }
329
+ });
330
+ // Used to display tooltip at x axis labels.
331
+ if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {
332
+ const xAxisElement = d3Select(xElement).call(xScale0);
333
+ try {
334
+ document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
335
+ // eslint-disable-next-line no-empty
336
+ } catch (e) {}
337
+ const tooltipProps = {
338
+ tooltipCls: classes.tooltip,
339
+ id: _tooltipId,
340
+ xAxis: xAxisElement
341
+ };
342
+ xAxisElement && tooltipOfXAxislabels(tooltipProps);
343
+ }
344
+ return /*#__PURE__*/ React.createElement("g", {
345
+ key: singleSet.indexNum,
346
+ transform: `translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - _groupWidth) / 2}, 0)`
347
+ }, singleGroup, barLabelsForGroup);
348
+ };
349
+ // For grouped vertical bar chart, First need to define total scale (from start to end)
350
+ // From that need to define scale for single group of bars - done by createX1Scale
351
+ const _createX0Scale = (containerWidth)=>{
352
+ const x0Axis = d3ScaleBand().domain(xAxisLabels).range(_useRtl ? [
353
+ containerWidth - _margins.right - _domainMargin,
354
+ _margins.left + _domainMargin
355
+ ] : [
356
+ _margins.left + _domainMargin,
357
+ containerWidth - _margins.right - _domainMargin
358
+ ]).paddingInner(_xAxisInnerPadding).paddingOuter(_xAxisOuterPadding);
359
+ return x0Axis;
360
+ };
361
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
362
+ const _createX1Scale = ()=>{
363
+ return d3ScaleBand().domain(keys)// When there is only one group, xScale0 adds padding around it,
364
+ // causing the bandwidth to become smaller than the actual group width.
365
+ // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.
366
+ .range(_useRtl ? [
367
+ _groupWidth,
368
+ 0
369
+ ] : [
370
+ 0,
371
+ _groupWidth
372
+ ]).paddingInner(X1_INNER_PADDING);
373
+ };
374
+ const _onLegendHover = (legendTitle)=>{
375
+ setActiveLegend(legendTitle);
376
+ };
377
+ const _onLegendLeave = ()=>{
378
+ setActiveLegend('');
379
+ };
380
+ const _getAxisData = React.useCallback((yAxisData)=>{
381
+ if (yAxisData && yAxisData.yAxisDomainValues.length) {
382
+ const { yAxisDomainValues: domainValue } = yAxisData;
383
+ _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || 0);
384
+ }
385
+ }, [
386
+ props.yMaxValue
387
+ ]);
388
+ /**
389
+ * This function checks if the given legend is highlighted or not.
390
+ * A legend can be highlighted in 2 ways:
391
+ * 1. selection: if the user clicks on it
392
+ * 2. hovering: if there is no selected legend and the user hovers over it
393
+ */ const _legendHighlighted = (legendTitle)=>{
394
+ return _getHighlightedLegend().includes(legendTitle);
395
+ };
396
+ /**
397
+ * This function checks if none of the legends is selected or hovered.
398
+ */ const _noLegendHighlighted = ()=>{
399
+ return _getHighlightedLegend().length === 0;
400
+ };
401
+ const _getHighlightedLegend = ()=>{
402
+ return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [
403
+ activeLegend
404
+ ] : [];
405
+ };
406
+ const getAriaLabel = (point, xAxisPoint)=>{
407
+ var _point_callOutAccessibilityData;
408
+ const xValue = point.xAxisCalloutData || xAxisPoint;
409
+ const legend = point.legend;
410
+ const yValue = point.yAxisCalloutData || point.data;
411
+ return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
412
+ };
413
+ const _getDomainMargins = (containerWidth)=>{
414
+ /** Total width available to render the bars */ const totalWidth = containerWidth - (_margins.left + MIN_DOMAIN_MARGIN) - (_margins.right + MIN_DOMAIN_MARGIN);
415
+ /** Rate at which the space between the groups changes wrt the group width */ const groupGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);
416
+ if (_xAxisType === XAxisTypes.StringAxis) {
417
+ if (isScalePaddingDefined(props.xAxisOuterPadding)) {
418
+ // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available
419
+ // to adjust the space before the first group and after the last group.
420
+ _domainMargin = 0;
421
+ } else if (props.barWidth !== 'auto') {
422
+ // Update the bar width so that when CartesianChart rerenders,
423
+ // the following calculations don't use the previous bar width.
424
+ _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);
425
+ const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * _barWidth;
426
+ /** Total width required to render the groups. Directly proportional to group width */ const reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;
427
+ if (totalWidth >= reqWidth) {
428
+ // Center align the chart by setting equal left and right margins for domain
429
+ _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;
430
+ }
431
+ } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {
432
+ // Calculate the remaining width after rendering groups at their maximum allowable width
433
+ const groupBandwidth = totalWidth / (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate);
434
+ const barBandwidth = groupBandwidth / (keys.length + (keys.length - 1) * BAR_GAP_RATE);
435
+ const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);
436
+ const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * barWidth;
437
+ let reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;
438
+ const margin1 = (totalWidth - reqWidth) / 2;
439
+ // Calculate the remaining width after accounting for the space required to render x-axis labels
440
+ const step = calculateLongestLabelWidth(xAxisLabels) + 20;
441
+ reqWidth = (xAxisLabels.length - _xAxisInnerPadding) * step;
442
+ const margin2 = (totalWidth - reqWidth) / 2;
443
+ _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));
444
+ }
445
+ }
446
+ return {
447
+ ..._margins,
448
+ left: _margins.left + _domainMargin,
449
+ right: _margins.right + _domainMargin
450
+ };
451
+ };
452
+ const _isChartEmpty = ()=>{
453
+ return !(props.data && props.data.length > 0 && props.data.filter((item)=>item.series.length).length > 0);
454
+ };
455
+ const _getChartTitle = ()=>{
456
+ return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Vertical bar chart with ${_xAxisLabels.length} groups of ${_keys.length} bars each. `;
457
+ };
458
+ return !_isChartEmpty() ? /*#__PURE__*/ React.createElement(CartesianChart, {
459
+ ...props,
460
+ chartTitle: _getChartTitle(),
461
+ points: _datasetForBars,
462
+ chartType: ChartTypes.GroupedVerticalBarChart,
463
+ calloutProps: calloutProps,
464
+ legendBars: legends,
465
+ xAxisType: _xAxisType,
466
+ datasetForXAxisDomain: _xAxisLabels,
467
+ tickParams: tickParams,
468
+ tickPadding: props.tickPadding || 5,
469
+ maxOfYVal: _yMax,
470
+ getmargins: _getMargins,
471
+ getGraphData: _getGraphData,
472
+ getAxisData: _getAxisData,
473
+ onChartMouseLeave: _handleChartMouseLeave,
474
+ getDomainMargins: _getDomainMargins,
475
+ ..._xAxisType === XAxisTypes.StringAxis && {
476
+ xAxisInnerPadding: _xAxisInnerPadding,
477
+ xAxisOuterPadding: _xAxisOuterPadding
478
+ },
479
+ barwidth: _barWidth,
480
+ /* eslint-disable react/jsx-no-bind */ children: ()=>{
481
+ return /*#__PURE__*/ React.createElement("g", null, _groupedVerticalBarGraph);
482
+ }
483
+ }) : /*#__PURE__*/ React.createElement("div", {
484
+ id: _emptyChartId,
485
+ role: 'alert',
486
+ style: {
487
+ opacity: '0'
488
+ },
489
+ "aria-label": 'Graph has no data to display'
490
+ });
491
+ });
492
+ GroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GroupedVerticalBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';\nimport { max as d3Max } from 'd3-array';\nimport { select as d3Select } from 'd3-selection';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { scaleBand as d3ScaleBand, scaleLinear as d3ScaleLinear } from 'd3-scale';\n\nimport { useId } from '@fluentui/react-utilities';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n tooltipOfXAxislabels,\n XAxisTypes,\n getTypeOfAxis,\n formatValueWithSIPrefix,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n} from '../../utilities/index';\n\nimport {\n AccessibilityProps,\n CartesianChart,\n Margins,\n Legend,\n RefArrayData,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n Legends,\n YValueHover,\n DataVizPalette,\n getColorFromToken,\n ChartPopoverProps,\n} from '../../index';\n\ntype StringAxis = D3Axis<string>;\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\nconst MIN_DOMAIN_MARGIN = 8;\nconst X1_INNER_PADDING = 0.1;\n// x1_inner_padding = space_between_bars / (space_between_bars + bar_width)\n// => space_between_bars = (x1_inner_padding / (1 - x1_inner_padding)) * bar_width\n/** Rate at which the space between the bars in a group changes wrt the bar width */\nconst BAR_GAP_RATE = X1_INNER_PADDING / (1 - X1_INNER_PADDING);\n\n// This interface used for - While forming datapoints from given prop \"data\" in code\ninterface GVDataPoint {\n [key: string]: number | string;\n}\n\n// While forming datapoints from given prop \"data\" in code. These datapoints are used for to draw graph easily.\ninterface GVSingleDataPoint {\n [key: string]: GVDataPoint;\n}\n\nexport const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n GroupedVerticalBarChartProps\n>((props = { maxBarWidth: 24 }, forwardedRef) => {\n const _tooltipId: string = useId('GVBCTooltipId_');\n const _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _dataset: GVDataPoint[] = [];\n let _keys: string[] = [];\n let _xAxisLabels: string[] = [];\n let _datasetForBars: any[] = [];\n let _margins: Margins = { top: 0, right: 0, bottom: 0, left: 0 };\n let _groupedVerticalBarGraph: JSX.Element[] = [];\n let _refArray: RefArrayData[] = [];\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\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\n\n 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 = keys.length * bar_width + (keys.length - 1) * space_between_bars\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n undefined,\n 2 / (2 + keys.length + (keys.length - 1) * BAR_GAP_RATE),\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);\n };\n\n const _createDataset = (points: GroupedVerticalBarChartData[]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const datasetForBars: any = [];\n const dataset: GVDataPoint[] = [];\n\n points.forEach((point: GroupedVerticalBarChartData, index: number) => {\n const singleDatasetPoint: GVDataPoint = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDatasetPointForBars: any = {};\n const singleDataSeries: GVBarChartSeriesPoint[] = [];\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint, seriesIndex) => {\n singleDatasetPoint[seriesPoint.key] = seriesPoint.data;\n singleDatasetPointForBars[seriesPoint.key] = {\n ...seriesPoint,\n };\n singleDataSeries.push(seriesPoint);\n });\n\n singleDatasetPointForBars.xAxisPoint = point.name;\n singleDatasetPointForBars.indexNum = index;\n singleDatasetPointForBars.groupSeries = singleDataSeries;\n singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;\n datasetForBars.push(singleDatasetPointForBars);\n dataset.push(singleDatasetPoint);\n });\n _dataset = dataset;\n return datasetForBars;\n };\n\n const _createDataSetOfGVBC = (points: GroupedVerticalBarChartData[]) => {\n const keys: string[] = [];\n const xAxisLabels: string[] = points.map(singlePoint => singlePoint.name);\n points[0].series.forEach((singleKey: GVBarChartSeriesPoint) => {\n keys.push(singleKey.key);\n });\n const datasetForBars = _createDataset(points);\n return {\n keys,\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 = (points: GroupedVerticalBarChartData[]): JSX.Element => {\n const data = points;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color2),\n getColorFromToken(DataVizPalette.color3),\n getColorFromToken(DataVizPalette.color4),\n getColorFromToken(DataVizPalette.color5),\n ];\n const actions: Legend[] = [];\n\n data.forEach((singleChartData: GroupedVerticalBarChartData) => {\n singleChartData.series.forEach((point: GVBarChartSeriesPoint) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n const checkSimilarLegends = actions.filter((leg: Legend) => leg.title === point.legend && leg.color === color);\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: Legend = {\n title: point.legend,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n });\n return (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={onLegendSelectionChange}\n />\n );\n };\n\n const points = props.data;\n const { keys, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points!);\n _keys = keys;\n _xAxisLabels = xAxisLabels;\n _datasetForBars = datasetForBars;\n const _xAxisType: XAxisTypes = getTypeOfAxis(points![0].name, true) as XAxisTypes;\n const legends: JSX.Element = _getLegendData(points!);\n _adjustProps();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const yMax = d3Max(_dataset, (point: any) => d3Max(_keys, (key: string) => point[key]));\n _yMax = Math.max(yMax, props.yMaxValue || 0);\n\n const calloutProps: ChartPopoverProps = {\n clickPosition,\n isPopoverOpen,\n color,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover,\n hoverXValue,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues!,\n tickFormat: props.tickFormat!,\n };\n\n const _getGraphData = (\n xScale: StringAxis | NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\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 xScale0.bandwidth() / (_keys.length + (_keys.length - 1) * BAR_GAP_RATE),\n );\n _groupWidth = (_keys.length + (_keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n\n const xScale1 = _createX1Scale();\n const allGroupsBars: JSX.Element[] = [];\n _datasetForBars.forEach((singleSet: GVSingleDataPoint) => {\n allGroupsBars.push(_buildGraph(singleSet, xScale0, xScale1, containerHeight, xElement!));\n });\n _groupedVerticalBarGraph = allGroupsBars;\n };\n\n const _getMargins = (margins: Margins) => {\n _margins = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '' : '0.1';\n return opacity;\n };\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n const onBarHover = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint !== pointData) {\n _calloutAnchorPoint = pointData;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n };\n\n const _onBarLeave = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n };\n\n const onBarFocus = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n refArrayIndexNumber: number,\n ): void => {\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (obj.index === pointData.legend && refArrayIndexNumber === index) {\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n });\n };\n\n const _refCallback = (element: SVGRectElement, legendTitle: string, refIndexNumber: number): void => {\n _refArray[refIndexNumber] = { index: legendTitle, refElement: element };\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 containerHeight: number,\n xElement: SVGElement,\n ): JSX.Element => {\n const singleGroup: JSX.Element[] = [];\n const barLabelsForGroup: JSX.Element[] = [];\n\n const yBarScale = d3ScaleLinear()\n .domain([0, yMax])\n .range([0, containerHeight! - _margins.bottom! - _margins.top!]);\n\n const tempDataSet = Object.keys(datasetForBars[0]).splice(0, keys.length);\n tempDataSet.forEach((datasetKey: string, index: number) => {\n const refIndexNumber = singleSet.indexNum * tempDataSet.length + index;\n const pointData = singleSet[datasetKey];\n // To align the centers of the generated bandwidth and the calculated one when they differ,\n // use the following addend.\n const xPoint = xScale1(datasetKey) + (xScale1.bandwidth() - _barWidth) / 2;\n const yPoint = Math.max(containerHeight! - _margins.bottom! - yBarScale(pointData.data), 0);\n const startColor = pointData.color ? pointData.color : getNextColor(index, 0);\n\n // Not rendering data with 0.\n pointData.data &&\n singleGroup.push(\n <React.Fragment key={`${singleSet.indexNum}-${index}`}>\n <rect\n className={classes.opacityChangeOnHover}\n height={Math.max(yBarScale(pointData.data), 0)}\n width={_barWidth}\n x={xPoint}\n y={yPoint}\n data-is-focusable={!props.hideTooltip && (_legendHighlighted(pointData.legend) || _noLegendHighlighted())}\n opacity={_getOpacity(pointData.legend)}\n ref={(e: SVGRectElement | null) => {\n _refCallback(e!, pointData.legend, refIndexNumber);\n }}\n fill={startColor}\n rx={0}\n onMouseOver={onBarHover.bind(null, pointData, singleSet)}\n onMouseMove={onBarHover.bind(null, pointData, singleSet)}\n onMouseOut={_onBarLeave}\n onFocus={onBarFocus.bind(null, pointData, singleSet, refIndexNumber)}\n onBlur={_onBarLeave}\n onClick={pointData.onClick}\n aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}\n tabIndex={pointData.legend !== '' ? 0 : undefined}\n role=\"img\"\n />\n </React.Fragment>,\n );\n if (\n pointData.data &&\n !props.hideLabels &&\n _barWidth >= 16 &&\n (_legendHighlighted(pointData.legend) || _noLegendHighlighted())\n ) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${index}`}\n x={xPoint + _barWidth / 2}\n y={yPoint - 6}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n >\n {formatValueWithSIPrefix(pointData.data)}\n </text>,\n );\n }\n });\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale0);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return (\n <g\n key={singleSet.indexNum}\n transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - _groupWidth) / 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(keys)\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 = containerWidth - (_margins.left! + MIN_DOMAIN_MARGIN) - (_margins.right! + MIN_DOMAIN_MARGIN);\n /** Rate at which the space between the groups changes wrt the group width */\n const groupGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);\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 = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n /** Total width required to render the groups. Directly proportional to group width */\n const reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\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 = totalWidth / (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate);\n const barBandwidth = groupBandwidth / (keys.length + (keys.length - 1) * BAR_GAP_RATE);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);\n const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * barWidth;\n let reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\n const margin1 = (totalWidth - reqWidth) / 2;\n\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(xAxisLabels) + 20;\n reqWidth = (xAxisLabels.length - _xAxisInnerPadding) * step;\n const margin2 = (totalWidth - reqWidth) / 2;\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n };\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.filter((item: GroupedVerticalBarChartData) => item.series.length).length > 0\n );\n };\n\n const _getChartTitle = (): string => {\n return (\n (props.chartTitle ? `${props.chartTitle}. ` : '') +\n `Vertical bar chart with ${_xAxisLabels.length} groups of ${_keys.length} bars each. `\n );\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_datasetForBars}\n chartType={ChartTypes.GroupedVerticalBarChart}\n calloutProps={calloutProps}\n legendBars={legends}\n xAxisType={_xAxisType}\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 /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["React","useGroupedVerticalBarChartStyles_unstable","max","d3Max","select","d3Select","scaleBand","d3ScaleBand","scaleLinear","d3ScaleLinear","useId","ChartTypes","getAccessibleDataObject","tooltipOfXAxislabels","XAxisTypes","getTypeOfAxis","formatValueWithSIPrefix","getScalePadding","getBarWidth","isScalePaddingDefined","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","CartesianChart","Legends","DataVizPalette","getColorFromToken","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","BAR_GAP_RATE","GroupedVerticalBarChart","forwardRef","props","maxBarWidth","forwardedRef","_tooltipId","_emptyChartId","_useRtl","_domainMargin","_dataset","_keys","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_refArray","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","color","setColor","useState","dataForHoverCard","setDataForHoverCard","selectedLegends","setSelectedLegends","legendProps","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","YValueHover","setYValueHover","hoverXValue","setHoverXValue","calloutLegend","setCalloutLegend","activeLegend","setActiveLegend","callOutAccessibilityData","setCallOutAccessibilityData","undefined","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","classes","useEffect","_adjustProps","barWidth","xAxisInnerPadding","keys","length","xAxisOuterPadding","_createDataset","points","datasetForBars","dataset","forEach","point","index","singleDatasetPoint","singleDatasetPointForBars","singleDataSeries","series","seriesPoint","seriesIndex","key","data","push","xAxisPoint","name","indexNum","groupSeries","stackCallOutAccessibilityData","_createDataSetOfGVBC","xAxisLabels","map","singlePoint","singleKey","onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","defaultPalette","color1","color2","color3","color4","color5","actions","singleChartData","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_xAxisType","yMax","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","tickParams","tickValues","tickFormat","_getGraphData","xScale","yScale","containerHeight","containerWidth","xElement","xScale0","_createX0Scale","bandwidth","xScale1","_createX1Scale","allGroupsBars","singleSet","_buildGraph","_getMargins","margins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","updatePosition","newX","newY","threshold","distance","sqrt","pow","onBarHover","pointData","groupData","mouseEvent","persist","clientX","clientY","xAxisCalloutData","yAxisCalloutData","isCalloutForStack","_onBarLeave","onBarFocus","refArrayIndexNumber","obj","_refCallback","element","refIndexNumber","refElement","singleGroup","barLabelsForGroup","yBarScale","domain","range","tempDataSet","Object","splice","datasetKey","xPoint","yPoint","startColor","Fragment","rect","className","opacityChangeOnHover","height","width","data-is-focusable","hideTooltip","ref","e","fill","rx","onMouseOver","bind","onMouseMove","onMouseOut","onFocus","onBlur","onClick","aria-label","getAriaLabel","tabIndex","role","hideLabels","text","textAnchor","barLabel","aria-hidden","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","call","document","getElementById","remove","tooltipProps","tooltipCls","tooltip","id","xAxis","g","transform","x0Axis","paddingInner","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupGapRate","StringAxis","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","step","margin2","min","_isChartEmpty","item","_getChartTitle","chartTitle","chartType","legendBars","xAxisType","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AWoB,uBAAuB;QAC7C6H,cAAcA;QACd2I,YAAYnJ;QACZoJ,WAAW/I;QACXgJ,uBAAuB/P;QACvBuH,YAAYA;QACZyI,aAAazQ,MAAMyQ,WAAW,IAAI;QAClCC,WAAWxP;QACXyP,YAAY1H;QACZ2H,cAAczI;QACd0I,aAAanC;QACboC,mBAAmB/J;QACnBgK,kBAAkB3B;QACjB,GAAI5H,eAAe3I,WAAW0Q,UAAU,IAAI;YAC3C9L,mBAAmBnC;YACnBsC,mBAAmBrC;QACrB,CAAC;QACDyP,UAAU5P;QACV,oCAAoC,GACpC6P,UAAU;YACR,qBAAO,oBAAC5C,WAAGrN;QACb;uBAGF,oBAACkQ;QAAI/C,IAAI/N;QAAe+M,MAAM;QAASgE,OAAO;YAAE9H,SAAS;QAAI;QAAG2D,cAAY;;AAEhF,GAAG;AACHlN,wBAAwBsR,WAAW,GAAG"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Vertical Bar Chart styles
3
+ * {@docCategory VerticalBarChart}
4
+ */ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GroupedVerticalBarChart.types.ts"],"sourcesContent":["import {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n GroupedVerticalBarChartData,\n} from '../../index';\n\n/**\n * Vertical Bar Chart properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: GroupedVerticalBarChartData[];\n\n /**\n * Width of each bar in the chart. When set to `undefined` or `'default'`, the bar width defaults to 16px,\n * which may decrease to prevent overlap. When set to `'auto'`, the bar width is calculated from padding values.\n * @default 16\n */\n barWidth?: number | 'default' | 'auto';\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: GroupedVerticalBarChartStyles;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * To display multi stack callout or single callout\n * @default false\n */\n isCalloutForStack?: boolean;\n\n /**\n * Prop to hide the bar labels\n * @default false\n */\n hideLabels?: boolean;\n\n /**\n * Maximum width of a bar, in pixels.\n * @default 24\n */\n maxBarWidth?: number;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1]. Only applicable to string x-axis.\n * @default 2/3\n */\n xAxisInnerPadding?: number;\n\n /**\n * Padding before the first bar and after the last bar as a fraction of\n * the [step](https://d3js.org/d3-scale/band#band_step). Takes a number in the range [0, 1].\n * Only applicable to string x-axis.\n */\n xAxisOuterPadding?: number;\n\n /**\n * Specifies the mode of the chart.\n * @default 'default'\n */\n mode?: 'default' | 'plotly';\n}\n\n/**\n * Vertical Bar Chart style properties\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * Vertical Bar Chart styles\n * {@docCategory VerticalBarChart}\n */\nexport interface GroupedVerticalBarChartStyles extends CartesianChartStyles {\n /**\n * Style for the bar labels\n */\n barLabel: string;\n}\n"],"names":[],"rangeMappings":";;;","mappings":"AAiGA;;;CAGC,GACD,WAKC"}
@@ -0,0 +1,3 @@
1
+ export * from './GroupedVerticalBarChart';
2
+ export * from './GroupedVerticalBarChart.types';
3
+ export * from '../../types/index';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GroupedVerticalBarChart';\nexport * from './GroupedVerticalBarChart.types';\nexport * from '../../types/index';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,cAAc,oBAAoB"}