@fluentui/react-charts 9.1.6 → 9.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/dist/index.d.ts +64 -5
  3. package/lib/components/AreaChart/AreaChart.js +21 -1
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/CommonComponents/CartesianChart.js +8 -9
  6. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  7. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  8. package/lib/components/CommonComponents/ChartPopover.js +2 -1
  9. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  10. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  11. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
  12. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  13. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +11 -5
  14. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  15. package/lib/components/DonutChart/Arc/Arc.js +10 -3
  16. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  17. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  18. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +7 -2
  19. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  20. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -6
  21. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  22. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +18 -1
  23. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  24. package/lib/components/HeatMapChart/HeatMapChart.js +29 -2
  25. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  26. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  27. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +7 -2
  28. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  29. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +15 -5
  30. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  31. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -1
  32. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  33. package/lib/components/LineChart/LineChart.js +22 -2
  34. package/lib/components/LineChart/LineChart.js.map +1 -1
  35. package/lib/components/SankeyChart/SankeyChart.js +18 -22
  36. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  37. package/lib/components/ScatterChart/ScatterChart.js +28 -3
  38. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  39. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
  40. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  41. package/lib/components/VerticalBarChart/VerticalBarChart.js +28 -15
  42. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  43. package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  44. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -12
  45. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  46. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  47. package/lib/utilities/FocusableTooltipText.js +1 -2
  48. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  49. package/lib/utilities/utilities.js +6 -144
  50. package/lib/utilities/utilities.js.map +1 -1
  51. package/lib-commonjs/components/AreaChart/AreaChart.js +20 -0
  52. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  53. package/lib-commonjs/components/CommonComponents/CartesianChart.js +7 -7
  54. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  55. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  56. package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
  57. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  58. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  59. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
  60. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  61. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +14 -5
  62. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  63. package/lib-commonjs/components/DonutChart/Arc/Arc.js +10 -3
  64. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  65. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  66. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +10 -2
  67. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  68. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +0 -14
  69. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  70. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +17 -0
  71. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  72. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +28 -1
  73. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  74. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  75. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +8 -2
  76. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  77. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +15 -5
  78. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  79. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +3 -0
  80. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  81. package/lib-commonjs/components/LineChart/LineChart.js +21 -1
  82. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  83. package/lib-commonjs/components/SankeyChart/SankeyChart.js +18 -22
  84. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  85. package/lib-commonjs/components/ScatterChart/ScatterChart.js +26 -1
  86. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  87. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +3 -3
  88. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  89. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +27 -14
  90. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  91. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
  92. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -11
  93. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  94. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  95. package/lib-commonjs/utilities/FocusableTooltipText.js +1 -2
  96. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  97. package/lib-commonjs/utilities/utilities.js +11 -132
  98. package/lib-commonjs/utilities/utilities.js.map +1 -1
  99. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,12 +1,37 @@
1
1
  # Change Log - @fluentui/react-charts
2
2
 
