@fluentui/react-charts 9.1.5 → 9.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/dist/index.d.ts +42 -2
- package/lib/components/AreaChart/AreaChart.js +3 -3
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +42 -9
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +1 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +37 -9
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -13
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +7 -6
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +16 -17
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +13 -7
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +3 -3
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -61
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +6 -31
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +2 -1
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +3 -3
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +2 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +25 -23
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +29 -0
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.js +11 -13
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -7
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +13 -15
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +2 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +7 -7
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +3 -3
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/utilities/utilities.js +11 -5
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +2 -2
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +2 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +41 -8
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +55 -9
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +8 -7
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +16 -17
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +13 -9
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +2 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -61
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +5 -54
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +2 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +2 -2
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +2 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +25 -23
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +49 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +11 -13
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +15 -8
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +12 -14
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +2 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +6 -6
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +2 -2
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +16 -7
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-charts
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri,
|
|
3
|
+
This log was last generated on Fri, 04 Jul 2025 10:00:11 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.1.6)
|
|
8
|
+
|
|
9
|
+
Fri, 04 Jul 2025 10:00:11 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.1.5..@fluentui/react-charts_v9.1.6)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: ensure ResponsiveContainer resizes correctly within grid layout ([PR #34728](https://github.com/microsoft/fluentui/pull/34728) by kumarkshitij@microsoft.com)
|
|
15
|
+
- port v8 changes to v9 ([PR #34731](https://github.com/microsoft/fluentui/pull/34731) by anushgupta@microsoft.com)
|
|
16
|
+
- Bump @fluentui/react-overflow to v9.4.6 ([PR #34457](https://github.com/microsoft/fluentui/pull/34457) by beachball)
|
|
17
|
+
- Bump @fluentui/react-popover to v9.11.6 ([PR #34457](https://github.com/microsoft/fluentui/pull/34457) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tooltip to v9.7.6 ([PR #34457](https://github.com/microsoft/fluentui/pull/34457) by beachball)
|
|
19
|
+
|
|
7
20
|
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.1.5)
|
|
8
21
|
|
|
9
|
-
Fri, 27 Jun 2025 13:
|
|
22
|
+
Fri, 27 Jun 2025 13:39:41 GMT
|
|
10
23
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.1.4..@fluentui/react-charts_v9.1.5)
|
|
11
24
|
|
|
12
25
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -345,7 +345,7 @@ export declare interface CartesianChartProps {
|
|
|
345
345
|
svgProps?: React_2.SVGProps<SVGSVGElement>;
|
|
346
346
|
/**
|
|
347
347
|
* Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows
|
|
348
|
-
* @
|
|
348
|
+
* @deprecated Use `reflowProps` instead.
|
|
349
349
|
*/
|
|
350
350
|
enableReflow?: boolean;
|
|
351
351
|
/**
|
|
@@ -448,6 +448,7 @@ export declare interface CartesianChartStyleProps {
|
|
|
448
448
|
toDrawShape?: boolean;
|
|
449
449
|
/**
|
|
450
450
|
* Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows
|
|
451
|
+
* @deprecated Use `reflowProps` instead.
|
|
451
452
|
*/
|
|
452
453
|
enableReflow?: boolean;
|
|
453
454
|
}
|
|
@@ -509,6 +510,10 @@ export declare interface CartesianChartStyles {
|
|
|
509
510
|
* Styles for the svg tooltip
|
|
510
511
|
*/
|
|
511
512
|
svgTooltip?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Styles for the chart svg element
|
|
515
|
+
*/
|
|
516
|
+
chart?: string;
|
|
512
517
|
}
|
|
513
518
|
|
|
514
519
|
/**
|
|
@@ -1162,6 +1167,10 @@ export declare interface GaugeChartStyles {
|
|
|
1162
1167
|
* Styles for the shape object in the callout
|
|
1163
1168
|
*/
|
|
1164
1169
|
shapeStyles?: string;
|
|
1170
|
+
/**
|
|
1171
|
+
* Styles for the chart wrapper div
|
|
1172
|
+
*/
|
|
1173
|
+
chartWrapper?: string;
|
|
1165
1174
|
}
|
|
1166
1175
|
|
|
1167
1176
|
/**
|
|
@@ -1517,6 +1526,11 @@ export declare interface HeatMapChartProps extends CartesianChartProps {
|
|
|
1517
1526
|
* @default alphabetical
|
|
1518
1527
|
* The prop used to decide order of string axis labels */
|
|
1519
1528
|
sortOrder?: 'none' | 'alphabetical';
|
|
1529
|
+
/**
|
|
1530
|
+
*@default false
|
|
1531
|
+
*Used for to elipse y axis labes and show tooltip on x axis labels
|
|
1532
|
+
*/
|
|
1533
|
+
showYAxisLablesTooltip?: boolean;
|
|
1520
1534
|
}
|
|
1521
1535
|
|
|
1522
1536
|
/**
|
|
@@ -2588,6 +2602,17 @@ export declare interface ResponsiveChildProps {
|
|
|
2588
2602
|
width?: number;
|
|
2589
2603
|
height?: number;
|
|
2590
2604
|
shouldResize?: number;
|
|
2605
|
+
styles?: ResponsiveChildStyles;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
/**
|
|
2609
|
+
* Responsive Child styles
|
|
2610
|
+
* {@docCategory ResponsiveContainer}
|
|
2611
|
+
*/
|
|
2612
|
+
export declare interface ResponsiveChildStyles {
|
|
2613
|
+
root?: string;
|
|
2614
|
+
chartWrapper?: string;
|
|
2615
|
+
chart?: string;
|
|
2591
2616
|
}
|
|
2592
2617
|
|
|
2593
2618
|
/**
|
|
@@ -2725,7 +2750,7 @@ export declare interface SankeyChartProps {
|
|
|
2725
2750
|
formatNumberOptions?: Intl.NumberFormatOptions;
|
|
2726
2751
|
/**
|
|
2727
2752
|
* Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows
|
|
2728
|
-
* @
|
|
2753
|
+
* @deprecated Use `reflowProps` instead.
|
|
2729
2754
|
*/
|
|
2730
2755
|
enableReflow?: boolean;
|
|
2731
2756
|
/**
|
|
@@ -2741,6 +2766,17 @@ export declare interface SankeyChartProps {
|
|
|
2741
2766
|
* The prop used to define the culture to localize the numbers and date
|
|
2742
2767
|
*/
|
|
2743
2768
|
culture?: string;
|
|
2769
|
+
/**
|
|
2770
|
+
* Props related to reflow behavior of the chart
|
|
2771
|
+
*/
|
|
2772
|
+
reflowProps?: {
|
|
2773
|
+
/**
|
|
2774
|
+
* Determines the reflow behavior of the chart.
|
|
2775
|
+
* When set to `'min-width'`, the chart will not shrink below a certain width and will enable scrolling if it overflows.
|
|
2776
|
+
* @default 'none'
|
|
2777
|
+
*/
|
|
2778
|
+
mode: 'none' | 'min-width';
|
|
2779
|
+
};
|
|
2744
2780
|
}
|
|
2745
2781
|
|
|
2746
2782
|
/**
|
|
@@ -2783,6 +2819,10 @@ export declare interface SankeyChartStyles {
|
|
|
2783
2819
|
* Styles for the chart wrapper div
|
|
2784
2820
|
*/
|
|
2785
2821
|
chartWrapper?: string;
|
|
2822
|
+
/**
|
|
2823
|
+
* Styles for the chart svg element
|
|
2824
|
+
*/
|
|
2825
|
+
chart?: string;
|
|
2786
2826
|
}
|
|
2787
2827
|
|
|
2788
2828
|
declare type SankeyLayoutGenerator = SankeyLayout<SankeyGraph<{}, {}>, {}, {}>;
|
|
@@ -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,
|
|
9
|
+
import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, tooltipOfAxislabels, getNextColor, getColorFromToken, formatDate, getSecureProps, areArraysEqual, getCurveFactory, find, findNumericMinMaxOfY } 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
|
|
@@ -603,9 +603,9 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
|
603
603
|
const tooltipProps = {
|
|
604
604
|
tooltipCls: classes.tooltip,
|
|
605
605
|
id: _tooltipId,
|
|
606
|
-
|
|
606
|
+
axis: xAxisElement
|
|
607
607
|
};
|
|
608
|
-
xAxisElement &&
|
|
608
|
+
xAxisElement && tooltipOfAxislabels(tooltipProps);
|
|
609
609
|
}
|
|
610
610
|
return graph;
|
|
611
611
|
}
|
|
@@ -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 tooltipOfXAxislabels,\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 xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(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","tooltipOfXAxislabels","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","_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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iBAAiBmH;mCAG3C,oBAAC8D,WAAGjO;YAGV;;IAGN;IACA,qBACE,oBAACiS;QAAI3F,IAAI7M;QAAeqO,MAAM;QAASoE,OAAO;YAAE/K,SAAS;QAAI;QAAGgH,cAAY;;AAEhF,GACA;AACFrP,UAAUqT,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} 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"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gBAAgByR,KAAK;gBACnC,MAAMC,SAAS1R,gBAAgByR,KAAK,CAACA,MAAMzN,MAAM,GAAG,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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","areaChartClassNames","tooltip","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","d","p","useAreaChartStyles","props","baseStyles"],"sources":["useAreaChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const areaChartClassNames = {\n tooltip: 'fui-ac__tooltip',\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n descriptionMessage: '',\n axisTitle: '',\n chartTitle: '',\n opacityChangeOnHover: '',\n shapeStyles: '',\n chartWrapper: '',\n svgTooltip: ''\n};\nconst useStyles = makeStyles({\n tooltip: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.padding(tokens.spacingHorizontalS),\n position: 'absolute',\n textAlign: 'center',\n top: tokens.spacingVerticalNone,\n backgroundColor: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusSmall,\n pointerEvents: 'none',\n color: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the AreaChart slots based on the state\n */ export const useAreaChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(areaChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ )\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,OAAO,EAAE,iBAAiB;EAC1BC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,KAAK,EAAE,EAAE;EACTC,eAAe,EAAE,EAAE;EACnBC,KAAK,EAAE,EAAE;EACTC,kBAAkB,EAAE,EAAE;EACtBC,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE,EAAE;EACdC,oBAAoB,EAAE,EAAE;EACxBC,WAAW,EAAE,EAAE;EACfC,YAAY,EAAE,EAAE;EAChBC,UAAU,EAAE;
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","areaChartClassNames","tooltip","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","d","p","useAreaChartStyles","props","baseStyles"],"sources":["useAreaChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const areaChartClassNames = {\n tooltip: 'fui-ac__tooltip',\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n descriptionMessage: '',\n axisTitle: '',\n chartTitle: '',\n opacityChangeOnHover: '',\n shapeStyles: '',\n chartWrapper: '',\n svgTooltip: '',\n chart: ''\n};\nconst useStyles = makeStyles({\n tooltip: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n ...shorthands.padding(tokens.spacingHorizontalS),\n position: 'absolute',\n textAlign: 'center',\n top: tokens.spacingVerticalNone,\n backgroundColor: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusSmall,\n pointerEvents: 'none',\n color: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the AreaChart slots based on the state\n */ export const useAreaChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(areaChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ )\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,OAAO,EAAE,iBAAiB;EAC1BC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,KAAK,EAAE,EAAE;EACTC,eAAe,EAAE,EAAE;EACnBC,KAAK,EAAE,EAAE;EACTC,kBAAkB,EAAE,EAAE;EACtBC,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE,EAAE;EACdC,oBAAoB,EAAE,EAAE;EACxBC,WAAW,EAAE,EAAE;EACfC,YAAY,EAAE,EAAE;EAChBC,UAAU,EAAE,EAAE;EACdC,KAAK,EAAE;AACX,CAAC;AACD,MAAMC,SAAS,gBAAGpB,QAAA;EAAAM,OAAA;IAAAe,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;AAAA,CAcjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,kBAAkB,GAAIC,KAAK,IAAG;EAC3C,MAAMC,UAAU,GAAG1B,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHd,OAAO,EAAEL,YAAY,CAACI,mBAAmB,CAACC,OAAO,EAAEwC,UAAU,CAACxC,OAAO,CAAC,yBAA0B;EACpG,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCartesianChartStyles } from './useCartesianChartStyles.styles';
|
|
3
|
-
import {
|
|
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';
|
|
5
|
+
import { useId } from '@fluentui/react-utilities';
|
|
4
6
|
import { SVGTooltipText } from '../../utilities/SVGTooltipText';
|
|
5
7
|
import { ChartPopover } from './ChartPopover';
|
|
6
8
|
import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
@@ -25,6 +27,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
|
|
|
25
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
28
|
let _xScale;
|
|
27
29
|
let isIntegralDataset = true;
|
|
30
|
+
let _tooltipId = useId('tooltip_');
|
|
28
31
|
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
29
32
|
const [containerHeight, setContainerHeight] = React.useState(0);
|
|
30
33
|
const [isRemoveValCalculated, setIsRemoveValCalculated] = React.useState(true);
|
|
@@ -141,11 +144,17 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
|
|
|
141
144
|
}
|
|
142
145
|
function calculateMaxYAxisLabelLength(chartType, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
146
|
points, className) {
|
|
147
|
+
const formatTickLabel = (str)=>{
|
|
148
|
+
if (props.showYAxisLablesTooltip) {
|
|
149
|
+
return truncateString(str, props.noOfCharsToTruncate || 4);
|
|
150
|
+
}
|
|
151
|
+
return str;
|
|
152
|
+
};
|
|
144
153
|
if (chartType === ChartTypes.HeatMapChart) {
|
|
145
154
|
var _points__data, _points_;
|
|
146
|
-
return calculateLongestLabelWidth((_points_ = points[0]) === null || _points_ === void 0 ? void 0 : (_points__data = _points_.data) === null || _points__data === void 0 ? void 0 : _points__data.map((point)=>point.y), `.${className} text`);
|
|
155
|
+
return calculateLongestLabelWidth((_points_ = points[0]) === null || _points_ === void 0 ? void 0 : (_points__data = _points_.data) === null || _points__data === void 0 ? void 0 : _points__data.map((point)=>formatTickLabel(`${point.y}`)), `.${className} text`);
|
|
147
156
|
} else {
|
|
148
|
-
return calculateLongestLabelWidth(points === null || points === void 0 ? void 0 : points.map((point)=>point.y), `.${className} text`);
|
|
157
|
+
return calculateLongestLabelWidth(points === null || points === void 0 ? void 0 : points.map((point)=>formatTickLabel(`${point.y}`)), `.${className} text`);
|
|
149
158
|
}
|
|
150
159
|
}
|
|
151
160
|
const { calloutProps, points, chartType, svgProps, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter } = props;
|
|
@@ -194,7 +203,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
|
|
|
194
203
|
yAxisTickCount: props.yAxisTickCount,
|
|
195
204
|
yMinValue: props.yMinValue || 0,
|
|
196
205
|
yMaxValue: props.yMaxValue || 0,
|
|
197
|
-
tickPadding: 10,
|
|
206
|
+
tickPadding: props.showYAxisLablesTooltip ? 15 : 10,
|
|
198
207
|
maxOfYVal: props.maxOfYVal,
|
|
199
208
|
yMinMaxValues: props.getMinMaxOfYAxis ? props.getMinMaxOfYAxis(points, props.yAxisType) : getMinMaxOfYAxis(points, chartType, props.yAxisType),
|
|
200
209
|
// please note these padding default values must be consistent in here
|
|
@@ -284,11 +293,34 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
|
|
|
284
293
|
}
|
|
285
294
|
yScalePrimary = createYAxis(YAxisParams, _useRtl, axisData, chartType, props.barwidth, isIntegralDataset, false, props.roundedTicks);
|
|
286
295
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
296
|
+
if (chartTypesToCheck.includes(props.chartType)) {
|
|
297
|
+
// To create y axis tick values by if specified truncating the rest of the text
|
|
298
|
+
// and showing elipsis or showing the whole string,
|
|
299
|
+
yScalePrimary && createYAxisLabels(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, 0, _useRtl);
|
|
300
|
+
// Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
|
|
301
|
+
// of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
|
|
302
|
+
// in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)
|
|
303
|
+
if (!props.showYAxisLablesTooltip) {
|
|
304
|
+
try {
|
|
305
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
306
|
+
//eslint-disable-next-line no-empty
|
|
307
|
+
} catch (e) {}
|
|
308
|
+
}
|
|
309
|
+
// Used to display tooltip at y axis labels.
|
|
310
|
+
if (props.showYAxisLablesTooltip) {
|
|
311
|
+
const _yAxisElement = d3Select(yAxisElement.current).call(yScalePrimary);
|
|
312
|
+
try {
|
|
313
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
314
|
+
//eslint-disable-next-line no-empty
|
|
315
|
+
} catch (e) {}
|
|
316
|
+
const ytooltipProps = {
|
|
317
|
+
tooltipCls: classes.tooltip,
|
|
318
|
+
id: _tooltipId,
|
|
319
|
+
axis: _yAxisElement
|
|
320
|
+
};
|
|
321
|
+
_yAxisElement && tooltipOfAxislabels(ytooltipProps);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
292
324
|
// Call back to the chart.
|
|
293
325
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
294
326
|
const _getData = (xScale, yScalePrimary, yScaleSecondary)=>{
|
|
@@ -413,6 +445,7 @@ import { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabs
|
|
|
413
445
|
style: {
|
|
414
446
|
display: 'block'
|
|
415
447
|
},
|
|
448
|
+
className: classes.chart,
|
|
416
449
|
...svgProps
|
|
417
450
|
}, /*#__PURE__*/ React.createElement("g", {
|
|
418
451
|
ref: (e)=>{
|