@fluentui/react-charts 0.0.0-nightly-20250911-0406.1 → 0.0.0-nightly-20250915-0408.1
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 +15 -15
- package/lib/components/CommonComponents/CartesianChart.js +5 -7
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +6 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +34 -32
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +6 -3
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -15
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/utilities/utilities.js +5 -5
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +5 -7
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +6 -4
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +34 -32
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +6 -3
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +17 -15
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +5 -5
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +13 -13
|
@@ -86,7 +86,7 @@ const HeatMapChart = /*#__PURE__*/ _react.forwardRef((props = {
|
|
|
86
86
|
rEndValue: 0
|
|
87
87
|
};
|
|
88
88
|
} else {
|
|
89
|
-
domainNRangeValue = (0, _index.domainRangeOfXStringAxis)(
|
|
89
|
+
domainNRangeValue = (0, _index.domainRangeOfXStringAxis)(_margins.current, width, isRTL);
|
|
90
90
|
}
|
|
91
91
|
return domainNRangeValue;
|
|
92
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/HeatMapChart/HeatMapChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { HeatMapChartProps } from './HeatMapChart.types';\nimport {\n AccessibilityProps,\n Chart,\n HeatMapChartData,\n HeatMapChartDataPoint,\n Margins,\n ImageExportOptions,\n} from '../../types/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n getColorContrast,\n getTypeOfAxis,\n resolveCSSVariables,\n XAxisTypes,\n YAxisType,\n createNumericYAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n useRtl,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { CartesianChart, ChartPopoverProps, ChildProps } from '../CommonComponents/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';\nimport { Legend, Legends, LegendContainer } from '../Legends/index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = HeatMapChartDataPoint & {\n legend: string;\n};\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\n\nexport const HeatMapChart: React.FunctionComponent<HeatMapChartProps> = React.forwardRef<\n HTMLDivElement,\n HeatMapChartProps\n>(\n (\n props = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n data: [],\n domainValuesForColorScale: [],\n rangeValuesForColorScale: [],\n },\n forwardedRef,\n ) => {\n const classes = useHeatMapChartStyles(props);\n const _stringXAxisDataPoints = React.useRef<string[]>([]);\n const _stringYAxisDataPoints = React.useRef<string[]>([]);\n const _dataSet = React.useRef<RectanglesGraphData>({});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _colorScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale = React.useRef<any>();\n const _xAxisType = React.useRef<XAxisTypes>();\n const _yAxisType = React.useRef<YAxisType>();\n const _calloutAnchorPoint = React.useRef<FlattenData | null>(null);\n const _emptyChartId = useId('_HeatMap_empty');\n const _margins = React.useRef<Margins>({});\n const cartesianChartRef = React.useRef<Chart>(null);\n const _legendsRef = React.useRef<LegendContainer>(null);\n const _isRtl = useRtl();\n\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [calloutTextColor, setCalloutTextColor] = React.useState<string>('');\n const [calloutYValue, setCalloutYValue] = React.useState<string>('');\n const [ratio, setRatio] = React.useState<[number, number]>();\n const [descriptionMessage, setDescriptionMessage] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _getMinMaxOfYAxis() {\n return { startValue: 0, endValue: 0 };\n }\n\n function _getDomainNRangeValues(\n points: HeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n const _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n props.data.forEach((item: HeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n const _getMargins = (margins: Margins) => {\n _margins.current = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n const _onRectFocus = (id: string, data: FlattenData, focusEvent: React.FocusEvent<SVGGElement>): void => {\n const boundingRect = focusEvent.currentTarget.getBoundingClientRect();\n const clientX = boundingRect.left + boundingRect.width / 2;\n const clientY = boundingRect.top + boundingRect.height / 2;\n updatePosition(clientX, clientY);\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n };\n\n const _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint.current !== data) {\n _calloutAnchorPoint.current = data;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(\n Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value),\n );\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n }\n };\n\n const _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n };\n\n const _getInvertedTextColor = (color: string): string => {\n return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n const _createRectangles = (): React.ReactNode => {\n const rectangles: JSXElement[] = [];\n const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n _stringXAxisDataPoints.current.forEach((xAxisDataPoint: string) => {\n let rectElement: JSXElement;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n _dataSet.current[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof _dataSet.current[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = _dataSet.current[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = tokens.colorNeutralForeground1;\n if (cartesianChartRef.current?.chartContainer) {\n styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = _getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1}\n fillOpacity={_getOpacity(dataPointObject.legend)}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill={_colorScale.current(dataPointObject.value)}\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={classes.text}\n transform={`translate(${_xAxisScale.current.bandwidth() / 2}, ${\n _yAxisScale.current.bandwidth() / 2\n })`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, props.culture, props.useUTC) as React.ReactNode}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_noLegendHighlighted() ? 0 : -1}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill=\"transparent\"\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n const _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (selectedLegend === legendTitle) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(legendTitle);\n }\n };\n const _createLegendBars = (): JSXElement => {\n const { data, legendProps } = props;\n const legends: Legend[] = [];\n data.forEach((item: HeatMapChartData) => {\n const legend: Legend = {\n title: item.legend,\n color: _colorScale.current(item.value),\n action: () => {\n _onLegendClick(item.legend);\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} legendRef={_legendsRef} />;\n };\n\n const _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n const _getXIndex = (value: string | Date | number): string => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_xAxisType.current === XAxisTypes.StringAxis) {\n return value as string;\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n const _getYIndex = (value: string | Date | number): string => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_yAxisType.current === YAxisType.StringAxis) {\n return value as string;\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n const { xAxisStringFormatter } = props;\n const _getFormattedLabelForXAxisDataPoint = React.useCallback(\n (point: string): string => {\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n },\n [xAxisStringFormatter],\n );\n\n const { yAxisStringFormatter } = props;\n const _getFormattedLabelForYAxisDataPoint = React.useCallback(\n (point: string): string => {\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n },\n [yAxisStringFormatter],\n );\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n const _getXAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = _getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);\n } else {\n return _getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n props.sortOrder,\n props.xAxisDateFormatString,\n props.xAxisNumberFormatString,\n ],\n );\n\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n const _getYAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = _getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);\n } else {\n return _getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n },\n [\n _getFormattedLabelForYAxisDataPoint,\n props.sortOrder,\n props.yAxisDateFormatString,\n props.yAxisNumberFormatString,\n ],\n );\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n const _createNewDataSet = React.useCallback(\n (\n data: HeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: HeatMapChartData) => {\n item.data.forEach((point: HeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = _getXIndex(item.x);\n const posY = _getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = _getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n datapoint.x = _getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (_xAxisType.current === XAxisTypes.NumericAxis) {\n datapoint.x = _getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (_yAxisType.current === YAxisType.DateAxis) {\n datapoint.y = _getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (_yAxisType.current === YAxisType.NumericAxis) {\n datapoint.y = _getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (_yAxisType.current === YAxisType.StringAxis) {\n datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable _stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `_createRectangles` should work perfetcly while looping, and if we don't change\n * then `_createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n _getFormattedLabelForYAxisDataPoint,\n _getXAxisDataPoints,\n _getYAxisDataPoints,\n props.sortOrder,\n ],\n );\n\n const _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n const _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\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 selectedLegend === legendTitle || (selectedLegend === '' && activeLegend === legendTitle);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return selectedLegend === '' && activeLegend === '';\n };\n\n const _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n const numDataPoints = props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n const _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n };\n\n const _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n };\n\n const _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: HeatMapChartDataPoint, b: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n return props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (_xAxisType.current === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = _getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n const _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return _xAxisType.current === XAxisTypes.StringAxis && props.xAxisCategoryOrder !== 'default';\n };\n\n const _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return _yAxisType.current === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n };\n\n const _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n\n const 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 }\n };\n\n const { x, y } = _getXandY();\n _xAxisType.current = getTypeOfAxis(x, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n props;\n _colorScale.current = _getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(\n () =>\n _createNewDataSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ),\n [\n _createNewDataSet,\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ],\n );\n _dataSet.current = dataSet;\n _stringYAxisDataPoints.current = yAxisPoints;\n _stringXAxisDataPoints.current = xAxisPoints;\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n isPopoverOpen,\n YValue: calloutYValue,\n legend: calloutLegend,\n color: calloutTextColor,\n ratio,\n descriptionMessage,\n clickPosition,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n styles: {\n calloutContentRoot: classes.calloutContentRoot!,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_stringXAxisDataPoints.current}\n stringDatasetForYAxisDomain={_stringYAxisDataPoints.current}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n getmargins={_getMargins}\n xAxisTickCount={_stringXAxisDataPoints.current.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n legendBars={_createLegendBars()}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n children={(p: ChildProps) => {\n _xAxisScale.current = p.xScale;\n _yAxisScale.current = p.yScalePrimary;\n return _createRectangles();\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n"],"names":["React","ChartTypes","getAccessibleDataObject","getColorContrast","getTypeOfAxis","resolveCSSVariables","XAxisTypes","YAxisType","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","useRtl","sortAxisCategories","formatToLocaleString","CartesianChart","useId","tokens","useHeatMapChartStyles","Legends","scaleLinear","d3ScaleLinear","format","d3Format","timeFormat","d3TimeFormat","toImage","HeatMapChart","forwardRef","props","xAxisCategoryOrder","yAxisCategoryOrder","data","domainValuesForColorScale","rangeValuesForColorScale","forwardedRef","classes","_stringXAxisDataPoints","useRef","_stringYAxisDataPoints","_dataSet","_colorScale","_xAxisScale","_yAxisScale","_xAxisType","_yAxisType","_calloutAnchorPoint","_emptyChartId","_margins","cartesianChartRef","_legendsRef","_isRtl","selectedLegend","setSelectedLegend","useState","activeLegend","setActiveLegend","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","calloutTextColor","setCalloutTextColor","calloutYValue","setCalloutYValue","ratio","setRatio","descriptionMessage","setDescriptionMessage","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","useImperativeHandle","componentRef","chartContainer","current","opts","toSVG","_getMinMaxOfYAxis","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","_getXandY","forEach","item","length","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","_onRectFocus","id","focusEvent","boundingRect","currentTarget","getBoundingClientRect","clientX","left","clientY","top","height","updatePosition","legend","rectText","Number","isNaN","value","colorNeutralForeground1","_onRectMouseOver","mouseEvent","persist","_onRectBlurOrMouseOut","_handleChartMouseLeave","_getInvertedTextColor","color","colorNeutralBackground1","_createRectangles","rectangles","yAxisDataPoints","slice","reverse","yAxisDataPoint","index","xAxisDataPoint","rectElement","dataPointObject","styleRules","foregroundColor","contrastRatio","g","key","role","aria-label","_getAriaLabel","tabIndex","fillOpacity","transform","onFocus","e","onBlur","onMouseOver","onMouseOut","rect","fill","bandwidth","onClick","text","dominantBaseline","textAnchor","className","culture","useUTC","NaN","push","_onLegendHover","_onLegendLeave","_onLegendClick","_createLegendBars","legendProps","legends","title","action","hoverAction","onMouseOutAction","legendRef","_getColorScale","domain","range","_getXIndex","getTime","StringAxis","_getYIndex","xAxisStringFormatter","_getFormattedLabelForXAxisDataPoint","useCallback","point","yAxisStringFormatter","_getFormattedLabelForYAxisDataPoint","_getXAxisDataPoints","xAxisPoints","unFormattedXAxisDataPoints","_getOrderedXAxisLabels","map","xPoint","_getStringFormattedDate","xAxisDateFormatString","_getStringFormattedNumber","xAxisNumberFormatString","sortOrder","_getYAxisDataPoints","yAxisPoints","unFormattedYAxisDataPoints","_getOrderedYAxisLabels","yPoint","yAxisDateFormatString","yAxisNumberFormatString","_createNewDataSet","flattenData","yPoints","uniqueYPoints","uniqueXPoints","posX","posY","Object","keys","_getOrderedXPoints","datapoint","dataSet","formatString","date","Date","setTime","xValue","yValue","zValue","description","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","numDataPoints","reduce","acc","curr","_shouldOrderXAxisLabelsByCategoryOrder","sort","a","b","toLowerCase","_mapCategoryToValues","_shouldOrderYAxisLabelsByCategoryOrder","xPoints","result","xValueToPoints","xAxisLabels","isYAxis","categoryToValues","category","newX","newY","threshold","distance","Math","sqrt","pow","useMemo","calloutProps","YValue","styles","calloutContentRoot","tickParams","tickFormat","yAxisType","createYAxis","datasetForXAxisDomain","stringDatasetForYAxisDomain","getDomainNRangeValues","getMinMaxOfYAxis","getmargins","xAxisTickCount","xAxistickSize","xAxisPadding","yAxisPadding","legendBars","onChartMouseLeave","children","p","xScale","yScalePrimary","div","style"],"mappings":";;;;+BAgDa0B;;;;;;;iEAhDU,QAAQ;uBAyBxB,wBAAwB;gCACM,4BAA4B;wBACH,4BAA4B;gCACpE,4BAA4B;4BAE3B,wBAAwB;6CACT,iCAAiC;wBACtB,mBAAmB;yBACvB,WAAW;0BACrB,YAAY;8BACJ,iBAAiB;kCACpC,qCAAqC;AAYtD,qBA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AAoC,GACpCe,UAAU,CAACC;YACTrP,YAAYoC,OAAO,GAAGiN,EAAEC,MAAM;YAC9BrP,YAAYmC,OAAO,GAAGiN,EAAEE,aAAa;YACrC,OAAOxJ;QACT;uBAGF,OAAA,aAAA,CAACyJ,OAAAA;QAAIlL,IAAIjE;QAAeyG,MAAM;QAAS2I,OAAO;YAAEvL,SAAS;QAAI;QAAG6C,cAAY;;AAEhF,GACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/HeatMapChart/HeatMapChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { HeatMapChartProps } from './HeatMapChart.types';\nimport {\n AccessibilityProps,\n Chart,\n HeatMapChartData,\n HeatMapChartDataPoint,\n Margins,\n ImageExportOptions,\n} from '../../types/index';\nimport {\n ChartTypes,\n getAccessibleDataObject,\n getColorContrast,\n getTypeOfAxis,\n resolveCSSVariables,\n XAxisTypes,\n YAxisType,\n createNumericYAxis,\n IMargins,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n useRtl,\n sortAxisCategories,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { CartesianChart, ChartPopoverProps, ChildProps } from '../CommonComponents/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useHeatMapChartStyles } from './useHeatMapChartStyles.styles';\nimport { Legend, Legends, LegendContainer } from '../Legends/index';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { format as d3Format } from 'd3-format';\nimport { timeFormat as d3TimeFormat } from 'd3-time-format';\nimport { toImage } from '../../utilities/image-export-utils';\n\ntype DataSet = {\n dataSet: RectanglesGraphData;\n yAxisPoints: string[];\n xAxisPoints: string[];\n};\ntype FlattenData = HeatMapChartDataPoint & {\n legend: string;\n};\ntype RectanglesGraphData = { [key: string]: FlattenData[] };\n\nexport const HeatMapChart: React.FunctionComponent<HeatMapChartProps> = React.forwardRef<\n HTMLDivElement,\n HeatMapChartProps\n>(\n (\n props = {\n xAxisCategoryOrder: 'default',\n yAxisCategoryOrder: 'default',\n data: [],\n domainValuesForColorScale: [],\n rangeValuesForColorScale: [],\n },\n forwardedRef,\n ) => {\n const classes = useHeatMapChartStyles(props);\n const _stringXAxisDataPoints = React.useRef<string[]>([]);\n const _stringYAxisDataPoints = React.useRef<string[]>([]);\n const _dataSet = React.useRef<RectanglesGraphData>({});\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _colorScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale = React.useRef<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale = React.useRef<any>();\n const _xAxisType = React.useRef<XAxisTypes>();\n const _yAxisType = React.useRef<YAxisType>();\n const _calloutAnchorPoint = React.useRef<FlattenData | null>(null);\n const _emptyChartId = useId('_HeatMap_empty');\n const _margins = React.useRef<Margins>({});\n const cartesianChartRef = React.useRef<Chart>(null);\n const _legendsRef = React.useRef<LegendContainer>(null);\n const _isRtl = useRtl();\n\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [calloutTextColor, setCalloutTextColor] = React.useState<string>('');\n const [calloutYValue, setCalloutYValue] = React.useState<string>('');\n const [ratio, setRatio] = React.useState<[number, number]>();\n const [descriptionMessage, setDescriptionMessage] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, _isRtl, opts);\n },\n }),\n [],\n );\n\n function _getMinMaxOfYAxis() {\n return { startValue: 0, endValue: 0 };\n }\n\n function _getDomainNRangeValues(\n points: HeatMapChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(_margins.current, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n const _getXandY = (): { x: string | Date | number; y: string | Date | number } => {\n let x: string | Date | number = '';\n let y: string | Date | number = '';\n props.data.forEach((item: HeatMapChartData) => {\n if (item.data && item.data.length > 0) {\n x = item.data[0].x;\n y = item.data[0].y;\n return { x, y };\n }\n });\n return { x, y };\n };\n\n const _getMargins = (margins: Margins) => {\n _margins.current = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '1' : '0.1';\n return opacity;\n };\n\n const _onRectFocus = (id: string, data: FlattenData, focusEvent: React.FocusEvent<SVGGElement>): void => {\n const boundingRect = focusEvent.currentTarget.getBoundingClientRect();\n const clientX = boundingRect.left + boundingRect.width / 2;\n const clientY = boundingRect.top + boundingRect.height / 2;\n updatePosition(clientX, clientY);\n /** Show the callout if highlighted rectangle is focused and Hide it if unhighlighted rectangle is focused */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value));\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n };\n\n const _onRectMouseOver = (id: string, data: FlattenData, mouseEvent: React.MouseEvent<SVGGElement>): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint.current !== data) {\n _calloutAnchorPoint.current = data;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n /** Show the callout if highlighted rectangle is hovered and Hide it if unhighlighted rectangle is hovered */\n setPopoverOpen(selectedLegend === '' || selectedLegend === data.legend);\n setCalloutYValue(`${data.rectText}`);\n setCalloutTextColor(\n Number.isNaN(data.value) ? tokens.colorNeutralForeground1 : _colorScale.current(data.value),\n );\n setCalloutLegend(data.legend);\n setRatio(data.ratio);\n setDescriptionMessage(data.descriptionMessage || '');\n setCallOutAccessibilityData(data.callOutAccessibilityData);\n }\n };\n\n const _onRectBlurOrMouseOut = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint.current = null;\n setPopoverOpen(false);\n };\n\n const _getInvertedTextColor = (color: string): string => {\n return color === tokens.colorNeutralForeground1 ? tokens.colorNeutralBackground1 : tokens.colorNeutralForeground1;\n };\n\n /**\n * This is the function which is responsible for\n * drawing the rectangle in the graph and also\n * attaching dom events to that rectangles\n */\n const _createRectangles = (): React.ReactNode => {\n const rectangles: JSXElement[] = [];\n const yAxisDataPoints = _stringYAxisDataPoints.current.slice().reverse();\n /**\n * yAxisDataPoint is noting but the DataPoint\n * which will be rendered on the y-axis\n */\n yAxisDataPoints.forEach((yAxisDataPoint: string) => {\n let index = 0;\n _stringXAxisDataPoints.current.forEach((xAxisDataPoint: string) => {\n let rectElement: JSXElement;\n const id = `x${xAxisDataPoint}y${yAxisDataPoint}`;\n if (\n _dataSet.current[yAxisDataPoint][index]?.x === xAxisDataPoint &&\n typeof _dataSet.current[yAxisDataPoint][index]?.value === 'number'\n ) {\n /**\n * dataPointObject is an object where it contains information on single\n * data point such as x, y , value, rectText property of the rectangle\n */\n const dataPointObject = _dataSet.current[yAxisDataPoint][index];\n let styleRules = '';\n let foregroundColor = tokens.colorNeutralForeground1;\n if (cartesianChartRef.current?.chartContainer) {\n styleRules = resolveCSSVariables(cartesianChartRef.current.chartContainer, foregroundColor);\n }\n const contrastRatio = getColorContrast(styleRules, _colorScale.current(dataPointObject.value));\n if (contrastRatio < 3) {\n foregroundColor = _getInvertedTextColor(foregroundColor);\n }\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_legendHighlighted(dataPointObject.legend) || _noLegendHighlighted() ? 0 : -1}\n fillOpacity={_getOpacity(dataPointObject.legend)}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill={_colorScale.current(dataPointObject.value)}\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n onClick={dataPointObject.onClick}\n />\n <text\n dominantBaseline={'middle'}\n textAnchor={'middle'}\n className={classes.text}\n transform={`translate(${_xAxisScale.current.bandwidth() / 2}, ${\n _yAxisScale.current.bandwidth() / 2\n })`}\n fill={foregroundColor}\n >\n {formatToLocaleString(dataPointObject.rectText, props.culture, props.useUTC) as React.ReactNode}\n </text>\n </g>\n );\n index++;\n } else {\n const dataPointObject: FlattenData = {\n x: xAxisDataPoint,\n y: yAxisDataPoint,\n value: NaN,\n rectText: 'No data available',\n legend: '',\n };\n rectElement = (\n <g\n key={id}\n role=\"img\"\n aria-label={_getAriaLabel(dataPointObject)}\n tabIndex={_noLegendHighlighted() ? 0 : -1}\n transform={`translate(${_xAxisScale.current(dataPointObject.x)}, ${_yAxisScale.current(\n dataPointObject.y,\n )})`}\n onFocus={e => _onRectFocus(id, dataPointObject, e)}\n onBlur={_onRectBlurOrMouseOut}\n onMouseOver={e => _onRectMouseOver(id, dataPointObject, e)}\n onMouseOut={_onRectBlurOrMouseOut}\n >\n <rect\n fill=\"transparent\"\n width={_xAxisScale.current.bandwidth()}\n height={_yAxisScale.current.bandwidth()}\n />\n </g>\n );\n }\n rectangles.push(rectElement);\n });\n });\n return rectangles;\n };\n /**\n * when the legend is hovered we need to highlight\n * all the rectangles which fall under that category\n * and un-highlight the rest of them\n * @param legendTitle\n */\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n /**\n * when the mouse is out from the legend , we need\n * to show the graph in initial mode.\n */\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n /**\n * @param legendTitle\n * when the legend is clicked we need to highlight\n * all the rectangles which fall under that category\n * and un highlight the rest of them\n */\n const _onLegendClick = (legendTitle: string): void => {\n /**\n * check if the legend is already selceted,\n * if yes, un-select the legend, else\n * set the selected legend state to legendTitle\n */\n if (selectedLegend === legendTitle) {\n setSelectedLegend('');\n } else {\n setSelectedLegend(legendTitle);\n }\n };\n const _createLegendBars = (): JSXElement => {\n const { data, legendProps } = props;\n const legends: Legend[] = [];\n data.forEach((item: HeatMapChartData) => {\n const legend: Legend = {\n title: item.legend,\n color: _colorScale.current(item.value),\n action: () => {\n _onLegendClick(item.legend);\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(item.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n legends.push(legend);\n });\n return <Legends {...legendProps} legends={legends} legendRef={_legendsRef} />;\n };\n\n const _getColorScale = () => {\n const { domainValuesForColorScale, rangeValuesForColorScale } = props;\n return d3ScaleLinear()\n .domain(domainValuesForColorScale)\n .range(rangeValuesForColorScale as unknown as number[]);\n };\n\n const _getXIndex = (value: string | Date | number): string => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_xAxisType.current === XAxisTypes.StringAxis) {\n return value as string;\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n const _getYIndex = (value: string | Date | number): string => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return `${(value as Date).getTime()}`;\n } else if (_yAxisType.current === YAxisType.StringAxis) {\n return value as string;\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return `${value}`;\n } else {\n return '';\n }\n };\n\n const { xAxisStringFormatter } = props;\n const _getFormattedLabelForXAxisDataPoint = React.useCallback(\n (point: string): string => {\n return xAxisStringFormatter ? xAxisStringFormatter(point) : point;\n },\n [xAxisStringFormatter],\n );\n\n const { yAxisStringFormatter } = props;\n const _getFormattedLabelForYAxisDataPoint = React.useCallback(\n (point: string): string => {\n return yAxisStringFormatter ? yAxisStringFormatter(point) : point;\n },\n [yAxisStringFormatter],\n );\n\n /**\n * This function will return the final sorted and formatted x-axis points\n * which will be rendered on the x-axis\n * @param points\n * @returns x-axis points\n */\n const _getXAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let xAxisPoints: string[] = [];\n const unFormattedXAxisDataPoints = _getOrderedXAxisLabels(points);\n xAxisPoints = unFormattedXAxisDataPoints.map((xPoint: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n return _getStringFormattedDate(xPoint, props.xAxisDateFormatString);\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return _getStringFormattedNumber(xPoint, props.xAxisNumberFormatString);\n } else {\n return _getFormattedLabelForXAxisDataPoint(xPoint);\n }\n });\n\n return xAxisPoints;\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n props.sortOrder,\n props.xAxisDateFormatString,\n props.xAxisNumberFormatString,\n ],\n );\n\n /**\n * This function will return the final sorted and formatted y-axis points\n * which will be rendered on the y-axis\n * @param points\n * @returns yaxis points\n */\n const _getYAxisDataPoints = React.useCallback(\n (points: { [key: string]: '1' }): string[] => {\n let yAxisPoints: string[] = [];\n const unFormattedYAxisDataPoints = _getOrderedYAxisLabels(points);\n yAxisPoints = unFormattedYAxisDataPoints.map((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n return _getStringFormattedDate(yPoint, props.yAxisDateFormatString);\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n return _getStringFormattedNumber(yPoint, props.yAxisNumberFormatString);\n } else {\n return _getFormattedLabelForYAxisDataPoint(yPoint);\n }\n });\n\n return yAxisPoints;\n },\n [\n _getFormattedLabelForYAxisDataPoint,\n props.sortOrder,\n props.yAxisDateFormatString,\n props.yAxisNumberFormatString,\n ],\n );\n\n /**\n * This will create a new data set based on the prop\n * @data\n * We will be using This data set to contsruct our rectangles\n * in the chart, we use this data set becuase, when we loop in this\n * data and build the heat map, it will support accessibility as\n * specified in the figma\n */\n\n const _createNewDataSet = React.useCallback(\n (\n data: HeatMapChartData[],\n xAxisDateFormatString: string | undefined,\n xAxisNumberFormatString: string | undefined,\n yAxisDateFormatString: string | undefined,\n yAxisNumberFormatString: string | undefined,\n ): DataSet => {\n /**\n * please do not destructure any of the props here,\n * instead send them as parameter to this functions so that\n * this functions get called whenever the prop changes\n */\n const flattenData: FlattenData[] = [];\n /**\n * below for each loop will store all the datapoints in the one array.\n * basically it will flatten the nestesd array (data prop) into single array\n * of object. where each object contains x, y, rectText , value and legend propety of single\n * data point.\n */\n data.forEach((item: HeatMapChartData) => {\n item.data.forEach((point: HeatMapChartDataPoint) => {\n flattenData.push({ ...point, legend: item.legend });\n });\n });\n const yPoints: RectanglesGraphData = {};\n const uniqueYPoints: { [key: string]: '1' } = {};\n const uniqueXPoints: { [key: string]: '1' } = {};\n flattenData.forEach((item: FlattenData) => {\n const posX = _getXIndex(item.x);\n const posY = _getYIndex(item.y);\n\n uniqueXPoints[posX] = '1';\n uniqueYPoints[posY] = '1';\n /** we will check if the property(posY) is already there in object, if Yes,\n * then we will append the item in the Array related to the pos, if not\n * then we will simply append the item in the new Array and\n * assign that array to the property (posY) in the Object\n * and finally we will get the array of Objects associated to each\n * property (which is nothing but y data point) and object in the\n * array are noting but x data points associated to the property y\n */\n if (yPoints[posY]) {\n yPoints[posY] = [...yPoints[posY], item];\n } else {\n yPoints[posY] = [item];\n }\n });\n /**\n * we will now sort(ascending) the array's of y data point based on the x value\n * sorting is important to achive the accessibility order of the\n * rectangles and then format the x and y datapoints respectively\n */\n Object.keys(yPoints).forEach((item: string) => {\n yPoints[item] = _getOrderedXPoints(yPoints[item]);\n\n yPoints[item].forEach((datapoint: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n datapoint.x = _getStringFormattedDate(datapoint.x as string, xAxisDateFormatString);\n }\n if (_xAxisType.current === XAxisTypes.NumericAxis) {\n datapoint.x = _getStringFormattedNumber(datapoint.x as string, xAxisNumberFormatString);\n }\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n datapoint.x = _getFormattedLabelForXAxisDataPoint(datapoint.x as string);\n }\n if (_yAxisType.current === YAxisType.DateAxis) {\n datapoint.y = _getStringFormattedDate(datapoint.y as string, yAxisDateFormatString);\n }\n if (_yAxisType.current === YAxisType.NumericAxis) {\n datapoint.y = _getStringFormattedNumber(datapoint.y as string, yAxisNumberFormatString);\n }\n if (_yAxisType.current === YAxisType.StringAxis) {\n datapoint.y = _getFormattedLabelForYAxisDataPoint(datapoint.y as string);\n }\n });\n });\n /**\n * if y-axis data points are of type date or number or if we have string formatter,\n * then we need to change data points to their respective string\n * format, becuase in the private variable _stringYAxisDatapoints, points will be stored in\n * string format. and in here `yPoint` are not so we need to change, so that\n * function `_createRectangles` should work perfetcly while looping, and if we don't change\n * then `_createRectangles` will fail while looping, causing the error\n * Cannot read property 'forEach' of undefined\n */\n\n Object.keys(yPoints).forEach((yPoint: string) => {\n if (_yAxisType.current === YAxisType.DateAxis) {\n yPoints[_getStringFormattedDate(yPoint, yAxisDateFormatString)] = yPoints[yPoint];\n } else if (_yAxisType.current === YAxisType.NumericAxis) {\n yPoints[`${_getStringFormattedNumber(yPoint, yAxisNumberFormatString)}`] = yPoints[yPoint];\n } else {\n yPoints[_getFormattedLabelForYAxisDataPoint(yPoint)] = yPoints[yPoint];\n }\n });\n /**\n * assigning new data set\n */\n const dataSet = yPoints;\n /**\n * These are the Y axis data points which will get rendered in the\n * Y axis in graph\n */\n const yAxisPoints = _getYAxisDataPoints(uniqueYPoints);\n /**\n * These are the x axis data points which will get rendered in the\n * x axis in the graph\n */\n\n const xAxisPoints = _getXAxisDataPoints(uniqueXPoints);\n return {\n dataSet,\n yAxisPoints,\n xAxisPoints,\n };\n },\n [\n _getFormattedLabelForXAxisDataPoint,\n _getFormattedLabelForYAxisDataPoint,\n _getXAxisDataPoints,\n _getYAxisDataPoints,\n props.sortOrder,\n ],\n );\n\n const _getStringFormattedDate = (point: string, formatString?: string): string => {\n const date = new Date();\n date.setTime(+point);\n return d3TimeFormat(formatString || '%b/%d')(date);\n };\n\n const _getStringFormattedNumber = (point: string, formatString?: string): string => {\n return d3Format(formatString || '.2~s')(+point);\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 selectedLegend === legendTitle || (selectedLegend === '' && activeLegend === legendTitle);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return selectedLegend === '' && activeLegend === '';\n };\n\n const _getAriaLabel = (point: FlattenData): string => {\n const xValue = point.x;\n const yValue = point.y;\n const legend = point.legend;\n const zValue = point.ratio ? `${point.ratio[0]}/${point.ratio[1]}` : point.rectText || point.value;\n const description = point.descriptionMessage;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${xValue}, ${yValue}. ${legend}, ${zValue}.` + (description ? ` ${description}.` : '')\n );\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n const numDataPoints = props.data.reduce((acc, curr) => acc + curr.data.length, 0);\n return (chartTitle ? `${chartTitle}. ` : '') + `Heat map chart with ${numDataPoints} data points. `;\n };\n\n const _getOrderedXAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_xAxisType.current === XAxisTypes.DateAxis || _xAxisType.current === XAxisTypes.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);\n };\n\n const _getOrderedYAxisLabels = (points: { [key: string]: '1' }) => {\n if (!_shouldOrderYAxisLabelsByCategoryOrder()) {\n // Keep the original ordering logic as the default behavior to ensure backward compatibility\n return Object.keys(points).sort((a: string, b: string) => {\n if (_yAxisType.current === YAxisType.DateAxis || _yAxisType.current === YAxisType.NumericAxis) {\n return +a - +b;\n } else {\n return props.sortOrder === 'none' ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : -1;\n }\n });\n }\n\n return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);\n };\n\n const _getOrderedXPoints = (xPoints: FlattenData[]) => {\n if (!_shouldOrderXAxisLabelsByCategoryOrder()) {\n return xPoints.sort((a: HeatMapChartDataPoint, b: HeatMapChartDataPoint) => {\n if (_xAxisType.current === XAxisTypes.StringAxis) {\n return props.sortOrder === 'none'\n ? 0\n : (a.x as string).toLowerCase() > (b.x as string).toLowerCase()\n ? 1\n : -1;\n } else if (_xAxisType.current === XAxisTypes.DateAxis) {\n return (a.x as Date).getTime() - (b.x as Date).getTime();\n } else if (_xAxisType.current === XAxisTypes.NumericAxis) {\n return +(a.x as string) > +(b.x as string) ? 1 : -1;\n } else {\n return a.x > b.x ? 1 : -1;\n }\n });\n }\n\n const result: FlattenData[] = [];\n\n const xValueToPoints: Record<string, FlattenData[]> = {};\n xPoints.forEach(point => {\n const xValue = point.x as string;\n if (!xValueToPoints[xValue]) {\n xValueToPoints[xValue] = [];\n }\n xValueToPoints[xValue].push(point);\n });\n\n const xAxisLabels = _getOrderedXAxisLabels({});\n xAxisLabels.forEach(xValue => {\n if (xValueToPoints[xValue]) {\n result.push(...xValueToPoints[xValue]);\n }\n });\n\n return result;\n };\n\n const _shouldOrderXAxisLabelsByCategoryOrder = () => {\n return _xAxisType.current === XAxisTypes.StringAxis && props.xAxisCategoryOrder !== 'default';\n };\n\n const _shouldOrderYAxisLabelsByCategoryOrder = () => {\n return _yAxisType.current === YAxisType.StringAxis && props.yAxisCategoryOrder !== 'default';\n };\n\n const _mapCategoryToValues = (isYAxis = false) => {\n const categoryToValues: Record<string, number[]> = {};\n props.data.forEach(item => {\n item.data.forEach(point => {\n const category = (isYAxis ? point.y : point.x) as string;\n if (!categoryToValues[category]) {\n categoryToValues[category] = [];\n }\n categoryToValues[category].push(point.value);\n });\n });\n return categoryToValues;\n };\n\n const 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 }\n };\n\n const { x, y } = _getXandY();\n _xAxisType.current = getTypeOfAxis(x, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(y, false) as YAxisType;\n const { data, xAxisDateFormatString, xAxisNumberFormatString, yAxisDateFormatString, yAxisNumberFormatString } =\n props;\n _colorScale.current = _getColorScale();\n const { dataSet, xAxisPoints, yAxisPoints } = React.useMemo(\n () =>\n _createNewDataSet(\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ),\n [\n _createNewDataSet,\n data,\n xAxisDateFormatString,\n xAxisNumberFormatString,\n yAxisDateFormatString,\n yAxisNumberFormatString,\n ],\n );\n _dataSet.current = dataSet;\n _stringYAxisDataPoints.current = yAxisPoints;\n _stringXAxisDataPoints.current = xAxisPoints;\n const calloutProps: ChartPopoverProps = {\n ...props.calloutProps,\n isPopoverOpen,\n YValue: calloutYValue,\n legend: calloutLegend,\n color: calloutTextColor,\n ratio,\n descriptionMessage,\n clickPosition,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n styles: {\n calloutContentRoot: classes.calloutContentRoot!,\n },\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={data}\n chartType={ChartTypes.HeatMapChart}\n xAxisType={XAxisTypes.StringAxis}\n yAxisType={YAxisType.StringAxis}\n calloutProps={calloutProps}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_stringXAxisDataPoints.current}\n stringDatasetForYAxisDomain={_stringYAxisDataPoints.current}\n createStringYAxis={createStringYAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n getmargins={_getMargins}\n xAxisTickCount={_stringXAxisDataPoints.current.length}\n xAxistickSize={0}\n xAxisPadding={0.02}\n yAxisPadding={0.02}\n legendBars={_createLegendBars()}\n onChartMouseLeave={_handleChartMouseLeave}\n componentRef={cartesianChartRef}\n tickParams={tickParams}\n /* eslint-disable react/jsx-no-bind */\n children={(p: ChildProps) => {\n _xAxisScale.current = p.xScale;\n _yAxisScale.current = p.yScalePrimary;\n return _createRectangles();\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\n"],"names":["React","ChartTypes","getAccessibleDataObject","getColorContrast","getTypeOfAxis","resolveCSSVariables","XAxisTypes","YAxisType","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","useRtl","sortAxisCategories","formatToLocaleString","CartesianChart","useId","tokens","useHeatMapChartStyles","Legends","scaleLinear","d3ScaleLinear","format","d3Format","timeFormat","d3TimeFormat","toImage","HeatMapChart","forwardRef","props","xAxisCategoryOrder","yAxisCategoryOrder","data","domainValuesForColorScale","rangeValuesForColorScale","forwardedRef","classes","_stringXAxisDataPoints","useRef","_stringYAxisDataPoints","_dataSet","_colorScale","_xAxisScale","_yAxisScale","_xAxisType","_yAxisType","_calloutAnchorPoint","_emptyChartId","_margins","cartesianChartRef","_legendsRef","_isRtl","selectedLegend","setSelectedLegend","useState","activeLegend","setActiveLegend","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","calloutTextColor","setCalloutTextColor","calloutYValue","setCalloutYValue","ratio","setRatio","descriptionMessage","setDescriptionMessage","callOutAccessibilityData","setCallOutAccessibilityData","clickPosition","setClickPosition","x","y","useImperativeHandle","componentRef","chartContainer","current","opts","toSVG","_getMinMaxOfYAxis","startValue","endValue","_getDomainNRangeValues","points","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","_getXandY","forEach","item","length","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","_onRectFocus","id","focusEvent","boundingRect","currentTarget","getBoundingClientRect","clientX","left","clientY","top","height","updatePosition","legend","rectText","Number","isNaN","value","colorNeutralForeground1","_onRectMouseOver","mouseEvent","persist","_onRectBlurOrMouseOut","_handleChartMouseLeave","_getInvertedTextColor","color","colorNeutralBackground1","_createRectangles","rectangles","yAxisDataPoints","slice","reverse","yAxisDataPoint","index","xAxisDataPoint","rectElement","dataPointObject","styleRules","foregroundColor","contrastRatio","g","key","role","aria-label","_getAriaLabel","tabIndex","fillOpacity","transform","onFocus","e","onBlur","onMouseOver","onMouseOut","rect","fill","bandwidth","onClick","text","dominantBaseline","textAnchor","className","culture","useUTC","NaN","push","_onLegendHover","_onLegendLeave","_onLegendClick","_createLegendBars","legendProps","legends","title","action","hoverAction","onMouseOutAction","legendRef","_getColorScale","domain","range","_getXIndex","getTime","StringAxis","_getYIndex","xAxisStringFormatter","_getFormattedLabelForXAxisDataPoint","useCallback","point","yAxisStringFormatter","_getFormattedLabelForYAxisDataPoint","_getXAxisDataPoints","xAxisPoints","unFormattedXAxisDataPoints","_getOrderedXAxisLabels","map","xPoint","_getStringFormattedDate","xAxisDateFormatString","_getStringFormattedNumber","xAxisNumberFormatString","sortOrder","_getYAxisDataPoints","yAxisPoints","unFormattedYAxisDataPoints","_getOrderedYAxisLabels","yPoint","yAxisDateFormatString","yAxisNumberFormatString","_createNewDataSet","flattenData","yPoints","uniqueYPoints","uniqueXPoints","posX","posY","Object","keys","_getOrderedXPoints","datapoint","dataSet","formatString","date","Date","setTime","xValue","yValue","zValue","description","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","numDataPoints","reduce","acc","curr","_shouldOrderXAxisLabelsByCategoryOrder","sort","a","b","toLowerCase","_mapCategoryToValues","_shouldOrderYAxisLabelsByCategoryOrder","xPoints","result","xValueToPoints","xAxisLabels","isYAxis","categoryToValues","category","newX","newY","threshold","distance","Math","sqrt","pow","useMemo","calloutProps","YValue","styles","calloutContentRoot","tickParams","tickFormat","yAxisType","createYAxis","datasetForXAxisDomain","stringDatasetForYAxisDomain","getDomainNRangeValues","getMinMaxOfYAxis","getmargins","xAxisTickCount","xAxistickSize","xAxisPadding","yAxisPadding","legendBars","onChartMouseLeave","children","p","xScale","yScalePrimary","div","style"],"mappings":";;;;+BAgDa0B;;;;;;;iEAhDU,QAAQ;uBAyBxB,wBAAwB;gCACM,4BAA4B;wBACH,4BAA4B;gCACpE,4BAA4B;4BAE3B,wBAAwB;6CACT,iCAAiC;wBACtB,mBAAmB;yBACvB,WAAW;0BACrB,YAAY;8BACJ,iBAAiB;kCACpC,qCAAqC;AAYtD,qBAAMA,WAAAA,GAA2D1B,OAAM2B,UAAU,CAItF,CACEC,QAAQ;IACNC,oBAAoB;IACpBC,oBAAoB;IACpBC,MAAM,EAAE;IACRC,2BAA2B,EAAE;IAC7BC,0BAA0B,EAAE;AAC9B,CAA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F,OAAA,aAAA,CAACyJ,OAAAA;QAAIlL,IAAIjE;QAAeyG,MAAM;QAAS2I,OAAO;YAAEvL,SAAS;QAAI;QAAG6C,cAAY;;AAEhF,GACA"}
|
|
@@ -512,19 +512,19 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
512
512
|
]);
|
|
513
513
|
}
|
|
514
514
|
if (isLegendSelected) {
|
|
515
|
-
var _points_i_lineOptions3, _points_i_lineOptions4;
|
|
515
|
+
var _points_i_lineOptions3, _points_i_lineOptions4, _points_i_lineOptions5;
|
|
516
516
|
const lineBorderWidth = ((_points_i_lineOptions3 = _points[i].lineOptions) === null || _points_i_lineOptions3 === void 0 ? void 0 : _points_i_lineOptions3.lineBorderWidth) ? Number.parseFloat(_points[i].lineOptions.lineBorderWidth.toString()) : 0;
|
|
517
517
|
if (lineBorderWidth > 0) {
|
|
518
|
-
var
|
|
518
|
+
var _points_i_lineOptions6, _points_i_lineOptions7;
|
|
519
519
|
var _points_i_lineOptions_strokeLinecap;
|
|
520
520
|
bordersForLine.push(/*#__PURE__*/ _react.createElement("path", {
|
|
521
521
|
id: borderId,
|
|
522
522
|
key: borderId,
|
|
523
523
|
d: line(lineData),
|
|
524
524
|
fill: "transparent",
|
|
525
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap = (
|
|
525
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap = (_points_i_lineOptions6 = _points[i].lineOptions) === null || _points_i_lineOptions6 === void 0 ? void 0 : _points_i_lineOptions6.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap !== void 0 ? _points_i_lineOptions_strokeLinecap : 'round',
|
|
526
526
|
strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
|
|
527
|
-
stroke: ((
|
|
527
|
+
stroke: ((_points_i_lineOptions7 = _points[i].lineOptions) === null || _points_i_lineOptions7 === void 0 ? void 0 : _points_i_lineOptions7.lineBorderColor) || _reacttheme.tokens.colorNeutralBackground1,
|
|
528
528
|
opacity: 1
|
|
529
529
|
}));
|
|
530
530
|
}
|
|
@@ -538,15 +538,16 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
538
538
|
stroke: lineColor,
|
|
539
539
|
strokeWidth: strokeWidth,
|
|
540
540
|
strokeLinecap: (_points_i_lineOptions_strokeLinecap1 = (_points_i_lineOptions4 = _points[i].lineOptions) === null || _points_i_lineOptions4 === void 0 ? void 0 : _points_i_lineOptions4.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap1 !== void 0 ? _points_i_lineOptions_strokeLinecap1 : 'round',
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
strokeDasharray: (_points_i_lineOptions5 = _points[i].lineOptions) === null || _points_i_lineOptions5 === void 0 ? void 0 : _points_i_lineOptions5.strokeDasharray,
|
|
542
|
+
onMouseMove: (event)=>_onMouseOverLargeDataset(i, verticaLineHeight, event, yScale),
|
|
543
|
+
onMouseOver: (event)=>_onMouseOverLargeDataset(i, verticaLineHeight, event, yScale),
|
|
543
544
|
onMouseOut: _handleMouseOut,
|
|
544
545
|
..._getClickHandler(_points[i].onLineClick),
|
|
545
546
|
opacity: 1,
|
|
546
547
|
tabIndex: isLegendSelected ? 0 : undefined
|
|
547
548
|
}));
|
|
548
549
|
} else {
|
|
549
|
-
var
|
|
550
|
+
var _points_i_lineOptions8, _points_i_lineOptions9;
|
|
550
551
|
var _points_i_lineOptions_strokeLinecap2;
|
|
551
552
|
linesForLine.push(/*#__PURE__*/ _react.createElement("path", {
|
|
552
553
|
id: lineId,
|
|
@@ -556,7 +557,8 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
556
557
|
"data-is-focusable": false,
|
|
557
558
|
stroke: lineColor,
|
|
558
559
|
strokeWidth: strokeWidth,
|
|
559
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap2 = (
|
|
560
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap2 = (_points_i_lineOptions8 = _points[i].lineOptions) === null || _points_i_lineOptions8 === void 0 ? void 0 : _points_i_lineOptions8.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap2 !== void 0 ? _points_i_lineOptions_strokeLinecap2 : 'round',
|
|
561
|
+
strokeDasharray: (_points_i_lineOptions9 = _points[i].lineOptions) === null || _points_i_lineOptions9 === void 0 ? void 0 : _points_i_lineOptions9.strokeDasharray,
|
|
560
562
|
opacity: 0.1
|
|
561
563
|
}));
|
|
562
564
|
}
|
|
@@ -570,13 +572,13 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
570
572
|
strokeWidth: DEFAULT_LINE_STROKE_SIZE,
|
|
571
573
|
stroke: lineColor,
|
|
572
574
|
visibility: 'hidden',
|
|
573
|
-
onMouseMove: (event)=>_onMouseOverLargeDataset
|
|
574
|
-
onMouseOver: (event)=>_onMouseOverLargeDataset
|
|
575
|
+
onMouseMove: (event)=>_onMouseOverLargeDataset(i, verticaLineHeight, event, yScale),
|
|
576
|
+
onMouseOver: (event)=>_onMouseOverLargeDataset(i, verticaLineHeight, event, yScale),
|
|
575
577
|
onMouseOut: _handleMouseOut
|
|
576
578
|
}));
|
|
577
579
|
} else if (!props.optimizeLargeData) {
|
|
578
580
|
for(let j = 1; j < _points[i].data.length; j++){
|
|
579
|
-
var
|
|
581
|
+
var _points_i_lineOptions10, _points_i_lineOptions_mode1, _points_i_lineOptions11, _points_i_lineOptions_mode2, _points_i_lineOptions12;
|
|
580
582
|
const gapResult = _checkInGap(j, gaps, gapIndex);
|
|
581
583
|
const isInGap = gapResult.isInGap;
|
|
582
584
|
gapIndex = gapResult.gapIndex;
|
|
@@ -589,17 +591,17 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
589
591
|
const yPoint1 = yScale(y1);
|
|
590
592
|
const xPoint2 = _xAxisScale(x2);
|
|
591
593
|
const yPoint2 = yScale(y2);
|
|
592
|
-
const strokeWidth = ((
|
|
594
|
+
const strokeWidth = ((_points_i_lineOptions10 = _points[i].lineOptions) === null || _points_i_lineOptions10 === void 0 ? void 0 : _points_i_lineOptions10.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
593
595
|
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
594
596
|
const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
|
|
595
|
-
const supportsTextMode = (
|
|
597
|
+
const supportsTextMode = (_points_i_lineOptions11 = _points[i].lineOptions) === null || _points_i_lineOptions11 === void 0 ? void 0 : (_points_i_lineOptions_mode1 = _points_i_lineOptions11.mode) === null || _points_i_lineOptions_mode1 === void 0 ? void 0 : _points_i_lineOptions_mode1.includes('text');
|
|
596
598
|
const text = _points[i].data[j - 1].text;
|
|
597
599
|
let currentMarkerSize = _points[i].data[j - 1].markerSize;
|
|
598
600
|
if ((0, _index1.isPlottable)(xPoint1, yPoint1)) {
|
|
599
|
-
var _points_i_lineOptions_mode3,
|
|
601
|
+
var _points_i_lineOptions_mode3, _points_i_lineOptions13;
|
|
600
602
|
const path = _getPath(xPoint1, yPoint1, circleId, j, false, _points[i].index);
|
|
601
603
|
var _points_i_data__text1;
|
|
602
|
-
pointsForLine.push(((
|
|
604
|
+
pointsForLine.push(((_points_i_lineOptions13 = _points[i].lineOptions) === null || _points_i_lineOptions13 === void 0 ? void 0 : (_points_i_lineOptions_mode3 = _points_i_lineOptions13.mode) === null || _points_i_lineOptions_mode3 === void 0 ? void 0 : _points_i_lineOptions_mode3.includes('markers')) || supportsTextMode ? /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("circle", {
|
|
603
605
|
id: circleId,
|
|
604
606
|
key: circleId,
|
|
605
607
|
r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
|
|
@@ -645,22 +647,22 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
645
647
|
}));
|
|
646
648
|
}
|
|
647
649
|
if (j + 1 === _points[i].data.length) {
|
|
648
|
-
var _points_i_lineOptions_mode4,
|
|
650
|
+
var _points_i_lineOptions_mode4, _points_i_lineOptions14;
|
|
649
651
|
// If this is last point of the line segment.
|
|
650
652
|
const lastCircleId = `${circleId}${j}L`;
|
|
651
653
|
const hiddenHoverCircleId = `${circleId}${j}D`;
|
|
652
654
|
const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;
|
|
653
655
|
const { xAxisCalloutData: lastCirlceXCallout, xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData } = _points[i].data[j];
|
|
654
656
|
currentMarkerSize = _points[i].data[j].markerSize;
|
|
655
|
-
const lastSupportsTextMode = (
|
|
657
|
+
const lastSupportsTextMode = (_points_i_lineOptions14 = _points[i].lineOptions) === null || _points_i_lineOptions14 === void 0 ? void 0 : (_points_i_lineOptions_mode4 = _points_i_lineOptions14.mode) === null || _points_i_lineOptions_mode4 === void 0 ? void 0 : _points_i_lineOptions_mode4.includes('text');
|
|
656
658
|
const lastText = _points[i].data[j].text;
|
|
657
659
|
if ((0, _index1.isPlottable)(xPoint2, yPoint2)) {
|
|
658
|
-
var _points_i_lineOptions_mode5,
|
|
660
|
+
var _points_i_lineOptions_mode5, _points_i_lineOptions15;
|
|
659
661
|
const path = _getPath(xPoint2, yPoint2, lastCircleId, j, true, _points[i].index);
|
|
660
662
|
var _points_i_data_j_text;
|
|
661
663
|
pointsForLine.push(/*#__PURE__*/ _react.createElement(_react.Fragment, {
|
|
662
664
|
key: `${lastCircleId}_container`
|
|
663
|
-
}, ((
|
|
665
|
+
}, ((_points_i_lineOptions15 = _points[i].lineOptions) === null || _points_i_lineOptions15 === void 0 ? void 0 : (_points_i_lineOptions_mode5 = _points_i_lineOptions15.mode) === null || _points_i_lineOptions_mode5 === void 0 ? void 0 : _points_i_lineOptions_mode5.includes('markers')) || lastSupportsTextMode ? /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("circle", {
|
|
664
666
|
id: lastCircleId,
|
|
665
667
|
key: lastCircleId,
|
|
666
668
|
r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
|
|
@@ -719,14 +721,14 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
719
721
|
})));
|
|
720
722
|
}
|
|
721
723
|
}
|
|
722
|
-
if ((0, _index1.isPlottable)(xPoint1, yPoint1) && (0, _index1.isPlottable)(xPoint2, yPoint2) && (!_hasMarkersMode || ((
|
|
724
|
+
if ((0, _index1.isPlottable)(xPoint1, yPoint1) && (0, _index1.isPlottable)(xPoint2, yPoint2) && (!_hasMarkersMode || ((_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : (_points_i_lineOptions_mode2 = _points_i_lineOptions12.mode) === null || _points_i_lineOptions_mode2 === void 0 ? void 0 : _points_i_lineOptions_mode2.includes('lines')))) {
|
|
723
725
|
if (isLegendSelected) {
|
|
724
726
|
// don't draw line if it is in a gap
|
|
725
727
|
if (!isInGap) {
|
|
726
|
-
var
|
|
727
|
-
const lineBorderWidth = ((
|
|
728
|
+
var _points_i_lineOptions16, _points_i_lineOptions17, _points_i_lineOptions18, _points_i_lineOptions19;
|
|
729
|
+
const lineBorderWidth = ((_points_i_lineOptions16 = _points[i].lineOptions) === null || _points_i_lineOptions16 === void 0 ? void 0 : _points_i_lineOptions16.lineBorderWidth) ? Number.parseFloat(_points[i].lineOptions.lineBorderWidth.toString()) : 0;
|
|
728
730
|
if (lineBorderWidth > 0) {
|
|
729
|
-
var
|
|
731
|
+
var _points_i_lineOptions20, _points_i_lineOptions21;
|
|
730
732
|
var _points_i_lineOptions_strokeLinecap3;
|
|
731
733
|
bordersForLine.push(/*#__PURE__*/ _react.createElement("line", {
|
|
732
734
|
id: borderId,
|
|
@@ -735,9 +737,9 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
735
737
|
y1: yPoint1,
|
|
736
738
|
x2: xPoint2,
|
|
737
739
|
y2: yPoint2,
|
|
738
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (
|
|
740
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (_points_i_lineOptions20 = _points[i].lineOptions) === null || _points_i_lineOptions20 === void 0 ? void 0 : _points_i_lineOptions20.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap3 !== void 0 ? _points_i_lineOptions_strokeLinecap3 : 'round',
|
|
739
741
|
strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
|
|
740
|
-
stroke: ((
|
|
742
|
+
stroke: ((_points_i_lineOptions21 = _points[i].lineOptions) === null || _points_i_lineOptions21 === void 0 ? void 0 : _points_i_lineOptions21.lineBorderColor) || _reacttheme.tokens.colorNeutralBackground1,
|
|
741
743
|
opacity: 1
|
|
742
744
|
}));
|
|
743
745
|
}
|
|
@@ -757,16 +759,16 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
757
759
|
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
|
|
758
760
|
onMouseOut: _handleMouseOut,
|
|
759
761
|
stroke: lineColor,
|
|
760
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap4 = (
|
|
761
|
-
strokeDasharray: (
|
|
762
|
-
strokeDashoffset: (
|
|
762
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap4 = (_points_i_lineOptions17 = _points[i].lineOptions) === null || _points_i_lineOptions17 === void 0 ? void 0 : _points_i_lineOptions17.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap4 !== void 0 ? _points_i_lineOptions_strokeLinecap4 : 'round',
|
|
763
|
+
strokeDasharray: (_points_i_lineOptions18 = _points[i].lineOptions) === null || _points_i_lineOptions18 === void 0 ? void 0 : _points_i_lineOptions18.strokeDasharray,
|
|
764
|
+
strokeDashoffset: (_points_i_lineOptions19 = _points[i].lineOptions) === null || _points_i_lineOptions19 === void 0 ? void 0 : _points_i_lineOptions19.strokeDashoffset,
|
|
763
765
|
opacity: 1,
|
|
764
766
|
..._getClickHandler(_points[i].onLineClick)
|
|
765
767
|
}));
|
|
766
768
|
}
|
|
767
769
|
} else {
|
|
768
770
|
if (!isInGap) {
|
|
769
|
-
var
|
|
771
|
+
var _points_i_lineOptions22, _points_i_lineOptions23, _points_i_lineOptions24;
|
|
770
772
|
var _points_i_lineOptions_strokeLinecap5;
|
|
771
773
|
linesForLine.push(/*#__PURE__*/ _react.createElement("line", {
|
|
772
774
|
id: lineId,
|
|
@@ -777,9 +779,9 @@ const LineChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
777
779
|
y2: yPoint2,
|
|
778
780
|
strokeWidth: strokeWidth,
|
|
779
781
|
stroke: lineColor,
|
|
780
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (
|
|
781
|
-
strokeDasharray: (
|
|
782
|
-
strokeDashoffset: (
|
|
782
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (_points_i_lineOptions22 = _points[i].lineOptions) === null || _points_i_lineOptions22 === void 0 ? void 0 : _points_i_lineOptions22.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap5 !== void 0 ? _points_i_lineOptions_strokeLinecap5 : 'round',
|
|
783
|
+
strokeDasharray: (_points_i_lineOptions23 = _points[i].lineOptions) === null || _points_i_lineOptions23 === void 0 ? void 0 : _points_i_lineOptions23.strokeDasharray,
|
|
784
|
+
strokeDashoffset: (_points_i_lineOptions24 = _points[i].lineOptions) === null || _points_i_lineOptions24 === void 0 ? void 0 : _points_i_lineOptions24.strokeDashoffset,
|
|
783
785
|
opacity: 0.1
|
|
784
786
|
}));
|
|
785
787
|
}
|