3
- This log was last generated on Fri, 04 Jul 2025 10:00:11 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 16 Jul 2025 13:51:49 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.1.8)
8
+
9
+ Wed, 16 Jul 2025 13:51:49 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.1.7..@fluentui/react-charts_v9.1.8)
11
+
12
+ ### Patches
13
+
14
+ - hbc focus ring fix ([PR #34832](https://github.com/microsoft/fluentui/pull/34832) by anushgupta@microsoft.com)
15
+ - refactor utilities to reduce monosize of components ([PR #34823](https://github.com/microsoft/fluentui/pull/34823) by anushgupta@microsoft.com)
16
+
17
+ ## [9.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.1.7)
18
+
19
+ Fri, 11 Jul 2025 15:59:20 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.1.6..@fluentui/react-charts_v9.1.7)
21
+
22
+ ### Patches
23
+
24
+ - fix accessibility bugs ([PR #34785](https://github.com/microsoft/fluentui/pull/34785) by anushgupta@microsoft.com)
25
+ - sankey chart callout fix ([PR #34806](https://github.com/microsoft/fluentui/pull/34806) by anushgupta@microsoft.com)
26
+ - fix accessibility issues ([PR #34798](https://github.com/microsoft/fluentui/pull/34798) by anushgupta@microsoft.com)
27
+ - fix(react-charts): Fix hook used conditionally inside a function ([PR #34787](https://github.com/microsoft/fluentui/pull/34787) by 98592573+AtishayMsft@users.noreply.github.com)
28
+ - Bump @fluentui/react-overflow to v9.4.7 ([PR #34807](https://github.com/microsoft/fluentui/pull/34807) by beachball)
29
+ - Bump @fluentui/react-popover to v9.11.7 ([PR #34807](https://github.com/microsoft/fluentui/pull/34807) by beachball)
30
+ - Bump @fluentui/react-tooltip to v9.7.7 ([PR #34807](https://github.com/microsoft/fluentui/pull/34807) by beachball)
31
+
7
32
  ## [9.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.1.6)
8
33
 
9
- Fri, 04 Jul 2025 10:00:11 GMT
34
+ Fri, 04 Jul 2025 10:02:50 GMT
10
35
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.1.5..@fluentui/react-charts_v9.1.6)
11
36
 
12
37
  ### Patches
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ import { SankeyGraph } from 'd3-sankey';
7
7
  import { SankeyLayout } from 'd3-sankey';
8
8
  import { SankeyLink } from 'd3-sankey';
9
9
  import { SankeyNode } from 'd3-sankey';
10
+ import { ScaleBand } from 'd3-scale';
11
+ import { ScaleLinear } from 'd3-scale';
10
12
  import { SVGProps } from 'react';
11
13
  import { TimeLocaleDefinition } from 'd3-time-format';
12
14
 
@@ -605,6 +607,7 @@ export declare interface ChartPopoverProps {
605
607
  descriptionMessage?: string;
606
608
  ratio?: [number, number];
607
609
  isCartesian?: boolean;
610
+ styles?: Partial<PopoverComponentStyles>;
608
611
  }
609
612
 
610
613
  /**
@@ -1540,6 +1543,7 @@ export declare interface HeatMapChartProps extends CartesianChartProps {
1540
1543
  export declare interface HeatMapChartStyles extends CartesianChartStyles {
1541
1544
  root?: string;
1542
1545
  text?: string;
1546
+ calloutContentRoot?: string;
1543
1547
  }
1544
1548
 
1545
1549
  /**
@@ -1888,6 +1892,10 @@ export declare interface HorizontalDataPoint {
1888
1892
  total?: number;
1889
1893
  }
1890
1894
 
1895
+ declare interface IAxisData {
1896
+ yAxisDomainValues: number[];
1897
+ }
1898
+
1891
1899
  /**
1892
1900
  * {@docCategory DeclarativeChart}
1893
1901
  */
@@ -1912,6 +1920,49 @@ export declare interface ImageExportOptions {
1912
1920
  background?: string;
1913
1921
  }
1914
1922
 
1923
+ declare interface IMargins {
1924
+ /**
1925
+ * left margin for the chart.
1926
+ * @default 40
1927
+ */
1928
+ left?: number;
1929
+ /**
1930
+ * Right margin for the chart.
1931
+ * @default 20
1932
+ */
1933
+ right?: number;
1934
+ /**
1935
+ * Top margin for the chart.
1936
+ * @default 20
1937
+ */
1938
+ top?: number;
1939
+ /**
1940
+ * Bottom margin for the chart.
1941
+ * @default 35
1942
+ */
1943
+ bottom?: number;
1944
+ }
1945
+
1946
+ declare interface IYAxisParams {
1947
+ yMinMaxValues?: {
1948
+ startValue: number;
1949
+ endValue: number;
1950
+ };
1951
+ maxOfYVal?: number;
1952
+ margins: IMargins;
1953
+ containerWidth: number;
1954
+ containerHeight: number;
1955
+ yAxisElement?: SVGSVGElement | null;
1956
+ yAxisTickFormat?: any;
1957
+ yAxisTickCount: number;
1958
+ yMaxValue?: number;
1959
+ yMinValue?: number;
1960
+ tickPadding?: number;
1961
+ eventAnnotationProps?: EventsAnnotationProps;
1962
+ eventLabelHeight?: number;
1963
+ yAxisPadding?: number;
1964
+ }
1965
+
1915
1966
  /**
1916
1967
  * @public
1917
1968
  * ILegend interface
@@ -2527,14 +2578,22 @@ export declare interface ModifiedCartesianChartProps extends CartesianChartProps
2527
2578
  /**
2528
2579
  * Get the min and max values of the y-axis
2529
2580
  */
2530
- getMinMaxOfYAxis?: (points: DataPoint[], yAxisType: YAxisType | undefined, useSecondaryYScale?: boolean) => {
2581
+ getMinMaxOfYAxis: (points: LineChartPoints[] | HorizontalBarChartWithAxisDataPoint[] | VerticalBarChartDataPoint[] | DataPoint[] | ScatterChartDataPoint[], yAxisType: YAxisType | undefined, useSecondaryYScale?: boolean) => {
2531
2582
  startValue: number;
2532
2583
  endValue: number;
2533
2584
  };
2534
- /**Add commentMore actions
2585
+ /**
2586
+ * Create the y-axis
2587
+ */
2588
+ createYAxis: (yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, isIntegralDataset: boolean, chartType: ChartTypes, useSecondaryYScale?: boolean, roundedTicks?: boolean) => ScaleLinear<number, number, never>;
2589
+ /**
2535
2590
  * Get the domain and range values
2536
2591
  */
2537
- getDomainNRangeValues?: (points: HorizontalBarChartWithAxisDataPoint[], margins: Margins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | string[] | undefined, shiftX: number) => IDomainNRange;
2592
+ getDomainNRangeValues: (points: LineChartPoints[] | VerticalBarChartDataPoint[] | VerticalStackedBarDataPoint[] | HorizontalBarChartWithAxisDataPoint[] | GroupedVerticalBarChartData[] | HeatMapChartDataPoint[], margins: Margins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | string[] | undefined, shiftX: number) => IDomainNRange;
2593
+ /**
2594
+ * Create the string y-axis
2595
+ */
2596
+ createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, barWidth: number | undefined, chartType?: ChartTypes) => ScaleBand<string>;
2538
2597
  }
2539
2598
 
2540
2599
  declare type NodesInColumns = {
@@ -3122,7 +3181,7 @@ export declare interface VerticalBarChartProps extends CartesianChartProps {
3122
3181
  /**
3123
3182
  * Call to provide customized styling that will layer on top of the variant rules.
3124
3183
  */
3125
- styles?: VerticalBarChartStyles;
3184
+ styles?: Partial<VerticalBarChartStyles>;
3126
3185
  /**
3127
3186
  * The prop used to define the culture to localized the numbers
3128
3187
  */
@@ -3248,7 +3307,7 @@ export declare interface VerticalStackedBarChartProps extends CartesianChartProp
3248
3307
  /**
3249
3308
  * Call to provide customized styling that will layer on top of the variant rules.
3250
3309
  */
3251
- styles?: VerticalStackedBarChartStyles;
3310
+ styles?: Partial<VerticalStackedBarChartStyles>;
3252
3311
  /**
3253
3312
  * Define a custom callout renderer for a stack; default is to render per data point
3254
3313
  */
@@ -6,7 +6,7 @@ import { select as d3Select } from 'd3-selection';
6
6
  import { tokens } from '@fluentui/react-theme';
7
7
  import { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';
8
8
  import { CartesianChart } from '../../index';
9
- import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, tooltipOfAxislabels, getNextColor, getColorFromToken, formatDate, getSecureProps, areArraysEqual, getCurveFactory, find, findNumericMinMaxOfY } from '../../utilities/index';
9
+ import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, tooltipOfAxislabels, getNextColor, getColorFromToken, formatDate, getSecureProps, areArraysEqual, getCurveFactory, find, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfNumericForAreaChart, domainRangeOfDateForAreaLineVerticalBarChart, createStringYAxis } from '../../utilities/index';
10
10
  import { useId } from '@fluentui/react-utilities';
11
11
  import { Legends } from '../Legends/index';
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -84,6 +84,22 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
84
84
  };
85
85
  }, []);
86
86
  const classes = useAreaChartStyles(props);
87
+ function _getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues) {
88
+ let domainNRangeValue;
89
+ if (xAxisType === XAxisTypes.NumericAxis) {
90
+ domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
91
+ } else if (xAxisType === XAxisTypes.DateAxis) {
92
+ domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
93
+ } else {
94
+ domainNRangeValue = {
95
+ dStartValue: 0,
96
+ dEndValue: 0,
97
+ rStartValue: 0,
98
+ rEndValue: 0
99
+ };
100
+ }
101
+ return domainNRangeValue;
102
+ }
87
103
  function _getMargins(margins) {
88
104
  _margins = margins;
89
105
  }
@@ -747,12 +763,16 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
747
763
  chartType: ChartTypes.AreaChart,
748
764
  calloutProps: calloutProps,
749
765
  legendBars: legends,
766
+ createYAxis: createNumericYAxis,
750
767
  xAxisType: isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis,
751
768
  tickParams: tickParams,
752
769
  maxOfYVal: data.maxOfYVal,
753
770
  getGraphData: _getGraphData,
771
+ getDomainNRangeValues: _getDomainNRangeValues,
772
+ createStringYAxis: createStringYAxis,
754
773
  getmargins: _getMargins,
755
774
  onChartMouseLeave: _handleChartMouseLeave,
775
+ getMinMaxOfYAxis: findNumericMinMaxOfY,
756
776
  enableFirstRenderOptimization: props.enablePerfOptimization && _firstRenderOptimization,
757
777
  componentRef: cartesianChartRef,
758
778
  /* eslint-disable react/jsx-no-bind */ // eslint-disable-next-line react/no-children-prop, @typescript-eslint/no-shadow
@@ -1 +1 @@
1
- {"version":3,"sources":["AreaChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAreaChartStyles } from './useAreaChartStyles.styles';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { pointer } from 'd3-selection';\nimport { select as d3Select } 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 {\n AccessibilityProps,\n CartesianChart,\n CustomizedCalloutData,\n AreaChartProps,\n LineChartDataPoint,\n LineChartPoints,\n ChildProps,\n Margins,\n YValueHover,\n ChartPopoverProps,\n Chart,\n} from '../../index';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfAxislabels,\n getNextColor,\n getColorFromToken,\n formatDate,\n getSecureProps,\n areArraysEqual,\n getCurveFactory,\n find,\n findNumericMinMaxOfY,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport { Legend, Legends } from '../Legends/index';\nimport { ScaleLinear } from 'd3-scale';\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\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 const _tooltipId: string = useId('AreaChartTooltipID');\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 // 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: JSX.Element[];\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 = React.useRef<Chart>(null);\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 // eslint-disable-next-line @typescript-eslint/no-shadow\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 React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const classes = useAreaChartStyles(props);\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 ? formatDate(pointToHighlight, props.useUTC) : pointToHighlight;\n const modifiedXVal = pointToHighlight instanceof Date ? pointToHighlight.getTime() : pointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\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) {\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 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 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, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = 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 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 }\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[]): JSX.Element {\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 />\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 ): JSX.Element[] {\n const points = _addDefaultColors(props.data.lineChartData);\n const { pointOptions, pointLineOptions } = props.data;\n\n const graph: JSX.Element[] = [];\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 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\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 onClick={() => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!)}\n onFocus={() => _handleFocus(index, pointIndex, circleId)}\n onBlur={_handleBlur}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n role=\"img\"\n aria-label={_getAriaLabel(index, pointIndex)}\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 onClick={() => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!)}\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 // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale);\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return graph;\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 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(lineIndex: number, pointIndex: number, circleId: string) {\n const { x, y, xAxisCalloutData } = props.data.lineChartData![lineIndex].data[pointIndex];\n const formattedDate = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const modifiedXVal = x instanceof Date ? x.getTime() : x;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = _calloutPoints.find((e: { x: string | number }) => e.x === modifiedXVal);\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 // 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 = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n (\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 _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: JSX.Element = _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,\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 xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n tickParams={tickParams}\n maxOfYVal={data.maxOfYVal}\n getGraphData={_getGraphData}\n getmargins={_getMargins}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop, @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","useAreaChartStyles","max","d3Max","bisector","pointer","select","d3Select","tokens","area","d3Area","stack","d3Stack","curveMonotoneX","d3CurveBasis","line","d3Line","CartesianChart","calloutData","getXAxisType","ChartTypes","XAxisTypes","getTypeOfAxis","tooltipOfAxislabels","getNextColor","getColorFromToken","formatDate","getSecureProps","areArraysEqual","getCurveFactory","find","findNumericMinMaxOfY","useId","Legends","bisect","d","x","left","InterceptVisibility","AreaChart","forwardRef","props","forwardedRef","_uniqueIdForGraph","_verticalLineId","_circleId","_rectId","_tooltipId","_enableComputationOptimization","_firstRenderOptimization","_emptyChartId","_containsSecondaryYAxis","_calloutPoints","_createSet","_colors","_opacity","_data","_chart","_margins","_xAxisRectScale","_isMultiStackChart","cartesianChartRef","useRef","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","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","classes","_getMargins","margins","_onRectMouseMove","mouseEvent","persist","data","lineChartData","_updatePosition","clientX","clientY","xOffset","invert","document","getElementById","i","d0","d1","pointToHighlight","index","axisType","length","x0","point0","point1","DateAxis","Date","getTime","Math","abs","NumericAxis","xAxisCalloutData","formattedDate","useUTC","modifiedXVal","found","element","_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","points","enablePerfOptimization","allChartPoints","colors","opacity","calloutPoints","singleChartPoint","color","mapOfXvalToListOfDataPoints","dataPoint","xValue","toLocaleString","Object","value","singleDataset","singleDataPoint","keysLength","keyVal","tempArr","valToCheck","filteredChartPoints","filter","point","val","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getGraphData","xAxis","yAxis","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","_drawGraph","_onLegendHover","legend","_onLegendLeave","_getLegendData","actions","singleChartData","checkSimilarLegends","leg","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","onChange","_onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","_onDataPointClick","func","_getOpacity","_legendHighlighted","_noLegendHighlighted","_getLineOpacity","_updateCircleFillColor","xDataPoint","lineColor","circleId","fillColor","colorNeutralBackground1","xScale","yScalePrimary","_addDefaultColors","pointOptions","pointLineOptions","graph","singleStackedData","yScale","useSecondaryYScale","curveFactory","lineOptions","curve","y0","y1","layerOpacity","Fragment","enableGradient","defs","linearGradient","id","x1","x2","y2","stop","offset","stopColor","path","fill","strokeWidth","stroke","onMouseMove","onMouseOut","onMouseOver","strokeDasharray","strokeDashoffset","strokeLinecap","circle","cx","cy","r","fillOpacity","optimizeLargeData","tabIndex","role","circleRadius","Number","g","clipPath","aria-label","map","singlePoint","pointIndex","onClick","onDataPointClick","onFocus","_handleFocus","onBlur","_handleBlur","_getCircleRadius","_getAriaLabel","visibility","showXAxisLablesTooltip","remove","e","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","_getHighlightedLegend","includes","item","lineIndex","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","mode","secondaryYScaleOptions","some","isXAxisDateType","tickParams","tickValues","tickFormat","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCalloutForStack","chartType","legendBars","xAxisType","getGraphData","getmargins","onChartMouseLeave","enableFirstRenderOptimization","children","ticks","width1","rectHeight","top","rect","width","height","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE;gBACtD,MAAM2N,aAAa7S,MAAM6J,eAAe,GAAI5I,SAAS6R,GAAG;gBACxD,qBACE,wDACE,oBAAC7D,yBACC,oBAAC8D;oBACCzF,IAAIjN;oBACJ2S,OAAOJ;oBACPK,QAAQJ;oBACR/E,MAAM;oBACNG,aAAa9C,CAAAA,QAASnH,iBAAiBmH;oBACvC+C,YAAY5H;oBACZ6H,aAAahD,CAAAA,QAASnH,iBAAiBmH;mCAG3C,oBAAC8D,WAAGjO;YAGV;;IAGN;IACA,qBACE,oBAACkS;QAAI5F,IAAI7M;QAAeqO,MAAM;QAASqE,OAAO;YAAEhL,SAAS;QAAI;QAAGgH,cAAY;;AAEhF,GACA;AACFrP,UAAUsT,WAAW,GAAG"}
1
+ {"version":3,"sources":["AreaChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAreaChartStyles } from './useAreaChartStyles.styles';\nimport { max as d3Max, bisector } from 'd3-array';\nimport { pointer } from 'd3-selection';\nimport { select as d3Select } 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 {\n AccessibilityProps,\n CartesianChart,\n CustomizedCalloutData,\n AreaChartProps,\n LineChartDataPoint,\n LineChartPoints,\n ChildProps,\n Margins,\n YValueHover,\n ChartPopoverProps,\n Chart,\n} from '../../index';\nimport {\n calloutData,\n getXAxisType,\n ChartTypes,\n XAxisTypes,\n getTypeOfAxis,\n tooltipOfAxislabels,\n getNextColor,\n getColorFromToken,\n formatDate,\n getSecureProps,\n areArraysEqual,\n getCurveFactory,\n find,\n findNumericMinMaxOfY,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfNumericForAreaChart,\n domainRangeOfDateForAreaLineVerticalBarChart,\n createStringYAxis,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport { Legend, Legends } from '../Legends/index';\nimport { ScaleLinear } from 'd3-scale';\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\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 const _tooltipId: string = useId('AreaChartTooltipID');\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 // 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: JSX.Element[];\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 = React.useRef<Chart>(null);\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 // eslint-disable-next-line @typescript-eslint/no-shadow\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 React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const classes = useAreaChartStyles(props);\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 = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);\n } else if (xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(\n points,\n margins,\n width,\n isRTL,\n tickValues! as Date[],\n chartType,\n barWidth,\n );\n } else {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n }\n return domainNRangeValue;\n }\n\n function _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 ? formatDate(pointToHighlight, props.useUTC) : pointToHighlight;\n const modifiedXVal = pointToHighlight instanceof Date ? pointToHighlight.getTime() : pointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n // eslint-disable-next-line @typescript-eslint/no-shadow\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) {\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 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 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, index: number) => {\n singleDataset.xVal = singleDataPoint.x;\n singleDataset[`chart${index}`] = 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 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 }\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[]): JSX.Element {\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 />\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 ): JSX.Element[] {\n const points = _addDefaultColors(props.data.lineChartData);\n const { pointOptions, pointLineOptions } = props.data;\n\n const graph: JSX.Element[] = [];\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 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\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 onClick={() => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!)}\n onFocus={() => _handleFocus(index, pointIndex, circleId)}\n onBlur={_handleBlur}\n {...getSecureProps(pointOptions)}\n r={_getCircleRadius(xDataPoint, circleRadius, circleId, legend)}\n role=\"img\"\n aria-label={_getAriaLabel(index, pointIndex)}\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 onClick={() => _onDataPointClick(points[index]!.data[pointIndex].onDataPointClick!)}\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 // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale);\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return graph;\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 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(lineIndex: number, pointIndex: number, circleId: string) {\n const { x, y, xAxisCalloutData } = props.data.lineChartData![lineIndex].data[pointIndex];\n const formattedDate = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const modifiedXVal = x instanceof Date ? x.getTime() : x;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = _calloutPoints.find((e: { x: string | number }) => e.x === modifiedXVal);\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 // 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 = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n (\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 _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: JSX.Element = _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,\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={findNumericMinMaxOfY}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop, @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","useAreaChartStyles","max","d3Max","bisector","pointer","select","d3Select","tokens","area","d3Area","stack","d3Stack","curveMonotoneX","d3CurveBasis","line","d3Line","CartesianChart","calloutData","getXAxisType","ChartTypes","XAxisTypes","getTypeOfAxis","tooltipOfAxislabels","getNextColor","getColorFromToken","formatDate","getSecureProps","areArraysEqual","getCurveFactory","find","findNumericMinMaxOfY","createNumericYAxis","domainRangeOfNumericForAreaChart","domainRangeOfDateForAreaLineVerticalBarChart","createStringYAxis","useId","Legends","bisect","d","x","left","InterceptVisibility","AreaChart","forwardRef","props","forwardedRef","_uniqueIdForGraph","_verticalLineId","_circleId","_rectId","_tooltipId","_enableComputationOptimization","_firstRenderOptimization","_emptyChartId","_containsSecondaryYAxis","_calloutPoints","_createSet","_colors","_opacity","_data","_chart","_margins","_xAxisRectScale","_isMultiStackChart","cartesianChartRef","useRef","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","useEffect","current","prevProps","useImperativeHandle","componentRef","chartContainer","classes","_getDomainNRangeValues","points","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","useUTC","modifiedXVal","found","element","_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","tempArr","valToCheck","filteredChartPoints","filter","point","val","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getGraphData","xAxis","yAxis","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","_drawGraph","_onLegendHover","legend","_onLegendLeave","_getLegendData","actions","singleChartData","checkSimilarLegends","leg","title","hoverAction","onMouseOutAction","legends","enabledWrapLines","enabledLegendsWrapLines","onChange","_onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","_onDataPointClick","func","_getOpacity","_legendHighlighted","_noLegendHighlighted","_getLineOpacity","_updateCircleFillColor","xDataPoint","lineColor","circleId","fillColor","colorNeutralBackground1","xScale","yScalePrimary","_addDefaultColors","pointOptions","pointLineOptions","graph","singleStackedData","yScale","useSecondaryYScale","curveFactory","lineOptions","curve","y0","y1","layerOpacity","Fragment","enableGradient","defs","linearGradient","id","x1","x2","y2","stop","offset","stopColor","path","fill","strokeWidth","stroke","onMouseMove","onMouseOut","onMouseOver","strokeDasharray","strokeDashoffset","strokeLinecap","circle","cx","cy","r","fillOpacity","optimizeLargeData","tabIndex","role","circleRadius","Number","g","clipPath","aria-label","map","singlePoint","pointIndex","onClick","onDataPointClick","onFocus","_handleFocus","onBlur","_handleBlur","_getCircleRadius","_getAriaLabel","visibility","showXAxisLablesTooltip","remove","e","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","axis","_getHighlightedLegend","includes","item","lineIndex","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","_getChartTitle","chartTitle","mode","secondaryYScaleOptions","some","isXAxisDateType","tickParams","tickFormat","calloutProps","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","isCalloutForStack","legendBars","createYAxis","getGraphData","getDomainNRangeValues","getmargins","onChartMouseLeave","getMinMaxOfYAxis","enableFirstRenderOptimization","children","ticks","width1","rectHeight","top","rect","height","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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O,YAAYpH;YACZqH,aAAa5T;YACbiF,WAAWgO,kBAAkB5T,WAAWiG,QAAQ,GAAGjG,WAAWgG,WAAW;YACzE6N,YAAYA;YACZtK,WAAW7C,KAAK6C,SAAS;YACzBiL,cAAc1I;YACd2I,uBAAuBnP;YACvBxE,mBAAmBA;YACnB4T,YAAYpO;YACZqO,mBAAmBzL;YACnB0L,kBAAkBlU;YAClBmU,+BAA+BrT,MAAM4I,sBAAsB,IAAIpI;YAC/DmD,cAAcvC;YACd,oCAAoC,GACpC,gFAAgF;YAChFkS,UAAU,CAACtT;gBACTkB,kBAAkBlB,MAAM+M,MAAM;gBAC9B,MAAMwG,QAAQrS,gBAAgBqS,KAAK;gBACnC,MAAMC,SAAStS,gBAAgBqS,KAAK,CAACA,MAAMtN,MAAM,GAAG,EAAE;gBACtD,MAAMwN,aAAazT,MAAMyK,eAAe,GAAIxJ,SAASyS,GAAG;gBACxD,qBACE,wDACE,oBAAC7D,yBACC,oBAAC8D;oBACCzF,IAAI7N;oBACJ4D,OAAOuP;oBACPI,QAAQH;oBACR/E,MAAM;oBACNG,aAAa9C,CAAAA,QAAShH,iBAAiBgH;oBACvC+C,YAAY3H;oBACZ4H,aAAahD,CAAAA,QAAShH,iBAAiBgH;mCAG3C,oBAAC8D,WAAG7O;YAGV;;IAGN;IACA,qBACE,oBAAC6S;QAAI3F,IAAIzN;QAAeiP,MAAM;QAASoE,OAAO;YAAE/K,SAAS;QAAI;QAAGgH,cAAY;;AAEhF,GACA;AACFjQ,UAAUiU,WAAW,GAAG"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useCartesianChartStyles } from './useCartesianChartStyles.styles';
3
3
  import { select as d3Select } from 'd3-selection';
4
- import { createNumericXAxis, createStringXAxis, getDomainNRangeValues, createDateXAxis, createYAxis, createStringYAxis, getMinMaxOfYAxis, XAxisTypes, YAxisType, createWrapOfXLabels, rotateXAxisLabels, calculateLongestLabelWidth, createYAxisLabels, ChartTypes, wrapContent, useRtl, truncateString, tooltipOfAxislabels } from '../../utilities/index';
4
+ import { createNumericXAxis, createStringXAxis, createDateXAxis, XAxisTypes, YAxisType, createWrapOfXLabels, rotateXAxisLabels, calculateLongestLabelWidth, createYAxisLabels, ChartTypes, wrapContent, useRtl, truncateString, tooltipOfAxislabels } from '../../utilities/index';
5
5
  import { useId } from '@fluentui/react-utilities';
6
6
  import { SVGTooltipText } from '../../utilities/SVGTooltipText';
7
7
  import { ChartPopover } from './ChartPopover';
@@ -178,8 +178,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
178
178
  if (props.enableFirstRenderOptimization && chartContainer.current || !props.enableFirstRenderOptimization) {
179
179
  _isFirstRender.current = false;
180
180
  const XAxisParams = {
181
- domainNRangeValues: props.getDomainNRangeValues ? props.getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues, // This is only used for Horizontal Bar Chart with Axis for y as string axis
182
- startFromX) : getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues, // This is only used for Horizontal Bar Chart with Axis for y as string axis
181
+ domainNRangeValues: props.getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues, // This is only used for Horizontal Bar Chart with Axis for y as string axis
183
182
  startFromX),
184
183
  containerHeight: containerHeight - removalValueForTextTuncate,
185
184
  margins: margins,
@@ -205,7 +204,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
205
204
  yMaxValue: props.yMaxValue || 0,
206
205
  tickPadding: props.showYAxisLablesTooltip ? 15 : 10,
207
206
  maxOfYVal: props.maxOfYVal,
208
- yMinMaxValues: props.getMinMaxOfYAxis ? props.getMinMaxOfYAxis(points, props.yAxisType) : getMinMaxOfYAxis(points, chartType, props.yAxisType),
207
+ yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),
209
208
  // please note these padding default values must be consistent in here
210
209
  // and the parent chart(HBWA/Vertical etc..) for more details refer example
211
210
  // http://using-d3js.com/04_07_ordinal_scales.html
@@ -266,7 +265,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
266
265
  yAxisDomainValues: []
267
266
  };
268
267
  if (props.yAxisType && props.yAxisType === YAxisType.StringAxis) {
269
- yScalePrimary = createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, props.chartType, props.barwidth, culture);
268
+ yScalePrimary = props.createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, props.barwidth);
270
269
  } else {
271
270
  // TODO: Since the scale domain values are now computed independently for both the primary and
272
271
  // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately
@@ -286,17 +285,17 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
286
285
  yMinValue: ((_props_secondaryYScaleOptions = props.secondaryYScaleOptions) === null || _props_secondaryYScaleOptions === void 0 ? void 0 : _props_secondaryYScaleOptions.yMinValue) || 0,
287
286
  yMaxValue: (_props_secondaryYScaleOptions_yMaxValue = (_props_secondaryYScaleOptions1 = props.secondaryYScaleOptions) === null || _props_secondaryYScaleOptions1 === void 0 ? void 0 : _props_secondaryYScaleOptions1.yMaxValue) !== null && _props_secondaryYScaleOptions_yMaxValue !== void 0 ? _props_secondaryYScaleOptions_yMaxValue : 100,
288
287
  tickPadding: 10,
289
- yMinMaxValues: props.getMinMaxOfYAxis ? props.getMinMaxOfYAxis(points, props.yAxisType, true) : getMinMaxOfYAxis(points, props.chartType, props.yAxisType, true),
288
+ yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),
290
289
  yAxisPadding: props.yAxisPadding
291
290
  };
292
- yScaleSecondary = createYAxis(YAxisParamsSecondary, _useRtl, axisData, chartType, props.barwidth, isIntegralDataset, true, props.roundedTicks);
291
+ yScaleSecondary = props.createYAxis(YAxisParamsSecondary, _useRtl, axisData, isIntegralDataset, chartType, true, props.roundedTicks);
293
292
  }
294
- yScalePrimary = createYAxis(YAxisParams, _useRtl, axisData, chartType, props.barwidth, isIntegralDataset, false, props.roundedTicks);
293
+ yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks);
295
294
  }
296
295
  if (chartTypesToCheck.includes(props.chartType)) {
297
296
  // To create y axis tick values by if specified truncating the rest of the text
298
297
  // and showing elipsis or showing the whole string,
299
- yScalePrimary && createYAxisLabels(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, 0, _useRtl);
298
+ yScalePrimary && createYAxisLabels(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, _useRtl);
300
299
  // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
301
300
  // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
302
301
  // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)