@fluentui/react-charts 9.0.4 → 9.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -2
- package/dist/index.d.ts +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +3 -0
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +10 -10
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +7 -2
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -5
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +2 -2
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +2 -2
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +9 -9
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -2
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +3 -2
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +8 -8
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -2
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +2 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/utilities/utilities.js +232 -53
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +3 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +10 -10
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +6 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +7 -4
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +2 -2
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +8 -8
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +7 -7
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +236 -61
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +9 -9
- package/lib/utilities/locale-util.js +0 -15
- package/lib/utilities/locale-util.js.map +0 -1
- package/lib-commonjs/utilities/locale-util.js +0 -25
- package/lib-commonjs/utilities/locale-util.js.map +0 -1
|
@@ -34,7 +34,7 @@ const _useGaugeChartStylesstyles = require("./useGaugeChartStyles.styles");
|
|
|
34
34
|
const _d3selection = require("d3-selection");
|
|
35
35
|
const _d3shape = require("d3-shape");
|
|
36
36
|
const _index = require("../../utilities/index");
|
|
37
|
-
const
|
|
37
|
+
const _chartutilities = require("@fluentui/chart-utilities");
|
|
38
38
|
const _SVGTooltipText = require("../../utilities/SVGTooltipText");
|
|
39
39
|
const _index1 = require("../Legends/index");
|
|
40
40
|
const _reacttabster = require("@fluentui/react-tabster");
|
|
@@ -413,7 +413,7 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
413
413
|
}, /*#__PURE__*/ _react.createElement("div", {
|
|
414
414
|
className: classes.calloutContentX,
|
|
415
415
|
...(0, _index.getAccessibleDataObject)(calloutProps.xAxisCalloutAccessibilityData, 'text', false)
|
|
416
|
-
}, (0,
|
|
416
|
+
}, (0, _chartutilities.formatToLocaleString)(calloutProps.hoverXValue, props.culture))), /*#__PURE__*/ _react.createElement("div", {
|
|
417
417
|
className: classes.calloutInfoContainer,
|
|
418
418
|
style: yValueHoverSubCountsExists ? {
|
|
419
419
|
display: 'flex'
|
|
@@ -451,7 +451,7 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
451
451
|
};
|
|
452
452
|
const toDrawShape = xValue.index !== undefined && xValue.index !== -1;
|
|
453
453
|
const { culture } = props;
|
|
454
|
-
const yValue = (0,
|
|
454
|
+
const yValue = (0, _chartutilities.formatToLocaleString)(xValue.y, culture);
|
|
455
455
|
if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {
|
|
456
456
|
return /*#__PURE__*/ _react.createElement("div", {
|
|
457
457
|
style: yValueHoverSubCountsExists ? marginStyle : {}
|
|
@@ -481,7 +481,7 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
481
481
|
className: classes.calloutlegendText
|
|
482
482
|
}, " ", xValue.legend), /*#__PURE__*/ _react.createElement("div", {
|
|
483
483
|
className: classes.calloutContentY
|
|
484
|
-
}, (0,
|
|
484
|
+
}, (0, _chartutilities.formatToLocaleString)(xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, culture)))));
|
|
485
485
|
} else {
|
|
486
486
|
const subcounts = xValue.yAxisCalloutData;
|
|
487
487
|
return /*#__PURE__*/ _react.createElement("div", {
|
|
@@ -497,9 +497,9 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
497
497
|
className: classes.calloutBlockContainer
|
|
498
498
|
}, /*#__PURE__*/ _react.createElement("div", {
|
|
499
499
|
className: classes.calloutlegendText
|
|
500
|
-
}, " ", (0,
|
|
500
|
+
}, " ", (0, _chartutilities.formatToLocaleString)(subcountName, culture)), /*#__PURE__*/ _react.createElement("div", {
|
|
501
501
|
className: classes.calloutContentY
|
|
502
|
-
}, (0,
|
|
502
|
+
}, (0, _chartutilities.formatToLocaleString)(subcounts[subcountName], culture)));
|
|
503
503
|
}));
|
|
504
504
|
}
|
|
505
505
|
}
|
|
@@ -551,14 +551,14 @@ const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
551
551
|
className: classes.limits,
|
|
552
552
|
role: "img",
|
|
553
553
|
"aria-label": `Min value: ${_minValue}`
|
|
554
|
-
}, (0, _index.
|
|
554
|
+
}, (0, _index.formatScientificLimitWidth)(_minValue)), /*#__PURE__*/ _react.createElement("text", {
|
|
555
555
|
x: (_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET),
|
|
556
556
|
y: 0,
|
|
557
557
|
textAnchor: "start",
|
|
558
558
|
className: classes.limits,
|
|
559
559
|
role: "img",
|
|
560
560
|
"aria-label": `Max value: ${_maxValue}`
|
|
561
|
-
}, (0, _index.
|
|
561
|
+
}, (0, _index.formatScientificLimitWidth)(_maxValue))), arcs.map((arc, index)=>{
|
|
562
562
|
const segment = _segments[arc.segmentIndex];
|
|
563
563
|
return /*#__PURE__*/ _react.createElement(_react.Fragment, {
|
|
564
564
|
key: index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GaugeChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatValueWithSIPrefix,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n} from '../../utilities/index';\nimport { convertToLocaleString } from '../../utilities/locale-util';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport { Legend, LegendShape, Legends, Shape } from '../Legends/index';\nimport { GaugeChartVariant, GaugeValueFormat, GaugeChartProps, GaugeChartSegment } from './GaugeChart.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\n\nconst GAUGE_MARGIN = 16;\nconst LABEL_WIDTH = 36;\nconst LABEL_HEIGHT = 16;\nconst LABEL_OFFSET = 4;\nconst TITLE_OFFSET = 11;\nconst EXTRA_NEEDLE_LENGTH = 4;\nexport const ARC_PADDING = 2;\nexport const BREAKPOINTS = [\n { minRadius: 52, arcWidth: 12, fontSize: 20 },\n { minRadius: 70, arcWidth: 16, fontSize: 24 },\n { minRadius: 88, arcWidth: 20, fontSize: 32 },\n { minRadius: 106, arcWidth: 24, fontSize: 32 },\n { minRadius: 124, arcWidth: 28, fontSize: 40 },\n { minRadius: 142, arcWidth: 32, fontSize: 40 },\n];\n\nexport const calcNeedleRotation = (chartValue: number, minValue: number, maxValue: number) => {\n let needleRotation = ((chartValue - minValue) / (maxValue - minValue)) * 180;\n if (needleRotation < 0) {\n needleRotation = 0;\n } else if (needleRotation > 180) {\n needleRotation = 180;\n }\n\n return needleRotation;\n};\n\nexport const getSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant?: GaugeChartVariant,\n isAriaLabel: boolean = false,\n) => {\n if (isAriaLabel) {\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${((segment.size / maxValue) * 100).toFixed()}%`\n : `${segment.legend}, ${segment.start} to ${segment.end}`;\n }\n\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.size} (${((segment.size / maxValue) * 100).toFixed()}%)`\n : `${segment.start} - ${segment.end}`;\n};\n\nexport const getChartValueLabel = (\n chartValue: number,\n minValue: number,\n maxValue: number,\n chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string),\n forCallout: boolean = false,\n): string => {\n if (forCallout) {\n // When displaying the chart value as a percentage, use fractions in the callout, and vice versa.\n // This helps clarify the actual value and avoid repetition.\n return minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${((chartValue / maxValue) * 100).toFixed()}%`\n : `${chartValue}/${maxValue}`;\n }\n\n return typeof chartValueFormat === 'function'\n ? chartValueFormat([chartValue - minValue, maxValue - minValue])\n : minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${chartValue}/${maxValue}`\n : `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport interface ExtendedSegment extends GaugeChartSegment {\n start: number;\n end: number;\n}\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\n const _getMargins = () => {\n const { hideMinMax, chartTitle, sublabel } = props;\n return {\n left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,\n bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN,\n };\n };\n const _margins: { left: number; right: number; top: number; bottom: number } = _getMargins();\n const _legendsHeight: number = !props.hideLegend ? 24 : 0;\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const _isRTL: boolean = useRtl();\n const [width, setWidth] = React.useState<number>(140 + _getMargins().left + _getMargins().right);\n const [height, setHeight] = React.useState<number>(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedElement, setFocusedElement] = React.useState<string | undefined>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\n const prevPropsRef = React.useRef<GaugeChartProps | null>(null);\n const _width = props.width || width;\n const _height = props.height || height;\n const _outerRadius: number = Math.min(\n (_width - (_margins.left + _margins.right)) / 2,\n _height - (_margins.top + _margins.bottom + _legendsHeight),\n );\n const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();\n const _innerRadius: number = _outerRadius - arcWidth;\n let _minValue!: number;\n let _maxValue!: number;\n let _segments!: ExtendedSegment[];\n let _calloutAnchor: string = '';\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n if (prevProps.height !== props.height || prevProps.width !== props.width) {\n setWidth(props.width!);\n setHeight(props.height!);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\n\n const classes = useGaugeChartStyles(props);\n function _getStylesBasedOnBreakpoint() {\n for (let index = BREAKPOINTS.length - 1; index >= 0; index -= 1) {\n if (_outerRadius >= BREAKPOINTS[index].minRadius) {\n return {\n arcWidth: BREAKPOINTS[index].arcWidth,\n chartValueSize: BREAKPOINTS[index].fontSize,\n };\n }\n }\n return {\n arcWidth: BREAKPOINTS[0].arcWidth,\n chartValueSize: BREAKPOINTS[0].fontSize,\n };\n }\n\n function _processProps() {\n const { minValue = 0, maxValue, segments, roundCorners } = props;\n\n let total = minValue;\n const processedSegments: ExtendedSegment[] = segments.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (segment: { size: number; legend: any; color: string; accessibilityData: any }, index: number) => {\n const size = Math.max(segment.size, 0);\n total += size;\n return {\n legend: segment.legend,\n size,\n color:\n typeof segment.color !== 'undefined'\n ? getColorFromToken(segment.color, false)\n : getNextColor(index, 0, false),\n accessibilityData: segment.accessibilityData,\n start: total - size,\n end: total,\n };\n },\n );\n if (typeof maxValue !== 'undefined' && total < maxValue) {\n processedSegments.push({\n legend: 'Unknown',\n size: maxValue - total,\n color: 'neutralLight',\n start: total,\n end: maxValue,\n });\n total = maxValue;\n }\n\n const arcGenerator = d3Arc()\n .cornerRadius(roundCorners ? 3 : 0)\n .padAngle(ARC_PADDING / _outerRadius)\n .padRadius(_outerRadius);\n const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;\n let prevAngle = -Math.PI / 2;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const arcs = rtlSafeSegments.map((segment, index) => {\n const endAngle = prevAngle + (segment.size / (total - minValue)) * Math.PI;\n const d = arcGenerator({\n innerRadius: _innerRadius,\n outerRadius: _outerRadius,\n startAngle: prevAngle,\n endAngle,\n })!;\n prevAngle = endAngle;\n return {\n d,\n segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,\n startAngle: prevAngle - (segment.size / (total - minValue)) * Math.PI,\n endAngle,\n };\n });\n\n _minValue = minValue;\n _maxValue = total;\n _segments = processedSegments;\n\n return {\n arcs,\n };\n }\n\n function _renderNeedle() {\n const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);\n const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;\n const strokeWidth = 2;\n const halfStrokeWidth = strokeWidth / 2;\n const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;\n\n return (\n <g transform={`rotate(${rtlSafeNeedleRotation}, 0, 0)`}>\n <path\n d={`\n M 0,${-halfStrokeWidth - 3}\n L ${-needleLength},${-halfStrokeWidth - 1}\n A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}\n L 0,${halfStrokeWidth + 3}\n A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}\n `}\n strokeWidth={strokeWidth}\n className={classes.needle}\n transform={`translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`}\n data-is-focusable={true}\n onFocus={e => _handleFocus(e, 'Needle')}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle')}\n onMouseMove={e => _handleMouseOver(e, 'Needle')}\n role=\"img\"\n aria-label={\n 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)\n }\n />\n </g>\n );\n }\n\n function _renderLegends() {\n if (props.hideLegend) {\n return null;\n }\n\n const legends: Legend[] = _segments.map((segment, index) => {\n const color: string = segment.color || getNextColor(index, 0, false);\n\n return {\n title: segment.legend,\n color,\n hoverAction: () => {\n setHoveredLegend(segment.legend);\n },\n onMouseOutAction: () => {\n setHoveredLegend('');\n },\n };\n });\n\n return (\n <div className={classes.legendsContainer} style={{ width: props.width }}>\n <Legends\n legends={legends}\n centerLegends\n {...props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\n />\n </div>\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _handleFocus(focusEvent: React.FocusEvent<SVGElement>, focusedElement: string) {\n _showCallout(focusEvent, focusedElement, true);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string) {\n _showCallout(mouseEvent, hoveredElement, false);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const target = event.currentTarget as HTMLElement | SVGElement;\n if (target && 'getBoundingClientRect' in target) {\n const boundingRect = target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n }\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverXValue: string =\n 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments.map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),\n color: segment.color,\n };\n return yValue;\n });\n _updatePosition(clientX, clientY);\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setHoverXValue(hoverXValue);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setHoverXValue('');\n setHoverYValues([]);\n if (isBlurEvent) {\n setFocusedElement('');\n }\n }\n\n function _wrapContent(content: string, id: string, maxWidth: number) {\n const textElement = d3Select<SVGTextElement, {}>(`#${id}`);\n textElement.text(content);\n if (!textElement.node()) {\n return false;\n }\n\n let isOverflowing = false;\n let textLength = textElement.node()!.getComputedTextLength();\n while (textLength > maxWidth && content.length > 0) {\n content = content.slice(0, -1);\n textElement.text(content + '...');\n isOverflowing = true;\n textLength = textElement.node()!.getComputedTextLength();\n }\n return isOverflowing;\n }\n\n // TO DO: Write a common functional component for Multi value callout and divide sub count method\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout(calloutProps: any) {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(calloutProps.YValueHover);\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(calloutProps!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {convertToLocaleString(calloutProps!.hoverXValue, props.culture)}\n </div>\n </div>\n <div className={classes.calloutInfoContainer} style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {calloutProps!.YValueHover &&\n calloutProps!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const { shouldDrawBorderBottom = false } = yValue;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!calloutProps.descriptionMessage && (\n <div className={classes.descriptionMessage}>{calloutProps.descriptionMessage}</div>\n )}\n </div>\n </div>\n );\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]) {\n if (yValueHover) {\n return yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n );\n }\n return false;\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = convertToLocaleString(xValue.y, culture);\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{ borderInlineStart: `4px solid ${xValue.color}` }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n style={{ display: 'flex' }}\n />\n )}\n <div>\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY}>\n {convertToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data,\n culture,\n )}\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}> {convertToLocaleString(subcountName, culture)}</div>\n <div className={classes.calloutContentY}>\n {convertToLocaleString(subcounts[subcountName], culture)}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n\n function _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const focusAttributes = useFocusableGroup();\n return (\n <div className={classes.root} ref={el => (_rootElem.current = el)} {...focusAttributes}>\n <svg\n className={classes.chart}\n style={{ width: props.width, height: props.height! - _legendsHeight }}\n role=\"region\"\n aria-label={_getChartTitle()}\n onMouseLeave={_handleMouseOut}\n >\n <g transform={`translate(${width / 2}, ${height - (_margins.bottom + _legendsHeight)})`}>\n {props.chartTitle && (\n <text\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n textAnchor=\"middle\"\n className={classes.chartTitle}\n aria-hidden={true}\n >\n {props.chartTitle}\n </text>\n )}\n {!props.hideMinMax && (\n <>\n <text\n x={(_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"end\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Min value: ${_minValue}`}\n >\n {formatValueWithSIPrefix(_minValue)}\n </text>\n <text\n x={(_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"start\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Max value: ${_maxValue}`}\n >\n {formatValueWithSIPrefix(_maxValue)}\n </text>\n </>\n )}\n {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\n strokeWidth={focusedElement === segment.legend ? ARC_PADDING : 0}\n className={classes.segment}\n fill={segment.color}\n opacity={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1}\n {...getAccessibleDataObject(\n {\n ariaLabel: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),\n ...segment.accessibilityData,\n },\n 'img',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend)}\n data-is-focusable={_legendHighlighted(segment.legend) || _noLegendHighlighted()}\n tabIndex={segment.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\n {_renderNeedle()}\n <g\n onMouseEnter={e => _handleMouseOver(e, 'Chart value')}\n onMouseMove={e => _handleMouseOver(e, 'Chart value')}\n >\n <SVGTooltipText\n content={getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)}\n textProps={{\n x: 0,\n y: 0,\n textAnchor: 'middle',\n className: classes.chartValue,\n fontSize: chartValueSize,\n 'aria-hidden': 'true',\n }}\n maxWidth={_innerRadius * 2 - 24}\n wrapContent={_wrapContent}\n />\n </g>\n {props.sublabel && (\n <SVGTooltipText\n content={props.sublabel}\n textProps={{\n x: 0,\n y: 4,\n textAnchor: 'middle',\n dominantBaseline: 'hanging',\n className: classes.sublabel,\n }}\n maxWidth={_innerRadius * 2}\n wrapContent={_wrapContent}\n />\n )}\n </g>\n </svg>\n {_renderLegends()}\n {!props.hideTooltip && isPopoverOpen && (\n <ChartPopover\n {...props.calloutProps}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout: _multiValueCallout({ hoverXValue: hoverXValue, YValueHover: hoverYValues }),\n }}\n />\n )}\n </div>\n );\n },\n);\nGaugeChart.displayName = 'GaugeChart';\n"],"names":["ARC_PADDING","BREAKPOINTS","GaugeChart","calcNeedleRotation","getChartValueLabel","getSegmentLabel","GAUGE_MARGIN","LABEL_WIDTH","LABEL_HEIGHT","LABEL_OFFSET","TITLE_OFFSET","EXTRA_NEEDLE_LENGTH","minRadius","arcWidth","fontSize","chartValue","minValue","maxValue","needleRotation","segment","variant","isAriaLabel","legend","size","toFixed","start","end","chartValueFormat","forCallout","toString","React","forwardRef","props","forwardedRef","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","_rootElem","useRef","_isRTL","useRtl","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","hoverXValue","setHoverXValue","hoverYValues","setHoverYValues","prevPropsRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","prevProps","areArraysEqual","useImperativeHandle","componentRef","chartContainer","classes","useGaugeChartStyles","index","length","_processProps","segments","roundCorners","total","processedSegments","map","max","color","getColorFromToken","getNextColor","accessibilityData","push","arcGenerator","d3Arc","cornerRadius","padAngle","padRadius","rtlSafeSegments","Array","from","reverse","prevAngle","PI","arcs","endAngle","d","innerRadius","outerRadius","startAngle","segmentIndex","_renderNeedle","rtlSafeNeedleRotation","strokeWidth","halfStrokeWidth","needleLength","createElement","g","transform","path","className","needle","data-is-focusable","onFocus","e","_handleFocus","onBlur","_handleBlur","onMouseEnter","_handleMouseOver","onMouseMove","role","aria-label","_renderLegends","legends","title","hoverAction","onMouseOutAction","div","legendsContainer","style","Legends","centerLegends","onChange","_onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","clientX","clientY","target","currentTarget","boundingRect","getBoundingClientRect","yValue","_updatePosition","isBlurEvent","_wrapContent","content","id","maxWidth","textElement","d3Select","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","marginBottom","calloutContentX","getAccessibleDataObject","xAxisCalloutAccessibilityData","convertToLocaleString","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","Shape","svgProps","shapeStyles","pathProps","fill","shape","Points","Object","keys","pointTypes","calloutlegendText","calloutContentY","data","subcounts","subcountName","newX","newY","threshold","distance","sqrt","pow","_getChartTitle","focusAttributes","useFocusableGroup","root","ref","el","svg","chart","onMouseLeave","textAnchor","aria-hidden","Fragment","limits","formatValueWithSIPrefix","arc","opacity","ariaLabel","tabIndex","SVGTooltipText","textProps","wrapContent","dominantBaseline","hideTooltip","ChartPopover","customCallout","customizedCallout","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA4BaA,WAAAA;eAAAA;;IACAC,WAAAA;eAAAA;;IAwEAC,UAAAA;eAAAA;;IA/DAC,kBAAAA;eAAAA;;IA6BAC,kBAAAA;eAAAA;;IAlBAC,eAAAA;eAAAA;;;;iEAjDU;2CACa;6BACD;yBACN;uBAWtB;4BAC+B;gC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ACHC,GAAG;YACHkM,YAAY;YACZ5H,WAAW3C,QAAQ5E,UAAU;YAC7BD,UAAU+D;YACV,eAAe;QACjB;QACA8G,UAAU5G,eAAe,IAAI;QAC7B8L,aAAarF;SAGhBxJ,MAAMK,QAAQ,IAAA,WAAA,GACbP,OAAAoG,aAAA,CAACyI,8BAAAA,EAAAA;QACClF,SAASzJ,MAAMK,QAAQ;QACvBuO,WAAW;YACT7M,GAAG;YACHC,GAAG;YACHkM,YAAY;YACZY,kBAAkB;YAClBxI,WAAW3C,QAAQtD,QAAQ;QAC7B;QACAsJ,UAAU5G,eAAe;QACzB8L,aAAarF;UAKpBrC,kBACA,CAACnH,MAAM+O,WAAW,IAAI9M,iBAAAA,WAAAA,GACrBnC,OAAAoG,aAAA,CAAC8I,0BAAAA,EAAAA;QACE,GAAGhP,MAAMoK,YAAY;QACtBvI,eAAeA;QACfI,eAAeA;QACfgN,eAAe;YACbC,mBAAmB/E,mBAAmB;gBAAEhI,aAAaA;gBAAaoI,aAAalI;YAAa;QAC9F;;AAKV;AAEFnE,WAAWiR,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["GaugeChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatScientificLimitWidth,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport { Legend, LegendShape, Legends, Shape } from '../Legends/index';\nimport { GaugeChartVariant, GaugeValueFormat, GaugeChartProps, GaugeChartSegment } from './GaugeChart.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\n\nconst GAUGE_MARGIN = 16;\nconst LABEL_WIDTH = 36;\nconst LABEL_HEIGHT = 16;\nconst LABEL_OFFSET = 4;\nconst TITLE_OFFSET = 11;\nconst EXTRA_NEEDLE_LENGTH = 4;\nexport const ARC_PADDING = 2;\nexport const BREAKPOINTS = [\n { minRadius: 52, arcWidth: 12, fontSize: 20 },\n { minRadius: 70, arcWidth: 16, fontSize: 24 },\n { minRadius: 88, arcWidth: 20, fontSize: 32 },\n { minRadius: 106, arcWidth: 24, fontSize: 32 },\n { minRadius: 124, arcWidth: 28, fontSize: 40 },\n { minRadius: 142, arcWidth: 32, fontSize: 40 },\n];\n\nexport const calcNeedleRotation = (chartValue: number, minValue: number, maxValue: number) => {\n let needleRotation = ((chartValue - minValue) / (maxValue - minValue)) * 180;\n if (needleRotation < 0) {\n needleRotation = 0;\n } else if (needleRotation > 180) {\n needleRotation = 180;\n }\n\n return needleRotation;\n};\n\nexport const getSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant?: GaugeChartVariant,\n isAriaLabel: boolean = false,\n) => {\n if (isAriaLabel) {\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${((segment.size / maxValue) * 100).toFixed()}%`\n : `${segment.legend}, ${segment.start} to ${segment.end}`;\n }\n\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.size} (${((segment.size / maxValue) * 100).toFixed()}%)`\n : `${segment.start} - ${segment.end}`;\n};\n\nexport const getChartValueLabel = (\n chartValue: number,\n minValue: number,\n maxValue: number,\n chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string),\n forCallout: boolean = false,\n): string => {\n if (forCallout) {\n // When displaying the chart value as a percentage, use fractions in the callout, and vice versa.\n // This helps clarify the actual value and avoid repetition.\n return minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${((chartValue / maxValue) * 100).toFixed()}%`\n : `${chartValue}/${maxValue}`;\n }\n\n return typeof chartValueFormat === 'function'\n ? chartValueFormat([chartValue - minValue, maxValue - minValue])\n : minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${chartValue}/${maxValue}`\n : `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport interface ExtendedSegment extends GaugeChartSegment {\n start: number;\n end: number;\n}\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\n const _getMargins = () => {\n const { hideMinMax, chartTitle, sublabel } = props;\n return {\n left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,\n bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN,\n };\n };\n const _margins: { left: number; right: number; top: number; bottom: number } = _getMargins();\n const _legendsHeight: number = !props.hideLegend ? 24 : 0;\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const _isRTL: boolean = useRtl();\n const [width, setWidth] = React.useState<number>(140 + _getMargins().left + _getMargins().right);\n const [height, setHeight] = React.useState<number>(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedElement, setFocusedElement] = React.useState<string | undefined>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\n const prevPropsRef = React.useRef<GaugeChartProps | null>(null);\n const _width = props.width || width;\n const _height = props.height || height;\n const _outerRadius: number = Math.min(\n (_width - (_margins.left + _margins.right)) / 2,\n _height - (_margins.top + _margins.bottom + _legendsHeight),\n );\n const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();\n const _innerRadius: number = _outerRadius - arcWidth;\n let _minValue!: number;\n let _maxValue!: number;\n let _segments!: ExtendedSegment[];\n let _calloutAnchor: string = '';\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n if (prevProps.height !== props.height || prevProps.width !== props.width) {\n setWidth(props.width!);\n setHeight(props.height!);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\n\n const classes = useGaugeChartStyles(props);\n function _getStylesBasedOnBreakpoint() {\n for (let index = BREAKPOINTS.length - 1; index >= 0; index -= 1) {\n if (_outerRadius >= BREAKPOINTS[index].minRadius) {\n return {\n arcWidth: BREAKPOINTS[index].arcWidth,\n chartValueSize: BREAKPOINTS[index].fontSize,\n };\n }\n }\n return {\n arcWidth: BREAKPOINTS[0].arcWidth,\n chartValueSize: BREAKPOINTS[0].fontSize,\n };\n }\n\n function _processProps() {\n const { minValue = 0, maxValue, segments, roundCorners } = props;\n\n let total = minValue;\n const processedSegments: ExtendedSegment[] = segments.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (segment: { size: number; legend: any; color: string; accessibilityData: any }, index: number) => {\n const size = Math.max(segment.size, 0);\n total += size;\n return {\n legend: segment.legend,\n size,\n color:\n typeof segment.color !== 'undefined'\n ? getColorFromToken(segment.color, false)\n : getNextColor(index, 0, false),\n accessibilityData: segment.accessibilityData,\n start: total - size,\n end: total,\n };\n },\n );\n if (typeof maxValue !== 'undefined' && total < maxValue) {\n processedSegments.push({\n legend: 'Unknown',\n size: maxValue - total,\n color: 'neutralLight',\n start: total,\n end: maxValue,\n });\n total = maxValue;\n }\n\n const arcGenerator = d3Arc()\n .cornerRadius(roundCorners ? 3 : 0)\n .padAngle(ARC_PADDING / _outerRadius)\n .padRadius(_outerRadius);\n const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;\n let prevAngle = -Math.PI / 2;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const arcs = rtlSafeSegments.map((segment, index) => {\n const endAngle = prevAngle + (segment.size / (total - minValue)) * Math.PI;\n const d = arcGenerator({\n innerRadius: _innerRadius,\n outerRadius: _outerRadius,\n startAngle: prevAngle,\n endAngle,\n })!;\n prevAngle = endAngle;\n return {\n d,\n segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,\n startAngle: prevAngle - (segment.size / (total - minValue)) * Math.PI,\n endAngle,\n };\n });\n\n _minValue = minValue;\n _maxValue = total;\n _segments = processedSegments;\n\n return {\n arcs,\n };\n }\n\n function _renderNeedle() {\n const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);\n const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;\n const strokeWidth = 2;\n const halfStrokeWidth = strokeWidth / 2;\n const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;\n\n return (\n <g transform={`rotate(${rtlSafeNeedleRotation}, 0, 0)`}>\n <path\n d={`\n M 0,${-halfStrokeWidth - 3}\n L ${-needleLength},${-halfStrokeWidth - 1}\n A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}\n L 0,${halfStrokeWidth + 3}\n A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}\n `}\n strokeWidth={strokeWidth}\n className={classes.needle}\n transform={`translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`}\n data-is-focusable={true}\n onFocus={e => _handleFocus(e, 'Needle')}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle')}\n onMouseMove={e => _handleMouseOver(e, 'Needle')}\n role=\"img\"\n aria-label={\n 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)\n }\n />\n </g>\n );\n }\n\n function _renderLegends() {\n if (props.hideLegend) {\n return null;\n }\n\n const legends: Legend[] = _segments.map((segment, index) => {\n const color: string = segment.color || getNextColor(index, 0, false);\n\n return {\n title: segment.legend,\n color,\n hoverAction: () => {\n setHoveredLegend(segment.legend);\n },\n onMouseOutAction: () => {\n setHoveredLegend('');\n },\n };\n });\n\n return (\n <div className={classes.legendsContainer} style={{ width: props.width }}>\n <Legends\n legends={legends}\n centerLegends\n {...props.legendProps}\n // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\n />\n </div>\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _handleFocus(focusEvent: React.FocusEvent<SVGElement>, focusedElement: string) {\n _showCallout(focusEvent, focusedElement, true);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string) {\n _showCallout(mouseEvent, hoveredElement, false);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const target = event.currentTarget as HTMLElement | SVGElement;\n if (target && 'getBoundingClientRect' in target) {\n const boundingRect = target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n }\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverXValue: string =\n 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments.map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),\n color: segment.color,\n };\n return yValue;\n });\n _updatePosition(clientX, clientY);\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setHoverXValue(hoverXValue);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setHoverXValue('');\n setHoverYValues([]);\n if (isBlurEvent) {\n setFocusedElement('');\n }\n }\n\n function _wrapContent(content: string, id: string, maxWidth: number) {\n const textElement = d3Select<SVGTextElement, {}>(`#${id}`);\n textElement.text(content);\n if (!textElement.node()) {\n return false;\n }\n\n let isOverflowing = false;\n let textLength = textElement.node()!.getComputedTextLength();\n while (textLength > maxWidth && content.length > 0) {\n content = content.slice(0, -1);\n textElement.text(content + '...');\n isOverflowing = true;\n textLength = textElement.node()!.getComputedTextLength();\n }\n return isOverflowing;\n }\n\n // TO DO: Write a common functional component for Multi value callout and divide sub count method\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout(calloutProps: any) {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(calloutProps.YValueHover);\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(calloutProps!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {formatToLocaleString(calloutProps!.hoverXValue, props.culture)}\n </div>\n </div>\n <div className={classes.calloutInfoContainer} style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {calloutProps!.YValueHover &&\n calloutProps!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const { shouldDrawBorderBottom = false } = yValue;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!calloutProps.descriptionMessage && (\n <div className={classes.descriptionMessage}>{calloutProps.descriptionMessage}</div>\n )}\n </div>\n </div>\n );\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]) {\n if (yValueHover) {\n return yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n );\n }\n return false;\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = formatToLocaleString(xValue.y, culture);\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{ borderInlineStart: `4px solid ${xValue.color}` }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n style={{ display: 'flex' }}\n />\n )}\n <div>\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY}>\n {formatToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data,\n culture,\n )}\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}> {formatToLocaleString(subcountName, culture)}</div>\n <div className={classes.calloutContentY}>\n {formatToLocaleString(subcounts[subcountName], culture)}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n\n function _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const focusAttributes = useFocusableGroup();\n return (\n <div className={classes.root} ref={el => (_rootElem.current = el)} {...focusAttributes}>\n <svg\n className={classes.chart}\n style={{ width: props.width, height: props.height! - _legendsHeight }}\n role=\"region\"\n aria-label={_getChartTitle()}\n onMouseLeave={_handleMouseOut}\n >\n <g transform={`translate(${width / 2}, ${height - (_margins.bottom + _legendsHeight)})`}>\n {props.chartTitle && (\n <text\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n textAnchor=\"middle\"\n className={classes.chartTitle}\n aria-hidden={true}\n >\n {props.chartTitle}\n </text>\n )}\n {!props.hideMinMax && (\n <>\n <text\n x={(_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"end\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Min value: ${_minValue}`}\n >\n {formatScientificLimitWidth(_minValue)}\n </text>\n <text\n x={(_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"start\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Max value: ${_maxValue}`}\n >\n {formatScientificLimitWidth(_maxValue)}\n </text>\n </>\n )}\n {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\n strokeWidth={focusedElement === segment.legend ? ARC_PADDING : 0}\n className={classes.segment}\n fill={segment.color}\n opacity={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1}\n {...getAccessibleDataObject(\n {\n ariaLabel: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),\n ...segment.accessibilityData,\n },\n 'img',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend)}\n data-is-focusable={_legendHighlighted(segment.legend) || _noLegendHighlighted()}\n tabIndex={segment.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\n {_renderNeedle()}\n <g\n onMouseEnter={e => _handleMouseOver(e, 'Chart value')}\n onMouseMove={e => _handleMouseOver(e, 'Chart value')}\n >\n <SVGTooltipText\n content={getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)}\n textProps={{\n x: 0,\n y: 0,\n textAnchor: 'middle',\n className: classes.chartValue,\n fontSize: chartValueSize,\n 'aria-hidden': 'true',\n }}\n maxWidth={_innerRadius * 2 - 24}\n wrapContent={_wrapContent}\n />\n </g>\n {props.sublabel && (\n <SVGTooltipText\n content={props.sublabel}\n textProps={{\n x: 0,\n y: 4,\n textAnchor: 'middle',\n dominantBaseline: 'hanging',\n className: classes.sublabel,\n }}\n maxWidth={_innerRadius * 2}\n wrapContent={_wrapContent}\n />\n )}\n </g>\n </svg>\n {_renderLegends()}\n {!props.hideTooltip && isPopoverOpen && (\n <ChartPopover\n {...props.calloutProps}\n clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout: _multiValueCallout({ hoverXValue: hoverXValue, YValueHover: hoverYValues }),\n }}\n />\n )}\n </div>\n );\n },\n);\nGaugeChart.displayName = 'GaugeChart';\n"],"names":["ARC_PADDING","BREAKPOINTS","GaugeChart","calcNeedleRotation","getChartValueLabel","getSegmentLabel","GAUGE_MARGIN","LABEL_WIDTH","LABEL_HEIGHT","LABEL_OFFSET","TITLE_OFFSET","EXTRA_NEEDLE_LENGTH","minRadius","arcWidth","fontSize","chartValue","minValue","maxValue","needleRotation","segment","variant","isAriaLabel","legend","size","toFixed","start","end","chartValueFormat","forCallout","toString","React","forwardRef","props","forwardedRef","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","_rootElem","useRef","_isRTL","useRtl","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","hoverXValue","setHoverXValue","hoverYValues","setHoverYValues","prevPropsRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","prevProps","areArraysEqual","useImperativeHandle","componentRef","chartContainer","classes","useGaugeChartStyles","index","length","_processProps","segments","roundCorners","total","processedSegments","map","max","color","getColorFromToken","getNextColor","accessibilityData","push","arcGenerator","d3Arc","cornerRadius","padAngle","padRadius","rtlSafeSegments","Array","from","reverse","prevAngle","PI","arcs","endAngle","d","innerRadius","outerRadius","startAngle","segmentIndex","_renderNeedle","rtlSafeNeedleRotation","strokeWidth","halfStrokeWidth","needleLength","createElement","g","transform","path","className","needle","data-is-focusable","onFocus","e","_handleFocus","onBlur","_handleBlur","onMouseEnter","_handleMouseOver","onMouseMove","role","aria-label","_renderLegends","legends","title","hoverAction","onMouseOutAction","div","legendsContainer","style","Legends","centerLegends","onChange","_onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","clientX","clientY","target","currentTarget","boundingRect","getBoundingClientRect","yValue","_updatePosition","isBlurEvent","_wrapContent","content","id","maxWidth","textElement","d3Select","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","marginBottom","calloutContentX","getAccessibleDataObject","xAxisCalloutAccessibilityData","formatToLocaleString","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","Shape","svgProps","shapeStyles","pathProps","fill","shape","Points","Object","keys","pointTypes","calloutlegendText","calloutContentY","data","subcounts","subcountName","newX","newY","threshold","distance","sqrt","pow","_getChartTitle","focusAttributes","useFocusableGroup","root","ref","el","svg","chart","onMouseLeave","textAnchor","aria-hidden","Fragment","limits","formatScientificLimitWidth","arc","opacity","ariaLabel","tabIndex","SVGTooltipText","textProps","wrapContent","dominantBaseline","hideTooltip","ChartPopover","customCallout","customizedCallout","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
className: classes.barLabel,
|
|
340
340
|
"aria-hidden": true
|
|
341
|
-
}, (0, _index.
|
|
341
|
+
}, (0, _index.formatScientificLimitWidth)(pointData.data)));
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
// Used to display tooltip at x axis labels.
|
|
@@ -1 +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 Chart,\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 const cartesianChartRef = React.useRef<Chart>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = 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 componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["GroupedVerticalBarChart","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","BAR_GAP_RATE","React","forwardRef","props","maxBarWidth","forwardedRef","_tooltipId","useId","_emptyChartId","_useRtl","useRtl","_domainMargin","_dataset","_keys","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_refArray","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","useRef","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","useGroupedVerticalBarChartStyles_unstable","useEffect","areArraysEqual","useImperativeHandle","componentRef","chartContainer","current","_adjustProps","getBarWidth","barWidth","getScalePadding","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","getColorFromToken","DataVizPalette","color1","color2","color3","color4","color5","actions","singleChartData","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","createElement","Legends","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_xAxisType","getTypeOfAxis","yMax","d3Max","max","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","getAccessibleDataObject","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","d3ScaleLinear","domain","range","tempDataSet","Object","splice","datasetKey","xPoint","yPoint","startColor","getNextColor","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","formatValueWithSIPrefix","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","d3Select","call","document","getElementById","remove","tooltipProps","tooltipCls","tooltip","id","xAxis","tooltipOfXAxislabels","g","transform","x0Axis","d3ScaleBand","paddingInner","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupGapRate","XAxisTypes","StringAxis","isScalePaddingDefined","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","step","calculateLongestLabelWidth","margin2","min","_isChartEmpty","item","_getChartTitle","chartTitle","CartesianChart","chartType","ChartTypes","legendBars","xAxisType","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA8DaA;;;eAAAA;;;;iEA9DU;wDACmC;yBA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,CAACuK,OAAsCA,KAAK5M,MAAM,CAACZ,MAAM,EAAEA,MAAM,GAAG,CAAA;IAE1F;IAEA,MAAMyN,iBAAiB;QACrB,OACE,AAAChS,CAAAA,MAAMiS,UAAU,GAAG,CAAC,EAAEjS,MAAMiS,UAAU,CAAC,EAAE,CAAC,GAAG,EAAA,IAC9C,CAAC,wBAAwB,EAAEtR,aAAa4D,MAAM,CAAC,WAAW,EAAE7D,MAAM6D,MAAM,CAAC,YAAY,CAAC;IAE1F;IAEA,OAAO,CAACuN,kBAAAA,WAAAA,GACNhS,OAAAmI,aAAA,CAACiK,sBAAAA,EAAAA;QACE,GAAGlS,KAAK;QACTiS,YAAYD;QACZtN,QAAQ9D;QACRuR,WAAWC,iBAAAA,CAAW1S,uBAAuB;QAC7CoJ,cAAcA;QACduJ,YAAYlK;QACZmK,WAAW9J;QACX+J,uBAAuB5R;QACvByI,YAAYA;QACZoJ,aAAaxS,MAAMwS,WAAW,IAAI;QAClCC,WAAWrR;QACXsR,YAAYrI;QACZsI,cAAcpJ;QACdqJ,aAAaxC;QACbyC,mBAAmBhL;QACnBiL,kBAAkBhC;QACjB,GAAItI,eAAeyI,iBAAAA,CAAWC,UAAU,IAAI;YAC3C7M,mBAAmB7C;YACnBgD,mBAAmB/C;QACrB,CAAC;QACDsR,UAAUzR;QACVwC,cAAcpC;QACd,oCAAoC,GACpCsR,UAAU;YACR,OAAA,WAAA,GAAOlT,OAAAmI,aAAA,CAAC6H,KAAAA,MAAG5O;QACb;uBAGFpB,OAAAmI,aAAA,CAACgL,OAAAA;QAAItD,IAAItP;QAAeoO,MAAM;QAASyE,OAAO;YAAEzI,SAAS;QAAI;QAAG6D,cAAY;;AAEhF;AACA5O,wBAAwByT,WAAW,GAAG"}
|
|
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 formatScientificLimitWidth,\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 Chart,\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 const cartesianChartRef = React.useRef<Chart>(null);\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = 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 {formatScientificLimitWidth(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 componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["GroupedVerticalBarChart","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","BAR_GAP_RATE","React","forwardRef","props","maxBarWidth","forwardedRef","_tooltipId","useId","_emptyChartId","_useRtl","useRtl","_domainMargin","_dataset","_keys","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_refArray","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","useRef","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","useGroupedVerticalBarChartStyles_unstable","useEffect","areArraysEqual","useImperativeHandle","componentRef","chartContainer","current","_adjustProps","getBarWidth","barWidth","getScalePadding","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","getColorFromToken","DataVizPalette","color1","color2","color3","color4","color5","actions","singleChartData","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","createElement","Legends","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_xAxisType","getTypeOfAxis","yMax","d3Max","max","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","getAccessibleDataObject","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","d3ScaleLinear","domain","range","tempDataSet","Object","splice","datasetKey","xPoint","yPoint","startColor","getNextColor","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","formatScientificLimitWidth","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","d3Select","call","document","getElementById","remove","tooltipProps","tooltipCls","tooltip","id","xAxis","tooltipOfXAxislabels","g","transform","x0Axis","d3ScaleBand","paddingInner","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupGapRate","XAxisTypes","StringAxis","isScalePaddingDefined","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","step","calculateLongestLabelWidth","margin2","min","_isChartEmpty","item","_getChartTitle","chartTitle","CartesianChart","chartType","ChartTypes","legendBars","xAxisType","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA8DaA;;;eAAAA;;;;iEA9DU;wDACmC;yBAC7B;6BACM;yBAEoC;gCAEjD;uBAgBf;wBAiBA;AAKP,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,2EAA2E;AAC3E,kFAAkF;AAClF,kFAAkF,GAClF,MAAMC,eAAeD,mBAAoB,CAAA,IAAIA,gBAAAA;AAYtC,MAAMF,0BAAAA,WAAAA,GAAkEI,OAAMC,UAAU,CAG7F,CAACC,QAAQ;IAAEC,aAAa;AAAG,CAAC,EAAEC;QAsByCF,oBAkBnEA;IAvCJ,MAAMG,aAAqBC,IAAAA,qBAAA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ACNhS,OAAAmI,aAAA,CAACiK,sBAAAA,EAAAA;QACE,GAAGlS,KAAK;QACTiS,YAAYD;QACZtN,QAAQ9D;QACRuR,WAAWC,iBAAAA,CAAW1S,uBAAuB;QAC7CoJ,cAAcA;QACduJ,YAAYlK;QACZmK,WAAW9J;QACX+J,uBAAuB5R;QACvByI,YAAYA;QACZoJ,aAAaxS,MAAMwS,WAAW,IAAI;QAClCC,WAAWrR;QACXsR,YAAYrI;QACZsI,cAAcpJ;QACdqJ,aAAaxC;QACbyC,mBAAmBhL;QACnBiL,kBAAkBhC;QACjB,GAAItI,eAAeyI,iBAAAA,CAAWC,UAAU,IAAI;YAC3C7M,mBAAmB7C;YACnBgD,mBAAmB/C;QACrB,CAAC;QACDsR,UAAUzR;QACVwC,cAAcpC;QACd,oCAAoC,GACpCsR,UAAU;YACR,OAAA,WAAA,GAAOlT,OAAAmI,aAAA,CAAC6H,KAAAA,MAAG5O;QACb;uBAGFpB,OAAAmI,aAAA,CAACgL,OAAAA;QAAItD,IAAItP;QAAeoO,MAAM;QAASyE,OAAO;YAAEzI,SAAS;QAAI;QAAG6D,cAAY;;AAEhF;AACA5O,wBAAwByT,WAAW,GAAG"}
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "HeatMapChart", {
|
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _index = require("../../utilities/index");
|
|
14
|
+
const _chartutilities = require("@fluentui/chart-utilities");
|
|
14
15
|
const _index1 = require("../CommonComponents/index");
|
|
15
16
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
17
|
const _reacttheme = require("@fluentui/react-theme");
|
|
@@ -170,7 +171,7 @@ const HeatMapChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
170
171
|
className: classes.text,
|
|
171
172
|
transform: `translate(${_xAxisScale.current.bandwidth() / 2}, ${_yAxisScale.current.bandwidth() / 2})`,
|
|
172
173
|
fill: foregroundColor
|
|
173
|
-
}, (0,
|
|
174
|
+
}, (0, _chartutilities.formatToLocaleString)(dataPointObject.rectText, props.culture, props.useUTC)));
|
|
174
175
|
index++;
|
|
175
176
|
} else {
|
|
176
177
|
const dataPointObject = {
|