@fluentui/react-charts 9.1.7 → 9.1.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.md +12 -2
- package/dist/index.d.ts +60 -3
- package/lib/components/AreaChart/AreaChart.js +21 -1
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +8 -9
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +18 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +25 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +1 -2
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +22 -2
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +26 -1
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +16 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +15 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +1 -2
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/utilities.js +6 -144
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +20 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +7 -7
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +17 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +24 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +1 -2
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +3 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +21 -1
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +25 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +15 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +14 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js +1 -2
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +11 -132
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LineChartProps } from './LineChart.types';\nimport { useLineChartStyles } from './useLineChartStyles.styles';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select, pointer } from 'd3-selection';\nimport { bisector } from 'd3-array';\nimport { Legend, Legends } from '../Legends/index';\nimport { line as d3Line } from 'd3-shape';\nimport { useId } from '@fluentui/react-utilities';\nimport { find } from '../../utilities/index';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n LineChartPoints,\n CustomizedCalloutData,\n Margins,\n RefArrayData,\n ColorFillBarsProps,\n LineChartGap,\n LineChartDataPoint,\n Chart,\n} from '../../index';\nimport { EventsAnnotation } from './eventAnnotation/EventAnnotation';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n calloutData,\n ChartTypes,\n getXAxisType,\n XAxisTypes,\n tooltipOfAxislabels,\n Points,\n pointTypes,\n getMinMaxOfYAxis,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n useRtl,\n formatDate,\n getCurveFactory,\n} from '../../utilities/index';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\nenum PointSize {\n hoverSize = 11,\n invisibleSize = 1,\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst DEFAULT_LINE_STROKE_SIZE = 4;\n// The given shape of a icon must be 2.5 times bigger than line width (known as stroke width)\nconst PATH_MULTIPLY_SIZE = 2.5;\n\n/**\n *\n * @param x units from origin\n * @param y units from origin\n * @param w is the legnth of the each side of a shape\n * @param index index to get the shape path\n */\nconst _getPointPath = (x: number, y: number, w: number, index: number): string => {\n const allPointPaths = [\n // circle path\n `M${x - w / 2} ${y}\n A${w / 2} ${w / 2} 0 1 0 ${x + w / 2} ${y}\n M${x - w / 2} ${y}\n A ${w / 2} ${w / 2} 0 1 1 ${x + w / 2} ${y}\n `,\n //square\n `M${x - w / 2} ${y - w / 2}\n L${x + w / 2} ${y - w / 2}\n L${x + w / 2} ${y + w / 2}\n L${x - w / 2} ${y + w / 2}\n Z`,\n //triangle\n `M${x - w / 2} ${y - 0.2886 * w}\n H ${x + w / 2}\n L${x} ${y + 0.5774 * w} Z`,\n //diamond\n `M${x} ${y - w / 2}\n L${x + w / 2} ${y}\n L${x} ${y + w / 2}\n L${x - w / 2} ${y}\n Z`,\n //pyramid\n `M${x} ${y - 0.5774 * w}\n L${x + w / 2} ${y + 0.2886 * w}\n L${x - w / 2} ${y + 0.2886 * w} Z`,\n //hexagon\n `M${x - 0.5 * w} ${y - 0.866 * w}\n L${x + 0.5 * w} ${y - 0.866 * w}\n L${x + w} ${y}\n L${x + 0.5 * w} ${y + 0.866 * w}\n L${x - 0.5 * w} ${y + 0.866 * w}\n L${x - w} ${y}\n Z`,\n //pentagon\n `M${x} ${y - 0.851 * w}\n L${x + 0.6884 * w} ${y - 0.2633 * w}\n L${x + 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.6884 * w} ${y - 0.2633 * w}\n Z`,\n //octagon\n `M${x - 0.5001 * w} ${y - 1.207 * w}\n L${x + 0.5001 * w} ${y - 1.207 * w}\n L${x + 1.207 * w} ${y - 0.5001 * w}\n L${x + 1.207 * w} ${y + 0.5001 * w}\n L${x + 0.5001 * w} ${y + 1.207 * w}\n L${x - 0.5001 * w} ${y + 1.207 * w}\n L${x - 1.207 * w} ${y + 0.5001 * w}\n L${x - 1.207 * w} ${y - 0.5001 * w}\n Z`,\n ];\n return allPointPaths[index];\n};\n\ntype LineChartDataWithIndex = LineChartPoints & { index: number };\n\n// Create a LineChart variant which uses these default styles and this styled subcomponent.\n/**\n * Linechart component\n * {@docCategory LineChart}\n */\nexport const LineChart: React.FunctionComponent<LineChartProps> = React.forwardRef<HTMLDivElement, LineChartProps>(\n (props, forwardedRef) => {\n let _points: LineChartDataWithIndex[] = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any[] = calloutData(_points) || [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisScale: any = '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _yScalePrimary: any = '';\n let _circleId: string = useId('circle');\n let _lineId: string = useId('lineID');\n let _borderId: string = useId('borderID');\n let _verticalLine: string = useId('verticalLine');\n let _colorFillBarPatternId: string = useId('colorFillBarPattern');\n let _uniqueCallOutID: string | null = '';\n let _refArray: RefArrayData[] = [];\n let margins: Margins;\n let eventLabelHeight: number = 36;\n let lines: JSX.Element[];\n let _renderedColorFillBars: JSX.Element[];\n const _colorFillBars = React.useRef<ColorFillBarsProps[]>([]);\n let _tooltipId: string = useId('LineChartTooltipId_');\n let _rectId: string = useId('containerRectLD');\n let _staticHighlightCircle: string = useId('staticHighlightCircle');\n let _firstRenderOptimization = true;\n let _emptyChartId: string = useId('_LineChart_empty');\n const _colorFillBarId = useId('_colorFillBarId');\n const _isRTL: boolean = useRtl();\n let xAxisCalloutAccessibilityData: AccessibilityProps = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n let _yScaleSecondary: ScaleLinear<number, number> | undefined;\n\n props.eventAnnotationProps &&\n props.eventAnnotationProps.labelHeight &&\n (eventLabelHeight = props.eventAnnotationProps.labelHeight);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>(\n _injectIndexPropertyInLineChartData(props.data.lineChartData, true),\n );\n const [selectedColorBarLegend, setSelectedColorBarLegend] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(\n (props.legendProps?.selectedLegends?.length ?? 0) > 0,\n );\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<LineChartDataPoint | null>(null);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n const pointsRef = React.useRef<LineChartDataWithIndex[] | []>([]);\n const calloutPointsRef = React.useRef<any[]>([]);\n const classes = useLineChartStyles(props);\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 (_points !== _injectIndexPropertyInLineChartData(props.data.lineChartData) || props.data !== _points) {\n pointsRef.current = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _injectIndexPropertyInLineChartData(\n lineChartData?: LineChartPoints[],\n isFilterSelectedLegends: boolean = false,\n ): LineChartDataWithIndex[] | [] {\n const { allowMultipleShapesForPoints = false } = props;\n // Apply filter only if isPropChange is true\n const filteredData = isFilterSelectedLegends\n ? lineChartData?.filter(\n (item: LineChartPoints) =>\n props.legendProps?.selectedLegends?.includes(item.legend) ||\n props.legendProps?.selectedLegend === item.legend,\n )\n : lineChartData;\n return filteredData\n ? filteredData.map((item: LineChartPoints, 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: allowMultipleShapesForPoints ? index : -1,\n color,\n };\n })\n : [];\n }\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps)\n : null;\n }\n\n function _getMargins(_margins: Margins) {\n margins = _margins;\n }\n\n function _initializeLineChartData(\n xScale: NumericAxis,\n yScalePrimary: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) {\n _xAxisScale = xScale;\n _yScalePrimary = yScalePrimary;\n _yScaleSecondary = yScaleSecondary;\n _renderedColorFillBars = props.colorFillBars ? _createColorFillBars(containerHeight) : [];\n lines = _createLines(xElement!, containerHeight!);\n }\n\n function _handleSingleLegendSelectionAction(lineChartItem: LineChartDataWithIndex | ColorFillBarsProps) {\n if (selectedLegend === lineChartItem.legend) {\n setSelectedLegend('');\n _handleLegendClick(lineChartItem, null);\n } else {\n setSelectedLegend(lineChartItem.legend);\n _handleLegendClick(lineChartItem, lineChartItem.legend);\n }\n }\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setSelectedColorBarLegend([]);\n setIsSelectedLegend(false);\n }\n\n function _handleLegendClick(\n lineChartItem: LineChartDataWithIndex | ColorFillBarsProps,\n selectedLegend: string | null | string[],\n ): void {\n if (lineChartItem.onLegendClick) {\n lineChartItem.onLegendClick(selectedLegend);\n }\n }\n\n function _createLegends(data: LineChartDataWithIndex[]): JSX.Element {\n const { legendProps, allowMultipleShapesForPoints = false } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const legendDataItems = data.map((point: LineChartDataWithIndex) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleLineLegendSelectionAction(point);\n } else {\n _handleSingleLegendSelectionAction(point);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend);\n },\n ...(point.legendShape && {\n shape: point.legendShape,\n }),\n ...(allowMultipleShapesForPoints && {\n shape: Points[point.index % Object.keys(pointTypes).length] as Legend['shape'],\n }),\n };\n return legend;\n });\n\n const colorFillBarsLegendDataItems = props.colorFillBars\n ? props.colorFillBars.map((colorFillBar: ColorFillBarsProps, index: number) => {\n const title = colorFillBar.legend;\n const color = getColorFromToken(colorFillBar.color);\n const legend: Legend = {\n title,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleColorFillBarLegendSelectionAction(colorFillBar);\n } else {\n _handleSingleLegendSelectionAction(colorFillBar);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(title);\n },\n opacity: _getColorFillBarOpacity(colorFillBar),\n stripePattern: colorFillBar.applyPattern,\n };\n return legend;\n })\n : [];\n\n return (\n <Legends\n legends={[...legendDataItems, ...colorFillBarsLegendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n {...props.legendProps}\n />\n );\n }\n\n function _getBoxWidthOfShape(pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false, strokeWidth = DEFAULT_LINE_STROKE_SIZE } = props;\n if (allowMultipleShapesForPoints) {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else if (pointIndex === 1 || isLastPoint) {\n return strokeWidth * PATH_MULTIPLY_SIZE;\n } else {\n return PointSize.invisibleSize;\n }\n } else {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else {\n return PointSize.invisibleSize;\n }\n }\n }\n\n function _getPath(\n xPos: number,\n yPos: number,\n pointId: string,\n pointIndex: number,\n isLastPoint: boolean,\n pointOftheLine: number,\n ): string {\n const { allowMultipleShapesForPoints = false } = props;\n let w = _getBoxWidthOfShape(pointId, pointIndex, isLastPoint);\n const index: number = allowMultipleShapesForPoints ? pointOftheLine % Object.keys(pointTypes).length : 0;\n const widthRatio = pointTypes[index].widthRatio;\n w = widthRatio > 1 ? w / widthRatio : w;\n\n return _getPointPath(xPos, yPos, w, index);\n }\n function _getPointFill(lineColor: string, pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false } = props;\n if (allowMultipleShapesForPoints) {\n if (pointIndex === 1 || isLastPoint) {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n }\n\n function _createLines(xElement: SVGElement, containerHeight: number): JSX.Element[] {\n const lines: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points = selectedLegendPoints;\n } else {\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n }\n for (let i = _points.length - 1; i >= 0; i--) {\n const linesForLine: JSX.Element[] = [];\n const bordersForLine: JSX.Element[] = [];\n const pointsForLine: JSX.Element[] = [];\n\n const legendVal: string = _points[i].legend;\n const lineColor: string = _points[i].color!;\n const verticaLineHeight = containerHeight - margins.bottom! + 6;\n const yScale = _points[i].useSecondaryYScale && _yScaleSecondary ? _yScaleSecondary : _yScalePrimary;\n if (_points[i].data.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[0] as LineChartDataPoint;\n const circleId = `${_circleId}_${i}`;\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n pointsForLine.push(\n <circle\n id={circleId}\n key={circleId}\n r={activePoint === circleId ? 5.5 : 3.5}\n cx={_xAxisScale(x1)}\n cy={yScale(y1)}\n fill={activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={isLegendSelected ? 0 : undefined}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0}\n stroke={activePoint === circleId ? lineColor : ''}\n role=\"img\"\n aria-label={_getAriaLabel(i, 0)}\n data-is-focusable={isLegendSelected}\n ref={(e: SVGCircleElement | null) => {\n _refCallback(e!, circleId);\n }}\n onFocus={() => _handleFocus(circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[0].onDataPointClick)}\n />,\n );\n }\n\n let gapIndex = 0;\n const gaps = _points[i].gaps?.sort((a, b) => a.startIndex - b.startIndex) ?? [];\n const lineCurve = _points[i].lineOptions?.curve;\n\n // Use path rendering technique for larger datasets to optimize performance.\n if ((props.optimizeLargeData || lineCurve) && _points[i].data.length > 1) {\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => _xAxisScale(d[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d[1]))\n .curve(getCurveFactory(lineCurve));\n\n const lineId = `${_lineId}_${i}`;\n const borderId = `${_borderId}_${i}`;\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const lineData: [number, number][] = [];\n for (let k = 0; k < _points[i].data.length; k++) {\n lineData.push([\n _points[i].data[k].x instanceof Date\n ? (_points[i].data[k].x as Date).getTime()\n : (_points[i].data[k].x as number),\n _points[i].data[k].y,\n ]);\n }\n\n if (isLegendSelected) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <path\n id={borderId}\n key={borderId}\n d={line(lineData)!}\n fill=\"transparent\"\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={true}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOut={_handleMouseOut}\n {..._getClickHandler(_points[i].onLineClick)}\n opacity={1}\n tabIndex={isLegendSelected ? 0 : undefined}\n />,\n );\n } else {\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={false}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n opacity={0.1}\n />,\n );\n }\n\n pointsForLine.push(\n <circle\n id={`${_staticHighlightCircle}_${i}`}\n key={`${_staticHighlightCircle}_${i}`}\n r={5.5}\n cx={0}\n cy={0}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={DEFAULT_LINE_STROKE_SIZE}\n stroke={lineColor}\n visibility={'hidden'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOut={_handleMouseOut}\n />,\n );\n } else if (!props.optimizeLargeData) {\n for (let j = 1; j < _points[i].data.length; j++) {\n const gapResult = _checkInGap(j, gaps, gapIndex);\n const isInGap = gapResult.isInGap;\n gapIndex = gapResult.gapIndex;\n\n const lineId = `${_lineId}_${i}_${j}`;\n const borderId = `${_borderId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[j - 1] as LineChartDataPoint;\n const { x: x2, y: y2 } = _points[i].data[j] as LineChartDataPoint;\n let path = _getPath(_xAxisScale(x1), yScale(y1), circleId, j, false, _points[i].index);\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean =\n _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;\n pointsForLine.push(\n <path\n id={circleId}\n key={circleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j - 1].onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, circleId, j, false)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j - 1)}\n tabIndex={isLegendSelected ? 0 : undefined}\n />,\n );\n if (j + 1 === _points[i].data.length) {\n // If this is last point of the line segment.\n const lastCircleId = `${circleId}${j}L`;\n const hiddenHoverCircleId = `${circleId}${j}D`;\n const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;\n path = _getPath(_xAxisScale(x2), yScale(y2), lastCircleId, j, true, _points[i].index);\n const {\n xAxisCalloutData: lastCirlceXCallout,\n xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData,\n } = _points[i].data[j];\n pointsForLine.push(\n <React.Fragment key={`${lastCircleId}_container`}>\n <path\n id={lastCircleId}\n key={lastCircleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() =>\n _handleFocus(lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData)\n }\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j].onDataPointClick)}\n opacity={isLegendSelected && !lastPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, lastCircleId, j, true)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={isLegendSelected ? 0 : undefined}\n />\n {/* Dummy circle acting as magnetic latch for last callout point */}\n <circle\n id={hiddenHoverCircleId}\n key={hiddenHoverCircleId}\n r={8}\n cx={_xAxisScale(x2)}\n cy={yScale(y2)}\n opacity={0}\n width={0}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={0}\n focusable={false}\n onBlur={_handleMouseOut}\n />\n </React.Fragment>,\n );\n /* eslint-enable react/jsx-no-bind */\n }\n\n if (isLegendSelected) {\n // don't draw line if it is in a gap\n if (!isInGap) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <line\n id={borderId}\n key={borderId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n {...(_points[i].lineOptions?.lineBorderColor && {\n stroke: _points[i].lineOptions?.lineBorderColor,\n })}\n className={classes.lineBorder}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeWidth={strokeWidth}\n ref={(e: SVGLineElement | null) => {\n _refCallback(e!, lineId);\n }}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={1}\n {..._getClickHandler(_points[i].onLineClick)}\n />,\n );\n }\n } else {\n if (!isInGap) {\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeWidth={strokeWidth}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={0.1}\n />,\n );\n }\n }\n }\n }\n\n lines.push(\n <g\n key={`line_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, line ${i + 1} of ${_points.length} with ${_points[i].data.length} data points.`}\n >\n {bordersForLine}\n {linesForLine}\n {pointsForLine}\n </g>,\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);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return lines;\n }\n\n function _createColorFillBars(containerHeight: number) {\n const colorFillBars: JSX.Element[] = [];\n if (isSelectedLegend) {\n _colorFillBars.current = selectedColorBarLegend;\n } else {\n _colorFillBars.current = props.colorFillBars!;\n }\n\n const yMinMaxValues = getMinMaxOfYAxis(_points, ChartTypes.LineChart);\n const FILL_Y_PADDING = 3;\n for (let i = 0; i < _colorFillBars.current.length; i++) {\n const colorFillBar = _colorFillBars.current[i];\n const colorFillBarId = `${_colorFillBarId}-${i}`;\n const color = getColorFromToken(colorFillBar.color);\n\n if (colorFillBar.applyPattern) {\n // Using a pattern element because CSS was unable to render diagonal stripes for rect elements\n colorFillBars.push(_getStripePattern(color, i));\n }\n\n for (let j = 0; j < colorFillBar.data.length; j++) {\n const startX = colorFillBar.data[j].startX;\n const endX = colorFillBar.data[j].endX;\n const opacity =\n _legendHighlighted(colorFillBar.legend) || _noLegendHighlighted() || isSelectedLegend\n ? _getColorFillBarOpacity(colorFillBar)\n : 0.1;\n colorFillBars.push(\n <rect\n fill={colorFillBar.applyPattern ? `url(#${_colorFillBarPatternId}_${i})` : color}\n fillOpacity={opacity}\n x={_isRTL ? _xAxisScale(endX) : _xAxisScale(startX)}\n y={_yScalePrimary(yMinMaxValues.endValue) - FILL_Y_PADDING}\n width={Math.abs(_xAxisScale(endX) - _xAxisScale(startX))}\n height={_yScalePrimary(props.yMinValue || 0) - _yScalePrimary(yMinMaxValues.endValue) + FILL_Y_PADDING}\n key={`${colorFillBarId}${j}`}\n />,\n );\n }\n }\n return colorFillBars;\n }\n\n function _getStripePattern(color: string, id: number) {\n // This describes a tile pattern that resembles diagonal stripes\n // For more information: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n const stripePath = 'M-4,4 l8,-8 M0,16 l16,-16 M12,20 l8,-8';\n return (\n <pattern\n id={`${_colorFillBarPatternId}_${id}`}\n width={16}\n height={16}\n key={`${_colorFillBarPatternId}_${id}`}\n patternUnits={'userSpaceOnUse'}\n >\n <path d={stripePath} stroke={color} strokeWidth={1.25} />\n </pattern>\n );\n }\n\n function _checkInGap(pointIndex: number, gaps: LineChartGap[], currentGapIndex: number) {\n let gapIndex = currentGapIndex;\n let isInGap = false;\n\n while (gapIndex < gaps.length && pointIndex > gaps[gapIndex].endIndex) {\n gapIndex++;\n }\n\n if (gapIndex < gaps.length && pointIndex > gaps[gapIndex].startIndex && pointIndex <= gaps[gapIndex].endIndex) {\n isInGap = true;\n }\n return { isInGap, gapIndex };\n }\n\n function _refCallback(element: SVGGElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n const _onMouseOverLargeDataset = (\n linenumber: number,\n lineHeight: number,\n mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>,\n yScale: ScaleLinear<number, number>,\n ) => {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n\n // This will get the value of the X when mouse is on the chart\n const xOffset = _xAxisScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![linenumber].data, xOffset);\n const d0 = lineChartData![linenumber].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![linenumber].data[i] as LineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let xPointToHighlight: string | Date | number = 0;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n xPointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n xPointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![linenumber].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData } = lineChartData![linenumber].data[index as number];\n const formattedDate =\n xPointToHighlight instanceof Date ? formatDate(xPointToHighlight, props.useUTC) : xPointToHighlight;\n const modifiedXVal = xPointToHighlight instanceof Date ? xPointToHighlight.getTime() : xPointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const pointToHighlight: LineChartDataPoint = lineChartData![linenumber].data[index!] as LineChartDataPoint;\n const pointToHighlightUpdated =\n nearestCircleToHighlight === null ||\n (nearestCircleToHighlight !== null &&\n pointToHighlight !== null &&\n (nearestCircleToHighlight.x !== pointToHighlight.x || nearestCircleToHighlight.y !== pointToHighlight.y));\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated) {\n _uniqueCallOutID = `#${_staticHighlightCircle}_${linenumber}`;\n\n d3Select(`#${_staticHighlightCircle}_${linenumber}`)\n .attr('cx', `${_xAxisScale(pointToHighlight.x)}`)\n .attr('cy', `${yScale(pointToHighlight.y)}`)\n .attr('visibility', 'visibility');\n\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(pointToHighlight.x)}, ${yScale(pointToHighlight.y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - 5 - yScale(pointToHighlight.y)}`);\n\n setNearestCircleToHighlight(pointToHighlight);\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setStackCalloutProps(found!);\n setYValueHover(found.values);\n setDataPointCalloutProps(found!);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue(formattedDate);\n setActivePoint('');\n }\n\n if (!found) {\n setPopoverOpen(false);\n setNearestCircleToHighlight(pointToHighlight);\n setActivePoint('');\n }\n };\n\n function _handleFocus(\n lineId: string,\n x: number | Date,\n\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: AccessibilityProps,\n ) {\n _uniqueCallOutID = circleId;\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: RefArrayData) => {\n if (obj.index === lineId) {\n setPopoverOpen(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n }\n\n function _handleHover(\n x: number | Date,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: AccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n yScale: ScaleLinear<number, number>,\n ) {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, ${yScale(y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - 5 - yScale(y)}`);\n\n if (_uniqueCallOutID !== circleId) {\n _uniqueCallOutID = circleId;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n } else {\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\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 _handleMouseOut() {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }\n\n function _handleChartMouseLeave() {\n _uniqueCallOutID = null;\n setActivePoint('');\n if (isPopoverOpen) {\n setPopoverOpen(false);\n }\n }\n\n function _handleMultipleLineLegendSelectionAction(selectedLine: LineChartDataWithIndex) {\n const selectedLineIndex = selectedLegendPoints.reduce((acc, line, index) => {\n if (acc > -1 || line.legend !== selectedLine.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedLines: LineChartDataWithIndex[];\n if (selectedLineIndex === -1) {\n selectedLines = [...selectedLegendPoints, selectedLine];\n } else {\n selectedLines = selectedLegendPoints\n .slice(0, selectedLineIndex)\n .concat(selectedLegendPoints.slice(selectedLineIndex + 1));\n }\n\n const areAllLineLegendsSelected = props.data && selectedLines.length === props.data.lineChartData!.length;\n\n if (\n areAllLineLegendsSelected &&\n ((props.colorFillBars && props.colorFillBars.length === selectedColorBarLegend.length) || !props.colorFillBars)\n ) {\n // Clear all legends if all legends including color fill bar legends are selected\n // Or clear all legends if all legends are selected and there are no color fill bars\n _clearMultipleLegendSelections();\n } else if (!selectedLines.length && !selectedColorBarLegend.length) {\n // Clear all legends if no legends including color fill bar legends are selected\n _clearMultipleLegendSelections();\n } else {\n // Otherwise, set state when one or more legends are selected, including color fill bar legends\n setSelectedLegendPoints(selectedLines);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedLines.map((line: LineChartDataWithIndex) => line.legend);\n _handleLegendClick(selectedLine, selectedLegendTitlesToPass);\n }\n\n function _handleMultipleColorFillBarLegendSelectionAction(selectedColorFillBar: ColorFillBarsProps) {\n const selectedColorFillBarIndex = selectedColorBarLegend.reduce((acc, colorFillBar, index) => {\n if (acc > -1 || colorFillBar.legend !== selectedColorFillBar.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedColorFillBars: ColorFillBarsProps[];\n if (selectedColorFillBarIndex === -1) {\n selectedColorFillBars = [...selectedColorBarLegend, selectedColorFillBar];\n } else {\n selectedColorFillBars = selectedColorBarLegend\n .slice(0, selectedColorFillBarIndex)\n .concat(selectedColorBarLegend.slice(selectedColorFillBarIndex + 1));\n }\n\n const areAllColorFillBarLegendsSelected =\n selectedColorFillBars.length === (props.colorFillBars && props.colorFillBars!.length);\n\n if (\n areAllColorFillBarLegendsSelected &&\n ((props.data && props.data.lineChartData!.length === selectedLegendPoints.length) || !props.data)\n ) {\n // Clear all legends if all legends, including line legends, are selected\n // Or clear all legends if all legends are selected and there is no line data\n _clearMultipleLegendSelections();\n } else if (!selectedColorFillBars.length && !selectedLegendPoints.length) {\n // Clear all legends if no legends are selected, including line legends\n _clearMultipleLegendSelections();\n } else {\n // set state when one or more legends are selected, including line legends\n setSelectedColorBarLegend(selectedColorFillBars);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedColorFillBars.map(\n (colorFillBar: ColorFillBarsProps) => colorFillBar.legend,\n );\n _handleLegendClick(selectedColorFillBar, selectedLegendTitlesToPass);\n }\n\n function _clearMultipleLegendSelections() {\n setSelectedColorBarLegend([]);\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n function _legendHighlighted(legend: string) {\n return selectedLegend === legend || (selectedLegend === '' && activeLegend === legend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n function _getColorFillBarOpacity(colorFillBar: ColorFillBarsProps) {\n return colorFillBar.applyPattern ? 1 : 0.4;\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = _points[lineIndex];\n const point = line.data[pointIndex];\n const formattedDate = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n props.data.lineChartData.filter((item: LineChartPoints) => item.data.length).length > 0\n );\n }\n\n const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n\n const isXAxisDateType = getXAxisType(_points);\n let points = _points;\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;\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!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack: true,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={props.data.chartTitle}\n points={points}\n chartType={ChartTypes.LineChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getGraphData={_initializeLineChartData}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: ChildProps) => {\n _xAxisScale = props.xScale!;\n _yScalePrimary = props.yScalePrimary!;\n _yScaleSecondary = props.yScaleSecondary;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={props.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n {props.optimizeLargeData ? (\n <rect id={_rectId} width={props.containerWidth} height={props.containerHeight} fill={'transparent'} />\n ) : (\n <></>\n )}\n <g>\n {_renderedColorFillBars}\n {lines}\n </g>\n {eventAnnotationProps && (\n <EventsAnnotation\n {...eventAnnotationProps}\n scale={props.xScale!}\n chartYTop={margins.top! + eventLabelHeight}\n chartYBottom={props.containerHeight! - 35}\n />\n )}\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 },\n);\nLineChart.displayName = 'LineChart';\n"],"names":["React","useLineChartStyles","select","d3Select","pointer","bisector","Legends","line","d3Line","useId","find","CartesianChart","EventsAnnotation","tokens","calloutData","ChartTypes","getXAxisType","XAxisTypes","tooltipOfAxislabels","Points","pointTypes","getMinMaxOfYAxis","getTypeOfAxis","getNextColor","getColorFromToken","useRtl","formatDate","getCurveFactory","PointSize","bisect","d","x","left","DEFAULT_LINE_STROKE_SIZE","PATH_MULTIPLY_SIZE","_getPointPath","y","w","index","allPointPaths","LineChart","forwardRef","props","forwardedRef","_points","_injectIndexPropertyInLineChartData","data","lineChartData","_calloutPoints","_xAxisScale","_yScalePrimary","_circleId","_lineId","_borderId","_verticalLine","_colorFillBarPatternId","_uniqueCallOutID","_refArray","margins","eventLabelHeight","lines","_renderedColorFillBars","_colorFillBars","useRef","_tooltipId","_rectId","_staticHighlightCircle","_firstRenderOptimization","_emptyChartId","_colorFillBarId","_isRTL","xAxisCalloutAccessibilityData","cartesianChartRef","_yScaleSecondary","eventAnnotationProps","labelHeight","hoverXValue","setHoverXValue","useState","activeLegend","setActiveLegend","YValueHover","setYValueHover","selectedLegend","setSelectedLegend","selectedLegendPoints","setSelectedLegendPoints","selectedColorBarLegend","setSelectedColorBarLegend","isSelectedLegend","setIsSelectedLegend","legendProps","selectedLegends","length","activePoint","setActivePoint","nearestCircleToHighlight","setNearestCircleToHighlight","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","clickPosition","setClickPosition","isPopoverOpen","setPopoverOpen","pointsRef","calloutPointsRef","classes","useEffect","current","height","width","useImperativeHandle","componentRef","chartContainer","isFilterSelectedLegends","allowMultipleShapesForPoints","filteredData","filter","item","includes","legend","map","color","updatePosition","newX","newY","threshold","distance","Math","sqrt","pow","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getMargins","_margins","_initializeLineChartData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","colorFillBars","_createColorFillBars","_createLines","_handleSingleLegendSelectionAction","lineChartItem","_handleLegendClick","_onHoverCardHide","onLegendClick","_createLegends","isLegendMultiSelectEnabled","canSelectMultipleLegends","legendDataItems","point","title","action","_handleMultipleLineLegendSelectionAction","onMouseOutAction","hoverAction","_handleChartMouseLeave","legendShape","shape","Object","keys","colorFillBarsLegendDataItems","colorFillBar","_handleMultipleColorFillBarLegendSelectionAction","opacity","_getColorFillBarOpacity","stripePattern","applyPattern","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onLegendHoverCardLeave","_getBoxWidthOfShape","pointId","pointIndex","isLastPoint","strokeWidth","_getPath","xPos","yPos","pointOftheLine","widthRatio","_getPointFill","lineColor","colorNeutralBackground1","i","linesForLine","bordersForLine","pointsForLine","legendVal","verticaLineHeight","bottom","yScale","useSecondaryYScale","x1","y1","xAxisCalloutData","circleId","isLegendSelected","_legendHighlighted","_noLegendHighlighted","push","circle","id","key","r","cx","cy","fill","tabIndex","undefined","onMouseOver","event","_handleHover","onMouseMove","onMouseOut","_handleMouseOut","stroke","role","aria-label","_getAriaLabel","data-is-focusable","ref","e","_refCallback","onFocus","_handleFocus","onBlur","_getClickHandler","onDataPointClick","gapIndex","gaps","sort","a","b","startIndex","lineCurve","lineOptions","curve","optimizeLargeData","lineId","borderId","lineData","k","Date","getTime","lineBorderWidth","Number","parseFloat","toString","path","strokeLinecap","lineBorderColor","_onMouseOverLargeDataset","bind","onLineClick","visibility","j","gapResult","_checkInGap","isInGap","x2","y2","currentPointHidden","hideNonActiveDots","lastCircleId","hiddenHoverCircleId","lastPointHidden","lastCirlceXCallout","lastCirlceXCalloutAccessibilityData","Fragment","focusable","className","lineBorder","strokeDasharray","strokeDashoffset","g","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","yMinMaxValues","FILL_Y_PADDING","colorFillBarId","_getStripePattern","startX","endX","rect","fillOpacity","endValue","abs","yMinValue","stripePath","pattern","patternUnits","currentGapIndex","endIndex","element","legendTitle","refElement","linenumber","lineHeight","mouseEvent","persist","xOffset","invert","d0","d1","axisType","xPointToHighlight","x0","point0","point1","DateAxis","NumericAxis","formattedDate","useUTC","modifiedXVal","found","pointToHighlight","pointToHighlightUpdated","attr","clientX","clientY","values","formattedData","xVal","forEach","obj","func","onClick","selectedLine","selectedLineIndex","reduce","acc","selectedLines","slice","concat","areAllLineLegendsSelected","_clearMultipleLegendSelections","selectedLegendTitlesToPass","selectedColorFillBar","selectedColorFillBarIndex","selectedColorFillBars","areAllColorFillBarLegendsSelected","lineIndex","xValue","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","tickValues","tickFormat","isXAxisDateType","points","legendBars","hideLegend","calloutProps","descriptionMessage","getCalloutDescriptionMessage","isCalloutForStack","culture","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","chartTitle","chartType","getmargins","getGraphData","xAxisType","onChartMouseLeave","enableFirstRenderOptimization","enablePerfOptimization","children","scale","chartYTop","top","chartYBottom","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;gBACRd,IAAI/J;gBACJoN,YAAY;gBACZkB,iBAAiB;gBAElBlP,MAAM+M,iBAAiB,iBACtB,oBAACuD;gBAAK3F,IAAIpJ;gBAAS+C,OAAOtE,MAAMoG,cAAc;gBAAE/B,QAAQrE,MAAMmG,eAAe;gBAAE6E,MAAM;+BAErF,yDAEF,oBAACoE,WACEjO,wBACAD,QAEFc,sCACC,oBAAC9D;gBACE,GAAG8D,oBAAoB;gBACxBiU,OAAOjW,MAAMiG,MAAM;gBACnBiQ,WAAWlV,QAAQmV,GAAG,GAAIlV;gBAC1BmV,cAAcpW,MAAMmG,eAAe,GAAI;;QAMnD;uBAGF,oBAACkQ;QAAI1L,IAAIjJ;QAAegK,MAAM;QAAS4K,OAAO;YAAEpO,SAAS;QAAI;QAAGyD,cAAY;;AAEhF,GACA;AACF7L,UAAUyW,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LineChartProps } from './LineChart.types';\nimport { useLineChartStyles } from './useLineChartStyles.styles';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select, pointer } from 'd3-selection';\nimport { bisector } from 'd3-array';\nimport { Legend, Legends } from '../Legends/index';\nimport { line as d3Line } from 'd3-shape';\nimport { useId } from '@fluentui/react-utilities';\nimport { find } from '../../utilities/index';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n LineChartPoints,\n CustomizedCalloutData,\n Margins,\n RefArrayData,\n ColorFillBarsProps,\n LineChartGap,\n LineChartDataPoint,\n Chart,\n} from '../../index';\nimport { EventsAnnotation } from './eventAnnotation/EventAnnotation';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n calloutData,\n ChartTypes,\n getXAxisType,\n XAxisTypes,\n tooltipOfAxislabels,\n Points,\n pointTypes,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n findNumericMinMaxOfY,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfDateForAreaLineVerticalBarChart,\n domainRangeOfNumericForAreaChart,\n createStringYAxis,\n useRtl,\n formatDate,\n getCurveFactory,\n} from '../../utilities/index';\nimport { ScaleLinear } from 'd3-scale';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\nenum PointSize {\n hoverSize = 11,\n invisibleSize = 1,\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst DEFAULT_LINE_STROKE_SIZE = 4;\n// The given shape of a icon must be 2.5 times bigger than line width (known as stroke width)\nconst PATH_MULTIPLY_SIZE = 2.5;\n\n/**\n *\n * @param x units from origin\n * @param y units from origin\n * @param w is the legnth of the each side of a shape\n * @param index index to get the shape path\n */\nconst _getPointPath = (x: number, y: number, w: number, index: number): string => {\n const allPointPaths = [\n // circle path\n `M${x - w / 2} ${y}\n A${w / 2} ${w / 2} 0 1 0 ${x + w / 2} ${y}\n M${x - w / 2} ${y}\n A ${w / 2} ${w / 2} 0 1 1 ${x + w / 2} ${y}\n `,\n //square\n `M${x - w / 2} ${y - w / 2}\n L${x + w / 2} ${y - w / 2}\n L${x + w / 2} ${y + w / 2}\n L${x - w / 2} ${y + w / 2}\n Z`,\n //triangle\n `M${x - w / 2} ${y - 0.2886 * w}\n H ${x + w / 2}\n L${x} ${y + 0.5774 * w} Z`,\n //diamond\n `M${x} ${y - w / 2}\n L${x + w / 2} ${y}\n L${x} ${y + w / 2}\n L${x - w / 2} ${y}\n Z`,\n //pyramid\n `M${x} ${y - 0.5774 * w}\n L${x + w / 2} ${y + 0.2886 * w}\n L${x - w / 2} ${y + 0.2886 * w} Z`,\n //hexagon\n `M${x - 0.5 * w} ${y - 0.866 * w}\n L${x + 0.5 * w} ${y - 0.866 * w}\n L${x + w} ${y}\n L${x + 0.5 * w} ${y + 0.866 * w}\n L${x - 0.5 * w} ${y + 0.866 * w}\n L${x - w} ${y}\n Z`,\n //pentagon\n `M${x} ${y - 0.851 * w}\n L${x + 0.6884 * w} ${y - 0.2633 * w}\n L${x + 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.6884 * w} ${y - 0.2633 * w}\n Z`,\n //octagon\n `M${x - 0.5001 * w} ${y - 1.207 * w}\n L${x + 0.5001 * w} ${y - 1.207 * w}\n L${x + 1.207 * w} ${y - 0.5001 * w}\n L${x + 1.207 * w} ${y + 0.5001 * w}\n L${x + 0.5001 * w} ${y + 1.207 * w}\n L${x - 0.5001 * w} ${y + 1.207 * w}\n L${x - 1.207 * w} ${y + 0.5001 * w}\n L${x - 1.207 * w} ${y - 0.5001 * w}\n Z`,\n ];\n return allPointPaths[index];\n};\n\ntype LineChartDataWithIndex = LineChartPoints & { index: number };\n\n// Create a LineChart variant which uses these default styles and this styled subcomponent.\n/**\n * Linechart component\n * {@docCategory LineChart}\n */\nexport const LineChart: React.FunctionComponent<LineChartProps> = React.forwardRef<HTMLDivElement, LineChartProps>(\n (props, forwardedRef) => {\n let _points: LineChartDataWithIndex[] = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any[] = calloutData(_points) || [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisScale: any = '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _yScalePrimary: any = '';\n let _circleId: string = useId('circle');\n let _lineId: string = useId('lineID');\n let _borderId: string = useId('borderID');\n let _verticalLine: string = useId('verticalLine');\n let _colorFillBarPatternId: string = useId('colorFillBarPattern');\n let _uniqueCallOutID: string | null = '';\n let _refArray: RefArrayData[] = [];\n let margins: Margins;\n let eventLabelHeight: number = 36;\n let lines: JSX.Element[];\n let _renderedColorFillBars: JSX.Element[];\n const _colorFillBars = React.useRef<ColorFillBarsProps[]>([]);\n let _tooltipId: string = useId('LineChartTooltipId_');\n let _rectId: string = useId('containerRectLD');\n let _staticHighlightCircle: string = useId('staticHighlightCircle');\n let _firstRenderOptimization = true;\n let _emptyChartId: string = useId('_LineChart_empty');\n const _colorFillBarId = useId('_colorFillBarId');\n const _isRTL: boolean = useRtl();\n let xAxisCalloutAccessibilityData: AccessibilityProps = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n let _yScaleSecondary: ScaleLinear<number, number> | undefined;\n\n props.eventAnnotationProps &&\n props.eventAnnotationProps.labelHeight &&\n (eventLabelHeight = props.eventAnnotationProps.labelHeight);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>(\n _injectIndexPropertyInLineChartData(props.data.lineChartData, true),\n );\n const [selectedColorBarLegend, setSelectedColorBarLegend] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(\n (props.legendProps?.selectedLegends?.length ?? 0) > 0,\n );\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<LineChartDataPoint | null>(null);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n const pointsRef = React.useRef<LineChartDataWithIndex[] | []>([]);\n const calloutPointsRef = React.useRef<any[]>([]);\n const classes = useLineChartStyles(props);\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 (_points !== _injectIndexPropertyInLineChartData(props.data.lineChartData) || props.data !== _points) {\n pointsRef.current = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _getDomainNRangeValues(\n points: LineChartPoints[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(\n points,\n margins,\n width,\n isRTL,\n tickValues! as Date[],\n chartType,\n barWidth,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n function _injectIndexPropertyInLineChartData(\n lineChartData?: LineChartPoints[],\n isFilterSelectedLegends: boolean = false,\n ): LineChartDataWithIndex[] | [] {\n const { allowMultipleShapesForPoints = false } = props;\n // Apply filter only if isPropChange is true\n const filteredData = isFilterSelectedLegends\n ? lineChartData?.filter(\n (item: LineChartPoints) =>\n props.legendProps?.selectedLegends?.includes(item.legend) ||\n props.legendProps?.selectedLegend === item.legend,\n )\n : lineChartData;\n return filteredData\n ? filteredData.map((item: LineChartPoints, 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: allowMultipleShapesForPoints ? index : -1,\n color,\n };\n })\n : [];\n }\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps)\n : null;\n }\n\n function _getMargins(_margins: Margins) {\n margins = _margins;\n }\n\n function _initializeLineChartData(\n xScale: NumericAxis,\n yScalePrimary: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) {\n _xAxisScale = xScale;\n _yScalePrimary = yScalePrimary;\n _yScaleSecondary = yScaleSecondary;\n _renderedColorFillBars = props.colorFillBars ? _createColorFillBars(containerHeight) : [];\n lines = _createLines(xElement!, containerHeight!);\n }\n\n function _handleSingleLegendSelectionAction(lineChartItem: LineChartDataWithIndex | ColorFillBarsProps) {\n if (selectedLegend === lineChartItem.legend) {\n setSelectedLegend('');\n _handleLegendClick(lineChartItem, null);\n } else {\n setSelectedLegend(lineChartItem.legend);\n _handleLegendClick(lineChartItem, lineChartItem.legend);\n }\n }\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setSelectedColorBarLegend([]);\n setIsSelectedLegend(false);\n }\n\n function _handleLegendClick(\n lineChartItem: LineChartDataWithIndex | ColorFillBarsProps,\n selectedLegend: string | null | string[],\n ): void {\n if (lineChartItem.onLegendClick) {\n lineChartItem.onLegendClick(selectedLegend);\n }\n }\n\n function _createLegends(data: LineChartDataWithIndex[]): JSX.Element {\n const { legendProps, allowMultipleShapesForPoints = false } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const legendDataItems = data.map((point: LineChartDataWithIndex) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleLineLegendSelectionAction(point);\n } else {\n _handleSingleLegendSelectionAction(point);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend);\n },\n ...(point.legendShape && {\n shape: point.legendShape,\n }),\n ...(allowMultipleShapesForPoints && {\n shape: Points[point.index % Object.keys(pointTypes).length] as Legend['shape'],\n }),\n };\n return legend;\n });\n\n const colorFillBarsLegendDataItems = props.colorFillBars\n ? props.colorFillBars.map((colorFillBar: ColorFillBarsProps, index: number) => {\n const title = colorFillBar.legend;\n const color = getColorFromToken(colorFillBar.color);\n const legend: Legend = {\n title,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleColorFillBarLegendSelectionAction(colorFillBar);\n } else {\n _handleSingleLegendSelectionAction(colorFillBar);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(title);\n },\n opacity: _getColorFillBarOpacity(colorFillBar),\n stripePattern: colorFillBar.applyPattern,\n };\n return legend;\n })\n : [];\n\n return (\n <Legends\n legends={[...legendDataItems, ...colorFillBarsLegendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n {...props.legendProps}\n />\n );\n }\n\n function _getBoxWidthOfShape(pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false, strokeWidth = DEFAULT_LINE_STROKE_SIZE } = props;\n if (allowMultipleShapesForPoints) {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else if (pointIndex === 1 || isLastPoint) {\n return strokeWidth * PATH_MULTIPLY_SIZE;\n } else {\n return PointSize.invisibleSize;\n }\n } else {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else {\n return PointSize.invisibleSize;\n }\n }\n }\n\n function _getPath(\n xPos: number,\n yPos: number,\n pointId: string,\n pointIndex: number,\n isLastPoint: boolean,\n pointOftheLine: number,\n ): string {\n const { allowMultipleShapesForPoints = false } = props;\n let w = _getBoxWidthOfShape(pointId, pointIndex, isLastPoint);\n const index: number = allowMultipleShapesForPoints ? pointOftheLine % Object.keys(pointTypes).length : 0;\n const widthRatio = pointTypes[index].widthRatio;\n w = widthRatio > 1 ? w / widthRatio : w;\n\n return _getPointPath(xPos, yPos, w, index);\n }\n function _getPointFill(lineColor: string, pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false } = props;\n if (allowMultipleShapesForPoints) {\n if (pointIndex === 1 || isLastPoint) {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n }\n\n function _createLines(xElement: SVGElement, containerHeight: number): JSX.Element[] {\n const lines: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points = selectedLegendPoints;\n } else {\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n }\n for (let i = _points.length - 1; i >= 0; i--) {\n const linesForLine: JSX.Element[] = [];\n const bordersForLine: JSX.Element[] = [];\n const pointsForLine: JSX.Element[] = [];\n\n const legendVal: string = _points[i].legend;\n const lineColor: string = _points[i].color!;\n const verticaLineHeight = containerHeight - margins.bottom! + 6;\n const yScale = _points[i].useSecondaryYScale && _yScaleSecondary ? _yScaleSecondary : _yScalePrimary;\n if (_points[i].data.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[0] as LineChartDataPoint;\n const circleId = `${_circleId}_${i}`;\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n pointsForLine.push(\n <circle\n id={circleId}\n key={circleId}\n r={activePoint === circleId ? 5.5 : 3.5}\n cx={_xAxisScale(x1)}\n cy={yScale(y1)}\n fill={activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={isLegendSelected ? 0 : undefined}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0}\n stroke={activePoint === circleId ? lineColor : ''}\n role=\"img\"\n aria-label={_getAriaLabel(i, 0)}\n data-is-focusable={isLegendSelected}\n ref={(e: SVGCircleElement | null) => {\n _refCallback(e!, circleId);\n }}\n onFocus={() => _handleFocus(circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[0].onDataPointClick)}\n />,\n );\n }\n\n let gapIndex = 0;\n const gaps = _points[i].gaps?.sort((a, b) => a.startIndex - b.startIndex) ?? [];\n const lineCurve = _points[i].lineOptions?.curve;\n\n // Use path rendering technique for larger datasets to optimize performance.\n if ((props.optimizeLargeData || lineCurve) && _points[i].data.length > 1) {\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => _xAxisScale(d[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d[1]))\n .curve(getCurveFactory(lineCurve));\n\n const lineId = `${_lineId}_${i}`;\n const borderId = `${_borderId}_${i}`;\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const lineData: [number, number][] = [];\n for (let k = 0; k < _points[i].data.length; k++) {\n lineData.push([\n _points[i].data[k].x instanceof Date\n ? (_points[i].data[k].x as Date).getTime()\n : (_points[i].data[k].x as number),\n _points[i].data[k].y,\n ]);\n }\n\n if (isLegendSelected) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <path\n id={borderId}\n key={borderId}\n d={line(lineData)!}\n fill=\"transparent\"\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={true}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOut={_handleMouseOut}\n {..._getClickHandler(_points[i].onLineClick)}\n opacity={1}\n tabIndex={isLegendSelected ? 0 : undefined}\n />,\n );\n } else {\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={false}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n opacity={0.1}\n />,\n );\n }\n\n pointsForLine.push(\n <circle\n id={`${_staticHighlightCircle}_${i}`}\n key={`${_staticHighlightCircle}_${i}`}\n r={5.5}\n cx={0}\n cy={0}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={DEFAULT_LINE_STROKE_SIZE}\n stroke={lineColor}\n visibility={'hidden'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale)}\n onMouseOut={_handleMouseOut}\n />,\n );\n } else if (!props.optimizeLargeData) {\n for (let j = 1; j < _points[i].data.length; j++) {\n const gapResult = _checkInGap(j, gaps, gapIndex);\n const isInGap = gapResult.isInGap;\n gapIndex = gapResult.gapIndex;\n\n const lineId = `${_lineId}_${i}_${j}`;\n const borderId = `${_borderId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[j - 1] as LineChartDataPoint;\n const { x: x2, y: y2 } = _points[i].data[j] as LineChartDataPoint;\n let path = _getPath(_xAxisScale(x1), yScale(y1), circleId, j, false, _points[i].index);\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean =\n _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;\n pointsForLine.push(\n <path\n id={circleId}\n key={circleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j - 1].onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, circleId, j, false)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j - 1)}\n tabIndex={isLegendSelected ? 0 : undefined}\n />,\n );\n if (j + 1 === _points[i].data.length) {\n // If this is last point of the line segment.\n const lastCircleId = `${circleId}${j}L`;\n const hiddenHoverCircleId = `${circleId}${j}D`;\n const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;\n path = _getPath(_xAxisScale(x2), yScale(y2), lastCircleId, j, true, _points[i].index);\n const {\n xAxisCalloutData: lastCirlceXCallout,\n xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData,\n } = _points[i].data[j];\n pointsForLine.push(\n <React.Fragment key={`${lastCircleId}_container`}>\n <path\n id={lastCircleId}\n key={lastCircleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() =>\n _handleFocus(lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData)\n }\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j].onDataPointClick)}\n opacity={isLegendSelected && !lastPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, lastCircleId, j, true)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={isLegendSelected ? 0 : undefined}\n />\n {/* Dummy circle acting as magnetic latch for last callout point */}\n <circle\n id={hiddenHoverCircleId}\n key={hiddenHoverCircleId}\n r={8}\n cx={_xAxisScale(x2)}\n cy={yScale(y2)}\n opacity={0}\n width={0}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={0}\n focusable={false}\n onBlur={_handleMouseOut}\n />\n </React.Fragment>,\n );\n /* eslint-enable react/jsx-no-bind */\n }\n\n if (isLegendSelected) {\n // don't draw line if it is in a gap\n if (!isInGap) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <line\n id={borderId}\n key={borderId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n {...(_points[i].lineOptions?.lineBorderColor && {\n stroke: _points[i].lineOptions?.lineBorderColor,\n })}\n className={classes.lineBorder}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeWidth={strokeWidth}\n ref={(e: SVGLineElement | null) => {\n _refCallback(e!, lineId);\n }}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n yScale,\n )\n }\n onMouseOut={_handleMouseOut}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={1}\n {..._getClickHandler(_points[i].onLineClick)}\n />,\n );\n }\n } else {\n if (!isInGap) {\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={yScale(y1)}\n x2={_xAxisScale(x2)}\n y2={yScale(y2)}\n strokeWidth={strokeWidth}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={0.1}\n />,\n );\n }\n }\n }\n }\n\n lines.push(\n <g\n key={`line_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, line ${i + 1} of ${_points.length} with ${_points[i].data.length} data points.`}\n >\n {bordersForLine}\n {linesForLine}\n {pointsForLine}\n </g>,\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);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return lines;\n }\n\n function _createColorFillBars(containerHeight: number) {\n const colorFillBars: JSX.Element[] = [];\n if (isSelectedLegend) {\n _colorFillBars.current = selectedColorBarLegend;\n } else {\n _colorFillBars.current = props.colorFillBars!;\n }\n\n const yMinMaxValues = findNumericMinMaxOfY(_points);\n const FILL_Y_PADDING = 3;\n for (let i = 0; i < _colorFillBars.current.length; i++) {\n const colorFillBar = _colorFillBars.current[i];\n const colorFillBarId = `${_colorFillBarId}-${i}`;\n const color = getColorFromToken(colorFillBar.color);\n\n if (colorFillBar.applyPattern) {\n // Using a pattern element because CSS was unable to render diagonal stripes for rect elements\n colorFillBars.push(_getStripePattern(color, i));\n }\n\n for (let j = 0; j < colorFillBar.data.length; j++) {\n const startX = colorFillBar.data[j].startX;\n const endX = colorFillBar.data[j].endX;\n const opacity =\n _legendHighlighted(colorFillBar.legend) || _noLegendHighlighted() || isSelectedLegend\n ? _getColorFillBarOpacity(colorFillBar)\n : 0.1;\n colorFillBars.push(\n <rect\n fill={colorFillBar.applyPattern ? `url(#${_colorFillBarPatternId}_${i})` : color}\n fillOpacity={opacity}\n x={_isRTL ? _xAxisScale(endX) : _xAxisScale(startX)}\n y={_yScalePrimary(yMinMaxValues.endValue) - FILL_Y_PADDING}\n width={Math.abs(_xAxisScale(endX) - _xAxisScale(startX))}\n height={_yScalePrimary(props.yMinValue || 0) - _yScalePrimary(yMinMaxValues.endValue) + FILL_Y_PADDING}\n key={`${colorFillBarId}${j}`}\n />,\n );\n }\n }\n return colorFillBars;\n }\n\n function _getStripePattern(color: string, id: number) {\n // This describes a tile pattern that resembles diagonal stripes\n // For more information: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n const stripePath = 'M-4,4 l8,-8 M0,16 l16,-16 M12,20 l8,-8';\n return (\n <pattern\n id={`${_colorFillBarPatternId}_${id}`}\n width={16}\n height={16}\n key={`${_colorFillBarPatternId}_${id}`}\n patternUnits={'userSpaceOnUse'}\n >\n <path d={stripePath} stroke={color} strokeWidth={1.25} />\n </pattern>\n );\n }\n\n function _checkInGap(pointIndex: number, gaps: LineChartGap[], currentGapIndex: number) {\n let gapIndex = currentGapIndex;\n let isInGap = false;\n\n while (gapIndex < gaps.length && pointIndex > gaps[gapIndex].endIndex) {\n gapIndex++;\n }\n\n if (gapIndex < gaps.length && pointIndex > gaps[gapIndex].startIndex && pointIndex <= gaps[gapIndex].endIndex) {\n isInGap = true;\n }\n return { isInGap, gapIndex };\n }\n\n function _refCallback(element: SVGGElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n const _onMouseOverLargeDataset = (\n linenumber: number,\n lineHeight: number,\n mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>,\n yScale: ScaleLinear<number, number>,\n ) => {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n\n // This will get the value of the X when mouse is on the chart\n const xOffset = _xAxisScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![linenumber].data, xOffset);\n const d0 = lineChartData![linenumber].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![linenumber].data[i] as LineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let xPointToHighlight: string | Date | number = 0;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n xPointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n xPointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![linenumber].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData } = lineChartData![linenumber].data[index as number];\n const formattedDate =\n xPointToHighlight instanceof Date ? formatDate(xPointToHighlight, props.useUTC) : xPointToHighlight;\n const modifiedXVal = xPointToHighlight instanceof Date ? xPointToHighlight.getTime() : xPointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const pointToHighlight: LineChartDataPoint = lineChartData![linenumber].data[index!] as LineChartDataPoint;\n const pointToHighlightUpdated =\n nearestCircleToHighlight === null ||\n (nearestCircleToHighlight !== null &&\n pointToHighlight !== null &&\n (nearestCircleToHighlight.x !== pointToHighlight.x || nearestCircleToHighlight.y !== pointToHighlight.y));\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated) {\n _uniqueCallOutID = `#${_staticHighlightCircle}_${linenumber}`;\n\n d3Select(`#${_staticHighlightCircle}_${linenumber}`)\n .attr('cx', `${_xAxisScale(pointToHighlight.x)}`)\n .attr('cy', `${yScale(pointToHighlight.y)}`)\n .attr('visibility', 'visibility');\n\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(pointToHighlight.x)}, ${yScale(pointToHighlight.y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - 5 - yScale(pointToHighlight.y)}`);\n\n setNearestCircleToHighlight(pointToHighlight);\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setStackCalloutProps(found!);\n setYValueHover(found.values);\n setDataPointCalloutProps(found!);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue(formattedDate);\n setActivePoint('');\n }\n\n if (!found) {\n setPopoverOpen(false);\n setNearestCircleToHighlight(pointToHighlight);\n setActivePoint('');\n }\n };\n\n function _handleFocus(\n lineId: string,\n x: number | Date,\n\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: AccessibilityProps,\n ) {\n _uniqueCallOutID = circleId;\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: RefArrayData) => {\n if (obj.index === lineId) {\n setPopoverOpen(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n }\n\n function _handleHover(\n x: number | Date,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: AccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n yScale: ScaleLinear<number, number>,\n ) {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, ${yScale(y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - 5 - yScale(y)}`);\n\n if (_uniqueCallOutID !== circleId) {\n _uniqueCallOutID = circleId;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n } else {\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\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 _handleMouseOut() {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }\n\n function _handleChartMouseLeave() {\n _uniqueCallOutID = null;\n setActivePoint('');\n if (isPopoverOpen) {\n setPopoverOpen(false);\n }\n }\n\n function _handleMultipleLineLegendSelectionAction(selectedLine: LineChartDataWithIndex) {\n const selectedLineIndex = selectedLegendPoints.reduce((acc, line, index) => {\n if (acc > -1 || line.legend !== selectedLine.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedLines: LineChartDataWithIndex[];\n if (selectedLineIndex === -1) {\n selectedLines = [...selectedLegendPoints, selectedLine];\n } else {\n selectedLines = selectedLegendPoints\n .slice(0, selectedLineIndex)\n .concat(selectedLegendPoints.slice(selectedLineIndex + 1));\n }\n\n const areAllLineLegendsSelected = props.data && selectedLines.length === props.data.lineChartData!.length;\n\n if (\n areAllLineLegendsSelected &&\n ((props.colorFillBars && props.colorFillBars.length === selectedColorBarLegend.length) || !props.colorFillBars)\n ) {\n // Clear all legends if all legends including color fill bar legends are selected\n // Or clear all legends if all legends are selected and there are no color fill bars\n _clearMultipleLegendSelections();\n } else if (!selectedLines.length && !selectedColorBarLegend.length) {\n // Clear all legends if no legends including color fill bar legends are selected\n _clearMultipleLegendSelections();\n } else {\n // Otherwise, set state when one or more legends are selected, including color fill bar legends\n setSelectedLegendPoints(selectedLines);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedLines.map((line: LineChartDataWithIndex) => line.legend);\n _handleLegendClick(selectedLine, selectedLegendTitlesToPass);\n }\n\n function _handleMultipleColorFillBarLegendSelectionAction(selectedColorFillBar: ColorFillBarsProps) {\n const selectedColorFillBarIndex = selectedColorBarLegend.reduce((acc, colorFillBar, index) => {\n if (acc > -1 || colorFillBar.legend !== selectedColorFillBar.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedColorFillBars: ColorFillBarsProps[];\n if (selectedColorFillBarIndex === -1) {\n selectedColorFillBars = [...selectedColorBarLegend, selectedColorFillBar];\n } else {\n selectedColorFillBars = selectedColorBarLegend\n .slice(0, selectedColorFillBarIndex)\n .concat(selectedColorBarLegend.slice(selectedColorFillBarIndex + 1));\n }\n\n const areAllColorFillBarLegendsSelected =\n selectedColorFillBars.length === (props.colorFillBars && props.colorFillBars!.length);\n\n if (\n areAllColorFillBarLegendsSelected &&\n ((props.data && props.data.lineChartData!.length === selectedLegendPoints.length) || !props.data)\n ) {\n // Clear all legends if all legends, including line legends, are selected\n // Or clear all legends if all legends are selected and there is no line data\n _clearMultipleLegendSelections();\n } else if (!selectedColorFillBars.length && !selectedLegendPoints.length) {\n // Clear all legends if no legends are selected, including line legends\n _clearMultipleLegendSelections();\n } else {\n // set state when one or more legends are selected, including line legends\n setSelectedColorBarLegend(selectedColorFillBars);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedColorFillBars.map(\n (colorFillBar: ColorFillBarsProps) => colorFillBar.legend,\n );\n _handleLegendClick(selectedColorFillBar, selectedLegendTitlesToPass);\n }\n\n function _clearMultipleLegendSelections() {\n setSelectedColorBarLegend([]);\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n function _legendHighlighted(legend: string) {\n return selectedLegend === legend || (selectedLegend === '' && activeLegend === legend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n function _getColorFillBarOpacity(colorFillBar: ColorFillBarsProps) {\n return colorFillBar.applyPattern ? 1 : 0.4;\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = _points[lineIndex];\n const point = line.data[pointIndex];\n const formattedDate = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n props.data.lineChartData.filter((item: LineChartPoints) => item.data.length).length > 0\n );\n }\n\n const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n\n const isXAxisDateType = getXAxisType(_points);\n let points = _points;\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;\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!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack: true,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={props.data.chartTitle}\n points={points}\n chartType={ChartTypes.LineChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createNumericYAxis}\n getmargins={_getMargins}\n getMinMaxOfYAxis={findNumericMinMaxOfY}\n getGraphData={_initializeLineChartData}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxis}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: ChildProps) => {\n _xAxisScale = props.xScale!;\n _yScalePrimary = props.yScalePrimary!;\n _yScaleSecondary = props.yScaleSecondary;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={props.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n {props.optimizeLargeData ? (\n <rect id={_rectId} width={props.containerWidth} height={props.containerHeight} fill={'transparent'} />\n ) : (\n <></>\n )}\n <g>\n {_renderedColorFillBars}\n {lines}\n </g>\n {eventAnnotationProps && (\n <EventsAnnotation\n {...eventAnnotationProps}\n scale={props.xScale!}\n chartYTop={margins.top! + eventLabelHeight}\n chartYBottom={props.containerHeight! - 35}\n />\n )}\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 },\n);\nLineChart.displayName = 'LineChart';\n"],"names":["React","useLineChartStyles","select","d3Select","pointer","bisector","Legends","line","d3Line","useId","find","CartesianChart","EventsAnnotation","tokens","calloutData","ChartTypes","getXAxisType","XAxisTypes","tooltipOfAxislabels","Points","pointTypes","getTypeOfAxis","getNextColor","getColorFromToken","findNumericMinMaxOfY","createNumericYAxis","domainRangeOfDateForAreaLineVerticalBarChart","domainRangeOfNumericForAreaChart","createStringYAxis","useRtl","formatDate","getCurveFactory","PointSize","bisect","d","x","left","DEFAULT_LINE_STROKE_SIZE","PATH_MULTIPLY_SIZE","_getPointPath","y","w","index","allPointPaths","LineChart","forwardRef","props","forwardedRef","_points","_injectIndexPropertyInLineChartData","data","lineChartData","_calloutPoints","_xAxisScale","_yScalePrimary","_circleId","_lineId","_borderId","_verticalLine","_colorFillBarPatternId","_uniqueCallOutID","_refArray","margins","eventLabelHeight","lines","_renderedColorFillBars","_colorFillBars","useRef","_tooltipId","_rectId","_staticHighlightCircle","_firstRenderOptimization","_emptyChartId","_colorFillBarId","_isRTL","xAxisCalloutAccessibilityData","cartesianChartRef","_yScaleSecondary","eventAnnotationProps","labelHeight","hoverXValue","setHoverXValue","useState","activeLegend","setActiveLegend","YValueHover","setYValueHover","selectedLegend","setSelectedLegend","selectedLegendPoints","setSelectedLegendPoints","selectedColorBarLegend","setSelectedColorBarLegend","isSelectedLegend","setIsSelectedLegend","legendProps","selectedLegends","length","activePoint","setActivePoint","nearestCircleToHighlight","setNearestCircleToHighlight","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","clickPosition","setClickPosition","isPopoverOpen","setPopoverOpen","pointsRef","calloutPointsRef","classes","useEffect","current","height","width","useImperativeHandle","componentRef","chartContainer","_getDomainNRangeValues","points","chartType","isRTL","xAxisType","barWidth","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","isFilterSelectedLegends","allowMultipleShapesForPoints","filteredData","filter","item","includes","legend","map","color","updatePosition","newX","newY","threshold","distance","Math","sqrt","pow","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getMargins","_margins","_initializeLineChartData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","colorFillBars","_createColorFillBars","_createLines","_handleSingleLegendSelectionAction","lineChartItem","_handleLegendClick","_onHoverCardHide","onLegendClick","_createLegends","isLegendMultiSelectEnabled","canSelectMultipleLegends","legendDataItems","point","title","action","_handleMultipleLineLegendSelectionAction","onMouseOutAction","hoverAction","_handleChartMouseLeave","legendShape","shape","Object","keys","colorFillBarsLegendDataItems","colorFillBar","_handleMultipleColorFillBarLegendSelectionAction","opacity","_getColorFillBarOpacity","stripePattern","applyPattern","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onLegendHoverCardLeave","_getBoxWidthOfShape","pointId","pointIndex","isLastPoint","strokeWidth","_getPath","xPos","yPos","pointOftheLine","widthRatio","_getPointFill","lineColor","colorNeutralBackground1","i","linesForLine","bordersForLine","pointsForLine","legendVal","verticaLineHeight","bottom","yScale","useSecondaryYScale","x1","y1","xAxisCalloutData","circleId","isLegendSelected","_legendHighlighted","_noLegendHighlighted","push","circle","id","key","r","cx","cy","fill","tabIndex","undefined","onMouseOver","event","_handleHover","onMouseMove","onMouseOut","_handleMouseOut","stroke","role","aria-label","_getAriaLabel","data-is-focusable","ref","e","_refCallback","onFocus","_handleFocus","onBlur","_getClickHandler","onDataPointClick","gapIndex","gaps","sort","a","b","startIndex","lineCurve","lineOptions","curve","optimizeLargeData","lineId","borderId","lineData","k","Date","getTime","lineBorderWidth","Number","parseFloat","toString","path","strokeLinecap","lineBorderColor","_onMouseOverLargeDataset","bind","onLineClick","visibility","j","gapResult","_checkInGap","isInGap","x2","y2","currentPointHidden","hideNonActiveDots","lastCircleId","hiddenHoverCircleId","lastPointHidden","lastCirlceXCallout","lastCirlceXCalloutAccessibilityData","Fragment","focusable","className","lineBorder","strokeDasharray","strokeDashoffset","g","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","yMinMaxValues","FILL_Y_PADDING","colorFillBarId","_getStripePattern","startX","endX","rect","fillOpacity","endValue","abs","yMinValue","stripePath","pattern","patternUnits","currentGapIndex","endIndex","element","legendTitle","refElement","linenumber","lineHeight","mouseEvent","persist","xOffset","invert","d0","d1","axisType","xPointToHighlight","x0","point0","point1","formattedDate","useUTC","modifiedXVal","found","pointToHighlight","pointToHighlightUpdated","attr","clientX","clientY","values","formattedData","xVal","forEach","obj","func","onClick","selectedLine","selectedLineIndex","reduce","acc","selectedLines","slice","concat","areAllLineLegendsSelected","_clearMultipleLegendSelections","selectedLegendTitlesToPass","selectedColorFillBar","selectedColorFillBarIndex","selectedColorFillBars","areAllColorFillBarLegendsSelected","lineIndex","xValue","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","tickFormat","isXAxisDateType","legendBars","hideLegend","calloutProps","descriptionMessage","getCalloutDescriptionMessage","isCalloutForStack","culture","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","chartTitle","createYAxis","getmargins","getMinMaxOfYAxis","getGraphData","getDomainNRangeValues","onChartMouseLeave","enableFirstRenderOptimization","enablePerfOptimization","children","scale","chartYTop","top","chartYBottom","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AM;QAASyK,OAAO;YAAEjO,SAAS;QAAI;QAAGyD,cAAY;;AAEhF,GACA;AACF5M,UAAUqX,WAAW,GAAG"}
|
|
@@ -4,7 +4,7 @@ import { select as d3Select } from 'd3-selection';
|
|
|
4
4
|
import { Legends } from '../Legends/index';
|
|
5
5
|
import { max as d3Max, min as d3Min } from 'd3-array';
|
|
6
6
|
import { useId } from '@fluentui/react-utilities';
|
|
7
|
-
import { areArraysEqual, find } from '../../utilities/index';
|
|
7
|
+
import { areArraysEqual, createNumericYAxis, createStringYAxis, domainRangeOfDateForScatterChart, domainRangeOfNumericForScatterChart, domainRangeOfXStringAxis, find, findNumericMinMaxOfY } from '../../utilities/index';
|
|
8
8
|
import { CartesianChart } from '../../index';
|
|
9
9
|
import { tokens } from '@fluentui/react-theme';
|
|
10
10
|
import { calloutData, ChartTypes, XAxisTypes, tooltipOfAxislabels, getTypeOfAxis, getNextColor, getColorFromToken, formatDate } from '../../utilities/index';
|
|
@@ -114,6 +114,27 @@ import { calloutData, ChartTypes, XAxisTypes, tooltipOfAxislabels, getTypeOfAxis
|
|
|
114
114
|
setPopoverOpen(true);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
function _getNumericMinMaxOfY(points, yAxisType) {
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
119
|
+
const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType);
|
|
120
|
+
let yPadding = 0;
|
|
121
|
+
yPadding = (endValue - startValue) * 0.1;
|
|
122
|
+
return {
|
|
123
|
+
startValue: startValue - yPadding,
|
|
124
|
+
endValue: endValue + yPadding
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function _getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
128
|
+
let domainNRangeValue;
|
|
129
|
+
if (xAxisType === XAxisTypes.NumericAxis) {
|
|
130
|
+
domainNRangeValue = domainRangeOfNumericForScatterChart(points, margins, width, isRTL);
|
|
131
|
+
} else if (xAxisType === XAxisTypes.DateAxis) {
|
|
132
|
+
domainNRangeValue = domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues);
|
|
133
|
+
} else {
|
|
134
|
+
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
135
|
+
}
|
|
136
|
+
return domainNRangeValue;
|
|
137
|
+
}
|
|
117
138
|
function _getMargins(_margins) {
|
|
118
139
|
margins = _margins;
|
|
119
140
|
}
|
|
@@ -432,6 +453,10 @@ import { calloutData, ChartTypes, XAxisTypes, tooltipOfAxislabels, getTypeOfAxis
|
|
|
432
453
|
getmargins: _getMargins,
|
|
433
454
|
getGraphData: _initializeScatterChartData,
|
|
434
455
|
xAxisType: _xAxisType,
|
|
456
|
+
getMinMaxOfYAxis: _getNumericMinMaxOfY,
|
|
457
|
+
getDomainNRangeValues: _getDomainNRangeValues,
|
|
458
|
+
createYAxis: createNumericYAxis,
|
|
459
|
+
createStringYAxis: createStringYAxis,
|
|
435
460
|
onChartMouseLeave: _handleChartMouseLeave,
|
|
436
461
|
enableFirstRenderOptimization: _firstRenderOptimization,
|
|
437
462
|
datasetForXAxisDomain: _xAxisLabels,
|