@fluentui/react-charting 5.24.7 → 5.24.8
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.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +22 -23
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +22 -23
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +22 -23
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";;;;IA0CA,IAAM,aAAa,GAAG,IAAA,0BAAkB,GAAgD,CAAC;IAEzF,8FAA8F;IAC9F;;;OAGG;IACU,QAAA,gBAAgB,GAAgD,KAAK,CAAC,UAAU,CAG3F,UAAC,KAAK,EAAE,YAAY;QACpB,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,QAAQ,CAAC,EAAf,CAAe,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAM,SAAS,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,UAAU,CAAC,EAAjB,CAAiB,EAAE,EAAE,CAAC,CAAC;QACrE,IAAM,aAAa,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,cAAc,CAAC,EAArB,CAAqB,EAAE,EAAE,CAAC,CAAC;QAC7E,IAAM,UAAU,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,wBAAwB,CAAC,EAA/B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AE,YAAY,EACnC,YAAY,EAAE,iBAAiB;YAC/B,sCAAsC;YACtC,kDAAkD;YAClD,QAAQ,EAAE,UAAC,UAAuB;gBAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;gBACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;gBAChD,OAAO,CACL;oBACE;wBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;wBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;YACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfDateForScatterChart,\n domainRangeOfNumericForScatterChart,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevPropsRef = React.useRef<IScatterChartProps | null>(null);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\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 }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForScatterChart(points, domainMargins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForScatterChart(points, domainMargins, width, isRTL, tickValues! as Date[]);\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return selectedLegends.length === 0;\n }, [selectedLegends]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\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 = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n function _getRangeForScatterMarkerSize(\n yScale: ScaleLinear<number, number>,\n yPadding: number,\n xMin: number,\n xMax: number,\n xPadding: number,\n ): number {\n const extraXPixels = getRTL()\n ? _xAxisScale.current?.(xMax - xPadding) - _xAxisScale.current?.(xMax)\n : _xAxisScale.current?.(xMin + xPadding) - _xAxisScale.current?.(xMin);\n\n const yMin = yScale.domain()[0];\n const extraYPixels = yScale(yMin) - yScale(yMin + yPadding);\n return Math.min(extraXPixels, extraYPixels);\n }\n\n const _createPlot = React.useCallback(\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n const yMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yPadding = (yMax - yMin) * 0.1;\n\n let xPadding = 0;\n let xMin: number = 0;\n let xMax: number = 0;\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n } else if (_xAxisType === XAxisTypes.DateAxis) {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as Date)!;\n })!.getTime();\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as Date;\n });\n })!.getTime();\n\n xPadding = (xMax - xMin) * 0.1;\n } else {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as number)!;\n })!;\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as number;\n });\n })!;\n\n xPadding = (xMax - xMin) * 0.1;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis\n ? _getRangeForScatterMarkerSize(_yAxisScale.current, yPadding, xMin, xMax, xPadding)\n : 0;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={_xAxisScale.current?.(x) + _xBandwidth.current}\n cy={_yAxisScale.current?.(y)}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n {text && (\n <text\n key={`${circleId}-label`}\n x={_xAxisScale.current?.(x) + _xBandwidth.current}\n y={_yAxisScale.current?.(y) + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>\n )}\n </>,\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\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: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n function _getNumericMinMaxOfY(\n points: IScatterChartPoints[],\n yAxisType?: YAxisType,\n ): { startValue: number; endValue: number } {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType);\n let yPadding = 0;\n yPadding = (endValue - startValue) * 0.1;\n\n return {\n startValue: startValue - yPadding,\n endValue: endValue + yPadding,\n };\n }\n\n const _getMinMaxofXAxis = React.useCallback(\n (points, yAxisType) => _getNumericMinMaxOfY(points as IScatterChartPoints[], yAxisType),\n [],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getMinMaxofXAxis}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
1
|
+
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";;;;IA0CA,IAAM,aAAa,GAAG,IAAA,0BAAkB,GAAgD,CAAC;IAEzF,8FAA8F;IAC9F;;;OAGG;IACU,QAAA,gBAAgB,GAAgD,KAAK,CAAC,UAAU,CAG3F,UAAC,KAAK,EAAE,YAAY;;QACpB,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,QAAQ,CAAC,EAAf,CAAe,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAM,SAAS,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,UAAU,CAAC,EAAjB,CAAiB,EAAE,EAAE,CAAC,CAAC;QACrE,IAAM,aAAa,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,cAAc,CAAC,EAArB,CAAqB,EAAE,EAAE,CAAC,CAAC;QAC7E,IAAM,UAAU,GAAW,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,wBAAwB,CAAC,EAA/B,CAA+B,EAAE,EAAE,CAAC,CAAC;QACpF,IAAM,wBAAwB,GAAG,IAAI,CAAC;QACtC,IAA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AsC;YACtC,kDAAkD;YAClD,QAAQ,EAAE,UAAC,UAAuB;gBAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;gBACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;gBAChD,OAAO,CACL;oBACE;wBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;wBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;YACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfDateForScatterChart,\n domainRangeOfNumericForScatterChart,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForScatterChart(points, domainMargins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForScatterChart(points, domainMargins, width, isRTL, tickValues! as Date[]);\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\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 = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n function _getRangeForScatterMarkerSize(\n yScale: ScaleLinear<number, number>,\n yPadding: number,\n xMin: number,\n xMax: number,\n xPadding: number,\n ): number {\n const extraXPixels = getRTL()\n ? _xAxisScale.current?.(xMax - xPadding) - _xAxisScale.current?.(xMax)\n : _xAxisScale.current?.(xMin + xPadding) - _xAxisScale.current?.(xMin);\n\n const yMin = yScale.domain()[0];\n const extraYPixels = yScale(yMin) - yScale(yMin + yPadding);\n return Math.min(extraXPixels, extraYPixels);\n }\n\n const _createPlot = React.useCallback(\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n const yMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yPadding = (yMax - yMin) * 0.1;\n\n let xPadding = 0;\n let xMin: number = 0;\n let xMax: number = 0;\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n } else if (_xAxisType === XAxisTypes.DateAxis) {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as Date)!;\n })!.getTime();\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as Date;\n });\n })!.getTime();\n\n xPadding = (xMax - xMin) * 0.1;\n } else {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as number)!;\n })!;\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as number;\n });\n })!;\n\n xPadding = (xMax - xMin) * 0.1;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis\n ? _getRangeForScatterMarkerSize(_yAxisScale.current, yPadding, xMin, xMax, xPadding)\n : 0;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={_xAxisScale.current?.(x) + _xBandwidth.current}\n cy={_yAxisScale.current?.(y)}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n {text && (\n <text\n key={`${circleId}-label`}\n x={_xAxisScale.current?.(x) + _xBandwidth.current}\n y={_yAxisScale.current?.(y) + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>\n )}\n </>,\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\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: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n function _getNumericMinMaxOfY(\n points: IScatterChartPoints[],\n yAxisType?: YAxisType,\n ): { startValue: number; endValue: number } {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType);\n let yPadding = 0;\n yPadding = (endValue - startValue) * 0.1;\n\n return {\n startValue: startValue - yPadding,\n endValue: endValue + yPadding,\n };\n }\n\n const _getMinMaxofXAxis = React.useCallback(\n (points, yAxisType) => _getNumericMinMaxOfY(points as IScatterChartPoints[], yAxisType),\n [],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getMinMaxofXAxis}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
@@ -19,6 +19,7 @@ var getClassNames = (0, react_1.classNamesFunction)();
|
|
|
19
19
|
* {@docCategory ScatterChart}
|
|
20
20
|
*/
|
|
21
21
|
exports.ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
22
|
+
var _a, _b;
|
|
22
23
|
var _circleId = React.useMemo(function () { return (0, react_1.getId)('circle'); }, []);
|
|
23
24
|
var _seriesId = React.useMemo(function () { return (0, react_1.getId)('seriesID'); }, []);
|
|
24
25
|
var _verticalLine = React.useMemo(function () { return (0, react_1.getId)('verticalLine'); }, []);
|
|
@@ -41,31 +42,29 @@ exports.ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
41
42
|
var _xBandwidth = React.useRef(0);
|
|
42
43
|
var cartesianChartRef = React.useRef(null);
|
|
43
44
|
var legendsRef = React.useRef(null);
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
45
|
+
var _c = React.useState(''), hoverXValue = _c[0], setHoverXValue = _c[1];
|
|
46
|
+
var _d = React.useState(''), activeLegend = _d[0], setActiveLegend = _d[1];
|
|
47
|
+
var _e = React.useState([]), YValueHover = _e[0], setYValueHover = _e[1];
|
|
47
48
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
49
|
+
var _f = React.useState([]), selectedLegendPoints = _f[0], setSelectedLegendPoints = _f[1];
|
|
50
|
+
var _g = React.useState(false), isSelectedLegend = _g[0], setIsSelectedLegend = _g[1];
|
|
51
|
+
var _h = React.useState(''), activePoint = _h[0], setActivePoint = _h[1];
|
|
52
|
+
var _j = React.useState(), stackCalloutProps = _j[0], setStackCalloutProps = _j[1];
|
|
53
|
+
var _k = React.useState(false), isCalloutVisible = _k[0], setCalloutVisible = _k[1];
|
|
54
|
+
var _l = React.useState(((_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends) || []), selectedLegends = _l[0], setSelectedLegends = _l[1];
|
|
55
|
+
var _m = React.useState(''), refSelected = _m[0], setRefSelected = _m[1];
|
|
56
|
+
var prevSelectedLegendsRef = React.useRef(undefined);
|
|
56
57
|
var classNames = getClassNames(props.styles, {
|
|
57
58
|
theme: props.theme,
|
|
58
59
|
});
|
|
59
60
|
React.useEffect(function () {
|
|
60
61
|
var _a, _b, _c;
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setSelectedLegends(((_c = props.legendProps) === null || _c === void 0 ? void 0 : _c.selectedLegends) || []);
|
|
65
|
-
}
|
|
62
|
+
if (prevSelectedLegendsRef.current &&
|
|
63
|
+
!(0, index_2.areArraysEqual)(prevSelectedLegendsRef.current, (_a = props.legendProps) === null || _a === void 0 ? void 0 : _a.selectedLegends)) {
|
|
64
|
+
setSelectedLegends(((_b = props.legendProps) === null || _b === void 0 ? void 0 : _b.selectedLegends) || []);
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
}, [props]);
|
|
66
|
+
prevSelectedLegendsRef.current = (_c = props.legendProps) === null || _c === void 0 ? void 0 : _c.selectedLegends;
|
|
67
|
+
}, [(_b = props.legendProps) === null || _b === void 0 ? void 0 : _b.selectedLegends]);
|
|
69
68
|
React.useImperativeHandle(props.componentRef, function () {
|
|
70
69
|
var _a, _b;
|
|
71
70
|
return ({
|
|
@@ -237,14 +236,14 @@ exports.ScatterChartBase = React.forwardRef(function (props, forwardedRef) {
|
|
|
237
236
|
setCalloutVisible(false);
|
|
238
237
|
}
|
|
239
238
|
}, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);
|
|
240
|
-
/**
|
|
241
|
-
* This function checks if none of the legends is selected or hovered.*/
|
|
242
|
-
var _noLegendHighlighted = React.useCallback(function () {
|
|
243
|
-
return selectedLegends.length === 0;
|
|
244
|
-
}, [selectedLegends]);
|
|
245
239
|
var _getHighlightedLegend = React.useCallback(function () {
|
|
246
240
|
return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];
|
|
247
241
|
}, [selectedLegends, activeLegend]);
|
|
242
|
+
/**
|
|
243
|
+
* This function checks if none of the legends is selected or hovered.*/
|
|
244
|
+
var _noLegendHighlighted = React.useCallback(function () {
|
|
245
|
+
return _getHighlightedLegend().length === 0;
|
|
246
|
+
}, [_getHighlightedLegend]);
|
|
248
247
|
/**
|
|
249
248
|
* This function checks if the given legend is highlighted or not.
|
|
250
249
|
* A legend can be highlighted in 2 ways:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,6CAAkD;AAClD,0CAAsE;AACtE,qCAAsD;AACtD,+CAS+B;AAC/B,qCAOqB;AACrB,+CAQ+B;AAC/B,yCAA2F;AAE3F,yEAA+E;AAC/E,6DAAqE;AAMrE,IAAM,aAAa,GAAG,IAAA,0BAAkB,GAAgD,CAAC;AAEzF,8FAA8F;AAC9F;;;GAGG;AACU,QAAA,gBAAgB,GAAgD,KAAK,CAAC,UAAU,CAG3F,UAAC,KAAK,EAAE,YAAY;IACpB,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,c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AAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,WAAW,EACvB,gBAAgB,EAAE,iBAAiB,EACnC,qBAAqB,EAAE,iCAAiC,EACxD,WAAW,EAAE,0BAAkB,EAC/B,iBAAiB,EAAE,yBAAiB,EACpC,YAAY,EAAE,2BAA2B,EACzC,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,sBAAsB,EACzC,6BAA6B,EAAE,wBAAwB,EACvD,qBAAqB,EAAE,YAAY,EACnC,YAAY,EAAE,iBAAiB;QAC/B,sCAAsC;QACtC,kDAAkD;QAClD,QAAQ,EAAE,UAAC,UAAuB;YAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;YACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;YAChD,OAAO,CACL;gBACE;oBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;oBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;QACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfDateForScatterChart,\n domainRangeOfNumericForScatterChart,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>([]);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevPropsRef = React.useRef<IScatterChartProps | null>(null);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\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 }\n prevPropsRef.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForScatterChart(points, domainMargins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForScatterChart(points, domainMargins, width, isRTL, tickValues! as Date[]);\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return selectedLegends.length === 0;\n }, [selectedLegends]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\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 = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n function _getRangeForScatterMarkerSize(\n yScale: ScaleLinear<number, number>,\n yPadding: number,\n xMin: number,\n xMax: number,\n xPadding: number,\n ): number {\n const extraXPixels = getRTL()\n ? _xAxisScale.current?.(xMax - xPadding) - _xAxisScale.current?.(xMax)\n : _xAxisScale.current?.(xMin + xPadding) - _xAxisScale.current?.(xMin);\n\n const yMin = yScale.domain()[0];\n const extraYPixels = yScale(yMin) - yScale(yMin + yPadding);\n return Math.min(extraXPixels, extraYPixels);\n }\n\n const _createPlot = React.useCallback(\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n const yMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yPadding = (yMax - yMin) * 0.1;\n\n let xPadding = 0;\n let xMin: number = 0;\n let xMax: number = 0;\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n } else if (_xAxisType === XAxisTypes.DateAxis) {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as Date)!;\n })!.getTime();\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as Date;\n });\n })!.getTime();\n\n xPadding = (xMax - xMin) * 0.1;\n } else {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as number)!;\n })!;\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as number;\n });\n })!;\n\n xPadding = (xMax - xMin) * 0.1;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis\n ? _getRangeForScatterMarkerSize(_yAxisScale.current, yPadding, xMin, xMax, xPadding)\n : 0;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={_xAxisScale.current?.(x) + _xBandwidth.current}\n cy={_yAxisScale.current?.(y)}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n {text && (\n <text\n key={`${circleId}-label`}\n x={_xAxisScale.current?.(x) + _xBandwidth.current}\n y={_yAxisScale.current?.(y) + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>\n )}\n </>,\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\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: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n function _getNumericMinMaxOfY(\n points: IScatterChartPoints[],\n yAxisType?: YAxisType,\n ): { startValue: number; endValue: number } {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType);\n let yPadding = 0;\n yPadding = (endValue - startValue) * 0.1;\n\n return {\n startValue: startValue - yPadding,\n endValue: endValue + yPadding,\n };\n }\n\n const _getMinMaxofXAxis = React.useCallback(\n (points, yAxisType) => _getNumericMinMaxOfY(points as IScatterChartPoints[], yAxisType),\n [],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getMinMaxofXAxis}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|
|
1
|
+
{"version":3,"file":"ScatterChart.base.js","sourceRoot":"../src/","sources":["components/ScatterChart/ScatterChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAG/B,6CAAkD;AAClD,0CAAsE;AACtE,qCAAsD;AACtD,+CAS+B;AAC/B,qCAOqB;AACrB,+CAQ+B;AAC/B,yCAA2F;AAE3F,yEAA+E;AAC/E,6DAAqE;AAMrE,IAAM,aAAa,GAAG,IAAA,0BAAkB,GAAgD,CAAC;AAEzF,8FAA8F;AAC9F;;;GAGG;AACU,QAAA,gBAAgB,GAAgD,KAAK,CAAC,UAAU,CAG3F,UAAC,KAAK,EAAE,YAAY;;IACpB,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,IAAA,aAAK,EAAC,QAAQ,CA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,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,WAAW,EACvB,gBAAgB,EAAE,iBAAiB,EACnC,qBAAqB,EAAE,iCAAiC,EACxD,WAAW,EAAE,0BAAkB,EAC/B,iBAAiB,EAAE,yBAAiB,EACpC,YAAY,EAAE,2BAA2B,EACzC,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,sBAAsB,EACzC,6BAA6B,EAAE,wBAAwB,EACvD,qBAAqB,EAAE,YAAY,EACnC,YAAY,EAAE,iBAAiB;QAC/B,sCAAsC;QACtC,kDAAkD;QAClD,QAAQ,EAAE,UAAC,UAAuB;YAChC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,MAAO,CAAC;YACzC,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,aAAc,CAAC;YAChD,OAAO,CACL;gBACE;oBACE,8BACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,UAAU,CAAC,eAAe,EAC9B,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,aAAa,EACjB,UAAU,EAAE,QAAQ,EACpB,eAAe,EAAE,KAAK,GACtB;oBACF,+BAAI,YAAY,CAAC,OAAO,CAAK,CAC3B,CACH,CACJ,CAAC;QACJ,CAAC,IACD,CACH,CAAC,CAAC,CAAC,CACF,6BAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAc,8BAA8B,GAAI,CAC/G,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,wBAAgB,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { IChildProps, IScatterChartStyleProps, IScatterChartStyles, IScatterChartProps } from './ScatterChart.types';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select } from 'd3-selection';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport {\n areArraysEqual,\n createNumericYAxis,\n createStringYAxis,\n domainRangeOfDateForScatterChart,\n domainRangeOfNumericForScatterChart,\n domainRangeOfXStringAxis,\n findNumericMinMaxOfY,\n YAxisType,\n} from '../../utilities/index';\nimport {\n IAccessibilityProps,\n CartesianChart,\n ICustomizedCalloutData,\n IMargins,\n IRefArrayData,\n IChart,\n} from '../../index';\nimport {\n calloutData,\n ChartTypes,\n XAxisTypes,\n tooltipOfAxislabels,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n} from '../../utilities/index';\nimport { classNamesFunction, DirectionalHint, find, getId, getRTL } from '@fluentui/react';\nimport { IImageExportOptions, IScatterChartDataPoint, IScatterChartPoints } from '../../types/index';\nimport { toImage as convertToImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\ntype ScatterChartDataWithIndex = IScatterChartPoints & { index: number };\nconst getClassNames = classNamesFunction<IScatterChartStyleProps, IScatterChartStyles>();\n\n// Create a ScatterChart variant which uses these default styles and this styled subcomponent.\n/**\n * ScatterChart component\n * {@docCategory ScatterChart}\n */\nexport const ScatterChartBase: React.FunctionComponent<IScatterChartProps> = React.forwardRef<\n HTMLDivElement,\n IScatterChartProps\n>((props, forwardedRef) => {\n const _circleId = React.useMemo(() => getId('circle'), []);\n const _seriesId: string = React.useMemo(() => getId('seriesID'), []);\n const _verticalLine: string = React.useMemo(() => getId('verticalLine'), []);\n const _tooltipId: string = React.useMemo(() => getId('ScatterChartTooltipId_'), []);\n const _firstRenderOptimization = true;\n const _emptyChartId: string = React.useMemo(() => getId('_ScatterChart_empty'), []);\n const _points = React.useRef<ScatterChartDataWithIndex[]>(\n _injectIndexPropertyInScatterChartData(props.data.scatterChartData),\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints = React.useMemo(() => calloutData(_points.current as any) || [], [_points]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _xAxisScale: any = React.useRef<any>('');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _yAxisScale: any = React.useRef<any>('');\n const _uniqueCallOutID = React.useRef<string | null>(null);\n const _refArray = React.useMemo(() => [], []);\n const margins = React.useRef<IMargins | null>(null);\n const renderSeries = React.useRef<JSX.Element[]>([]);\n let _xAxisLabels: string[] = [];\n const _xAxisCalloutAccessibilityData: IAccessibilityProps = {};\n const _xBandwidth = React.useRef<number>(0);\n const cartesianChartRef = React.useRef<IChart>(null);\n const legendsRef = React.useRef<ILegendContainer>(null);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [stackCalloutProps, setStackCalloutProps] = React.useState<ICustomizedCalloutData>();\n const [isCalloutVisible, setCalloutVisible] = React.useState(false);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [refSelected, setRefSelected] = React.useState<string>('');\n const prevSelectedLegendsRef = React.useRef<string[] | undefined>(undefined);\n\n const classNames = getClassNames(props.styles!, {\n theme: props.theme!,\n });\n\n React.useEffect(() => {\n if (\n prevSelectedLegendsRef.current &&\n !areArraysEqual(prevSelectedLegendsRef.current, props.legendProps?.selectedLegends)\n ) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevSelectedLegendsRef.current = props.legendProps?.selectedLegends;\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return convertToImage(cartesianChartRef.current?.chartContainer, legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _xAxisType: XAxisTypes =\n props.data.scatterChartData! &&\n props.data.scatterChartData!.length > 0 &&\n props.data.scatterChartData![0].data &&\n props.data.scatterChartData![0].data.length > 0\n ? (getTypeOfAxis(props.data.scatterChartData![0].data[0].x, true) as XAxisTypes)\n : XAxisTypes.StringAxis;\n\n const pointsRef = React.useRef<ScatterChartDataWithIndex[] | []>([]);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (\n _points.current !== _injectIndexPropertyInScatterChartData(props.data.scatterChartData) ||\n props.data !== _points.current\n ) {\n pointsRef.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data, _points]);\n\n function _injectIndexPropertyInScatterChartData(\n scatterChartData?: IScatterChartPoints[],\n ): ScatterChartDataWithIndex[] | [] {\n return scatterChartData\n ? scatterChartData.map((item: IScatterChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: -1,\n color,\n };\n })\n : [];\n }\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n function _createLegends(data: ScatterChartDataWithIndex[]): JSX.Element {\n const { legendProps } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const mapLegendToPoints: Record<string, ScatterChartDataWithIndex[]> = {};\n data.forEach((point: ScatterChartDataWithIndex) => {\n if (point.legend) {\n if (!mapLegendToPoints[point.legend]) {\n mapLegendToPoints[point.legend] = [];\n }\n mapLegendToPoints[point.legend].push(point);\n }\n });\n const legendDataItems: ILegend[] = Object.entries(mapLegendToPoints).map(([legendTitle, points]) => {\n const representativePoint = points[0];\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: legendTitle,\n color: representativePoint.color!,\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(legendTitle);\n },\n ...(representativePoint.legendShape && {\n shape: representativePoint.legendShape,\n }),\n };\n return legend;\n });\n\n return (\n <Legends\n legends={[...legendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n onChange={_onLegendSelectionChange}\n {...props.legendProps}\n />\n );\n }\n\n function _onLegendSelectionChange(\n legendsSelected: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(legendsSelected);\n } else {\n setSelectedLegends(legendsSelected.slice(-1));\n }\n\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(legendsSelected, event, currentLegend);\n }\n }\n\n const _getPointFill = React.useCallback(\n (lineColor: string, pointId: string) => {\n const { theme } = props;\n if (activePoint === pointId) {\n return theme!.semanticColors.bodyBackground;\n } else {\n return lineColor;\n }\n },\n [activePoint, props],\n );\n\n const getDomainNRangeValuesScatterChart = React.useCallback(\n (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any,\n domainMargins: IMargins,\n width: number,\n _chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n _barWidth: number,\n tickValues: number[] | Date[] | string[] | undefined,\n ) => {\n if (xAxisType === XAxisTypes.NumericAxis) {\n return domainRangeOfNumericForScatterChart(points, domainMargins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n return domainRangeOfDateForScatterChart(points, domainMargins, width, isRTL, tickValues! as Date[]);\n }\n // String Axis type\n return domainRangeOfXStringAxis(domainMargins, width, isRTL);\n },\n [],\n );\n\n const _handleFocus = React.useCallback(\n (\n seriesId: string,\n x: number | Date | string,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: IAccessibilityProps,\n ) => {\n _uniqueCallOutID.current = circleId;\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === seriesId) {\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found!.values);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, _refArray, props.culture, props.useUTC],\n );\n\n const _handleHover = React.useCallback(\n (\n x: number | Date | string,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: IAccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) => {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal) as\n | { x: string | number; values: [] }\n | undefined;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr(\n 'transform',\n () => `translate(${_xAxisScale.current?.(x) + _xBandwidth.current}, ${_yAxisScale.current?.(y)})`,\n )\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale.current?.(y)}`);\n\n if (_uniqueCallOutID.current !== circleId) {\n _uniqueCallOutID.current = circleId;\n setCalloutVisible(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setRefSelected(`#${circleId}`);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setActivePoint(circleId);\n }\n } else {\n setActivePoint(circleId);\n }\n },\n [_verticalLine, _xAxisScale, _xBandwidth, _calloutPoints, props.culture, props.useUTC],\n );\n\n const _handleMouseOut = React.useCallback(() => {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }, [_verticalLine]);\n\n const _handleChartMouseLeave = React.useCallback(() => {\n _uniqueCallOutID.current = null;\n setActivePoint('');\n if (isCalloutVisible) {\n setCalloutVisible(false);\n }\n }, [_uniqueCallOutID, isCalloutVisible, setActivePoint, setCalloutVisible]);\n\n const _getHighlightedLegend = React.useCallback((): string[] => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }, [selectedLegends, activeLegend]);\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n const _noLegendHighlighted = React.useCallback((): boolean => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\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 = React.useCallback(\n (legend: string): boolean => {\n return _getHighlightedLegend().includes(legend);\n },\n [_getHighlightedLegend],\n );\n\n const _getAriaLabel = React.useCallback(\n (seriesIndex: number, pointIndex: number): string => {\n const series = _points.current?.[seriesIndex];\n const point = series.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = series.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n },\n [_points, props.culture, props.useUTC],\n );\n\n function _getRangeForScatterMarkerSize(\n yScale: ScaleLinear<number, number>,\n yPadding: number,\n xMin: number,\n xMax: number,\n xPadding: number,\n ): number {\n const extraXPixels = getRTL()\n ? _xAxisScale.current?.(xMax - xPadding) - _xAxisScale.current?.(xMax)\n : _xAxisScale.current?.(xMin + xPadding) - _xAxisScale.current?.(xMin);\n\n const yMin = yScale.domain()[0];\n const extraYPixels = yScale(yMin) - yScale(yMin + yPadding);\n return Math.min(extraXPixels, extraYPixels);\n }\n\n const _createPlot = React.useCallback(\n (xElement: SVGElement, containerHeight: number): JSX.Element[] => {\n const series: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points.current = selectedLegendPoints;\n } else {\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n }\n\n const yMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.y)!;\n })!;\n const yPadding = (yMax - yMin) * 0.1;\n\n let xPadding = 0;\n let xMin: number = 0;\n let xMax: number = 0;\n if (_xAxisType === XAxisTypes.StringAxis) {\n _xBandwidth.current = _xAxisScale.current?.bandwidth() / 2;\n } else if (_xAxisType === XAxisTypes.DateAxis) {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as Date)!;\n })!.getTime();\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as Date;\n });\n })!.getTime();\n\n xPadding = (xMax - xMin) * 0.1;\n } else {\n xMin = d3Min(_points.current, (point: IScatterChartPoints) => {\n return d3Min(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => item.x as number)!;\n })!;\n\n xMax = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.x as number;\n });\n })!;\n\n xPadding = (xMax - xMin) * 0.1;\n }\n\n const maxMarkerSize = d3Max(_points.current, (point: IScatterChartPoints) => {\n return d3Max(point.data as IScatterChartDataPoint[], (item: IScatterChartDataPoint) => {\n return item.markerSize as number;\n });\n })!;\n\n for (let i = _points.current?.length - 1; i >= 0; i--) {\n const pointsForSeries: JSX.Element[] = [];\n\n const legendVal: string = _points.current?.[i]?.legend;\n const seriesColor: string = _points.current?.[i]?.color!;\n const verticaLineHeight = containerHeight - (margins.current?.bottom ?? 0) + 6;\n\n for (let j = 0; j < _points.current?.[i]?.data?.length; j++) {\n const seriesId = `${_seriesId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points.current?.[i]?.data[j];\n const pointMarkerSize = (_points.current?.[i]?.data[j] as IScatterChartDataPoint).markerSize;\n const extraMaxPixels =\n _xAxisType !== XAxisTypes.StringAxis\n ? _getRangeForScatterMarkerSize(_yAxisScale.current, yPadding, xMin, xMax, xPadding)\n : 0;\n const minPixel = 4;\n const maxPixel = 16;\n const circleRadius =\n pointMarkerSize && maxMarkerSize !== 0\n ? _xAxisType !== XAxisTypes.StringAxis\n ? (pointMarkerSize * extraMaxPixels) / maxMarkerSize\n : minPixel + ((pointMarkerSize - minPixel) / (maxMarkerSize - minPixel)) * (maxPixel - minPixel)\n : activePoint === circleId\n ? 6\n : 4;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points.current?.[i]?.hideNonActiveDots && activePoint !== circleId;\n const text = _points.current?.[i].data[j]?.text;\n pointsForSeries.push(\n <>\n <circle\n id={circleId}\n key={circleId}\n r={Math.max(circleRadius, 4)}\n cx={_xAxisScale.current?.(x) + _xBandwidth.current}\n cy={_yAxisScale.current?.(y)}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x,\n y,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points.current?.[i]?.data[j]?.onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.1}\n fill={_getPointFill(seriesColor, circleId)}\n stroke={seriesColor}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points.current?.[i]?.legend !== '' ? 0 : undefined}\n />\n {text && (\n <text\n key={`${circleId}-label`}\n x={_xAxisScale.current?.(x) + _xBandwidth.current}\n y={_yAxisScale.current?.(y) + Math.max(circleRadius + 12, 16)}\n className={classNames.markerLabel}\n >\n {text}\n </text>\n )}\n </>,\n );\n }\n\n series.push(\n <g\n key={`series_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, series ${i + 1} of ${_points.current?.length} with ${\n _points.current?.[i]?.data?.length\n } data points.`}\n >\n {pointsForSeries}\n </g>,\n );\n }\n\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale.current);\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: classNames.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return series;\n },\n [\n _xAxisScale,\n _yAxisScale,\n props.data.scatterChartData,\n props.showXAxisLablesTooltip,\n props.wrapXAxisLables,\n _circleId,\n _getAriaLabel,\n _getPointFill,\n _handleFocus,\n _handleHover,\n _handleMouseOut,\n _legendHighlighted,\n _noLegendHighlighted,\n _seriesId,\n _tooltipId,\n _xAxisType,\n activePoint,\n isSelectedLegend,\n selectedLegendPoints,\n classNames,\n ],\n );\n\n const _initializeScatterChartData = React.useCallback(\n (\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) => {\n _xAxisScale.current = xScale;\n _yAxisScale.current = yScale;\n renderSeries.current = _createPlot(xElement!, containerHeight!);\n },\n [renderSeries, _xAxisScale, _yAxisScale, _createPlot],\n );\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.scatterChartData &&\n props.data.scatterChartData.length > 0 &&\n props.data.scatterChartData.filter((item: IScatterChartPoints) => item.data.length).length > 0\n );\n }\n\n function _closeCallout() {\n setCalloutVisible(false);\n }\n\n function _getNumericMinMaxOfY(\n points: IScatterChartPoints[],\n yAxisType?: YAxisType,\n ): { startValue: number; endValue: number } {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType);\n let yPadding = 0;\n yPadding = (endValue - startValue) * 0.1;\n\n return {\n startValue: startValue - yPadding,\n endValue: endValue + yPadding,\n };\n }\n\n const _getMinMaxofXAxis = React.useCallback(\n (points, yAxisType) => _getNumericMinMaxOfY(points as IScatterChartPoints[], yAxisType),\n [],\n );\n\n const { legendProps, tickValues, tickFormat } = props;\n _points.current = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);\n\n let points = _points.current as IScatterChartPoints[];\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points.current;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points.current!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n YValueHover,\n hoverXValue,\n id: `toolTip${_uniqueCallOutID.current}`,\n target: refSelected,\n isBeakVisible: false,\n gapSpace: 15,\n onDismiss: _closeCallout,\n preventDismissOnEvent: () => true,\n hidden: !(!props.hideTooltip && isCalloutVisible),\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: _xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n const xAxisLabels: string[] = _points.current\n .map((point: ScatterChartDataWithIndex) => point.data.map((dp: IScatterChartDataPoint) => dp.x as string))\n .flat();\n\n _xAxisLabels = Array.from(new Set(xAxisLabels));\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n ref={cartesianChartRef}\n chartTitle={props.data.chartTitle}\n isCalloutForStack\n points={points}\n chartType={ChartTypes.ScatterChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getMinMaxOfYAxis={_getMinMaxofXAxis}\n getDomainNRangeValues={getDomainNRangeValuesScatterChart}\n createYAxis={createNumericYAxis}\n createStringYAxis={createStringYAxis}\n getGraphData={_initializeScatterChartData}\n xAxisType={_xAxisType}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={_firstRenderOptimization}\n datasetForXAxisDomain={_xAxisLabels}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(childProps: IChildProps) => {\n _xAxisScale.current = childProps.xScale!;\n _yAxisScale.current = childProps.yScalePrimary!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={childProps.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n <g>{renderSeries.current}</g>\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nScatterChartBase.displayName = 'ScatterChart';\n"]}
|