@fluentui/react-charts 9.0.1 → 9.0.2
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 +17 -2
- package/dist/index.d.ts +463 -36
- package/lib/GaugeChart.js +1 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/GroupedVerticalBarChart.js +1 -0
- package/lib/GroupedVerticalBarChart.js.map +1 -0
- package/lib/ScatterChart.js +1 -0
- package/lib/ScatterChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js +589 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +174 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +492 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/index.js +3 -0
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +90 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +478 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib/components/ScatterChart/index.js +3 -0
- package/lib/components/ScatterChart/index.js.map +1 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +65 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/utilities.js +123 -5
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/GaugeChart.js +6 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/ScatterChart.js +6 -0
- package/lib-commonjs/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +618 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.js +8 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +252 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +498 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +139 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +484 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/index.js +8 -0
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +96 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/index.js +3 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +115 -5
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
export const groupedVerticalBarChartClassNames = {
|
|
4
|
+
opacityChangeOnHover: 'fui-gvbc**opacityChangeOnHover',
|
|
5
|
+
tooltip: 'fui-gvbc**tooltip',
|
|
6
|
+
barLabel: 'fui-gvbc**barLabel',
|
|
7
|
+
root: '',
|
|
8
|
+
xAxis: '',
|
|
9
|
+
yAxis: '',
|
|
10
|
+
legendContainer: '',
|
|
11
|
+
hover: '',
|
|
12
|
+
calloutContentRoot: '',
|
|
13
|
+
calloutContentX: '',
|
|
14
|
+
calloutContentY: '',
|
|
15
|
+
descriptionMessage: '',
|
|
16
|
+
calloutDateTimeContainer: '',
|
|
17
|
+
calloutInfoContainer: '',
|
|
18
|
+
calloutBlockContainer: '',
|
|
19
|
+
calloutBlockContainertoDrawShapefalse: '',
|
|
20
|
+
calloutBlockContainertoDrawShapetrue: '',
|
|
21
|
+
calloutlegendText: '',
|
|
22
|
+
axisTitle: '',
|
|
23
|
+
chartTitle: '',
|
|
24
|
+
shapeStyles: '',
|
|
25
|
+
chartWrapper: ''
|
|
26
|
+
};
|
|
27
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
28
|
+
opacityChangeOnHover: {
|
|
29
|
+
Bceei9c: "f158kwzp"
|
|
30
|
+
},
|
|
31
|
+
tooltip: {
|
|
32
|
+
Bahqtrf: "fk6fouc",
|
|
33
|
+
Be2twd7: "fkhj508",
|
|
34
|
+
Bhrd7zp: "figsok6",
|
|
35
|
+
Bg96gwp: "f1i3iumi",
|
|
36
|
+
mc9l5x: "f22iagw",
|
|
37
|
+
Beiy3e4: "f1vx9l62",
|
|
38
|
+
z8tnut: "f17mpqex",
|
|
39
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
40
|
+
Byoj8tv: "fdvome7",
|
|
41
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
|
|
42
|
+
qhf8xq: "f1euv43f",
|
|
43
|
+
fsow6f: "f17mccla",
|
|
44
|
+
Bhzewxz: "fr6rvge",
|
|
45
|
+
Bkfmm31: "f5q6cfr",
|
|
46
|
+
Bgh53k4: 0,
|
|
47
|
+
B2eet1l: 0,
|
|
48
|
+
De3pzq: 0,
|
|
49
|
+
Bcmaq0h: 0,
|
|
50
|
+
gk0gix: 0,
|
|
51
|
+
B20660r: 0,
|
|
52
|
+
B8a6bjv: 0,
|
|
53
|
+
Bpptf2m: 0,
|
|
54
|
+
e5kdtc: 0,
|
|
55
|
+
Bkjc3bi: 0,
|
|
56
|
+
ayd6f0: "fcm7iae",
|
|
57
|
+
Beyfa6y: 0,
|
|
58
|
+
Bbmb7ep: 0,
|
|
59
|
+
Btl43ni: 0,
|
|
60
|
+
B7oj6ja: 0,
|
|
61
|
+
Dimara: "fq9zq91",
|
|
62
|
+
Bkecrkj: "f1aehjj5",
|
|
63
|
+
sj55zd: "f19n0e5"
|
|
64
|
+
},
|
|
65
|
+
barLabel: {
|
|
66
|
+
Bahqtrf: "fk6fouc",
|
|
67
|
+
Be2twd7: "fy9rknc",
|
|
68
|
+
Bhrd7zp: "fl43uef",
|
|
69
|
+
Bg96gwp: "fwrc4pm",
|
|
70
|
+
Bkfmm31: "fhuob2q"
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
d: [".f158kwzp{cursor:default;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f22iagw{display:flex;}", ".f1vx9l62{flex-direction:column;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f1euv43f{position:absolute;}", ".f17mccla{text-align:center;}", ".fr6rvge{top:var(--spacingVerticalNone);}", ".f5q6cfr{fill:var(--colorNeutralBackground1);}", [".fcm7iae{background:var(--colorNeutralBackground1);}", {
|
|
74
|
+
p: -2
|
|
75
|
+
}], [".fq9zq91{border-radius:var(--borderRadiusSmall);}", {
|
|
76
|
+
p: -1
|
|
77
|
+
}], ".f1aehjj5{pointer-events:none;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fhuob2q{fill:var(--colorNeutralForeground1);}"]
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Apply styling to the GroupedVerticalBarChart slots based on the state
|
|
81
|
+
*/
|
|
82
|
+
export const useGroupedVerticalBarChartStyles_unstable = props => {
|
|
83
|
+
const baseStyles = useStyles();
|
|
84
|
+
return {
|
|
85
|
+
opacityChangeOnHover: mergeClasses(groupedVerticalBarChartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/),
|
|
86
|
+
tooltip: mergeClasses(groupedVerticalBarChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),
|
|
87
|
+
barLabel: mergeClasses(groupedVerticalBarChartClassNames.barLabel, baseStyles.barLabel /*props.styles?.barLabel*/)
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=useGroupedVerticalBarChartStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","groupedVerticalBarChartClassNames","opacityChangeOnHover","tooltip","barLabel","root","xAxis","yAxis","legendContainer","hover","calloutContentRoot","calloutContentX","calloutContentY","descriptionMessage","calloutDateTimeContainer","calloutInfoContainer","calloutBlockContainer","calloutBlockContainertoDrawShapefalse","calloutBlockContainertoDrawShapetrue","calloutlegendText","axisTitle","chartTitle","shapeStyles","chartWrapper","useStyles","Bceei9c","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","Bkfmm31","Bgh53k4","B2eet1l","De3pzq","Bcmaq0h","gk0gix","B20660r","B8a6bjv","Bpptf2m","e5kdtc","Bkjc3bi","ayd6f0","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","d","p","useGroupedVerticalBarChartStyles_unstable","props","baseStyles"],"sources":["useGroupedVerticalBarChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const groupedVerticalBarChartClassNames = {\n opacityChangeOnHover: 'fui-gvbc**opacityChangeOnHover',\n tooltip: 'fui-gvbc**tooltip',\n barLabel: 'fui-gvbc**barLabel',\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n calloutContentRoot: '',\n calloutContentX: '',\n calloutContentY: '',\n descriptionMessage: '',\n calloutDateTimeContainer: '',\n calloutInfoContainer: '',\n calloutBlockContainer: '',\n calloutBlockContainertoDrawShapefalse: '',\n calloutBlockContainertoDrawShapetrue: '',\n calloutlegendText: '',\n axisTitle: '',\n chartTitle: '',\n shapeStyles: '',\n chartWrapper: ''\n};\nconst useStyles = makeStyles({\n opacityChangeOnHover: {\n cursor: 'default'\n },\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 fill: tokens.colorNeutralBackground1,\n background: tokens.colorNeutralBackground1,\n borderRadius: tokens.borderRadiusSmall,\n pointerEvents: 'none',\n color: tokens.colorNeutralForeground1\n },\n barLabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1\n }\n});\n/**\n * Apply styling to the GroupedVerticalBarChart slots based on the state\n */ export const useGroupedVerticalBarChartStyles_unstable = (props)=>{\n const baseStyles = useStyles();\n return {\n opacityChangeOnHover: mergeClasses(groupedVerticalBarChartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/ ),\n tooltip: mergeClasses(groupedVerticalBarChartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n barLabel: mergeClasses(groupedVerticalBarChartClassNames.barLabel, baseStyles.barLabel /*props.styles?.barLabel*/ )\n };\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,iCAAiC,GAAG;EAC7CC,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;EAAA;AAAA,CAsBjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,yCAAyC,GAAIC,KAAK,IAAG;EAClE,MAAMC,UAAU,GAAGtC,SAAS,CAAC,CAAC;EAC9B,OAAO;IACHtB,oBAAoB,EAAEL,YAAY,CAACI,iCAAiC,CAACC,oBAAoB,EAAE4D,UAAU,CAAC5D,oBAAoB,CAAC,sCAAuC,CAAC;IACnKC,OAAO,EAAEN,YAAY,CAACI,iCAAiC,CAACE,OAAO,EAAE2D,UAAU,CAAC3D,OAAO,CAAC,yBAA0B,CAAC;IAC/GC,QAAQ,EAAEP,YAAY,CAACI,iCAAiC,CAACG,QAAQ,EAAE0D,UAAU,CAAC1D,QAAQ,CAAC,0BAA2B;EACtH,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items.\n * This prop is used for
|
|
1
|
+
{"version":3,"sources":["Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * @public\n * Legends styles\n * {@docCategory Legends}\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n}\n\n/**\n * @public\n * ILegend interface\n * {@docCategory Legends}\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\n/**\n * @public\n * Legend style properties\n * {@docCategory Legends}\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * @public\n * Legend properties\n * {@docCategory Legends}\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n}\n\n/**\n * @public\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LineChartProps } from './LineChart.types';\nimport { useLineChartStyles } from './useLineChartStyles.styles';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select, pointer } from 'd3-selection';\nimport { bisector } from 'd3-array';\nimport { Legend, Legends } from '../Legends/index';\nimport { line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';\nimport { useId } from '@fluentui/react-utilities';\nimport { find } from '../../utilities/index';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n LineChartPoints,\n CustomizedCalloutData,\n Margins,\n RefArrayData,\n ColorFillBarsProps,\n LineChartGap,\n LineChartDataPoint,\n Chart,\n} from '../../index';\nimport { EventsAnnotation } from './eventAnnotation/EventAnnotation';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n calloutData,\n ChartTypes,\n getXAxisType,\n XAxisTypes,\n tooltipOfXAxislabels,\n Points,\n pointTypes,\n getMinMaxOfYAxis,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n useRtl,\n formatDate,\n} from '../../utilities/index';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\nenum PointSize {\n hoverSize = 11,\n invisibleSize = 1,\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst DEFAULT_LINE_STROKE_SIZE = 4;\n// The given shape of a icon must be 2.5 times bigger than line width (known as stroke width)\nconst PATH_MULTIPLY_SIZE = 2.5;\n\n/**\n *\n * @param x units from origin\n * @param y units from origin\n * @param w is the legnth of the each side of a shape\n * @param index index to get the shape path\n */\nconst _getPointPath = (x: number, y: number, w: number, index: number): string => {\n const allPointPaths = [\n // circle path\n `M${x - w / 2} ${y}\n A${w / 2} ${w / 2} 0 1 0 ${x + w / 2} ${y}\n M${x - w / 2} ${y}\n A ${w / 2} ${w / 2} 0 1 1 ${x + w / 2} ${y}\n `,\n //square\n `M${x - w / 2} ${y - w / 2}\n L${x + w / 2} ${y - w / 2}\n L${x + w / 2} ${y + w / 2}\n L${x - w / 2} ${y + w / 2}\n Z`,\n //triangle\n `M${x - w / 2} ${y - 0.2886 * w}\n H ${x + w / 2}\n L${x} ${y + 0.5774 * w} Z`,\n //diamond\n `M${x} ${y - w / 2}\n L${x + w / 2} ${y}\n L${x} ${y + w / 2}\n L${x - w / 2} ${y}\n Z`,\n //pyramid\n `M${x} ${y - 0.5774 * w}\n L${x + w / 2} ${y + 0.2886 * w}\n L${x - w / 2} ${y + 0.2886 * w} Z`,\n //hexagon\n `M${x - 0.5 * w} ${y - 0.866 * w}\n L${x + 0.5 * w} ${y - 0.866 * w}\n L${x + w} ${y}\n L${x + 0.5 * w} ${y + 0.866 * w}\n L${x - 0.5 * w} ${y + 0.866 * w}\n L${x - w} ${y}\n Z`,\n //pentagon\n `M${x} ${y - 0.851 * w}\n L${x + 0.6884 * w} ${y - 0.2633 * w}\n L${x + 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.6884 * w} ${y - 0.2633 * w}\n Z`,\n //octagon\n `M${x - 0.5001 * w} ${y - 1.207 * w}\n L${x + 0.5001 * w} ${y - 1.207 * w}\n L${x + 1.207 * w} ${y - 0.5001 * w}\n L${x + 1.207 * w} ${y + 0.5001 * w}\n L${x + 0.5001 * w} ${y + 1.207 * w}\n L${x - 0.5001 * w} ${y + 1.207 * w}\n L${x - 1.207 * w} ${y + 0.5001 * w}\n L${x - 1.207 * w} ${y - 0.5001 * w}\n Z`,\n ];\n return allPointPaths[index];\n};\n\ntype LineChartDataWithIndex = LineChartPoints & { index: number };\n\n// Create a LineChart variant which uses these default styles and this styled subcomponent.\n/**\n * Linechart component\n * {@docCategory LineChart}\n */\nexport const LineChart: React.FunctionComponent<LineChartProps> = React.forwardRef<HTMLDivElement, LineChartProps>(\n (props, forwardedRef) => {\n let _points: LineChartDataWithIndex[] = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any[] = calloutData(_points) || [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisScale: any = '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _yAxisScale: any = '';\n let _circleId: string = useId('circle');\n let _lineId: string = useId('lineID');\n let _borderId: string = useId('borderID');\n let _verticalLine: string = useId('verticalLine');\n let _colorFillBarPatternId: string = useId('colorFillBarPattern');\n let _uniqueCallOutID: string | null = '';\n let _refArray: RefArrayData[] = [];\n let margins: Margins;\n let eventLabelHeight: number = 36;\n let lines: JSX.Element[];\n let _renderedColorFillBars: JSX.Element[];\n const _colorFillBars = React.useRef<ColorFillBarsProps[]>([]);\n let _tooltipId: string = useId('LineChartTooltipId_');\n let _rectId: string = useId('containerRectLD');\n let _staticHighlightCircle: string = useId('staticHighlightCircle');\n let _firstRenderOptimization = true;\n let _emptyChartId: string = useId('_LineChart_empty');\n const _colorFillBarId = useId('_colorFillBarId');\n const _isRTL: boolean = useRtl();\n let xAxisCalloutAccessibilityData: AccessibilityProps = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n\n props.eventAnnotationProps &&\n props.eventAnnotationProps.labelHeight &&\n (eventLabelHeight = props.eventAnnotationProps.labelHeight);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [selectedColorBarLegend, setSelectedColorBarLegend] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<LineChartDataPoint | null>(null);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n const pointsRef = React.useRef<LineChartDataWithIndex[] | []>([]);\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (_points !== _injectIndexPropertyInLineChartData(props.data.lineChartData) || props.data !== _points) {\n pointsRef.current = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _injectIndexPropertyInLineChartData(lineChartData?: LineChartPoints[]): LineChartDataWithIndex[] | [] {\n const { allowMultipleShapesForPoints = false } = props;\n return lineChartData\n ? lineChartData.map((item: LineChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: allowMultipleShapesForPoints ? index : -1,\n color,\n };\n })\n : [];\n }\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps)\n : null;\n }\n\n function _getMargins(_margins: Margins) {\n margins = _margins;\n }\n\n function _initializeLineChartData(\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n _xAxisScale = xScale;\n _yAxisScale = yScale;\n _renderedColorFillBars = props.colorFillBars ? _createColorFillBars(containerHeight) : [];\n lines = _createLines(xElement!, containerHeight!);\n }\n\n function _handleSingleLegendSelectionAction(lineChartItem: LineChartDataWithIndex | ColorFillBarsProps) {\n if (selectedLegend === lineChartItem.legend) {\n setSelectedLegend('');\n _handleLegendClick(lineChartItem, null);\n } else {\n setSelectedLegend(lineChartItem.legend);\n _handleLegendClick(lineChartItem, lineChartItem.legend);\n }\n }\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setSelectedColorBarLegend([]);\n setIsSelectedLegend(false);\n }\n\n function _handleLegendClick(\n lineChartItem: LineChartDataWithIndex | ColorFillBarsProps,\n selectedLegend: string | null | string[],\n ): void {\n if (lineChartItem.onLegendClick) {\n lineChartItem.onLegendClick(selectedLegend);\n }\n }\n\n function _createLegends(data: LineChartDataWithIndex[]): JSX.Element {\n const { legendProps, allowMultipleShapesForPoints = false } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const legendDataItems = data.map((point: LineChartDataWithIndex) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleLineLegendSelectionAction(point);\n } else {\n _handleSingleLegendSelectionAction(point);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend);\n },\n ...(point.legendShape && {\n shape: point.legendShape,\n }),\n ...(allowMultipleShapesForPoints && {\n shape: Points[point.index % Object.keys(pointTypes).length] as Legend['shape'],\n }),\n };\n return legend;\n });\n\n const colorFillBarsLegendDataItems = props.colorFillBars\n ? props.colorFillBars.map((colorFillBar: ColorFillBarsProps, index: number) => {\n const title = colorFillBar.legend;\n const color = getColorFromToken(colorFillBar.color);\n const legend: Legend = {\n title,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleColorFillBarLegendSelectionAction(colorFillBar);\n } else {\n _handleSingleLegendSelectionAction(colorFillBar);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(title);\n },\n opacity: _getColorFillBarOpacity(colorFillBar),\n stripePattern: colorFillBar.applyPattern,\n };\n return legend;\n })\n : [];\n\n return (\n <Legends\n legends={[...legendDataItems, ...colorFillBarsLegendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n {...props.legendProps}\n />\n );\n }\n\n function _getBoxWidthOfShape(pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false, strokeWidth = DEFAULT_LINE_STROKE_SIZE } = props;\n if (allowMultipleShapesForPoints) {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else if (pointIndex === 1 || isLastPoint) {\n return strokeWidth * PATH_MULTIPLY_SIZE;\n } else {\n return PointSize.invisibleSize;\n }\n } else {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else {\n return PointSize.invisibleSize;\n }\n }\n }\n\n function _getPath(\n xPos: number,\n yPos: number,\n pointId: string,\n pointIndex: number,\n isLastPoint: boolean,\n pointOftheLine: number,\n ): string {\n const { allowMultipleShapesForPoints = false } = props;\n let w = _getBoxWidthOfShape(pointId, pointIndex, isLastPoint);\n const index: number = allowMultipleShapesForPoints ? pointOftheLine % Object.keys(pointTypes).length : 0;\n const widthRatio = pointTypes[index].widthRatio;\n w = widthRatio > 1 ? w / widthRatio : w;\n\n return _getPointPath(xPos, yPos, w, index);\n }\n function _getPointFill(lineColor: string, pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false } = props;\n if (allowMultipleShapesForPoints) {\n if (pointIndex === 1 || isLastPoint) {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n }\n\n function _createLines(xElement: SVGElement, containerHeight: number): JSX.Element[] {\n const lines: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points = selectedLegendPoints;\n } else {\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n }\n for (let i = _points.length - 1; i >= 0; i--) {\n const linesForLine: JSX.Element[] = [];\n const bordersForLine: JSX.Element[] = [];\n const pointsForLine: JSX.Element[] = [];\n\n const legendVal: string = _points[i].legend;\n const lineColor: string = _points[i].color!;\n const verticaLineHeight = containerHeight - margins.bottom! + 6;\n if (_points[i].data.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[0];\n const circleId = `${_circleId}_${i}`;\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n pointsForLine.push(\n <circle\n id={circleId}\n key={circleId}\n r={activePoint === circleId ? 5.5 : 3.5}\n cx={_xAxisScale(x1)}\n cy={_yAxisScale(y1)}\n fill={activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0}\n stroke={activePoint === circleId ? lineColor : ''}\n role=\"img\"\n aria-label={_getAriaLabel(i, 0)}\n data-is-focusable={isLegendSelected}\n ref={(e: SVGCircleElement | null) => {\n _refCallback(e!, circleId);\n }}\n onFocus={() => _handleFocus(circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[0].onDataPointClick)}\n />,\n );\n }\n\n let gapIndex = 0;\n const gaps = _points[i].gaps?.sort((a, b) => a.startIndex - b.startIndex) ?? [];\n\n // Use path rendering technique for larger datasets to optimize performance.\n if (props.optimizeLargeData && _points[i].data.length > 1) {\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => _xAxisScale(d[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => _yAxisScale(d[1]))\n .curve(d3curveLinear);\n\n const lineId = `${_lineId}_${i}`;\n const borderId = `${_borderId}_${i}`;\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const lineData: [number, number][] = [];\n for (let k = 0; k < _points[i].data.length; k++) {\n lineData.push([\n _points[i].data[k].x instanceof Date\n ? (_points[i].data[k].x as Date).getTime()\n : (_points[i].data[k].x as number),\n _points[i].data[k].y,\n ]);\n }\n\n if (isLegendSelected) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <path\n id={borderId}\n key={borderId}\n d={line(lineData)!}\n fill=\"transparent\"\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={true}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOut={_handleMouseOut}\n {..._getClickHandler(_points[i].onLineClick)}\n opacity={1}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />,\n );\n } else {\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={false}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n opacity={0.1}\n />,\n );\n }\n\n pointsForLine.push(\n <circle\n id={`${_staticHighlightCircle}_${i}`}\n key={`${_staticHighlightCircle}_${i}`}\n r={5.5}\n cx={0}\n cy={0}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={DEFAULT_LINE_STROKE_SIZE}\n stroke={lineColor}\n visibility={'hidden'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOut={_handleMouseOut}\n />,\n );\n } else if (!props.optimizeLargeData) {\n for (let j = 1; j < _points[i].data.length; j++) {\n const gapResult = _checkInGap(j, gaps, gapIndex);\n const isInGap = gapResult.isInGap;\n gapIndex = gapResult.gapIndex;\n\n const lineId = `${_lineId}_${i}_${j}`;\n const borderId = `${_borderId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j - 1];\n const { x: x2, y: y2 } = _points[i].data[j];\n let path = _getPath(_xAxisScale(x1), _yAxisScale(y1), circleId, j, false, _points[i].index);\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean =\n _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;\n pointsForLine.push(\n <path\n id={circleId}\n key={circleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j - 1].onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, circleId, j, false)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j - 1)}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />,\n );\n if (j + 1 === _points[i].data.length) {\n // If this is last point of the line segment.\n const lastCircleId = `${circleId}${j}L`;\n const hiddenHoverCircleId = `${circleId}${j}D`;\n const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;\n path = _getPath(_xAxisScale(x2), _yAxisScale(y2), lastCircleId, j, true, _points[i].index);\n const {\n xAxisCalloutData: lastCirlceXCallout,\n xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData,\n } = _points[i].data[j];\n pointsForLine.push(\n <React.Fragment key={`${lastCircleId}_container`}>\n <path\n id={lastCircleId}\n key={lastCircleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() =>\n _handleFocus(lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData)\n }\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j].onDataPointClick)}\n opacity={isLegendSelected && !lastPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, lastCircleId, j, true)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />\n {/* Dummy circle acting as magnetic latch for last callout point */}\n <circle\n id={hiddenHoverCircleId}\n key={hiddenHoverCircleId}\n r={8}\n cx={_xAxisScale(x2)}\n cy={_yAxisScale(y2)}\n opacity={0}\n width={0}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={0}\n focusable={false}\n onBlur={_handleMouseOut}\n />\n </React.Fragment>,\n );\n /* eslint-enable react/jsx-no-bind */\n }\n\n if (isLegendSelected) {\n // don't draw line if it is in a gap\n if (!isInGap) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <line\n id={borderId}\n key={borderId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeWidth={strokeWidth}\n ref={(e: SVGLineElement | null) => {\n _refCallback(e!, lineId);\n }}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={1}\n {..._getClickHandler(_points[i].onLineClick)}\n />,\n );\n }\n } else {\n if (!isInGap) {\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeWidth={strokeWidth}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={0.1}\n />,\n );\n }\n }\n }\n }\n\n lines.push(\n <g\n key={`line_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, line ${i + 1} of ${_points.length} with ${_points[i].data.length} data points.`}\n >\n {bordersForLine}\n {linesForLine}\n {pointsForLine}\n </g>,\n );\n }\n const classes = useLineChartStyles(props);\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return lines;\n }\n\n function _createColorFillBars(containerHeight: number) {\n const colorFillBars: JSX.Element[] = [];\n if (isSelectedLegend) {\n _colorFillBars.current = selectedColorBarLegend;\n } else {\n _colorFillBars.current = props.colorFillBars!;\n }\n\n const yMinMaxValues = getMinMaxOfYAxis(_points, ChartTypes.LineChart);\n const FILL_Y_PADDING = 3;\n for (let i = 0; i < _colorFillBars.current.length; i++) {\n const colorFillBar = _colorFillBars.current[i];\n const colorFillBarId = `${_colorFillBarId}-${i}`;\n const color = getColorFromToken(colorFillBar.color);\n\n if (colorFillBar.applyPattern) {\n // Using a pattern element because CSS was unable to render diagonal stripes for rect elements\n colorFillBars.push(_getStripePattern(color, i));\n }\n\n for (let j = 0; j < colorFillBar.data.length; j++) {\n const startX = colorFillBar.data[j].startX;\n const endX = colorFillBar.data[j].endX;\n const opacity =\n _legendHighlighted(colorFillBar.legend) || _noLegendHighlighted() || isSelectedLegend\n ? _getColorFillBarOpacity(colorFillBar)\n : 0.1;\n colorFillBars.push(\n <rect\n fill={colorFillBar.applyPattern ? `url(#${_colorFillBarPatternId}_${i})` : color}\n fillOpacity={opacity}\n x={_isRTL ? _xAxisScale(endX) : _xAxisScale(startX)}\n y={_yAxisScale(yMinMaxValues.endValue) - FILL_Y_PADDING}\n width={Math.abs(_xAxisScale(endX) - _xAxisScale(startX))}\n height={_yAxisScale(props.yMinValue || 0) - _yAxisScale(yMinMaxValues.endValue) + FILL_Y_PADDING}\n key={`${colorFillBarId}${j}`}\n />,\n );\n }\n }\n return colorFillBars;\n }\n\n function _getStripePattern(color: string, id: number) {\n // This describes a tile pattern that resembles diagonal stripes\n // For more information: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n const stripePath = 'M-4,4 l8,-8 M0,16 l16,-16 M12,20 l8,-8';\n return (\n <pattern\n id={`${_colorFillBarPatternId}_${id}`}\n width={16}\n height={16}\n key={`${_colorFillBarPatternId}_${id}`}\n patternUnits={'userSpaceOnUse'}\n >\n <path d={stripePath} stroke={color} strokeWidth={1.25} />\n </pattern>\n );\n }\n\n function _checkInGap(pointIndex: number, gaps: LineChartGap[], currentGapIndex: number) {\n let gapIndex = currentGapIndex;\n let isInGap = false;\n\n while (gapIndex < gaps.length && pointIndex > gaps[gapIndex].endIndex) {\n gapIndex++;\n }\n\n if (gapIndex < gaps.length && pointIndex > gaps[gapIndex].startIndex && pointIndex <= gaps[gapIndex].endIndex) {\n isInGap = true;\n }\n return { isInGap, gapIndex };\n }\n\n function _refCallback(element: SVGGElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n const _onMouseOverLargeDataset = (\n linenumber: number,\n lineHeight: number,\n mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>,\n ) => {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n\n // This will get the value of the X when mouse is on the chart\n const xOffset = _xAxisScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![linenumber].data, xOffset);\n const d0 = lineChartData![linenumber].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![linenumber].data[i] as LineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let xPointToHighlight: string | Date | number = 0;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n xPointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n xPointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![linenumber].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData } = lineChartData![linenumber].data[index as number];\n const formattedDate =\n xPointToHighlight instanceof Date ? formatDate(xPointToHighlight, props.useUTC) : xPointToHighlight;\n const modifiedXVal = xPointToHighlight instanceof Date ? xPointToHighlight.getTime() : xPointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const pointToHighlight: LineChartDataPoint = lineChartData![linenumber].data[index!];\n const pointToHighlightUpdated =\n nearestCircleToHighlight === null ||\n (nearestCircleToHighlight !== null &&\n pointToHighlight !== null &&\n (nearestCircleToHighlight.x !== pointToHighlight.x || nearestCircleToHighlight.y !== pointToHighlight.y));\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated) {\n _uniqueCallOutID = `#${_staticHighlightCircle}_${linenumber}`;\n\n d3Select(`#${_staticHighlightCircle}_${linenumber}`)\n .attr('cx', `${_xAxisScale(pointToHighlight.x)}`)\n .attr('cy', `${_yAxisScale(pointToHighlight.y)}`)\n .attr('visibility', 'visibility');\n\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(pointToHighlight.x)}, ${_yAxisScale(pointToHighlight.y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale(pointToHighlight.y)}`);\n\n setNearestCircleToHighlight(pointToHighlight);\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setStackCalloutProps(found!);\n setYValueHover(found.values);\n setDataPointCalloutProps(found!);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue(formattedDate);\n setActivePoint('');\n }\n\n if (!found) {\n setPopoverOpen(false);\n setNearestCircleToHighlight(pointToHighlight);\n setActivePoint('');\n }\n };\n\n function _handleFocus(\n lineId: string,\n x: number | Date,\n\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: AccessibilityProps,\n ) {\n _uniqueCallOutID = circleId;\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: RefArrayData) => {\n if (obj.index === lineId) {\n setPopoverOpen(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n }\n\n function _handleHover(\n x: number | Date,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: AccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, ${_yAxisScale(y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale(y)}`);\n\n if (_uniqueCallOutID !== circleId) {\n _uniqueCallOutID = circleId;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n } else {\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n }\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _handleMouseOut() {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }\n\n function _handleChartMouseLeave() {\n _uniqueCallOutID = null;\n setActivePoint('');\n if (isPopoverOpen) {\n setPopoverOpen(false);\n }\n }\n\n function _handleMultipleLineLegendSelectionAction(selectedLine: LineChartDataWithIndex) {\n const selectedLineIndex = selectedLegendPoints.reduce((acc, line, index) => {\n if (acc > -1 || line.legend !== selectedLine.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedLines: LineChartDataWithIndex[];\n if (selectedLineIndex === -1) {\n selectedLines = [...selectedLegendPoints, selectedLine];\n } else {\n selectedLines = selectedLegendPoints\n .slice(0, selectedLineIndex)\n .concat(selectedLegendPoints.slice(selectedLineIndex + 1));\n }\n\n const areAllLineLegendsSelected = props.data && selectedLines.length === props.data.lineChartData!.length;\n\n if (\n areAllLineLegendsSelected &&\n ((props.colorFillBars && props.colorFillBars.length === selectedColorBarLegend.length) || !props.colorFillBars)\n ) {\n // Clear all legends if all legends including color fill bar legends are selected\n // Or clear all legends if all legends are selected and there are no color fill bars\n _clearMultipleLegendSelections();\n } else if (!selectedLines.length && !selectedColorBarLegend.length) {\n // Clear all legends if no legends including color fill bar legends are selected\n _clearMultipleLegendSelections();\n } else {\n // Otherwise, set state when one or more legends are selected, including color fill bar legends\n setSelectedLegendPoints(selectedLines);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedLines.map((line: LineChartDataWithIndex) => line.legend);\n _handleLegendClick(selectedLine, selectedLegendTitlesToPass);\n }\n\n function _handleMultipleColorFillBarLegendSelectionAction(selectedColorFillBar: ColorFillBarsProps) {\n const selectedColorFillBarIndex = selectedColorBarLegend.reduce((acc, colorFillBar, index) => {\n if (acc > -1 || colorFillBar.legend !== selectedColorFillBar.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedColorFillBars: ColorFillBarsProps[];\n if (selectedColorFillBarIndex === -1) {\n selectedColorFillBars = [...selectedColorBarLegend, selectedColorFillBar];\n } else {\n selectedColorFillBars = selectedColorBarLegend\n .slice(0, selectedColorFillBarIndex)\n .concat(selectedColorBarLegend.slice(selectedColorFillBarIndex + 1));\n }\n\n const areAllColorFillBarLegendsSelected =\n selectedColorFillBars.length === (props.colorFillBars && props.colorFillBars!.length);\n\n if (\n areAllColorFillBarLegendsSelected &&\n ((props.data && props.data.lineChartData!.length === selectedLegendPoints.length) || !props.data)\n ) {\n // Clear all legends if all legends, including line legends, are selected\n // Or clear all legends if all legends are selected and there is no line data\n _clearMultipleLegendSelections();\n } else if (!selectedColorFillBars.length && !selectedLegendPoints.length) {\n // Clear all legends if no legends are selected, including line legends\n _clearMultipleLegendSelections();\n } else {\n // set state when one or more legends are selected, including line legends\n setSelectedColorBarLegend(selectedColorFillBars);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedColorFillBars.map(\n (colorFillBar: ColorFillBarsProps) => colorFillBar.legend,\n );\n _handleLegendClick(selectedColorFillBar, selectedLegendTitlesToPass);\n }\n\n function _clearMultipleLegendSelections() {\n setSelectedColorBarLegend([]);\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n function _legendHighlighted(legend: string) {\n return selectedLegend === legend || (selectedLegend === '' && activeLegend === legend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n function _getColorFillBarOpacity(colorFillBar: ColorFillBarsProps) {\n return colorFillBar.applyPattern ? 1 : 0.4;\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = _points[lineIndex];\n const point = line.data[pointIndex];\n const formattedDate = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n props.data.lineChartData.filter((item: LineChartPoints) => item.data.length).length > 0\n );\n }\n\n const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n\n const isXAxisDateType = getXAxisType(_points);\n let points = _points;\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack: true,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={props.data.chartTitle}\n points={points}\n chartType={ChartTypes.LineChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getGraphData={_initializeLineChartData}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: ChildProps) => {\n _xAxisScale = props.xScale!;\n _yAxisScale = props.yScale!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={props.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n {props.optimizeLargeData ? (\n <rect id={_rectId} width={props.containerWidth} height={props.containerHeight} fill={'transparent'} />\n ) : (\n <></>\n )}\n <g>\n {_renderedColorFillBars}\n {lines}\n </g>\n {eventAnnotationProps && (\n <EventsAnnotation\n {...eventAnnotationProps}\n scale={props.xScale!}\n chartYTop={margins.top! + eventLabelHeight}\n chartYBottom={props.containerHeight! - 35}\n />\n )}\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\nLineChart.displayName = 'LineChart';\n"],"names":["React","useLineChartStyles","select","d3Select","pointer","bisector","Legends","line","d3Line","curveLinear","d3curveLinear","useId","find","CartesianChart","EventsAnnotation","tokens","calloutData","ChartTypes","getXAxisType","XAxisTypes","tooltipOfXAxislabels","Points","pointTypes","getMinMaxOfYAxis","getTypeOfAxis","getNextColor","getColorFromToken","useRtl","formatDate","PointSize","bisect","d","x","left","DEFAULT_LINE_STROKE_SIZE","PATH_MULTIPLY_SIZE","_getPointPath","y","w","index","allPointPaths","LineChart","forwardRef","props","forwardedRef","_points","_injectIndexPropertyInLineChartData","data","lineChartData","_calloutPoints","_xAxisScale","_yAxisScale","_circleId","_lineId","_borderId","_verticalLine","_colorFillBarPatternId","_uniqueCallOutID","_refArray","margins","eventLabelHeight","lines","_renderedColorFillBars","_colorFillBars","useRef","_tooltipId","_rectId","_staticHighlightCircle","_firstRenderOptimization","_emptyChartId","_colorFillBarId","_isRTL","xAxisCalloutAccessibilityData","cartesianChartRef","eventAnnotationProps","labelHeight","hoverXValue","setHoverXValue","useState","activeLegend","setActiveLegend","YValueHover","setYValueHover","selectedLegend","setSelectedLegend","selectedLegendPoints","setSelectedLegendPoints","selectedColorBarLegend","setSelectedColorBarLegend","isSelectedLegend","setIsSelectedLegend","activePoint","setActivePoint","nearestCircleToHighlight","setNearestCircleToHighlight","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","clickPosition","setClickPosition","isPopoverOpen","setPopoverOpen","pointsRef","calloutPointsRef","useEffect","current","height","width","useImperativeHandle","componentRef","chartContainer","allowMultipleShapesForPoints","map","item","color","updatePosition","newX","newY","threshold","distance","Math","sqrt","pow","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getMargins","_margins","_initializeLineChartData","xScale","yScale","containerHeight","containerWidth","xElement","colorFillBars","_createColorFillBars","_createLines","_handleSingleLegendSelectionAction","lineChartItem","legend","_handleLegendClick","_onHoverCardHide","onLegendClick","_createLegends","legendProps","isLegendMultiSelectEnabled","canSelectMultipleLegends","legendDataItems","point","title","action","_handleMultipleLineLegendSelectionAction","onMouseOutAction","hoverAction","_handleChartMouseLeave","legendShape","shape","Object","keys","length","colorFillBarsLegendDataItems","colorFillBar","_handleMultipleColorFillBarLegendSelectionAction","opacity","_getColorFillBarOpacity","stripePattern","applyPattern","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onLegendHoverCardLeave","_getBoxWidthOfShape","pointId","pointIndex","isLastPoint","strokeWidth","_getPath","xPos","yPos","pointOftheLine","widthRatio","_getPointFill","lineColor","colorNeutralBackground1","i","linesForLine","bordersForLine","pointsForLine","legendVal","verticaLineHeight","bottom","x1","y1","xAxisCalloutData","circleId","isLegendSelected","_legendHighlighted","_noLegendHighlighted","push","circle","id","key","r","cx","cy","fill","tabIndex","undefined","onMouseOver","event","_handleHover","onMouseMove","onMouseOut","_handleMouseOut","stroke","role","aria-label","_getAriaLabel","data-is-focusable","ref","e","_refCallback","onFocus","_handleFocus","onBlur","_getClickHandler","onDataPointClick","gapIndex","gaps","sort","a","b","startIndex","optimizeLargeData","curve","lineId","borderId","lineOptions","lineData","k","Date","getTime","lineBorderWidth","Number","parseFloat","toString","path","strokeLinecap","lineBorderColor","_onMouseOverLargeDataset","bind","onLineClick","visibility","j","gapResult","_checkInGap","isInGap","x2","y2","currentPointHidden","hideNonActiveDots","lastCircleId","hiddenHoverCircleId","lastPointHidden","lastCirlceXCallout","lastCirlceXCalloutAccessibilityData","Fragment","focusable","strokeDasharray","strokeDashoffset","g","classes","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","xAxis","yMinMaxValues","FILL_Y_PADDING","colorFillBarId","_getStripePattern","startX","endX","rect","fillOpacity","endValue","abs","yMinValue","stripePath","pattern","patternUnits","currentGapIndex","endIndex","element","legendTitle","refElement","linenumber","lineHeight","mouseEvent","persist","xOffset","invert","d0","d1","axisType","xPointToHighlight","x0","point0","point1","DateAxis","NumericAxis","formattedDate","useUTC","modifiedXVal","found","pointToHighlight","pointToHighlightUpdated","attr","clientX","clientY","values","formattedData","xVal","forEach","obj","func","onClick","selectedLine","selectedLineIndex","reduce","acc","selectedLines","slice","concat","areAllLineLegendsSelected","_clearMultipleLegendSelections","selectedLegendTitlesToPass","selectedColorFillBar","selectedColorFillBarIndex","selectedColorFillBars","areAllColorFillBarLegendsSelected","lineIndex","xValue","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","filter","tickValues","tickFormat","isXAxisDateType","points","legendBars","hideLegend","calloutProps","descriptionMessage","getCalloutDescriptionMessage","isCalloutForStack","culture","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","chartTitle","chartType","getmargins","getGraphData","xAxisType","onChartMouseLeave","enableFirstRenderOptimization","enablePerfOptimization","children","scale","chartYTop","top","chartYBottom","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1Q;gBACC2L,IAAI;gBACJC,IAAI;gBACJiE,IAAI;gBACJC,IAAI1N,MAAMyF,eAAe;gBACzBqF,QAAQ;gBACRd,IAAIpJ;gBACJwM,YAAY;gBACZgB,iBAAiB;gBAElBpO,MAAMiM,iBAAiB,iBACtB,oBAACwD;gBAAKzF,IAAIzI;gBAAS0C,OAAOjE,MAAM0F,cAAc;gBAAE1B,QAAQhE,MAAMyF,eAAe;gBAAE4E,MAAM;+BAErF,yDAEF,oBAACiE,WACEnN,wBACAD,QAEFa,sCACC,oBAAC5D;gBACE,GAAG4D,oBAAoB;gBACxBsT,OAAOrV,MAAMuF,MAAM;gBACnB+P,WAAWtU,QAAQuU,GAAG,GAAItU;gBAC1BuU,cAAcxV,MAAMyF,eAAe,GAAI;;QAMnD;uBAGF,oBAACgQ;QAAIzL,IAAItI;QAAeqJ,MAAM;QAAS2K,OAAO;YAAEjO,SAAS;QAAI;QAAGuD,cAAY;;AAEhF,GACA;AACFlL,UAAU6V,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LineChartProps } from './LineChart.types';\nimport { useLineChartStyles } from './useLineChartStyles.styles';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { select as d3Select, pointer } from 'd3-selection';\nimport { bisector } from 'd3-array';\nimport { Legend, Legends } from '../Legends/index';\nimport { line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';\nimport { useId } from '@fluentui/react-utilities';\nimport { find } from '../../utilities/index';\nimport {\n AccessibilityProps,\n CartesianChart,\n ChildProps,\n LineChartPoints,\n CustomizedCalloutData,\n Margins,\n RefArrayData,\n ColorFillBarsProps,\n LineChartGap,\n LineChartDataPoint,\n Chart,\n} from '../../index';\nimport { EventsAnnotation } from './eventAnnotation/EventAnnotation';\nimport { tokens } from '@fluentui/react-theme';\nimport {\n calloutData,\n ChartTypes,\n getXAxisType,\n XAxisTypes,\n tooltipOfXAxislabels,\n Points,\n pointTypes,\n getMinMaxOfYAxis,\n getTypeOfAxis,\n getNextColor,\n getColorFromToken,\n useRtl,\n formatDate,\n} from '../../utilities/index';\n\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\nenum PointSize {\n hoverSize = 11,\n invisibleSize = 1,\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst bisect = bisector((d: any) => d.x).left;\n\nconst DEFAULT_LINE_STROKE_SIZE = 4;\n// The given shape of a icon must be 2.5 times bigger than line width (known as stroke width)\nconst PATH_MULTIPLY_SIZE = 2.5;\n\n/**\n *\n * @param x units from origin\n * @param y units from origin\n * @param w is the legnth of the each side of a shape\n * @param index index to get the shape path\n */\nconst _getPointPath = (x: number, y: number, w: number, index: number): string => {\n const allPointPaths = [\n // circle path\n `M${x - w / 2} ${y}\n A${w / 2} ${w / 2} 0 1 0 ${x + w / 2} ${y}\n M${x - w / 2} ${y}\n A ${w / 2} ${w / 2} 0 1 1 ${x + w / 2} ${y}\n `,\n //square\n `M${x - w / 2} ${y - w / 2}\n L${x + w / 2} ${y - w / 2}\n L${x + w / 2} ${y + w / 2}\n L${x - w / 2} ${y + w / 2}\n Z`,\n //triangle\n `M${x - w / 2} ${y - 0.2886 * w}\n H ${x + w / 2}\n L${x} ${y + 0.5774 * w} Z`,\n //diamond\n `M${x} ${y - w / 2}\n L${x + w / 2} ${y}\n L${x} ${y + w / 2}\n L${x - w / 2} ${y}\n Z`,\n //pyramid\n `M${x} ${y - 0.5774 * w}\n L${x + w / 2} ${y + 0.2886 * w}\n L${x - w / 2} ${y + 0.2886 * w} Z`,\n //hexagon\n `M${x - 0.5 * w} ${y - 0.866 * w}\n L${x + 0.5 * w} ${y - 0.866 * w}\n L${x + w} ${y}\n L${x + 0.5 * w} ${y + 0.866 * w}\n L${x - 0.5 * w} ${y + 0.866 * w}\n L${x - w} ${y}\n Z`,\n //pentagon\n `M${x} ${y - 0.851 * w}\n L${x + 0.6884 * w} ${y - 0.2633 * w}\n L${x + 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.5001 * w} ${y + 0.6884 * w}\n L${x - 0.6884 * w} ${y - 0.2633 * w}\n Z`,\n //octagon\n `M${x - 0.5001 * w} ${y - 1.207 * w}\n L${x + 0.5001 * w} ${y - 1.207 * w}\n L${x + 1.207 * w} ${y - 0.5001 * w}\n L${x + 1.207 * w} ${y + 0.5001 * w}\n L${x + 0.5001 * w} ${y + 1.207 * w}\n L${x - 0.5001 * w} ${y + 1.207 * w}\n L${x - 1.207 * w} ${y + 0.5001 * w}\n L${x - 1.207 * w} ${y - 0.5001 * w}\n Z`,\n ];\n return allPointPaths[index];\n};\n\ntype LineChartDataWithIndex = LineChartPoints & { index: number };\n\n// Create a LineChart variant which uses these default styles and this styled subcomponent.\n/**\n * Linechart component\n * {@docCategory LineChart}\n */\nexport const LineChart: React.FunctionComponent<LineChartProps> = React.forwardRef<HTMLDivElement, LineChartProps>(\n (props, forwardedRef) => {\n let _points: LineChartDataWithIndex[] = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _calloutPoints: any[] = calloutData(_points) || [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xAxisScale: any = '';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _yAxisScale: any = '';\n let _circleId: string = useId('circle');\n let _lineId: string = useId('lineID');\n let _borderId: string = useId('borderID');\n let _verticalLine: string = useId('verticalLine');\n let _colorFillBarPatternId: string = useId('colorFillBarPattern');\n let _uniqueCallOutID: string | null = '';\n let _refArray: RefArrayData[] = [];\n let margins: Margins;\n let eventLabelHeight: number = 36;\n let lines: JSX.Element[];\n let _renderedColorFillBars: JSX.Element[];\n const _colorFillBars = React.useRef<ColorFillBarsProps[]>([]);\n let _tooltipId: string = useId('LineChartTooltipId_');\n let _rectId: string = useId('containerRectLD');\n let _staticHighlightCircle: string = useId('staticHighlightCircle');\n let _firstRenderOptimization = true;\n let _emptyChartId: string = useId('_LineChart_empty');\n const _colorFillBarId = useId('_colorFillBarId');\n const _isRTL: boolean = useRtl();\n let xAxisCalloutAccessibilityData: AccessibilityProps = {};\n const cartesianChartRef = React.useRef<Chart>(null);\n\n props.eventAnnotationProps &&\n props.eventAnnotationProps.labelHeight &&\n (eventLabelHeight = props.eventAnnotationProps.labelHeight);\n\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<[]>([]);\n const [selectedLegend, setSelectedLegend] = React.useState<string>('');\n const [selectedLegendPoints, setSelectedLegendPoints] = React.useState<any[]>([]);\n const [selectedColorBarLegend, setSelectedColorBarLegend] = React.useState<any[]>([]);\n const [isSelectedLegend, setIsSelectedLegend] = React.useState<boolean>(false);\n const [activePoint, setActivePoint] = React.useState<string>('');\n const [nearestCircleToHighlight, setNearestCircleToHighlight] = React.useState<LineChartDataPoint | null>(null);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<CustomizedCalloutData>();\n const [stackCalloutProps, setStackCalloutProps] = React.useState<CustomizedCalloutData>();\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n\n const pointsRef = React.useRef<LineChartDataWithIndex[] | []>([]);\n const calloutPointsRef = React.useRef<any[]>([]);\n React.useEffect(() => {\n /** note that height and width are not used to resize or set as dimesions of the chart,\n * fitParentContainer is responisble for setting the height and width or resizing of the svg/chart\n */\n\n if (_points !== _injectIndexPropertyInLineChartData(props.data.lineChartData) || props.data !== _points) {\n pointsRef.current = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n calloutPointsRef.current = calloutData(pointsRef.current);\n }\n }, [props.height, props.width, props.data]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n function _injectIndexPropertyInLineChartData(lineChartData?: LineChartPoints[]): LineChartDataWithIndex[] | [] {\n const { allowMultipleShapesForPoints = false } = props;\n return lineChartData\n ? lineChartData.map((item: LineChartPoints, index: number) => {\n let color: string;\n if (typeof item.color === 'undefined') {\n color = getNextColor(index, 0);\n } else {\n color = getColorFromToken(item.color);\n }\n return {\n ...item,\n index: allowMultipleShapesForPoints ? index : -1,\n color,\n };\n })\n : [];\n }\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getCustomizedCallout() {\n return props.onRenderCalloutPerStack\n ? props.onRenderCalloutPerStack(stackCalloutProps)\n : props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps)\n : null;\n }\n\n function _getMargins(_margins: Margins) {\n margins = _margins;\n }\n\n function _initializeLineChartData(\n xScale: NumericAxis,\n yScale: NumericAxis,\n containerHeight: number,\n containerWidth: number,\n xElement: SVGElement | null,\n ) {\n _xAxisScale = xScale;\n _yAxisScale = yScale;\n _renderedColorFillBars = props.colorFillBars ? _createColorFillBars(containerHeight) : [];\n lines = _createLines(xElement!, containerHeight!);\n }\n\n function _handleSingleLegendSelectionAction(lineChartItem: LineChartDataWithIndex | ColorFillBarsProps) {\n if (selectedLegend === lineChartItem.legend) {\n setSelectedLegend('');\n _handleLegendClick(lineChartItem, null);\n } else {\n setSelectedLegend(lineChartItem.legend);\n _handleLegendClick(lineChartItem, lineChartItem.legend);\n }\n }\n\n function _onHoverCardHide() {\n setSelectedLegendPoints([]);\n setSelectedColorBarLegend([]);\n setIsSelectedLegend(false);\n }\n\n function _handleLegendClick(\n lineChartItem: LineChartDataWithIndex | ColorFillBarsProps,\n selectedLegend: string | null | string[],\n ): void {\n if (lineChartItem.onLegendClick) {\n lineChartItem.onLegendClick(selectedLegend);\n }\n }\n\n function _createLegends(data: LineChartDataWithIndex[]): JSX.Element {\n const { legendProps, allowMultipleShapesForPoints = false } = props;\n const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);\n const legendDataItems = data.map((point: LineChartDataWithIndex) => {\n const color: string = point.color!;\n // mapping data to the format Legends component needs\n const legend: Legend = {\n title: point.legend!,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleLineLegendSelectionAction(point);\n } else {\n _handleSingleLegendSelectionAction(point);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(point.legend);\n },\n ...(point.legendShape && {\n shape: point.legendShape,\n }),\n ...(allowMultipleShapesForPoints && {\n shape: Points[point.index % Object.keys(pointTypes).length] as Legend['shape'],\n }),\n };\n return legend;\n });\n\n const colorFillBarsLegendDataItems = props.colorFillBars\n ? props.colorFillBars.map((colorFillBar: ColorFillBarsProps, index: number) => {\n const title = colorFillBar.legend;\n const color = getColorFromToken(colorFillBar.color);\n const legend: Legend = {\n title,\n color,\n action: () => {\n if (isLegendMultiSelectEnabled) {\n _handleMultipleColorFillBarLegendSelectionAction(colorFillBar);\n } else {\n _handleSingleLegendSelectionAction(colorFillBar);\n }\n },\n onMouseOutAction: () => {\n setActiveLegend('');\n },\n hoverAction: () => {\n _handleChartMouseLeave();\n setActiveLegend(title);\n },\n opacity: _getColorFillBarOpacity(colorFillBar),\n stripePattern: colorFillBar.applyPattern,\n };\n return legend;\n })\n : [];\n\n return (\n <Legends\n legends={[...legendDataItems, ...colorFillBarsLegendDataItems]}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...(isLegendMultiSelectEnabled && { onLegendHoverCardLeave: _onHoverCardHide })}\n {...props.legendProps}\n />\n );\n }\n\n function _getBoxWidthOfShape(pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false, strokeWidth = DEFAULT_LINE_STROKE_SIZE } = props;\n if (allowMultipleShapesForPoints) {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else if (pointIndex === 1 || isLastPoint) {\n return strokeWidth * PATH_MULTIPLY_SIZE;\n } else {\n return PointSize.invisibleSize;\n }\n } else {\n if (activePoint === pointId) {\n return PointSize.hoverSize;\n } else {\n return PointSize.invisibleSize;\n }\n }\n }\n\n function _getPath(\n xPos: number,\n yPos: number,\n pointId: string,\n pointIndex: number,\n isLastPoint: boolean,\n pointOftheLine: number,\n ): string {\n const { allowMultipleShapesForPoints = false } = props;\n let w = _getBoxWidthOfShape(pointId, pointIndex, isLastPoint);\n const index: number = allowMultipleShapesForPoints ? pointOftheLine % Object.keys(pointTypes).length : 0;\n const widthRatio = pointTypes[index].widthRatio;\n w = widthRatio > 1 ? w / widthRatio : w;\n\n return _getPointPath(xPos, yPos, w, index);\n }\n function _getPointFill(lineColor: string, pointId: string, pointIndex: number, isLastPoint: boolean) {\n const { allowMultipleShapesForPoints = false } = props;\n if (allowMultipleShapesForPoints) {\n if (pointIndex === 1 || isLastPoint) {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n } else {\n if (activePoint === pointId) {\n return tokens.colorNeutralBackground1;\n } else {\n return lineColor;\n }\n }\n }\n\n function _createLines(xElement: SVGElement, containerHeight: number): JSX.Element[] {\n const lines: JSX.Element[] = [];\n if (isSelectedLegend) {\n _points = selectedLegendPoints;\n } else {\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n }\n for (let i = _points.length - 1; i >= 0; i--) {\n const linesForLine: JSX.Element[] = [];\n const bordersForLine: JSX.Element[] = [];\n const pointsForLine: JSX.Element[] = [];\n\n const legendVal: string = _points[i].legend;\n const lineColor: string = _points[i].color!;\n const verticaLineHeight = containerHeight - margins.bottom! + 6;\n if (_points[i].data.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[0] as LineChartDataPoint;\n const circleId = `${_circleId}_${i}`;\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n pointsForLine.push(\n <circle\n id={circleId}\n key={circleId}\n r={activePoint === circleId ? 5.5 : 3.5}\n cx={_xAxisScale(x1)}\n cy={_yAxisScale(y1)}\n fill={activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor}\n opacity={isLegendSelected ? 1 : 0.1}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0}\n stroke={activePoint === circleId ? lineColor : ''}\n role=\"img\"\n aria-label={_getAriaLabel(i, 0)}\n data-is-focusable={isLegendSelected}\n ref={(e: SVGCircleElement | null) => {\n _refCallback(e!, circleId);\n }}\n onFocus={() => _handleFocus(circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[0].onDataPointClick)}\n />,\n );\n }\n\n let gapIndex = 0;\n const gaps = _points[i].gaps?.sort((a, b) => a.startIndex - b.startIndex) ?? [];\n\n // Use path rendering technique for larger datasets to optimize performance.\n if (props.optimizeLargeData && _points[i].data.length > 1) {\n const line = d3Line()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .x((d: any) => _xAxisScale(d[0]))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .y((d: any) => _yAxisScale(d[1]))\n .curve(d3curveLinear);\n\n const lineId = `${_lineId}_${i}`;\n const borderId = `${_borderId}_${i}`;\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const lineData: [number, number][] = [];\n for (let k = 0; k < _points[i].data.length; k++) {\n lineData.push([\n _points[i].data[k].x instanceof Date\n ? (_points[i].data[k].x as Date).getTime()\n : (_points[i].data[k].x as number),\n _points[i].data[k].y,\n ]);\n }\n\n if (isLegendSelected) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <path\n id={borderId}\n key={borderId}\n d={line(lineData)!}\n fill=\"transparent\"\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={true}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOut={_handleMouseOut}\n {..._getClickHandler(_points[i].onLineClick)}\n opacity={1}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />,\n );\n } else {\n linesForLine.push(\n <path\n id={lineId}\n key={lineId}\n d={line(lineData)!}\n fill=\"transparent\"\n data-is-focusable={false}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n opacity={0.1}\n />,\n );\n }\n\n pointsForLine.push(\n <circle\n id={`${_staticHighlightCircle}_${i}`}\n key={`${_staticHighlightCircle}_${i}`}\n r={5.5}\n cx={0}\n cy={0}\n fill={tokens.colorNeutralBackground1}\n strokeWidth={DEFAULT_LINE_STROKE_SIZE}\n stroke={lineColor}\n visibility={'hidden'}\n onMouseMove={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOver={event => _onMouseOverLargeDataset.bind(i, verticaLineHeight, event)}\n onMouseOut={_handleMouseOut}\n />,\n );\n } else if (!props.optimizeLargeData) {\n for (let j = 1; j < _points[i].data.length; j++) {\n const gapResult = _checkInGap(j, gaps, gapIndex);\n const isInGap = gapResult.isInGap;\n gapIndex = gapResult.gapIndex;\n\n const lineId = `${_lineId}_${i}_${j}`;\n const borderId = `${_borderId}_${i}_${j}`;\n const circleId = `${_circleId}_${i}_${j}`;\n const {\n x: x1,\n y: y1,\n xAxisCalloutData,\n xAxisCalloutAccessibilityData,\n } = _points[i].data[j - 1] as LineChartDataPoint;\n const { x: x2, y: y2 } = _points[i].data[j] as LineChartDataPoint;\n let path = _getPath(_xAxisScale(x1), _yAxisScale(y1), circleId, j, false, _points[i].index);\n const strokeWidth = _points[i].lineOptions?.strokeWidth || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;\n\n const isLegendSelected: boolean =\n _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;\n\n const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;\n pointsForLine.push(\n <path\n id={circleId}\n key={circleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() => _handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData)}\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j - 1].onDataPointClick)}\n opacity={isLegendSelected && !currentPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, circleId, j, false)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j - 1)}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />,\n );\n if (j + 1 === _points[i].data.length) {\n // If this is last point of the line segment.\n const lastCircleId = `${circleId}${j}L`;\n const hiddenHoverCircleId = `${circleId}${j}D`;\n const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;\n path = _getPath(_xAxisScale(x2), _yAxisScale(y2), lastCircleId, j, true, _points[i].index);\n const {\n xAxisCalloutData: lastCirlceXCallout,\n xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData,\n } = _points[i].data[j];\n pointsForLine.push(\n <React.Fragment key={`${lastCircleId}_container`}>\n <path\n id={lastCircleId}\n key={lastCircleId}\n d={path}\n data-is-focusable={isLegendSelected}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n onFocus={() =>\n _handleFocus(lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData)\n }\n onBlur={_handleMouseOut}\n {..._getClickHandler(_points[i].data[j].onDataPointClick)}\n opacity={isLegendSelected && !lastPointHidden ? 1 : 0.01}\n fill={_getPointFill(lineColor, lastCircleId, j, true)}\n stroke={lineColor}\n strokeWidth={strokeWidth}\n role=\"img\"\n aria-label={_getAriaLabel(i, j)}\n tabIndex={_points[i].legend !== '' ? 0 : undefined}\n />\n {/* Dummy circle acting as magnetic latch for last callout point */}\n <circle\n id={hiddenHoverCircleId}\n key={hiddenHoverCircleId}\n r={8}\n cx={_xAxisScale(x2)}\n cy={_yAxisScale(y2)}\n opacity={0}\n width={0}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x2,\n y2,\n verticaLineHeight,\n lastCirlceXCallout,\n lastCircleId,\n lastCirlceXCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n strokeWidth={0}\n focusable={false}\n onBlur={_handleMouseOut}\n />\n </React.Fragment>,\n );\n /* eslint-enable react/jsx-no-bind */\n }\n\n if (isLegendSelected) {\n // don't draw line if it is in a gap\n if (!isInGap) {\n const lineBorderWidth = _points[i].lineOptions?.lineBorderWidth\n ? Number.parseFloat(_points[i].lineOptions!.lineBorderWidth!.toString())\n : 0;\n if (lineBorderWidth > 0) {\n bordersForLine.push(\n <line\n id={borderId}\n key={borderId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeWidth={Number.parseFloat(strokeWidth.toString()) + lineBorderWidth}\n stroke={_points[i].lineOptions?.lineBorderColor || tokens.colorNeutralBackground1}\n opacity={1}\n />,\n );\n }\n\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeWidth={strokeWidth}\n ref={(e: SVGLineElement | null) => {\n _refCallback(e!, lineId);\n }}\n onMouseOver={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseMove={(event: React.MouseEvent<SVGElement>) =>\n _handleHover(\n x1,\n y1,\n verticaLineHeight,\n xAxisCalloutData,\n circleId,\n xAxisCalloutAccessibilityData,\n event,\n )\n }\n onMouseOut={_handleMouseOut}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={1}\n {..._getClickHandler(_points[i].onLineClick)}\n />,\n );\n }\n } else {\n if (!isInGap) {\n linesForLine.push(\n <line\n id={lineId}\n key={lineId}\n x1={_xAxisScale(x1)}\n y1={_yAxisScale(y1)}\n x2={_xAxisScale(x2)}\n y2={_yAxisScale(y2)}\n strokeWidth={strokeWidth}\n stroke={lineColor}\n strokeLinecap={_points[i].lineOptions?.strokeLinecap ?? 'round'}\n strokeDasharray={_points[i].lineOptions?.strokeDasharray}\n strokeDashoffset={_points[i].lineOptions?.strokeDashoffset}\n opacity={0.1}\n />,\n );\n }\n }\n }\n }\n\n lines.push(\n <g\n key={`line_${i}`}\n role=\"region\"\n aria-label={`${legendVal}, line ${i + 1} of ${_points.length} with ${_points[i].data.length} data points.`}\n >\n {bordersForLine}\n {linesForLine}\n {pointsForLine}\n </g>,\n );\n }\n const classes = useLineChartStyles(props);\n // Removing un wanted tooltip div from DOM, when prop not provided.\n if (!props.showXAxisLablesTooltip) {\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(_xAxisScale);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n xAxis: xAxisElement,\n };\n xAxisElement && tooltipOfXAxislabels(tooltipProps);\n }\n return lines;\n }\n\n function _createColorFillBars(containerHeight: number) {\n const colorFillBars: JSX.Element[] = [];\n if (isSelectedLegend) {\n _colorFillBars.current = selectedColorBarLegend;\n } else {\n _colorFillBars.current = props.colorFillBars!;\n }\n\n const yMinMaxValues = getMinMaxOfYAxis(_points, ChartTypes.LineChart);\n const FILL_Y_PADDING = 3;\n for (let i = 0; i < _colorFillBars.current.length; i++) {\n const colorFillBar = _colorFillBars.current[i];\n const colorFillBarId = `${_colorFillBarId}-${i}`;\n const color = getColorFromToken(colorFillBar.color);\n\n if (colorFillBar.applyPattern) {\n // Using a pattern element because CSS was unable to render diagonal stripes for rect elements\n colorFillBars.push(_getStripePattern(color, i));\n }\n\n for (let j = 0; j < colorFillBar.data.length; j++) {\n const startX = colorFillBar.data[j].startX;\n const endX = colorFillBar.data[j].endX;\n const opacity =\n _legendHighlighted(colorFillBar.legend) || _noLegendHighlighted() || isSelectedLegend\n ? _getColorFillBarOpacity(colorFillBar)\n : 0.1;\n colorFillBars.push(\n <rect\n fill={colorFillBar.applyPattern ? `url(#${_colorFillBarPatternId}_${i})` : color}\n fillOpacity={opacity}\n x={_isRTL ? _xAxisScale(endX) : _xAxisScale(startX)}\n y={_yAxisScale(yMinMaxValues.endValue) - FILL_Y_PADDING}\n width={Math.abs(_xAxisScale(endX) - _xAxisScale(startX))}\n height={_yAxisScale(props.yMinValue || 0) - _yAxisScale(yMinMaxValues.endValue) + FILL_Y_PADDING}\n key={`${colorFillBarId}${j}`}\n />,\n );\n }\n }\n return colorFillBars;\n }\n\n function _getStripePattern(color: string, id: number) {\n // This describes a tile pattern that resembles diagonal stripes\n // For more information: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n const stripePath = 'M-4,4 l8,-8 M0,16 l16,-16 M12,20 l8,-8';\n return (\n <pattern\n id={`${_colorFillBarPatternId}_${id}`}\n width={16}\n height={16}\n key={`${_colorFillBarPatternId}_${id}`}\n patternUnits={'userSpaceOnUse'}\n >\n <path d={stripePath} stroke={color} strokeWidth={1.25} />\n </pattern>\n );\n }\n\n function _checkInGap(pointIndex: number, gaps: LineChartGap[], currentGapIndex: number) {\n let gapIndex = currentGapIndex;\n let isInGap = false;\n\n while (gapIndex < gaps.length && pointIndex > gaps[gapIndex].endIndex) {\n gapIndex++;\n }\n\n if (gapIndex < gaps.length && pointIndex > gaps[gapIndex].startIndex && pointIndex <= gaps[gapIndex].endIndex) {\n isInGap = true;\n }\n return { isInGap, gapIndex };\n }\n\n function _refCallback(element: SVGGElement, legendTitle: string): void {\n _refArray.push({ index: legendTitle, refElement: element });\n }\n\n const _onMouseOverLargeDataset = (\n linenumber: number,\n lineHeight: number,\n mouseEvent: React.MouseEvent<SVGRectElement | SVGPathElement | SVGCircleElement>,\n ) => {\n mouseEvent.persist();\n const { data } = props;\n const { lineChartData } = data;\n\n // This will get the value of the X when mouse is on the chart\n const xOffset = _xAxisScale.invert(pointer(mouseEvent)[0], document.getElementById(_rectId)!);\n const i = bisect(lineChartData![linenumber].data, xOffset);\n const d0 = lineChartData![linenumber].data[i - 1] as LineChartDataPoint;\n const d1 = lineChartData![linenumber].data[i] as LineChartDataPoint;\n let axisType: XAxisTypes | null = null;\n let xPointToHighlight: string | Date | number = 0;\n let index: null | number = null;\n if (d0 === undefined && d1 !== undefined) {\n xPointToHighlight = d1.x;\n index = i;\n } else if (d0 !== undefined && d1 === undefined) {\n xPointToHighlight = d0.x;\n index = i - 1;\n } else {\n axisType = getTypeOfAxis(lineChartData![linenumber].data[0].x, true) as XAxisTypes;\n let x0;\n let point0;\n let point1;\n switch (axisType) {\n case XAxisTypes.DateAxis:\n x0 = new Date(xOffset).getTime();\n point0 = (d0.x as Date).getTime();\n point1 = (d1.x as Date).getTime();\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n case XAxisTypes.NumericAxis:\n x0 = xOffset as number;\n point0 = d0.x as number;\n point1 = d1.x as number;\n xPointToHighlight = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? d1.x : d0.x;\n index = Math.abs(x0 - point0) > Math.abs(x0 - point1) ? i : i - 1;\n break;\n default:\n break;\n }\n }\n\n const { xAxisCalloutData } = lineChartData![linenumber].data[index as number];\n const formattedDate =\n xPointToHighlight instanceof Date ? formatDate(xPointToHighlight, props.useUTC) : xPointToHighlight;\n const modifiedXVal = xPointToHighlight instanceof Date ? xPointToHighlight.getTime() : xPointToHighlight;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found: any = find(_calloutPoints, (element: { x: string | number }) => {\n return element.x === modifiedXVal;\n });\n const pointToHighlight: LineChartDataPoint = lineChartData![linenumber].data[index!] as LineChartDataPoint;\n const pointToHighlightUpdated =\n nearestCircleToHighlight === null ||\n (nearestCircleToHighlight !== null &&\n pointToHighlight !== null &&\n (nearestCircleToHighlight.x !== pointToHighlight.x || nearestCircleToHighlight.y !== pointToHighlight.y));\n // if no points need to be called out then don't show vertical line and callout card\n if (found && pointToHighlightUpdated) {\n _uniqueCallOutID = `#${_staticHighlightCircle}_${linenumber}`;\n\n d3Select(`#${_staticHighlightCircle}_${linenumber}`)\n .attr('cx', `${_xAxisScale(pointToHighlight.x)}`)\n .attr('cy', `${_yAxisScale(pointToHighlight.y)}`)\n .attr('visibility', 'visibility');\n\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(pointToHighlight.x)}, ${_yAxisScale(pointToHighlight.y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale(pointToHighlight.y)}`);\n\n setNearestCircleToHighlight(pointToHighlight);\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setStackCalloutProps(found!);\n setYValueHover(found.values);\n setDataPointCalloutProps(found!);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue(formattedDate);\n setActivePoint('');\n }\n\n if (!found) {\n setPopoverOpen(false);\n setNearestCircleToHighlight(pointToHighlight);\n setActivePoint('');\n }\n };\n\n function _handleFocus(\n lineId: string,\n x: number | Date,\n\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData?: AccessibilityProps,\n ) {\n _uniqueCallOutID = circleId;\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, 0)`)\n .attr('visibility', 'visibility');\n _refArray.forEach((obj: RefArrayData) => {\n if (obj.index === lineId) {\n setPopoverOpen(true);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n }\n });\n } else {\n setActivePoint(circleId);\n }\n }\n\n function _handleHover(\n x: number | Date,\n y: number | Date,\n lineHeight: number,\n xAxisCalloutData: string | undefined,\n circleId: string,\n xAxisCalloutAccessibilityData: AccessibilityProps | undefined,\n mouseEvent: React.MouseEvent<SVGElement>,\n ) {\n mouseEvent?.persist();\n const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;\n const xVal = x instanceof Date ? x.getTime() : x;\n const found = find(_calloutPoints, (element: { x: string | number }) => element.x === xVal);\n // if no points need to be called out then don't show vertical line and callout card\n\n if (found) {\n d3Select(`#${_verticalLine}`)\n .attr('transform', () => `translate(${_xAxisScale(x)}, ${_yAxisScale(y)})`)\n .attr('visibility', 'visibility')\n .attr('y2', `${lineHeight - _yAxisScale(y)}`);\n\n if (_uniqueCallOutID !== circleId) {\n _uniqueCallOutID = circleId;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);\n setYValueHover(found.values);\n setStackCalloutProps(found!);\n setDataPointCalloutProps(found!);\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n } else {\n setActivePoint(circleId);\n setNearestCircleToHighlight(null);\n }\n }\n\n /**\n * Screen readers announce an element as clickable if the onClick attribute is set.\n * This function sets the attribute only when a click event handler is provided.*/\n\n function _getClickHandler(func?: () => void): { onClick?: () => void } {\n if (func) {\n return {\n onClick: func,\n };\n }\n\n return {};\n }\n\n function _handleMouseOut() {\n d3Select(`#${_verticalLine}`).attr('visibility', 'hidden');\n }\n\n function _handleChartMouseLeave() {\n _uniqueCallOutID = null;\n setActivePoint('');\n if (isPopoverOpen) {\n setPopoverOpen(false);\n }\n }\n\n function _handleMultipleLineLegendSelectionAction(selectedLine: LineChartDataWithIndex) {\n const selectedLineIndex = selectedLegendPoints.reduce((acc, line, index) => {\n if (acc > -1 || line.legend !== selectedLine.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedLines: LineChartDataWithIndex[];\n if (selectedLineIndex === -1) {\n selectedLines = [...selectedLegendPoints, selectedLine];\n } else {\n selectedLines = selectedLegendPoints\n .slice(0, selectedLineIndex)\n .concat(selectedLegendPoints.slice(selectedLineIndex + 1));\n }\n\n const areAllLineLegendsSelected = props.data && selectedLines.length === props.data.lineChartData!.length;\n\n if (\n areAllLineLegendsSelected &&\n ((props.colorFillBars && props.colorFillBars.length === selectedColorBarLegend.length) || !props.colorFillBars)\n ) {\n // Clear all legends if all legends including color fill bar legends are selected\n // Or clear all legends if all legends are selected and there are no color fill bars\n _clearMultipleLegendSelections();\n } else if (!selectedLines.length && !selectedColorBarLegend.length) {\n // Clear all legends if no legends including color fill bar legends are selected\n _clearMultipleLegendSelections();\n } else {\n // Otherwise, set state when one or more legends are selected, including color fill bar legends\n setSelectedLegendPoints(selectedLines);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedLines.map((line: LineChartDataWithIndex) => line.legend);\n _handleLegendClick(selectedLine, selectedLegendTitlesToPass);\n }\n\n function _handleMultipleColorFillBarLegendSelectionAction(selectedColorFillBar: ColorFillBarsProps) {\n const selectedColorFillBarIndex = selectedColorBarLegend.reduce((acc, colorFillBar, index) => {\n if (acc > -1 || colorFillBar.legend !== selectedColorFillBar.legend) {\n return acc;\n } else {\n return index;\n }\n }, -1);\n\n let selectedColorFillBars: ColorFillBarsProps[];\n if (selectedColorFillBarIndex === -1) {\n selectedColorFillBars = [...selectedColorBarLegend, selectedColorFillBar];\n } else {\n selectedColorFillBars = selectedColorBarLegend\n .slice(0, selectedColorFillBarIndex)\n .concat(selectedColorBarLegend.slice(selectedColorFillBarIndex + 1));\n }\n\n const areAllColorFillBarLegendsSelected =\n selectedColorFillBars.length === (props.colorFillBars && props.colorFillBars!.length);\n\n if (\n areAllColorFillBarLegendsSelected &&\n ((props.data && props.data.lineChartData!.length === selectedLegendPoints.length) || !props.data)\n ) {\n // Clear all legends if all legends, including line legends, are selected\n // Or clear all legends if all legends are selected and there is no line data\n _clearMultipleLegendSelections();\n } else if (!selectedColorFillBars.length && !selectedLegendPoints.length) {\n // Clear all legends if no legends are selected, including line legends\n _clearMultipleLegendSelections();\n } else {\n // set state when one or more legends are selected, including line legends\n setSelectedColorBarLegend(selectedColorFillBars);\n setIsSelectedLegend(true);\n }\n\n const selectedLegendTitlesToPass = selectedColorFillBars.map(\n (colorFillBar: ColorFillBarsProps) => colorFillBar.legend,\n );\n _handleLegendClick(selectedColorFillBar, selectedLegendTitlesToPass);\n }\n\n function _clearMultipleLegendSelections() {\n setSelectedColorBarLegend([]);\n setSelectedLegendPoints([]);\n setIsSelectedLegend(false);\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it*/\n\n function _legendHighlighted(legend: string) {\n return selectedLegend === legend || (selectedLegend === '' && activeLegend === legend);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.*/\n\n function _noLegendHighlighted() {\n return selectedLegend === '' && activeLegend === '';\n }\n\n function _getColorFillBarOpacity(colorFillBar: ColorFillBarsProps) {\n return colorFillBar.applyPattern ? 1 : 0.4;\n }\n\n function _getAriaLabel(lineIndex: number, pointIndex: number): string {\n const line = _points[lineIndex];\n const point = line.data[pointIndex];\n const formattedDate = point.x instanceof Date ? formatDate(point.x, props.useUTC) : point.x;\n const xValue = point.xAxisCalloutData || formattedDate;\n const legend = line.legend;\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n }\n\n function _isChartEmpty(): boolean {\n return !(\n props.data &&\n props.data.lineChartData &&\n props.data.lineChartData.length > 0 &&\n props.data.lineChartData.filter((item: LineChartPoints) => item.data.length).length > 0\n );\n }\n\n const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;\n _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);\n\n const isXAxisDateType = getXAxisType(_points);\n let points = _points;\n if (legendProps && !!legendProps.canSelectMultipleLegends) {\n points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;\n _calloutPoints = calloutData(points);\n }\n\n let legendBars = null;\n // reduce computation cost by only creating legendBars\n // if when hideLegend is false.\n // NOTE: they are rendered only when hideLegend is false in CartesianChart.\n if (!props.hideLegend) {\n legendBars = _createLegends(_points!); // ToDo: Memoize legends to improve performance.\n }\n const calloutProps = {\n YValueHover: YValueHover,\n hoverXValue: hoverXValue,\n descriptionMessage:\n props.getCalloutDescriptionMessage && stackCalloutProps\n ? props.getCalloutDescriptionMessage(stackCalloutProps)\n : undefined,\n 'data-is-focusable': true,\n xAxisCalloutAccessibilityData: xAxisCalloutAccessibilityData,\n ...props.calloutProps,\n clickPosition: clickPosition,\n isPopoverOpen: isPopoverOpen,\n isCalloutForStack: true,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n customCallout: {\n customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout()! : undefined,\n customCalloutProps: props.calloutPropsPerDataPoint\n ? props.calloutPropsPerDataPoint(dataPointCalloutProps!)\n : undefined,\n },\n };\n const tickParams = {\n tickValues,\n tickFormat,\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={props.data.chartTitle}\n points={points}\n chartType={ChartTypes.LineChart}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n getmargins={_getMargins}\n getGraphData={_initializeLineChartData}\n xAxisType={isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis}\n onChartMouseLeave={_handleChartMouseLeave}\n enableFirstRenderOptimization={props.enablePerfOptimization && _firstRenderOptimization}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n // eslint-disable-next-line react/no-children-prop\n children={(props: ChildProps) => {\n _xAxisScale = props.xScale!;\n _yAxisScale = props.yScale!;\n return (\n <>\n <g>\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={props.containerHeight}\n stroke={'#323130'}\n id={_verticalLine}\n visibility={'hidden'}\n strokeDasharray={'5,5'}\n />\n {props.optimizeLargeData ? (\n <rect id={_rectId} width={props.containerWidth} height={props.containerHeight} fill={'transparent'} />\n ) : (\n <></>\n )}\n <g>\n {_renderedColorFillBars}\n {lines}\n </g>\n {eventAnnotationProps && (\n <EventsAnnotation\n {...eventAnnotationProps}\n scale={props.xScale!}\n chartYTop={margins.top! + eventLabelHeight}\n chartYBottom={props.containerHeight! - 35}\n />\n )}\n </g>\n </>\n );\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n },\n);\nLineChart.displayName = 'LineChart';\n"],"names":["React","useLineChartStyles","select","d3Select","pointer","bisector","Legends","line","d3Line","curveLinear","d3curveLinear","useId","find","CartesianChart","EventsAnnotation","tokens","calloutData","ChartTypes","getXAxisType","XAxisTypes","tooltipOfXAxislabels","Points","pointTypes","getMinMaxOfYAxis","getTypeOfAxis","getNextColor","getColorFromToken","useRtl","formatDate","PointSize","bisect","d","x","left","DEFAULT_LINE_STROKE_SIZE","PATH_MULTIPLY_SIZE","_getPointPath","y","w","index","allPointPaths","LineChart","forwardRef","props","forwardedRef","_points","_injectIndexPropertyInLineChartData","data","lineChartData","_calloutPoints","_xAxisScale","_yAxisScale","_circleId","_lineId","_borderId","_verticalLine","_colorFillBarPatternId","_uniqueCallOutID","_refArray","margins","eventLabelHeight","lines","_renderedColorFillBars","_colorFillBars","useRef","_tooltipId","_rectId","_staticHighlightCircle","_firstRenderOptimization","_emptyChartId","_colorFillBarId","_isRTL","xAxisCalloutAccessibilityData","cartesianChartRef","eventAnnotationProps","labelHeight","hoverXValue","setHoverXValue","useState","activeLegend","setActiveLegend","YValueHover","setYValueHover","selectedLegend","setSelectedLegend","selectedLegendPoints","setSelectedLegendPoints","selectedColorBarLegend","setSelectedColorBarLegend","isSelectedLegend","setIsSelectedLegend","activePoint","setActivePoint","nearestCircleToHighlight","setNearestCircleToHighlight","dataPointCalloutProps","setDataPointCalloutProps","stackCalloutProps","setStackCalloutProps","clickPosition","setClickPosition","isPopoverOpen","setPopoverOpen","pointsRef","calloutPointsRef","useEffect","current","height","width","useImperativeHandle","componentRef","chartContainer","allowMultipleShapesForPoints","map","item","color","updatePosition","newX","newY","threshold","distance","Math","sqrt","pow","_getCustomizedCallout","onRenderCalloutPerStack","onRenderCalloutPerDataPoint","_getMargins","_margins","_initializeLineChartData","xScale","yScale","containerHeight","containerWidth","xElement","colorFillBars","_createColorFillBars","_createLines","_handleSingleLegendSelectionAction","lineChartItem","legend","_handleLegendClick","_onHoverCardHide","onLegendClick","_createLegends","legendProps","isLegendMultiSelectEnabled","canSelectMultipleLegends","legendDataItems","point","title","action","_handleMultipleLineLegendSelectionAction","onMouseOutAction","hoverAction","_handleChartMouseLeave","legendShape","shape","Object","keys","length","colorFillBarsLegendDataItems","colorFillBar","_handleMultipleColorFillBarLegendSelectionAction","opacity","_getColorFillBarOpacity","stripePattern","applyPattern","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","onLegendHoverCardLeave","_getBoxWidthOfShape","pointId","pointIndex","isLastPoint","strokeWidth","_getPath","xPos","yPos","pointOftheLine","widthRatio","_getPointFill","lineColor","colorNeutralBackground1","i","linesForLine","bordersForLine","pointsForLine","legendVal","verticaLineHeight","bottom","x1","y1","xAxisCalloutData","circleId","isLegendSelected","_legendHighlighted","_noLegendHighlighted","push","circle","id","key","r","cx","cy","fill","tabIndex","undefined","onMouseOver","event","_handleHover","onMouseMove","onMouseOut","_handleMouseOut","stroke","role","aria-label","_getAriaLabel","data-is-focusable","ref","e","_refCallback","onFocus","_handleFocus","onBlur","_getClickHandler","onDataPointClick","gapIndex","gaps","sort","a","b","startIndex","optimizeLargeData","curve","lineId","borderId","lineOptions","lineData","k","Date","getTime","lineBorderWidth","Number","parseFloat","toString","path","strokeLinecap","lineBorderColor","_onMouseOverLargeDataset","bind","onLineClick","visibility","j","gapResult","_checkInGap","isInGap","x2","y2","currentPointHidden","hideNonActiveDots","lastCircleId","hiddenHoverCircleId","lastPointHidden","lastCirlceXCallout","lastCirlceXCalloutAccessibilityData","Fragment","focusable","strokeDasharray","strokeDashoffset","g","classes","showXAxisLablesTooltip","document","getElementById","remove","wrapXAxisLables","xAxisElement","call","tooltipProps","tooltipCls","tooltip","xAxis","yMinMaxValues","FILL_Y_PADDING","colorFillBarId","_getStripePattern","startX","endX","rect","fillOpacity","endValue","abs","yMinValue","stripePath","pattern","patternUnits","currentGapIndex","endIndex","element","legendTitle","refElement","linenumber","lineHeight","mouseEvent","persist","xOffset","invert","d0","d1","axisType","xPointToHighlight","x0","point0","point1","DateAxis","NumericAxis","formattedDate","useUTC","modifiedXVal","found","pointToHighlight","pointToHighlightUpdated","attr","clientX","clientY","values","formattedData","xVal","forEach","obj","func","onClick","selectedLine","selectedLineIndex","reduce","acc","selectedLines","slice","concat","areAllLineLegendsSelected","_clearMultipleLegendSelections","selectedLegendTitlesToPass","selectedColorFillBar","selectedColorFillBarIndex","selectedColorFillBars","areAllColorFillBarLegendsSelected","lineIndex","xValue","yValue","yAxisCalloutData","callOutAccessibilityData","ariaLabel","_isChartEmpty","filter","tickValues","tickFormat","isXAxisDateType","points","legendBars","hideLegend","calloutProps","descriptionMessage","getCalloutDescriptionMessage","isCalloutForStack","culture","isCartesian","customCallout","customizedCallout","customCalloutProps","calloutPropsPerDataPoint","tickParams","chartTitle","chartType","getmargins","getGraphData","xAxisType","onChartMouseLeave","enableFirstRenderOptimization","enablePerfOptimization","children","scale","chartYTop","top","chartYBottom","div","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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