@fluentui/react-charts 9.3.24 → 9.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -2
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -0
- package/lib/components/AreaChart/AreaChart.js +3 -3
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +5 -4
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +1 -1
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +2 -2
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +22 -10
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +3 -3
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +5 -5
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +1 -1
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +1 -1
- package/lib/components/PolarChart/PolarChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +7 -7
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +1 -1
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +2 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +8 -5
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +2 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/utilities/utilities.js +3 -2
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.cjs +3 -3
- package/lib-commonjs/components/AreaChart/AreaChart.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs +5 -4
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.cjs +2 -2
- package/lib-commonjs/components/GanttChart/GanttChart.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs +22 -10
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs +5 -5
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.cjs +1 -1
- package/lib-commonjs/components/LineChart/LineChart.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.cjs +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs +7 -7
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs +2 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs +8 -5
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs +2 -2
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs.map +1 -1
- package/lib-commonjs/utilities/utilities.cjs +3 -2
- package/lib-commonjs/utilities/utilities.cjs.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-charts
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Mon, 21 Sep 2026 16:12:52 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.3.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.26)
|
|
8
|
+
|
|
9
|
+
Mon, 21 Sep 2026 16:12:52 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.25..@fluentui/react-charts_v9.3.26)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- feat: add custom callout rendering to GaugeChart ([PR #36730](https://github.com/microsoft/fluentui/pull/36730) by atisjai@microsoft.com)
|
|
15
|
+
- fix(react-charts): prevent prototype pollution in chart data grouping ([PR #36715](https://github.com/microsoft/fluentui/pull/36715) by v-baambati@microsoft.com)
|
|
16
|
+
- fixed prototypr issue in vegalite adapter ([PR #36743](https://github.com/microsoft/fluentui/pull/36743) by v-baambati@microsoft.com)
|
|
17
|
+
- Added test cases prototype pollution fix ([PR #36737](https://github.com/microsoft/fluentui/pull/36737) by v-baambati@microsoft.com)
|
|
18
|
+
- Bump @fluentui/react-button to v9.11.1 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-overflow to v9.9.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
- Bump @fluentui/react-popover to v9.14.8 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
|
+
- Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
23
|
+
- Bump @fluentui/react-tabster to v9.26.18 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
24
|
+
- Bump @fluentui/react-tooltip to v9.10.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
25
|
+
- Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
26
|
+
|
|
27
|
+
## [9.3.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.25)
|
|
28
|
+
|
|
29
|
+
Mon, 24 Aug 2026 16:40:04 GMT
|
|
30
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.24..@fluentui/react-charts_v9.3.25)
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- Bump @fluentui/react-overflow to v9.9.3 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
35
|
+
- Bump @fluentui/react-popover to v9.14.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
36
|
+
|
|
7
37
|
## [9.3.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.24)
|
|
8
38
|
|
|
9
|
-
Tue, 11 Aug 2026 17:
|
|
39
|
+
Tue, 11 Aug 2026 17:20:14 GMT
|
|
10
40
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.23..@fluentui/react-charts_v9.3.24)
|
|
11
41
|
|
|
12
42
|
### Patches
|
package/dist/index.d.cts
CHANGED
|
@@ -1839,6 +1839,37 @@ export declare interface GanttChartStyles extends CartesianChartStyles {
|
|
|
1839
1839
|
|
|
1840
1840
|
export declare const GaugeChart: React_2.FunctionComponent<GaugeChartProps>;
|
|
1841
1841
|
|
|
1842
|
+
/**
|
|
1843
|
+
* Data provided to a custom GaugeChart callout renderer.
|
|
1844
|
+
* {@docCategory GaugeChart}
|
|
1845
|
+
*/
|
|
1846
|
+
export declare interface GaugeChartCalloutData {
|
|
1847
|
+
/**
|
|
1848
|
+
* Legend of the segment or gauge element that opened the callout.
|
|
1849
|
+
*/
|
|
1850
|
+
legend: string;
|
|
1851
|
+
/**
|
|
1852
|
+
* Current value of the gauge.
|
|
1853
|
+
*/
|
|
1854
|
+
chartValue: number;
|
|
1855
|
+
/**
|
|
1856
|
+
* Minimum value of the gauge.
|
|
1857
|
+
*/
|
|
1858
|
+
minValue: number;
|
|
1859
|
+
/**
|
|
1860
|
+
* Maximum value of the gauge.
|
|
1861
|
+
*/
|
|
1862
|
+
maxValue: number;
|
|
1863
|
+
/**
|
|
1864
|
+
* Formatted current value displayed in the default callout.
|
|
1865
|
+
*/
|
|
1866
|
+
chartValueLabel: string;
|
|
1867
|
+
/**
|
|
1868
|
+
* Segment values displayed in the default callout.
|
|
1869
|
+
*/
|
|
1870
|
+
segmentValues: YValueHover[];
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1842
1873
|
/**
|
|
1843
1874
|
* Gauge Chart properties
|
|
1844
1875
|
* {@docCategory GaugeChart}
|
|
@@ -1914,6 +1945,10 @@ export declare interface GaugeChartProps {
|
|
|
1914
1945
|
* Props for the callout in the chart
|
|
1915
1946
|
*/
|
|
1916
1947
|
calloutProps?: Partial<ChartPopoverProps>;
|
|
1948
|
+
/**
|
|
1949
|
+
* Defines a custom callout renderer. The second argument can be used to render the default callout content.
|
|
1950
|
+
*/
|
|
1951
|
+
onRenderCallout?: RenderFunction<GaugeChartCalloutData>;
|
|
1917
1952
|
/**
|
|
1918
1953
|
* Specifies the variant of GaugeChart to be rendered
|
|
1919
1954
|
* @defaultvalue GaugeChartVariant.MultipleSegments
|
package/dist/index.d.ts
CHANGED
|
@@ -1839,6 +1839,37 @@ export declare interface GanttChartStyles extends CartesianChartStyles {
|
|
|
1839
1839
|
|
|
1840
1840
|
export declare const GaugeChart: React_2.FunctionComponent<GaugeChartProps>;
|
|
1841
1841
|
|
|
1842
|
+
/**
|
|
1843
|
+
* Data provided to a custom GaugeChart callout renderer.
|
|
1844
|
+
* {@docCategory GaugeChart}
|
|
1845
|
+
*/
|
|
1846
|
+
export declare interface GaugeChartCalloutData {
|
|
1847
|
+
/**
|
|
1848
|
+
* Legend of the segment or gauge element that opened the callout.
|
|
1849
|
+
*/
|
|
1850
|
+
legend: string;
|
|
1851
|
+
/**
|
|
1852
|
+
* Current value of the gauge.
|
|
1853
|
+
*/
|
|
1854
|
+
chartValue: number;
|
|
1855
|
+
/**
|
|
1856
|
+
* Minimum value of the gauge.
|
|
1857
|
+
*/
|
|
1858
|
+
minValue: number;
|
|
1859
|
+
/**
|
|
1860
|
+
* Maximum value of the gauge.
|
|
1861
|
+
*/
|
|
1862
|
+
maxValue: number;
|
|
1863
|
+
/**
|
|
1864
|
+
* Formatted current value displayed in the default callout.
|
|
1865
|
+
*/
|
|
1866
|
+
chartValueLabel: string;
|
|
1867
|
+
/**
|
|
1868
|
+
* Segment values displayed in the default callout.
|
|
1869
|
+
*/
|
|
1870
|
+
segmentValues: YValueHover[];
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1842
1873
|
/**
|
|
1843
1874
|
* Gauge Chart properties
|
|
1844
1875
|
* {@docCategory GaugeChart}
|
|
@@ -1914,6 +1945,10 @@ export declare interface GaugeChartProps {
|
|
|
1914
1945
|
* Props for the callout in the chart
|
|
1915
1946
|
*/
|
|
1916
1947
|
calloutProps?: Partial<ChartPopoverProps>;
|
|
1948
|
+
/**
|
|
1949
|
+
* Defines a custom callout renderer. The second argument can be used to render the default callout content.
|
|
1950
|
+
*/
|
|
1951
|
+
onRenderCallout?: RenderFunction<GaugeChartCalloutData>;
|
|
1917
1952
|
/**
|
|
1918
1953
|
* Specifies the variant of GaugeChart to be rendered
|
|
1919
1954
|
* @defaultvalue GaugeChartVariant.MultipleSegments
|
|
@@ -262,7 +262,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
262
262
|
opacity.push(singleChartPoint.opacity || 1);
|
|
263
263
|
allChartPoints.push(...singleChartPoint.data);
|
|
264
264
|
});
|
|
265
|
-
const mapOfXvalToListOfDataPoints =
|
|
265
|
+
const mapOfXvalToListOfDataPoints = Object.create(null);
|
|
266
266
|
allChartPoints.forEach((dataPoint)=>{
|
|
267
267
|
const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;
|
|
268
268
|
// map of x value to the list of data points which share the same x value .
|
|
@@ -362,7 +362,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
362
362
|
function _createDatasetForXCoordinateWithMultipleYValues(allChartPoints) {
|
|
363
363
|
const dataSet = [];
|
|
364
364
|
// Group data points by x-axis value
|
|
365
|
-
const groupedData =
|
|
365
|
+
const groupedData = Object.create(null);
|
|
366
366
|
allChartPoints.forEach((dataPoint)=>{
|
|
367
367
|
const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;
|
|
368
368
|
if (!groupedData[xValue]) {
|
|
@@ -810,7 +810,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
810
810
|
return false;
|
|
811
811
|
}
|
|
812
812
|
for (const item of lineChartData){
|
|
813
|
-
const xValueMap =
|
|
813
|
+
const xValueMap = Object.create(null);
|
|
814
814
|
for (const point of item.data){
|
|
815
815
|
const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;
|
|
816
816
|
if (!xValueMap[xValue]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AreaChart/AreaChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { pointer } from 'd3-selection';\nimport { tokens } from '@fluentui/react-theme';\nimport { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';\nimport type {\n AccessibilityProps,\n CustomizedCalloutData,\n AreaChartProps,\n LineChartDataPoint,\n LineChartPoints,\n ChildProps,\n Margins,\n YValueHover,\n ChartPopoverProps,\n} from '../../index';\nimport { CartesianChart } from '../../index';\nimport type { IDomainNRange, YAxisType } from '../../utilities/index';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n getSecureProps,\n areArraysEqual,\n getCurveFactory,\n findNumericMinMaxOfY,\n createNumericYAxis,\n domainRangeOfNumericForAreaLineScatterCharts,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n createStringYAxis,\n findCalloutPoints,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { Legend } from '../Legends/index';\nimport { Legends } from '../Legends/index';\nimport type { ScaleLinear } from 'd3-scale';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { useImageExport } from '../../utilities/hooks';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nenum InterceptVisibility {\n show = 'visibility',\n hide = 'hidden',\n}\n\nexport interface AreaChartAreaPoint {\n xVal: string | number;\n values: AreaChartDataSetPoint;\n}\nexport interface AreaChartDataSetPoint {\n [key: string]: number | string | number[];\n}\nexport interface DPointType {\n values: { 0: number; 1: number; data: {} };\n xVal: number | Date;\n}\nexport interface MapXToDataSet {\n [key: string]: LineChartDataPoint[];\n [key: number]: LineChartDataPoint[];\n}\n\ninterface ILineChartDataPointWithLegend extends LineChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n}\n\ntype ILineChartPointsWithoutData = Omit<LineChartPoints, 'data'>;\ninterface LineChartPointsWithLegend extends ILineChartPointsWithoutData {\n data: ILineChartDataPointWithLegend[];\n}\n\n//by default d3-shape 3.2.0 limits the< path> data point precision to 3 digits(d3/d3-path#10)\n\nexport const AreaChart: React.FunctionComponent<AreaChartProps> = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (props, forwardedRef) => {\n const _uniqueIdForGraph: string = useId('areaChart_');\n const _verticalLineId: string = useId('verticalLine_');\n const _circleId: string = useId('circle');\n const _rectId: string = useId('rectangle');\n //enableComputationOptimization is used for optimized code to group data points by x value\n //from O(n^2) to O(n) using a map.\n const _enableComputationOptimization: boolean = true;\n const _firstRenderOptimization: boolean = true;\n const _emptyChartId: string = useId('_AreaChart_empty');\n let _containsSecondaryYAxis = false;\n const _hasMissingXValues = _containsMissingXValues();\n const _hasDuplicateXValues = _xCoordinateContainsMultipleY();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any;\n let _createSet: (data: LineChartPoints[]) => {\n colors: string[];\n opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n calloutPoints: any;\n };\n let _colors: string[];\n let _opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _data: any;\n let _chart: JSXElement[];\n let _margins: Margins;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisRectScale: any;\n // determines if the given area chart has multiple stacked bar charts\n let _isMultiStackChart: boolean;\n const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [hoverXValue, setHoverXValue] = React.useState<string | number | undefined | null>('');\n\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [lineXValue, setLineXValue] = React.useState<number>(0);\n const [displayOfLine, setDisplayOfLine] = React.useState<InterceptVisibility>(InterceptVisibility.hide);\n const [isCircleClicked, setIsCircleClicked] = React.useState<boolean>(false);\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<number | string | Date | null>(null);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [xAxisCalloutAccessibilityData, setXAxisCalloutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<AreaChartProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n function _getMinMaxOfYAxis(points: LineChartPoints[], yAxisType: YAxisType, useSecondaryYScale: boolean) {\n return findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale);\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 ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(\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 _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _onRectMouseMove(mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>) {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n // This will get the value of the X when mouse is on the chart\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n const xOffset = _xAxisRectScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![0].data, xOffset);\n const d0 = lineChartData![0].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![0].data[i] as LineChartDataPoint;\n let pointToHighlight: string | Date | number | null = null;\n let index: null | number = null;\n const axisType =\n lineChartData![0].data.length > 0 ? (getTypeOfAxis(lineChartData![0].data[0].x, true) as XAxisTypes) : null;\n if (d0 === undefined && d1 !== undefined) {\n pointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n pointToHighlight = d0.x;\n index = i - 1;\n } else {\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 pointToHighlight = 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 pointToHighlight = 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 // eslint-disable-next-line @typescript-eslint/no-shadow\n const { xAxisCalloutData, xAxisCalloutAccessibilityData } = lineChartData![0].data[index as number];\n const formattedDate =\n pointToHighlight instanceof Date\n ? formatDateToLocaleString(pointToHighlight, props.culture, props.useUTC as boolean)\n : pointToHighlight;\n const found = findCalloutPoints(_calloutPoints, pointToHighlight);\n\n const _nearestCircleToHighlight =\n axisType === XAxisTypes.DateAxis ? (pointToHighlight as Date).getTime() : pointToHighlight;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n const filteredValues = _getFilteredLegendValues(found.values);\n setNearestCircleToHighlight(_nearestCircleToHighlight);\n setLineXValue(_xAxisRectScale(pointToHighlight));\n setDisplayOfLine(InterceptVisibility.show);\n setIsCircleClicked(false);\n setStackCalloutProps({ ...found, values: filteredValues });\n setYValueHover(filteredValues);\n setDataPointCalloutProps({ ...found, values: filteredValues });\n setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);\n setXAxisCalloutAccessibilityData(xAxisCalloutAccessibilityData);\n setActivePoint('');\n } else {\n setPopoverOpen(false);\n setNearestCircleToHighlight(nearestCircleToHighlight);\n setDisplayOfLine(InterceptVisibility.hide);\n setIsCircleClicked(false);\n }\n }\n /**\n * just cleaning up the state which we have set in the mouse move event\n */\n function _onRectMouseOut() {\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 _handleChartMouseLeave() {\n setPopoverOpen(false);\n setNearestCircleToHighlight(null);\n setLineXValue(0);\n setDisplayOfLine(InterceptVisibility.hide);\n setIsCircleClicked(false);\n setStackCalloutProps(undefined);\n setDataPointCalloutProps(undefined);\n setHoverXValue(undefined);\n setYValueHover([]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _getDataPoints(keys: string[], dataSet: any) {\n const renderPoints: Array<AreaChartDataSetPoint[]> = [];\n let maxOfYVal = 0;\n\n if (_shouldFillToZeroY()) {\n keys.forEach((key, index) => {\n const currentLayer: AreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dataSet.forEach((d: any) => {\n currentLayer.push({\n values: [0, d[key]], // Start from zero for \"tozeroy\" mode\n xVal: d.xVal,\n });\n if (d[key] > maxOfYVal) {\n maxOfYVal = d[key];\n }\n });\n renderPoints.push(currentLayer);\n });\n } else {\n const dataValues = d3Stack().keys(keys)(dataSet);\n maxOfYVal = d3Max(dataValues[dataValues.length - 1], dp => dp[1])!;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dataValues.forEach((layer: any) => {\n const currentLayer: AreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n layer.forEach((d: any) => {\n currentLayer.push({\n values: d,\n xVal: d.data.xVal,\n });\n });\n renderPoints.push(currentLayer);\n });\n }\n\n _isMultiStackChart = !!(props.legendProps?.selectedLegends\n ? renderPoints?.length >= 1\n : renderPoints?.length > 1);\n return {\n renderData: renderPoints,\n // The maxOfYVal prop is only required for the primary y-axis. When the data includes\n // a secondary y-axis, the mode defaults to tozeroy, so maxOfYVal should be calculated using\n // only the data points associated with the primary y-axis.\n maxOfYVal: _containsSecondaryYAxis ? findNumericMinMaxOfY(props.data.lineChartData!).endValue : maxOfYVal,\n };\n }\n\n function _createDataSet(points: LineChartPoints[]) {\n if (props.enablePerfOptimization && _enableComputationOptimization && !_hasDuplicateXValues) {\n const allChartPoints: LineChartDataPoint[] = [];\n const dataSet: AreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: LineChartPoints) => {\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...(singleChartPoint.data as LineChartDataPoint[]));\n });\n\n const mapOfXvalToListOfDataPoints: MapXToDataSet = {};\n allChartPoints.forEach((dataPoint: LineChartDataPoint) => {\n const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;\n // map of x value to the list of data points which share the same x value .\n if (mapOfXvalToListOfDataPoints[xValue]) {\n mapOfXvalToListOfDataPoints[xValue].push(dataPoint);\n } else {\n mapOfXvalToListOfDataPoints[xValue] = [dataPoint];\n }\n });\n\n Object.keys(mapOfXvalToListOfDataPoints).forEach((key: number | string) => {\n const value: LineChartDataPoint[] = mapOfXvalToListOfDataPoints[key];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n value.forEach((singleDataPoint: LineChartDataPoint, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n });\n\n // get keys from dataset, used to render data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n const keys: string[] = [];\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n\n // Data used to draw graph\n const data = _getDataPoints(keys, dataSet);\n\n return {\n colors,\n opacity,\n keys,\n data,\n calloutPoints,\n };\n } else {\n const allChartPoints: LineChartDataPoint[] = [];\n const dataSet: AreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n let data = {};\n const keys: string[] = [];\n let index = 0;\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: LineChartPoints) => {\n // if legend is not populated, then assign a legend\n if (_hasDuplicateXValues && !singleChartPoint.legend) {\n singleChartPoint.legend = `chart${index}`;\n ++index;\n }\n singleChartPoint.data.forEach((point: ILineChartDataPointWithLegend) => {\n point.legend = singleChartPoint.legend;\n });\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...(singleChartPoint.data as LineChartDataPoint[]));\n });\n\n if (!_hasDuplicateXValues) {\n let tempArr = allChartPoints;\n while (tempArr.length) {\n const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n const filteredChartPoints: LineChartDataPoint[] = tempArr.filter(\n (point: LineChartDataPoint) =>\n (point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck,\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n filteredChartPoints.forEach((singleDataPoint: LineChartDataPoint, id: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${id}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n // removing compared objects from array\n const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n tempArr = tempArr.filter(\n (point: LineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val,\n );\n }\n\n // get keys from dataset, used to create stacked data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n // Data used to draw graph\n data = _getDataPoints(keys, dataSet);\n } else {\n const datasetForDuplicateValues = _createDatasetForXCoordinateWithMultipleYValues(allChartPoints);\n data = _getDataPoints(datasetForDuplicateValues.keys, datasetForDuplicateValues.filteredDataSet);\n }\n\n return {\n colors,\n opacity,\n keys,\n data,\n calloutPoints,\n };\n }\n }\n\n function _createDatasetForXCoordinateWithMultipleYValues(allChartPoints: LineChartDataPoint[]) {\n const dataSet: AreaChartDataSetPoint[] = [];\n\n // Group data points by x-axis value\n const groupedData: Record<string | number, ILineChartDataPointWithLegend[]> = {};\n allChartPoints.forEach((dataPoint: ILineChartDataPointWithLegend) => {\n const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;\n if (!groupedData[xValue]) {\n groupedData[xValue] = [];\n }\n groupedData[xValue].push(dataPoint);\n });\n\n // Aggregate data points for each x-axis value\n Object.keys(groupedData).forEach(xValue => {\n const dataPoints = groupedData[xValue];\n dataPoints.forEach((dataPoint, id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = { xVal: dataPoints[0].x };\n\n const key = dataPoint.legend ? dataPoint.legend : `chart${id}`;\n singleDataset[key] = dataPoint.y;\n dataSet.push(singleDataset);\n });\n });\n\n // get all unique keys from each array within the dataSet\n const allLegends: string[] = [];\n dataSet.forEach(item => {\n Object.keys(item).forEach(key => {\n if (key !== 'xVal' && !allLegends.includes(key)) {\n allLegends.push(key);\n }\n });\n });\n\n dataSet.forEach(item => {\n allLegends.forEach(legend => {\n if (!item[legend]) {\n item[legend] = 0; // Fill with 0 if the legend is missing\n }\n });\n });\n\n // exclude all items within dataset having all legend values 0\n const filteredDataSet = dataSet.filter(item => {\n return allLegends.some(legend => item[legend] !== 0);\n });\n\n const keys = Array.from(\n new Set(filteredDataSet.flatMap(item => Object.keys(item).filter(key => key !== 'xVal'))),\n );\n\n return {\n keys,\n filteredDataSet,\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 _getGraphData(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xAxis: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxis: any,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) {\n _chart = _drawGraph(containerHeight, xAxis, yAxis, yScaleSecondary, xElement!);\n }\n\n function _onLegendHover(legend: string): void {\n setActiveLegend(legend);\n }\n\n function _onLegendLeave(): void {\n setActiveLegend(undefined);\n }\n\n function _getLegendData(points: LineChartPoints[]): JSXElement {\n const data = points;\n const actions: Legend[] = [];\n\n data.forEach((singleChartData: LineChartPoints) => {\n const color: string = singleChartData.color!;\n const checkSimilarLegends = actions.filter(\n (leg: Legend) => leg.title === singleChartData.legend && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: Legend = {\n title: singleChartData.legend,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(singleChartData.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n return (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _onDataPointClick(func: (() => void) | undefined) {\n if (func) {\n func();\n }\n setIsCircleClicked(true);\n }\n\n function _getOpacity(legend: string): number {\n if (!_isMultiStackChart) {\n return 0.7;\n } else {\n const opacity = _legendHighlighted(legend) || _noLegendHighlighted() ? 0.7 : 0.1;\n return opacity;\n }\n }\n\n function _getLineOpacity(legend: string): number {\n if (!_isMultiStackChart) {\n return 1;\n } else {\n let opacity = 0.3;\n if (isPopoverOpen) {\n opacity = 1;\n }\n if (!_noLegendHighlighted()) {\n opacity = _legendHighlighted(legend) ? 0 : 0.1;\n }\n return opacity;\n }\n }\n\n function _updateCircleFillColor(xDataPoint: number | Date, lineColor: string, circleId: string): string {\n let fillColor = lineColor;\n if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {\n if (!isCircleClicked) {\n fillColor = tokens.colorNeutralBackground1;\n }\n }\n\n return fillColor;\n }\n\n function _drawGraph(\n containerHeight: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n xElement: SVGElement,\n ): JSXElement[] {\n const points = _addDefaultColors(props.data.lineChartData);\n const { pointOptions, pointLineOptions } = props.data;\n\n const graph: JSXElement[] = [];\n let lineColor: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _data.forEach((singleStackedData: Array<any>, index: number) => {\n const yScale = points[index]?.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n const curveFactory = getCurveFactory(points[index]?.lineOptions?.curve, d3CurveBasis);\n const area = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((d: any) => yScale(d.values[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((d: any) => yScale(d.values[1]))\n .curve(curveFactory);\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d.values[1]))\n .curve(curveFactory);\n const layerOpacity = _shouldFillToZeroY() ? 0.8 : _opacity[index];\n graph.push(\n <React.Fragment key={`${index}-graph-${_uniqueIdForGraph}`}>\n {props.enableGradient && (\n <defs>\n <linearGradient id={`gradient_${index}`} x1=\"0%\" x2=\"0%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0\" stopColor={_colors[index]} />\n <stop offset=\"100%\" stopColor=\"transparent\" />\n </linearGradient>\n </defs>\n )}\n <path\n id={`${index}-line-${_uniqueIdForGraph}`}\n d={line(singleStackedData)!}\n fill={'transparent'}\n strokeWidth={points[index]?.lineOptions?.strokeWidth ?? 3}\n stroke={_colors[index]}\n opacity={_getLineOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n strokeDasharray={points[index]?.lineOptions?.strokeDasharray}\n strokeDashoffset={points[index]?.lineOptions?.strokeDashoffset}\n strokeLinecap={points[index]?.lineOptions?.strokeLinecap}\n />\n {singleStackedData.length === 1 ? (\n <circle\n id={`${index}-graph-${_uniqueIdForGraph}`}\n cx={xScale(singleStackedData[0].xVal)}\n cy={yScale(singleStackedData[0].values[1])}\n r={6}\n stroke={_colors[index]}\n strokeWidth={3}\n fill={_colors[index]}\n opacity={layerOpacity}\n fillOpacity={_getOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onFocus={event => _handleFocus(event, index, 0, `${_circleId}_${index}`)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n />\n ) : (\n <path\n id={`${index}-graph-${_uniqueIdForGraph}`}\n d={area(singleStackedData)!}\n fill={props.enableGradient ? `url(#gradient_${index})` : _colors[index]}\n opacity={layerOpacity}\n fillOpacity={_getOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n {...(props.optimizeLargeData && {\n tabIndex: _legendHighlighted(points[index]!.legend) || _noLegendHighlighted() ? 0 : undefined,\n role: 'img',\n 'aria-label': `${points[index].legend}, series ${index + 1} of ${points.length} with ${\n points[index].data.length\n } data points.`,\n })}\n />\n )}\n </React.Fragment>,\n );\n });\n\n const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _data.forEach((singleStackedData: Array<any>, index: number) => {\n if (points.length === index) {\n return;\n }\n const yScale = points[index]?.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n if (!props.optimizeLargeData || singleStackedData.length === 1) {\n // Render circles for all data points\n graph.push(\n <g\n key={`${index}-dots-${_uniqueIdForGraph}`}\n clipPath=\"url(#clip)\"\n role=\"region\"\n aria-label={`${points[index].legend}, series ${index + 1} of ${points.length} with ${\n points[index].data.length\n } data points.`}\n >\n {singleStackedData.map((singlePoint: DPointType, pointIndex: number) => {\n const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n lineColor = points[index]!.color!;\n const legend = points[index]!.legend;\n return (\n <circle\n key={circleId}\n id={circleId}\n tabIndex={_legendHighlighted(points[index]!.legend) || _noLegendHighlighted() ? 0 : undefined}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={_updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n {..._getOnClickHandler(points, index, pointIndex)}\n onFocus={event => _handleFocus(event, index, pointIndex, circleId)}\n onBlur={_handleBlur}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n role=\"img\"\n aria-label={\n (!_hasDuplicateXValues && !_hasMissingXValues && _getAriaLabel(index, pointIndex)) || undefined\n }\n />\n );\n })}\n </g>,\n );\n } else {\n // Render circles for data points close to the mouse pointer only\n singleStackedData.forEach((singlePoint: DPointType, pointIndex: number) => {\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n if (nearestCircleToHighlight === xDataPoint) {\n const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;\n lineColor = points[index]!.color!;\n const legend = points[index]!.legend;\n graph.push(\n <circle\n key={circleId}\n id={circleId}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={_updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n onFocus={event => _handleFocus(event, index, pointIndex, circleId)}\n {..._getOnClickHandler(points, index, pointIndex)}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n />,\n );\n }\n });\n }\n });\n graph.push(\n <line\n id={_verticalLineId}\n key={_verticalLineId}\n x1={lineXValue}\n y1={0}\n x2={lineXValue}\n y2={containerHeight}\n strokeWidth={1}\n strokeDasharray={5.5}\n stroke={lineColor!}\n opacity={0.5}\n visibility={displayOfLine}\n {...getSecureProps(pointLineOptions)}\n />,\n );\n return graph;\n }\n\n function _getOnClickHandler(points: LineChartPoints[], index: number, pointIndex: number) {\n if (!_hasDuplicateXValues && !_hasMissingXValues) {\n return {\n onClick: () => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!),\n };\n }\n return {};\n }\n\n function _getCircleRadius(xDataPoint: number, circleRadius: number, circleId: string, legend: string): number {\n // Show the circle if no legends are selected or if the point's legend is in the selected legends\n if (!_noLegendHighlighted() && !_legendHighlighted(legend)) {\n return 0;\n }\n\n if (isCircleClicked && nearestCircleToHighlight === xDataPoint) {\n return 1;\n } else if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {\n return circleRadius;\n } else {\n return 0;\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _addDefaultColors(lineChartData?: LineChartPoints[]): LineChartPoints[] {\n if (_hasMissingXValues) {\n // get union of all x values\n const allXValues: Set<string | number> = new Set();\n lineChartData &&\n lineChartData.forEach((line: LineChartPoints) => {\n line.data.forEach((point: LineChartDataPoint) => {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n allXValues.add(xValue);\n });\n });\n lineChartData &&\n lineChartData.forEach((line: LineChartPointsWithLegend) => {\n allXValues.forEach((xValue: string | number) => {\n const point = line.data.find((item: ILineChartDataPointWithLegend) => {\n return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;\n });\n if (!point) {\n line.data.push({\n x: typeof xValue === 'string' ? new Date(xValue) : xValue,\n y: 0,\n legend: line.legend,\n });\n }\n });\n // sort the data points by x value\n line.data.sort((a: LineChartDataPoint, b: LineChartDataPoint) => {\n const xA = a.x instanceof Date ? a.x.getTime() : a.x;\n const xB = b.x instanceof Date ? b.x.getTime() : b.x;\n return xA < xB ? -1 : xA > xB ? 1 : 0;\n });\n });\n }\n return lineChartData\n ? lineChartData.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n\n return { ...item, color };\n })\n : [];\n }\n\n function _handleFocus(\n event: React.FocusEvent<SVGCircleElement, Element>,\n lineIndex: number,\n pointIndex: number,\n circleId: string,\n ) {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGCircleElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n\n const { x, y, xAxisCalloutData } = props.data.lineChartData![lineIndex].data[pointIndex];\n const formattedDate = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC as boolean) : x;\n const found = findCalloutPoints(_calloutPoints, x);\n if (found) {\n // Show details in the callout for the focused point only\n found.values = found.values.filter((e: { y: number }) => e.y === y);\n const filteredValues = _getFilteredLegendValues(found.values);\n\n setPopoverOpen(true);\n setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);\n setYValueHover(filteredValues!);\n setStackCalloutProps({ ...found, values: filteredValues });\n setDataPointCalloutProps({ ...found, values: filteredValues });\n setActivePoint(circleId);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _getFilteredLegendValues(values: any) {\n return !_noLegendHighlighted()\n ? values.filter((value: { legend: string }) => _legendHighlighted(value.legend))\n : values;\n }\n\n function _handleBlur() {\n setPopoverOpen(false);\n setHoverXValue(undefined);\n setYValueHover([]);\n setStackCalloutProps(undefined);\n setDataPointCalloutProps(undefined);\n setActivePoint('');\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = props.data.lineChartData![lineIndex];\n const point = line.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC as boolean) : 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 (\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props.data.lineChartData.filter((item: { data: string | any[] }) => item.data.length === 0).length === 0\n )\n // if all the data sets have no data\n // filtering all items which have no data and checking if the length of the filtered array is 0\n // which means chart is not empty\n );\n }\n\n function _getChartTitle(): string {\n const { chartTitle, lineChartData } = props.data;\n return (chartTitle ? `${chartTitle}. ` : '') + `Area chart with ${lineChartData?.length || 0} data series. `;\n }\n\n function _xCoordinateContainsMultipleY(): boolean {\n const { lineChartData } = props.data;\n if (!lineChartData) {\n return false;\n }\n for (const item of lineChartData) {\n const xValueMap: Record<string, number[]> = {};\n for (const point of item.data) {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n if (!xValueMap[xValue]) {\n xValueMap[xValue] = [];\n }\n xValueMap[xValue].push(point.y);\n if (xValueMap[xValue].length > 1) {\n return true;\n }\n }\n }\n return false;\n }\n\n function _containsMissingXValues(): boolean {\n const { lineChartData } = props.data;\n if (!lineChartData) {\n return false;\n }\n const allXValues: Set<string | number> = new Set();\n lineChartData.forEach((line: LineChartPoints) => {\n line.data.forEach((point: LineChartDataPoint) => {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n allXValues.add(xValue);\n });\n });\n // for all x values, check if the x value is present in all series\n let hasMissingValues = false;\n lineChartData.forEach((line: LineChartPoints) => {\n allXValues.forEach((xValue: string | number) => {\n const point = line.data.find((item: LineChartDataPoint) => {\n return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;\n });\n if (!point) {\n hasMissingValues = true;\n }\n });\n });\n return hasMissingValues;\n }\n\n function _shouldFillToZeroY() {\n return props.mode === 'tozeroy' || _containsSecondaryYAxis;\n }\n\n if (!_isChartEmpty()) {\n const { lineChartData } = props.data;\n const points = _addDefaultColors(lineChartData);\n _containsSecondaryYAxis = !!props.secondaryYScaleOptions && points.some(point => point.useSecondaryYScale);\n _createSet = _createDataSet;\n const { colors, opacity, data, calloutPoints } = _createSet(points);\n _calloutPoints = calloutPoints;\n const isXAxisDateType = getXAxisType(points);\n _colors = colors;\n _opacity = opacity;\n _data = data.renderData;\n const legends: JSXElement = _getLegendData(points);\n\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const calloutProps: ChartPopoverProps = {\n YValueHover: YValueHover!,\n hoverXValue: hoverXValue!,\n xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition,\n isPopoverOpen: isPopoverOpen && !_hasDuplicateXValues && !_hasMissingXValues,\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCalloutForStack: true,\n };\n return (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={points}\n chartType={ChartTypes.AreaChart}\n calloutProps={calloutProps}\n legendBars={legends}\n createYAxis={createNumericYAxis}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n tickParams={tickParams}\n maxOfYVal={data.maxOfYVal}\n getGraphData={_getGraphData}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxis}\n getmargins={_getMargins}\n onChartMouseLeave={_handleChartMouseLeave}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n _xAxisRectScale = props.xScale;\n const ticks = _xAxisRectScale.ticks();\n const width1 = _xAxisRectScale(ticks[ticks.length - 1]);\n const rectHeight = props.containerHeight! - _margins.top!;\n return (\n <>\n <g>\n <rect\n id={_rectId}\n width={width1}\n height={rectHeight}\n fill={'transparent'}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n />\n </g>\n <g>{_chart}</g>\n </>\n );\n }}\n />\n );\n }\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\nAreaChart.displayName = 'AreaChart';\n"],"names":["React","max","d3Max","bisector","pointer","tokens","area","d3Area","stack","d3Stack","curveMonotoneX","d3CurveBasis","line","d3Line","CartesianChart","calloutData","getXAxisType","ChartTypes","XAxisTypes","getTypeOfAxis","getNextColor","getColorFromToken","getSecureProps","areArraysEqual","getCurveFactory","findNumericMinMaxOfY","createNumericYAxis","domainRangeOfNumericForAreaLineScatterCharts","domainRangeOfDateForAreaLineScatterVerticalBarCharts","createStringYAxis","findCalloutPoints","useId","Legends","formatDateToLocaleString","useImageExport","bisect","d","x","left","InterceptVisibility","AreaChart","forwardRef","props","forwardedRef","_uniqueIdForGraph","_verticalLineId","_circleId","_rectId","_enableComputationOptimization","_firstRenderOptimization","_emptyChartId","_containsSecondaryYAxis","_hasMissingXValues","_containsMissingXValues","_hasDuplicateXValues","_xCoordinateContainsMultipleY","_calloutPoints","_createSet","_colors","_opacity","_data","_chart","_margins","_xAxisRectScale","_isMultiStackChart","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","selectedLegends","setSelectedLegends","useState","legendProps","activeLegend","setActiveLegend","undefined","hoverXValue","setHoverXValue","YValueHover","setYValueHover","lineXValue","setLineXValue","displayOfLine","setDisplayOfLine","isCircleClicked","setIsCircleClicked","nearestCircleToHighlight","setNearestCircleToHighlight","activePoint","setActivePoint","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","xAxisCalloutAccessibilityData","setXAxisCalloutAccessibilityData","clickPosition","setClickPosition","y","isPopoverOpen","setPopoverOpen","prevPropsRef","useRef","useEffect","current","prevProps","_getMinMaxOfYAxis","points","yAxisType","useSecondaryYScale","_getDomainNRangeValues","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","_getMargins","_onRectMouseMove","mouseEvent","persist","data","lineChartData","_updatePosition","clientX","clientY","xOffset","invert","document","getElementById","i","d0","d1","pointToHighlight","index","axisType","length","x0","point0","point1","Date","getTime","Math","abs","xAxisCalloutData","formattedDate","culture","useUTC","found","_nearestCircleToHighlight","filteredValues","_getFilteredLegendValues","values","_onRectMouseOut","newX","newY","threshold","distance","sqrt","pow","_handleChartMouseLeave","_getDataPoints","keys","dataSet","renderPoints","maxOfYVal","_shouldFillToZeroY","forEach","key","currentLayer","push","xVal","dataValues","dp","layer","renderData","endValue","_createDataSet","enablePerfOptimization","allChartPoints","colors","opacity","calloutPoints","singleChartPoint","color","mapOfXvalToListOfDataPoints","dataPoint","xValue","toLocaleString","Object","value","singleDataset","singleDataPoint","keysLength","keyVal","legend","point","tempArr","valToCheck","filteredChartPoints","filter","id","val","datasetForDuplicateValues","_createDatasetForXCoordinateWithMultipleYValues","filteredDataSet","groupedData","dataPoints","allLegends","item","includes","some","Array","from","Set","flatMap","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getGraphData","xAxis","yAxis","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","_drawGraph","_onLegendHover","_onLegendLeave","_getLegendData","actions","singleChartData","checkSimilarLegends","leg","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_onDataPointClick","func","_getOpacity","_legendHighlighted","_noLegendHighlighted","_getLineOpacity","_updateCircleFillColor","xDataPoint","lineColor","circleId","fillColor","colorNeutralBackground1","xScale","yScalePrimary","_addDefaultColors","pointOptions","pointLineOptions","graph","singleStackedData","yScale","curveFactory","lineOptions","curve","y0","y1","layerOpacity","Fragment","enableGradient","defs","linearGradient","x1","x2","y2","stop","offset","stopColor","path","fill","strokeWidth","stroke","onMouseMove","onMouseOut","onMouseOver","strokeDasharray","strokeDashoffset","strokeLinecap","circle","cx","cy","r","fillOpacity","onFocus","_handleFocus","optimizeLargeData","tabIndex","role","circleRadius","Number","g","clipPath","aria-label","map","singlePoint","pointIndex","_getOnClickHandler","onBlur","_handleBlur","_getCircleRadius","_getAriaLabel","visibility","onClick","onDataPointClick","_getHighlightedLegend","allXValues","add","find","sort","a","b","xA","xB","lineIndex","targetRect","target","getBoundingClientRect","top","height","e","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","xValueMap","hasMissingValues","mode","secondaryYScaleOptions","isXAxisDateType","tickParams","tickFormat","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCalloutForStack","legendBars","createYAxis","getGraphData","getDomainNRangeValues","getmargins","onChartMouseLeave","getMinMaxOfYAxis","enableFirstRenderOptimization","children","ticks","width1","rectHeight","rect","div","style","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAClD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,QAAQC,MAAM,EAAEC,SAASC,OAAO,EAAEC,kBAAkBC,YAAY,EAAEC,QAAQC,MAAM,QAAQ,WAAW;AAY5G,SAASC,cAAc,QAAQ,iBAAc;AAE7C,SACEC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,4CAA4C,EAC5CC,oDAAoD,EACpDC,iBAAiB,EACjBC,iBAAiB,QACZ,2BAAwB;AAC/B,SAASC,KAAK,QAAQ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K,SAASwR,GAAG;gBACxD,qBACE,wDACE,oBAAC3B,yBACC,oBAAC+D;oBACCxK,IAAInK;oBACJkE,OAAOuQ;oBACPjC,QAAQkC;oBACRnF,MAAM;oBACNG,aAAa5C,CAAAA,QAAS9H,iBAAiB8H;oBACvC6C,YAAYxI;oBACZyI,aAAa9C,CAAAA,QAAS9H,iBAAiB8H;mCAG3C,oBAAC8D,WAAG9P;YAGV;;IAGN;IACA,qBACE,oBAAC8T;QAAIzK,IAAIhK;QAAesQ,MAAM;QAASoE,OAAO;YAAE9L,SAAS;QAAI;QAAG+H,cAAY;;AAEhF,GACA;AACFrR,UAAUqV,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/AreaChart/AreaChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { pointer } from 'd3-selection';\nimport { tokens } from '@fluentui/react-theme';\nimport { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';\nimport type {\n AccessibilityProps,\n CustomizedCalloutData,\n AreaChartProps,\n LineChartDataPoint,\n LineChartPoints,\n ChildProps,\n Margins,\n YValueHover,\n ChartPopoverProps,\n} from '../../index';\nimport { CartesianChart } from '../../index';\nimport type { IDomainNRange, YAxisType } from '../../utilities/index';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n getSecureProps,\n areArraysEqual,\n getCurveFactory,\n findNumericMinMaxOfY,\n createNumericYAxis,\n domainRangeOfNumericForAreaLineScatterCharts,\n domainRangeOfDateForAreaLineScatterVerticalBarCharts,\n createStringYAxis,\n findCalloutPoints,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { Legend } from '../Legends/index';\nimport { Legends } from '../Legends/index';\nimport type { ScaleLinear } from 'd3-scale';\nimport { formatDateToLocaleString } from '@fluentui/chart-utilities';\nimport { useImageExport } from '../../utilities/hooks';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nenum InterceptVisibility {\n show = 'visibility',\n hide = 'hidden',\n}\n\nexport interface AreaChartAreaPoint {\n xVal: string | number;\n values: AreaChartDataSetPoint;\n}\nexport interface AreaChartDataSetPoint {\n [key: string]: number | string | number[];\n}\nexport interface DPointType {\n values: { 0: number; 1: number; data: {} };\n xVal: number | Date;\n}\nexport interface MapXToDataSet {\n [key: string]: LineChartDataPoint[];\n [key: number]: LineChartDataPoint[];\n}\n\ninterface ILineChartDataPointWithLegend extends LineChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n}\n\ntype ILineChartPointsWithoutData = Omit<LineChartPoints, 'data'>;\ninterface LineChartPointsWithLegend extends ILineChartPointsWithoutData {\n data: ILineChartDataPointWithLegend[];\n}\n\n//by default d3-shape 3.2.0 limits the< path> data point precision to 3 digits(d3/d3-path#10)\n\nexport const AreaChart: React.FunctionComponent<AreaChartProps> = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (props, forwardedRef) => {\n const _uniqueIdForGraph: string = useId('areaChart_');\n const _verticalLineId: string = useId('verticalLine_');\n const _circleId: string = useId('circle');\n const _rectId: string = useId('rectangle');\n //enableComputationOptimization is used for optimized code to group data points by x value\n //from O(n^2) to O(n) using a map.\n const _enableComputationOptimization: boolean = true;\n const _firstRenderOptimization: boolean = true;\n const _emptyChartId: string = useId('_AreaChart_empty');\n let _containsSecondaryYAxis = false;\n const _hasMissingXValues = _containsMissingXValues();\n const _hasDuplicateXValues = _xCoordinateContainsMultipleY();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any;\n let _createSet: (data: LineChartPoints[]) => {\n colors: string[];\n opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n calloutPoints: any;\n };\n let _colors: string[];\n let _opacity: number[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _data: any;\n let _chart: JSXElement[];\n let _margins: Margins;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisRectScale: any;\n // determines if the given area chart has multiple stacked bar charts\n let _isMultiStackChart: boolean;\n const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);\n\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [activeLegend, setActiveLegend] = React.useState<string | undefined>(undefined);\n const [hoverXValue, setHoverXValue] = React.useState<string | number | undefined | null>('');\n\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [lineXValue, setLineXValue] = React.useState<number>(0);\n const [displayOfLine, setDisplayOfLine] = React.useState<InterceptVisibility>(InterceptVisibility.hide);\n const [isCircleClicked, setIsCircleClicked] = React.useState<boolean>(false);\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<number | string | Date | null>(null);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [xAxisCalloutAccessibilityData, setXAxisCalloutAccessibilityData] = React.useState<AccessibilityProps>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const prevPropsRef = React.useRef<AreaChartProps | null>(null);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n function _getMinMaxOfYAxis(points: LineChartPoints[], yAxisType: YAxisType, useSecondaryYScale: boolean) {\n return findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale);\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 ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis) {\n domainNRangeValue = domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(\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 _getMargins(margins: Margins) {\n _margins = margins;\n }\n\n function _onRectMouseMove(mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>) {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n _updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n // This will get the value of the X when mouse is on the chart\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n const xOffset = _xAxisRectScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![0].data, xOffset);\n const d0 = lineChartData![0].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![0].data[i] as LineChartDataPoint;\n let pointToHighlight: string | Date | number | null = null;\n let index: null | number = null;\n const axisType =\n lineChartData![0].data.length > 0 ? (getTypeOfAxis(lineChartData![0].data[0].x, true) as XAxisTypes) : null;\n if (d0 === undefined && d1 !== undefined) {\n pointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n pointToHighlight = d0.x;\n index = i - 1;\n } else {\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 pointToHighlight = 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 pointToHighlight = 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 // eslint-disable-next-line @typescript-eslint/no-shadow\n const { xAxisCalloutData, xAxisCalloutAccessibilityData } = lineChartData![0].data[index as number];\n const formattedDate =\n pointToHighlight instanceof Date\n ? formatDateToLocaleString(pointToHighlight, props.culture, props.useUTC as boolean)\n : pointToHighlight;\n const found = findCalloutPoints(_calloutPoints, pointToHighlight);\n\n const _nearestCircleToHighlight =\n axisType === XAxisTypes.DateAxis ? (pointToHighlight as Date).getTime() : pointToHighlight;\n // if no points need to be called out then don't show vertical line and callout card\n if (found) {\n const filteredValues = _getFilteredLegendValues(found.values);\n setNearestCircleToHighlight(_nearestCircleToHighlight);\n setLineXValue(_xAxisRectScale(pointToHighlight));\n setDisplayOfLine(InterceptVisibility.show);\n setIsCircleClicked(false);\n setStackCalloutProps({ ...found, values: filteredValues });\n setYValueHover(filteredValues);\n setDataPointCalloutProps({ ...found, values: filteredValues });\n setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);\n setXAxisCalloutAccessibilityData(xAxisCalloutAccessibilityData);\n setActivePoint('');\n } else {\n setPopoverOpen(false);\n setNearestCircleToHighlight(nearestCircleToHighlight);\n setDisplayOfLine(InterceptVisibility.hide);\n setIsCircleClicked(false);\n }\n }\n /**\n * just cleaning up the state which we have set in the mouse move event\n */\n function _onRectMouseOut() {\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 _handleChartMouseLeave() {\n setPopoverOpen(false);\n setNearestCircleToHighlight(null);\n setLineXValue(0);\n setDisplayOfLine(InterceptVisibility.hide);\n setIsCircleClicked(false);\n setStackCalloutProps(undefined);\n setDataPointCalloutProps(undefined);\n setHoverXValue(undefined);\n setYValueHover([]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _getDataPoints(keys: string[], dataSet: any) {\n const renderPoints: Array<AreaChartDataSetPoint[]> = [];\n let maxOfYVal = 0;\n\n if (_shouldFillToZeroY()) {\n keys.forEach((key, index) => {\n const currentLayer: AreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dataSet.forEach((d: any) => {\n currentLayer.push({\n values: [0, d[key]], // Start from zero for \"tozeroy\" mode\n xVal: d.xVal,\n });\n if (d[key] > maxOfYVal) {\n maxOfYVal = d[key];\n }\n });\n renderPoints.push(currentLayer);\n });\n } else {\n const dataValues = d3Stack().keys(keys)(dataSet);\n maxOfYVal = d3Max(dataValues[dataValues.length - 1], dp => dp[1])!;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dataValues.forEach((layer: any) => {\n const currentLayer: AreaChartDataSetPoint[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n layer.forEach((d: any) => {\n currentLayer.push({\n values: d,\n xVal: d.data.xVal,\n });\n });\n renderPoints.push(currentLayer);\n });\n }\n\n _isMultiStackChart = !!(props.legendProps?.selectedLegends\n ? renderPoints?.length >= 1\n : renderPoints?.length > 1);\n return {\n renderData: renderPoints,\n // The maxOfYVal prop is only required for the primary y-axis. When the data includes\n // a secondary y-axis, the mode defaults to tozeroy, so maxOfYVal should be calculated using\n // only the data points associated with the primary y-axis.\n maxOfYVal: _containsSecondaryYAxis ? findNumericMinMaxOfY(props.data.lineChartData!).endValue : maxOfYVal,\n };\n }\n\n function _createDataSet(points: LineChartPoints[]) {\n if (props.enablePerfOptimization && _enableComputationOptimization && !_hasDuplicateXValues) {\n const allChartPoints: LineChartDataPoint[] = [];\n const dataSet: AreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: LineChartPoints) => {\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...(singleChartPoint.data as LineChartDataPoint[]));\n });\n\n const mapOfXvalToListOfDataPoints: MapXToDataSet = Object.create(null);\n allChartPoints.forEach((dataPoint: LineChartDataPoint) => {\n const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;\n // map of x value to the list of data points which share the same x value .\n if (mapOfXvalToListOfDataPoints[xValue]) {\n mapOfXvalToListOfDataPoints[xValue].push(dataPoint);\n } else {\n mapOfXvalToListOfDataPoints[xValue] = [dataPoint];\n }\n });\n\n Object.keys(mapOfXvalToListOfDataPoints).forEach((key: number | string) => {\n const value: LineChartDataPoint[] = mapOfXvalToListOfDataPoints[key];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n value.forEach((singleDataPoint: LineChartDataPoint, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n });\n\n // get keys from dataset, used to render data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n const keys: string[] = [];\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n\n // Data used to draw graph\n const data = _getDataPoints(keys, dataSet);\n\n return {\n colors,\n opacity,\n keys,\n data,\n calloutPoints,\n };\n } else {\n const allChartPoints: LineChartDataPoint[] = [];\n const dataSet: AreaChartDataSetPoint[] = [];\n const colors: string[] = [];\n const opacity: number[] = [];\n const calloutPoints = calloutData(points!);\n\n let data = {};\n const keys: string[] = [];\n let index = 0;\n\n points &&\n points.length &&\n points.forEach((singleChartPoint: LineChartPoints) => {\n // if legend is not populated, then assign a legend\n if (_hasDuplicateXValues && !singleChartPoint.legend) {\n singleChartPoint.legend = `chart${index}`;\n ++index;\n }\n singleChartPoint.data.forEach((point: ILineChartDataPointWithLegend) => {\n point.legend = singleChartPoint.legend;\n });\n colors.push(singleChartPoint.color!);\n opacity.push(singleChartPoint.opacity || 1);\n allChartPoints.push(...(singleChartPoint.data as LineChartDataPoint[]));\n });\n\n if (!_hasDuplicateXValues) {\n let tempArr = allChartPoints;\n while (tempArr.length) {\n const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n const filteredChartPoints: LineChartDataPoint[] = tempArr.filter(\n (point: LineChartDataPoint) =>\n (point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck,\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = {};\n filteredChartPoints.forEach((singleDataPoint: LineChartDataPoint, id: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${id}`] = singleDataPoint.y;\n });\n dataSet.push(singleDataset);\n // removing compared objects from array\n const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;\n tempArr = tempArr.filter(\n (point: LineChartDataPoint) => (point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val,\n );\n }\n\n // get keys from dataset, used to create stacked data\n const keysLength: number = dataSet && Object.keys(dataSet[0])!.length;\n for (let i = 0; i < keysLength - 1; i++) {\n const keyVal = `chart${i}`;\n keys.push(keyVal);\n }\n // Data used to draw graph\n data = _getDataPoints(keys, dataSet);\n } else {\n const datasetForDuplicateValues = _createDatasetForXCoordinateWithMultipleYValues(allChartPoints);\n data = _getDataPoints(datasetForDuplicateValues.keys, datasetForDuplicateValues.filteredDataSet);\n }\n\n return {\n colors,\n opacity,\n keys,\n data,\n calloutPoints,\n };\n }\n }\n\n function _createDatasetForXCoordinateWithMultipleYValues(allChartPoints: LineChartDataPoint[]) {\n const dataSet: AreaChartDataSetPoint[] = [];\n\n // Group data points by x-axis value\n const groupedData: Record<string | number, ILineChartDataPointWithLegend[]> = Object.create(null);\n allChartPoints.forEach((dataPoint: ILineChartDataPointWithLegend) => {\n const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;\n if (!groupedData[xValue]) {\n groupedData[xValue] = [];\n }\n groupedData[xValue].push(dataPoint);\n });\n\n // Aggregate data points for each x-axis value\n Object.keys(groupedData).forEach(xValue => {\n const dataPoints = groupedData[xValue];\n dataPoints.forEach((dataPoint, id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDataset: any = { xVal: dataPoints[0].x };\n\n const key = dataPoint.legend ? dataPoint.legend : `chart${id}`;\n singleDataset[key] = dataPoint.y;\n dataSet.push(singleDataset);\n });\n });\n\n // get all unique keys from each array within the dataSet\n const allLegends: string[] = [];\n dataSet.forEach(item => {\n Object.keys(item).forEach(key => {\n if (key !== 'xVal' && !allLegends.includes(key)) {\n allLegends.push(key);\n }\n });\n });\n\n dataSet.forEach(item => {\n allLegends.forEach(legend => {\n if (!item[legend]) {\n item[legend] = 0; // Fill with 0 if the legend is missing\n }\n });\n });\n\n // exclude all items within dataset having all legend values 0\n const filteredDataSet = dataSet.filter(item => {\n return allLegends.some(legend => item[legend] !== 0);\n });\n\n const keys = Array.from(\n new Set(filteredDataSet.flatMap(item => Object.keys(item).filter(key => key !== 'xVal'))),\n );\n\n return {\n keys,\n filteredDataSet,\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 _getGraphData(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xAxis: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxis: any,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) {\n _chart = _drawGraph(containerHeight, xAxis, yAxis, yScaleSecondary, xElement!);\n }\n\n function _onLegendHover(legend: string): void {\n setActiveLegend(legend);\n }\n\n function _onLegendLeave(): void {\n setActiveLegend(undefined);\n }\n\n function _getLegendData(points: LineChartPoints[]): JSXElement {\n const data = points;\n const actions: Legend[] = [];\n\n data.forEach((singleChartData: LineChartPoints) => {\n const color: string = singleChartData.color!;\n const checkSimilarLegends = actions.filter(\n (leg: Legend) => leg.title === singleChartData.legend && leg.color === color,\n );\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n\n const legend: Legend = {\n title: singleChartData.legend,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(singleChartData.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n return (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n function _onDataPointClick(func: (() => void) | undefined) {\n if (func) {\n func();\n }\n setIsCircleClicked(true);\n }\n\n function _getOpacity(legend: string): number {\n if (!_isMultiStackChart) {\n return 0.7;\n } else {\n const opacity = _legendHighlighted(legend) || _noLegendHighlighted() ? 0.7 : 0.1;\n return opacity;\n }\n }\n\n function _getLineOpacity(legend: string): number {\n if (!_isMultiStackChart) {\n return 1;\n } else {\n let opacity = 0.3;\n if (isPopoverOpen) {\n opacity = 1;\n }\n if (!_noLegendHighlighted()) {\n opacity = _legendHighlighted(legend) ? 0 : 0.1;\n }\n return opacity;\n }\n }\n\n function _updateCircleFillColor(xDataPoint: number | Date, lineColor: string, circleId: string): string {\n let fillColor = lineColor;\n if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {\n if (!isCircleClicked) {\n fillColor = tokens.colorNeutralBackground1;\n }\n }\n\n return fillColor;\n }\n\n function _drawGraph(\n containerHeight: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n xElement: SVGElement,\n ): JSXElement[] {\n const points = _addDefaultColors(props.data.lineChartData);\n const { pointOptions, pointLineOptions } = props.data;\n\n const graph: JSXElement[] = [];\n let lineColor: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _data.forEach((singleStackedData: Array<any>, index: number) => {\n const yScale = points[index]?.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n const curveFactory = getCurveFactory(points[index]?.lineOptions?.curve, d3CurveBasis);\n const area = d3Area()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y0((d: any) => yScale(d.values[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y1((d: any) => yScale(d.values[1]))\n .curve(curveFactory);\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => xScale(d.xVal))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => yScale(d.values[1]))\n .curve(curveFactory);\n const layerOpacity = _shouldFillToZeroY() ? 0.8 : _opacity[index];\n graph.push(\n <React.Fragment key={`${index}-graph-${_uniqueIdForGraph}`}>\n {props.enableGradient && (\n <defs>\n <linearGradient id={`gradient_${index}`} x1=\"0%\" x2=\"0%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0\" stopColor={_colors[index]} />\n <stop offset=\"100%\" stopColor=\"transparent\" />\n </linearGradient>\n </defs>\n )}\n <path\n id={`${index}-line-${_uniqueIdForGraph}`}\n d={line(singleStackedData)!}\n fill={'transparent'}\n strokeWidth={points[index]?.lineOptions?.strokeWidth ?? 3}\n stroke={_colors[index]}\n opacity={_getLineOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n strokeDasharray={points[index]?.lineOptions?.strokeDasharray}\n strokeDashoffset={points[index]?.lineOptions?.strokeDashoffset}\n strokeLinecap={points[index]?.lineOptions?.strokeLinecap}\n />\n {singleStackedData.length === 1 ? (\n <circle\n id={`${index}-graph-${_uniqueIdForGraph}`}\n cx={xScale(singleStackedData[0].xVal)}\n cy={yScale(singleStackedData[0].values[1])}\n r={6}\n stroke={_colors[index]}\n strokeWidth={3}\n fill={_colors[index]}\n opacity={layerOpacity}\n fillOpacity={_getOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onFocus={event => _handleFocus(event, index, 0, `${_circleId}_${index}`)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n />\n ) : (\n <path\n id={`${index}-graph-${_uniqueIdForGraph}`}\n d={area(singleStackedData)!}\n fill={props.enableGradient ? `url(#gradient_${index})` : _colors[index]}\n opacity={layerOpacity}\n fillOpacity={_getOpacity(points[index]!.legend)}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n {...(props.optimizeLargeData && {\n tabIndex: _legendHighlighted(points[index]!.legend) || _noLegendHighlighted() ? 0 : undefined,\n role: 'img',\n 'aria-label': `${points[index].legend}, series ${index + 1} of ${points.length} with ${\n points[index].data.length\n } data points.`,\n })}\n />\n )}\n </React.Fragment>,\n );\n });\n\n const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _data.forEach((singleStackedData: Array<any>, index: number) => {\n if (points.length === index) {\n return;\n }\n const yScale = points[index]?.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n if (!props.optimizeLargeData || singleStackedData.length === 1) {\n // Render circles for all data points\n graph.push(\n <g\n key={`${index}-dots-${_uniqueIdForGraph}`}\n clipPath=\"url(#clip)\"\n role=\"region\"\n aria-label={`${points[index].legend}, series ${index + 1} of ${points.length} with ${\n points[index].data.length\n } data points.`}\n >\n {singleStackedData.map((singlePoint: DPointType, pointIndex: number) => {\n const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n lineColor = points[index]!.color!;\n const legend = points[index]!.legend;\n return (\n <circle\n key={circleId}\n id={circleId}\n tabIndex={_legendHighlighted(points[index]!.legend) || _noLegendHighlighted() ? 0 : undefined}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={_updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n {..._getOnClickHandler(points, index, pointIndex)}\n onFocus={event => _handleFocus(event, index, pointIndex, circleId)}\n onBlur={_handleBlur}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n role=\"img\"\n aria-label={\n (!_hasDuplicateXValues && !_hasMissingXValues && _getAriaLabel(index, pointIndex)) || undefined\n }\n />\n );\n })}\n </g>,\n );\n } else {\n // Render circles for data points close to the mouse pointer only\n singleStackedData.forEach((singlePoint: DPointType, pointIndex: number) => {\n const xDataPoint = singlePoint.xVal instanceof Date ? singlePoint.xVal.getTime() : singlePoint.xVal;\n if (nearestCircleToHighlight === xDataPoint) {\n const circleId = `${_circleId}_${index * _data[0].length + pointIndex}`;\n lineColor = points[index]!.color!;\n const legend = points[index]!.legend;\n graph.push(\n <circle\n key={circleId}\n id={circleId}\n cx={xScale(singlePoint.xVal)}\n cy={yScale(singlePoint.values[1])}\n stroke={lineColor}\n strokeWidth={3}\n fill={_updateCircleFillColor(xDataPoint, lineColor, circleId)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n onFocus={event => _handleFocus(event, index, pointIndex, circleId)}\n {..._getOnClickHandler(points, index, pointIndex)}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n />,\n );\n }\n });\n }\n });\n graph.push(\n <line\n id={_verticalLineId}\n key={_verticalLineId}\n x1={lineXValue}\n y1={0}\n x2={lineXValue}\n y2={containerHeight}\n strokeWidth={1}\n strokeDasharray={5.5}\n stroke={lineColor!}\n opacity={0.5}\n visibility={displayOfLine}\n {...getSecureProps(pointLineOptions)}\n />,\n );\n return graph;\n }\n\n function _getOnClickHandler(points: LineChartPoints[], index: number, pointIndex: number) {\n if (!_hasDuplicateXValues && !_hasMissingXValues) {\n return {\n onClick: () => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!),\n };\n }\n return {};\n }\n\n function _getCircleRadius(xDataPoint: number, circleRadius: number, circleId: string, legend: string): number {\n // Show the circle if no legends are selected or if the point's legend is in the selected legends\n if (!_noLegendHighlighted() && !_legendHighlighted(legend)) {\n return 0;\n }\n\n if (isCircleClicked && nearestCircleToHighlight === xDataPoint) {\n return 1;\n } else if (nearestCircleToHighlight === xDataPoint || activePoint === circleId) {\n return circleRadius;\n } else {\n return 0;\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n }\n\n function _addDefaultColors(lineChartData?: LineChartPoints[]): LineChartPoints[] {\n if (_hasMissingXValues) {\n // get union of all x values\n const allXValues: Set<string | number> = new Set();\n lineChartData &&\n lineChartData.forEach((line: LineChartPoints) => {\n line.data.forEach((point: LineChartDataPoint) => {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n allXValues.add(xValue);\n });\n });\n lineChartData &&\n lineChartData.forEach((line: LineChartPointsWithLegend) => {\n allXValues.forEach((xValue: string | number) => {\n const point = line.data.find((item: ILineChartDataPointWithLegend) => {\n return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;\n });\n if (!point) {\n line.data.push({\n x: typeof xValue === 'string' ? new Date(xValue) : xValue,\n y: 0,\n legend: line.legend,\n });\n }\n });\n // sort the data points by x value\n line.data.sort((a: LineChartDataPoint, b: LineChartDataPoint) => {\n const xA = a.x instanceof Date ? a.x.getTime() : a.x;\n const xB = b.x instanceof Date ? b.x.getTime() : b.x;\n return xA < xB ? -1 : xA > xB ? 1 : 0;\n });\n });\n }\n return lineChartData\n ? lineChartData.map((item, index) => {\n let color: string;\n // isInverted property is applicable to v8 themes only\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n\n return { ...item, color };\n })\n : [];\n }\n\n function _handleFocus(\n event: React.FocusEvent<SVGCircleElement, Element>,\n lineIndex: number,\n pointIndex: number,\n circleId: string,\n ) {\n let cx = 0;\n let cy = 0;\n\n const targetRect = (event.target as SVGCircleElement).getBoundingClientRect();\n cx = targetRect.left + targetRect.width / 2;\n cy = targetRect.top + targetRect.height / 2;\n _updatePosition(cx, cy);\n\n const { x, y, xAxisCalloutData } = props.data.lineChartData![lineIndex].data[pointIndex];\n const formattedDate = x instanceof Date ? formatDateToLocaleString(x, props.culture, props.useUTC as boolean) : x;\n const found = findCalloutPoints(_calloutPoints, x);\n if (found) {\n // Show details in the callout for the focused point only\n found.values = found.values.filter((e: { y: number }) => e.y === y);\n const filteredValues = _getFilteredLegendValues(found.values);\n\n setPopoverOpen(true);\n setHoverXValue(xAxisCalloutData ? xAxisCalloutData : formattedDate);\n setYValueHover(filteredValues!);\n setStackCalloutProps({ ...found, values: filteredValues });\n setDataPointCalloutProps({ ...found, values: filteredValues });\n setActivePoint(circleId);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _getFilteredLegendValues(values: any) {\n return !_noLegendHighlighted()\n ? values.filter((value: { legend: string }) => _legendHighlighted(value.legend))\n : values;\n }\n\n function _handleBlur() {\n setPopoverOpen(false);\n setHoverXValue(undefined);\n setYValueHover([]);\n setStackCalloutProps(undefined);\n setDataPointCalloutProps(undefined);\n setActivePoint('');\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = props.data.lineChartData![lineIndex];\n const point = line.data[pointIndex];\n const formattedDate =\n point.x instanceof Date ? formatDateToLocaleString(point.x, props.culture, props.useUTC as boolean) : 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 (\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props.data.lineChartData.filter((item: { data: string | any[] }) => item.data.length === 0).length === 0\n )\n // if all the data sets have no data\n // filtering all items which have no data and checking if the length of the filtered array is 0\n // which means chart is not empty\n );\n }\n\n function _getChartTitle(): string {\n const { chartTitle, lineChartData } = props.data;\n return (chartTitle ? `${chartTitle}. ` : '') + `Area chart with ${lineChartData?.length || 0} data series. `;\n }\n\n function _xCoordinateContainsMultipleY(): boolean {\n const { lineChartData } = props.data;\n if (!lineChartData) {\n return false;\n }\n for (const item of lineChartData) {\n const xValueMap: Record<string, number[]> = Object.create(null);\n for (const point of item.data) {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n if (!xValueMap[xValue]) {\n xValueMap[xValue] = [];\n }\n xValueMap[xValue].push(point.y);\n if (xValueMap[xValue].length > 1) {\n return true;\n }\n }\n }\n return false;\n }\n\n function _containsMissingXValues(): boolean {\n const { lineChartData } = props.data;\n if (!lineChartData) {\n return false;\n }\n const allXValues: Set<string | number> = new Set();\n lineChartData.forEach((line: LineChartPoints) => {\n line.data.forEach((point: LineChartDataPoint) => {\n const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;\n allXValues.add(xValue);\n });\n });\n // for all x values, check if the x value is present in all series\n let hasMissingValues = false;\n lineChartData.forEach((line: LineChartPoints) => {\n allXValues.forEach((xValue: string | number) => {\n const point = line.data.find((item: LineChartDataPoint) => {\n return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;\n });\n if (!point) {\n hasMissingValues = true;\n }\n });\n });\n return hasMissingValues;\n }\n\n function _shouldFillToZeroY() {\n return props.mode === 'tozeroy' || _containsSecondaryYAxis;\n }\n\n if (!_isChartEmpty()) {\n const { lineChartData } = props.data;\n const points = _addDefaultColors(lineChartData);\n _containsSecondaryYAxis = !!props.secondaryYScaleOptions && points.some(point => point.useSecondaryYScale);\n _createSet = _createDataSet;\n const { colors, opacity, data, calloutPoints } = _createSet(points);\n _calloutPoints = calloutPoints;\n const isXAxisDateType = getXAxisType(points);\n _colors = colors;\n _opacity = opacity;\n _data = data.renderData;\n const legends: JSXElement = _getLegendData(points);\n\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n const calloutProps: ChartPopoverProps = {\n YValueHover: YValueHover!,\n hoverXValue: hoverXValue!,\n xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition,\n isPopoverOpen: isPopoverOpen && !_hasDuplicateXValues && !_hasMissingXValues,\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n isCalloutForStack: true,\n };\n return (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={points}\n chartType={ChartTypes.AreaChart}\n calloutProps={calloutProps}\n legendBars={legends}\n createYAxis={createNumericYAxis}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n tickParams={tickParams}\n maxOfYVal={data.maxOfYVal}\n getGraphData={_getGraphData}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxis}\n getmargins={_getMargins}\n onChartMouseLeave={_handleChartMouseLeave}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n children={(props: ChildProps) => {\n _xAxisRectScale = props.xScale;\n const ticks = _xAxisRectScale.ticks();\n const width1 = _xAxisRectScale(ticks[ticks.length - 1]);\n const rectHeight = props.containerHeight! - _margins.top!;\n return (\n <>\n <g>\n <rect\n id={_rectId}\n width={width1}\n height={rectHeight}\n fill={'transparent'}\n onMouseMove={event => _onRectMouseMove(event)}\n onMouseOut={_onRectMouseOut}\n onMouseOver={event => _onRectMouseMove(event)}\n />\n </g>\n <g>{_chart}</g>\n </>\n );\n }}\n />\n );\n }\n return (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\nAreaChart.displayName = 'AreaChart';\n"],"names":["React","max","d3Max","bisector","pointer","tokens","area","d3Area","stack","d3Stack","curveMonotoneX","d3CurveBasis","line","d3Line","CartesianChart","calloutData","getXAxisType","ChartTypes","XAxisTypes","getTypeOfAxis","getNextColor","getColorFromToken","getSecureProps","areArraysEqual","getCurveFactory","findNumericMinMaxOfY","createNumericYAxis","domainRangeOfNumericForAreaLineScatterCharts","domainRangeOfDateForAreaLineScatterVerticalBarCharts","createStringYAxis","findCalloutPoints","useId","Legends","formatDateToLocaleString","useImageExport","bisect","d","x","left","InterceptVisibility","AreaChart","forwardRef","props","forwardedRef","_uniqueIdForGraph","_verticalLineId","_circleId","_rectId","_enableComputationOptimization","_firstRenderOptimization","_emptyChartId","_containsSecondaryYAxis","_hasMissingXValues","_containsMissingXValues","_hasDuplicateXValues","_xCoordinateContainsMultipleY","_calloutPoints","_createSet","_colors","_opacity","_data","_chart","_margins","_xAxisRectScale","_isMultiStackChart","cartesianChartRef","legendsRef","_legendsRef","componentRef","hideLegend","selectedLegends","setSelectedLegends","useState","legendProps","activeLegend","setActiveLegend","undefined","hoverXValue","setHoverXValue","YValueHover","setYValueHover","lineXValue","setLineXValue","displayOfLine","setDisplayOfLine","isCircleClicked","setIsCircleClicked","nearestCircleToHighlight","setNearestCircleToHighlight","activePoint","setActivePoint","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","xAxisCalloutAccessibilityData","setXAxisCalloutAccessibilityData","clickPosition","setClickPosition","y","isPopoverOpen","setPopoverOpen","prevPropsRef","useRef","useEffect","current","prevProps","_getMinMaxOfYAxis","points","yAxisType","useSecondaryYScale","_getDomainNRangeValues","margins","width","chartType","isRTL","xAxisType","barWidth","tickValues","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","_getMargins","_onRectMouseMove","mouseEvent","persist","data","lineChartData","_updatePosition","clientX","clientY","xOffset","invert","document","getElementById","i","d0","d1","pointToHighlight","index","axisType","length","x0","point0","point1","Date","getTime","Math","abs","xAxisCalloutData","formattedDate","culture","useUTC","found","_nearestCircleToHighlight","filteredValues","_getFilteredLegendValues","values","_onRectMouseOut","newX","newY","threshold","distance","sqrt","pow","_handleChartMouseLeave","_getDataPoints","keys","dataSet","renderPoints","maxOfYVal","_shouldFillToZeroY","forEach","key","currentLayer","push","xVal","dataValues","dp","layer","renderData","endValue","_createDataSet","enablePerfOptimization","allChartPoints","colors","opacity","calloutPoints","singleChartPoint","color","mapOfXvalToListOfDataPoints","Object","create","dataPoint","xValue","toLocaleString","value","singleDataset","singleDataPoint","keysLength","keyVal","legend","point","tempArr","valToCheck","filteredChartPoints","filter","id","val","datasetForDuplicateValues","_createDatasetForXCoordinateWithMultipleYValues","filteredDataSet","groupedData","dataPoints","allLegends","item","includes","some","Array","from","Set","flatMap","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getGraphData","xAxis","yAxis","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","_drawGraph","_onLegendHover","_onLegendLeave","_getLegendData","actions","singleChartData","checkSimilarLegends","leg","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_onDataPointClick","func","_getOpacity","_legendHighlighted","_noLegendHighlighted","_getLineOpacity","_updateCircleFillColor","xDataPoint","lineColor","circleId","fillColor","colorNeutralBackground1","xScale","yScalePrimary","_addDefaultColors","pointOptions","pointLineOptions","graph","singleStackedData","yScale","curveFactory","lineOptions","curve","y0","y1","layerOpacity","Fragment","enableGradient","defs","linearGradient","x1","x2","y2","stop","offset","stopColor","path","fill","strokeWidth","stroke","onMouseMove","onMouseOut","onMouseOver","strokeDasharray","strokeDashoffset","strokeLinecap","circle","cx","cy","r","fillOpacity","onFocus","_handleFocus","optimizeLargeData","tabIndex","role","circleRadius","Number","g","clipPath","aria-label","map","singlePoint","pointIndex","_getOnClickHandler","onBlur","_handleBlur","_getCircleRadius","_getAriaLabel","visibility","onClick","onDataPointClick","_getHighlightedLegend","allXValues","add","find","sort","a","b","xA","xB","lineIndex","targetRect","target","getBoundingClientRect","top","height","e","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","xValueMap","hasMissingValues","mode","secondaryYScaleOptions","isXAxisDateType","tickParams","tickFormat","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCalloutForStack","legendBars","createYAxis","getGraphData","getDomainNRangeValues","getmargins","onChartMouseLeave","getMinMaxOfYAxis","enableFirstRenderOptimization","children","ticks","width1","rectHeight","rect","div","style","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAOC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAClD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,QAAQC,MAAM,EAAEC,SAASC,OAAO,EAAEC,kBAAkBC,YAAY,EAAEC,QAAQC,MAAM,QAAQ,WAAW;AAY5G,SAASC,cAAc,QAAQ,iBAAc;AAE7C,SACEC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,4CAA4C,EAC5CC,oDAAoD,EACpDC,iBAAiB,EACjBC,iBAAiB,QACZ,2BAAwB;AAC/B,SAASC,KAAK,QAAQ,4BAA4B;AAGlD,SAASC,OAAO,QAAQ,sBAAmB;AAE3C,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,2BAAwB;AAEvD,8DAA8D;AAC9D,MAAMC,SAAShC,SAAS,CAACiC,IAAWA,EAAEC,CAAC,EAAEC,IAAI;AAE7C,IAAA,AAAKC,6CAAAA;;;WAAAA;EAAAA;AAiCL,6FAA6F;AAE7F,OAAO,MAAMC,0BAAqDxC,MAAMyC,UAAU,CAChF,CAACC,O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AGN;IACA,qBACE,oBAAC+T;QAAIzK,IAAIjK;QAAeuQ,MAAM;QAASoE,OAAO;YAAE/L,SAAS;QAAI;QAAGgI,cAAY;;AAEhF,GACA;AACFtR,UAAUsV,WAAW,GAAG"}
|
|
@@ -273,7 +273,7 @@ const useIsDarkTheme = ()=>{
|
|
|
273
273
|
}), [
|
|
274
274
|
exportAsImage
|
|
275
275
|
]);
|
|
276
|
-
const groupedTraces =
|
|
276
|
+
const groupedTraces = Object.create(null);
|
|
277
277
|
let nonCartesianTraceCount = 0;
|
|
278
278
|
// For annotation-only charts, create a single group entry
|
|
279
279
|
if (chart.type === 'annotation') {
|