@fluentui/react-charts 0.0.0-nightly-20260119-0407.1 → 0.0.0-nightly-20260121-0406.1
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 +13 -13
- package/lib/components/CommonComponents/CartesianChart.js +31 -14
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +15 -5
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/utilities/ChartTitle.js +17 -5
- package/lib/utilities/ChartTitle.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +31 -14
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +15 -5
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.js +17 -5
- package/lib-commonjs/utilities/ChartTitle.js.map +1 -1
- package/package.json +10 -10
|
@@ -7,9 +7,20 @@ const AXIS_TITLE_PADDING = 8;
|
|
|
7
7
|
* A reusable chart title component that renders an SVG text element with tooltip support.
|
|
8
8
|
* This component encapsulates the common pattern for rendering chart titles across all chart types.
|
|
9
9
|
*/ export const ChartTitle = (props)=>{
|
|
10
|
-
const { title, x, y, maxWidth, className, titleStyles,
|
|
10
|
+
const { title, x, y, maxWidth, className, titleStyles, tooltipProps, tooltipClassName } = props;
|
|
11
11
|
const { titleFont, titleXAnchor, titleYAnchor, titlePad } = titleStyles !== null && titleStyles !== void 0 ? titleStyles : {};
|
|
12
|
-
const
|
|
12
|
+
const computedTextAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';
|
|
13
|
+
// Calculate dominantBaseline from titleYAnchor for vertical alignment
|
|
14
|
+
// 'top' means text hangs below the y position (text-before-edge/hanging)
|
|
15
|
+
// 'bottom' means text sits above the y position (text-after-edge/alphabetic)
|
|
16
|
+
// 'middle' means text is centered on the y position (central)
|
|
17
|
+
const computedDominantBaseline = titleYAnchor === 'top' ? 'hanging' : titleYAnchor === 'bottom' ? 'alphabetic' : titleYAnchor === 'middle' ? 'central' : 'auto';
|
|
18
|
+
var _titlePad_l, _titlePad_r;
|
|
19
|
+
// Calculate x position with padding adjustments
|
|
20
|
+
const computedX = x + ((_titlePad_l = titlePad === null || titlePad === void 0 ? void 0 : titlePad.l) !== null && _titlePad_l !== void 0 ? _titlePad_l : 0) - ((_titlePad_r = titlePad === null || titlePad === void 0 ? void 0 : titlePad.r) !== null && _titlePad_r !== void 0 ? _titlePad_r : 0);
|
|
21
|
+
var _titlePad_t, _titlePad_b;
|
|
22
|
+
// Calculate y position with padding adjustments
|
|
23
|
+
const calculatedY = (y !== null && y !== void 0 ? y : Math.max((typeof (titleFont === null || titleFont === void 0 ? void 0 : titleFont.size) === 'number' ? titleFont.size : 13) + AXIS_TITLE_PADDING, CHART_TITLE_PADDING - AXIS_TITLE_PADDING)) + ((_titlePad_t = titlePad === null || titlePad === void 0 ? void 0 : titlePad.t) !== null && _titlePad_t !== void 0 ? _titlePad_t : 0) - ((_titlePad_b = titlePad === null || titlePad === void 0 ? void 0 : titlePad.b) !== null && _titlePad_b !== void 0 ? _titlePad_b : 0);
|
|
13
24
|
const commonSvgToolTipProps = {
|
|
14
25
|
wrapContent,
|
|
15
26
|
showBackground: true,
|
|
@@ -20,12 +31,13 @@ const AXIS_TITLE_PADDING = 8;
|
|
|
20
31
|
...commonSvgToolTipProps,
|
|
21
32
|
content: title,
|
|
22
33
|
textProps: {
|
|
23
|
-
x,
|
|
34
|
+
x: computedX,
|
|
24
35
|
y: calculatedY,
|
|
25
|
-
textAnchor,
|
|
36
|
+
textAnchor: computedTextAnchor,
|
|
37
|
+
dominantBaseline: computedDominantBaseline,
|
|
26
38
|
className,
|
|
27
39
|
'aria-hidden': true,
|
|
28
|
-
style: getChartTitleInlineStyles(titleFont
|
|
40
|
+
style: getChartTitleInlineStyles(titleFont)
|
|
29
41
|
},
|
|
30
42
|
maxWidth: maxWidth
|
|
31
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utilities/ChartTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SVGTooltipText, SVGTooltipTextProps } from './SVGTooltipText';\nimport { CHART_TITLE_PADDING, getChartTitleInlineStyles, TitleStyles } from './Common.styles';\nimport { wrapContent } from './utilities';\n\nconst AXIS_TITLE_PADDING = 8;\n\n/**\n * Props for the ChartTitle component\n */\nexport interface ChartTitleProps {\n /**\n * The title text to display\n */\n title: string;\n /**\n * The x position for the title (typically center of chart)\n */\n x: number;\n /**\n * Optional custom y position. If not provided, calculated based on font size.\n */\n y?: number;\n /**\n * Maximum width for the title text before wrapping/truncation\n */\n maxWidth?: number;\n /**\n * CSS class name for the title text element\n */\n className?: string;\n /**\n * Title styles configuration (font, anchors, padding)\n */\n titleStyles?: TitleStyles;\n /**\n * Text anchor for SVG text element\n * @default 'middle'\n */\n textAnchor?: 'start' | 'middle' | 'end';\n /**\n * Additional SVGTooltipText props to pass through\n */\n tooltipProps?: Partial<SVGTooltipTextProps>;\n /**\n * CSS class for the tooltip\n */\n tooltipClassName?: string;\n}\n\n/**\n * A reusable chart title component that renders an SVG text element with tooltip support.\n * This component encapsulates the common pattern for rendering chart titles across all chart types.\n */\nexport const ChartTitle: React.FunctionComponent<ChartTitleProps> = props => {\n const {
|
|
1
|
+
{"version":3,"sources":["../src/utilities/ChartTitle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SVGTooltipText, SVGTooltipTextProps } from './SVGTooltipText';\nimport { CHART_TITLE_PADDING, getChartTitleInlineStyles, TitleStyles } from './Common.styles';\nimport { wrapContent } from './utilities';\n\nconst AXIS_TITLE_PADDING = 8;\n\n/**\n * Props for the ChartTitle component\n */\nexport interface ChartTitleProps {\n /**\n * The title text to display\n */\n title: string;\n /**\n * The x position for the title (typically center of chart)\n */\n x: number;\n /**\n * Optional custom y position. If not provided, calculated based on font size.\n */\n y?: number;\n /**\n * Maximum width for the title text before wrapping/truncation\n */\n maxWidth?: number;\n /**\n * CSS class name for the title text element\n */\n className?: string;\n /**\n * Title styles configuration (font, anchors, padding)\n */\n titleStyles?: TitleStyles;\n /**\n * Text anchor for SVG text element\n * @default 'middle'\n */\n textAnchor?: 'start' | 'middle' | 'end';\n /**\n * Additional SVGTooltipText props to pass through\n */\n tooltipProps?: Partial<SVGTooltipTextProps>;\n /**\n * CSS class for the tooltip\n */\n tooltipClassName?: string;\n}\n\n/**\n * A reusable chart title component that renders an SVG text element with tooltip support.\n * This component encapsulates the common pattern for rendering chart titles across all chart types.\n */\nexport const ChartTitle: React.FunctionComponent<ChartTitleProps> = props => {\n const { title, x, y, maxWidth, className, titleStyles, tooltipProps, tooltipClassName } = props;\n\n const { titleFont, titleXAnchor, titleYAnchor, titlePad } = titleStyles ?? {};\n const computedTextAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';\n\n // Calculate dominantBaseline from titleYAnchor for vertical alignment\n // 'top' means text hangs below the y position (text-before-edge/hanging)\n // 'bottom' means text sits above the y position (text-after-edge/alphabetic)\n // 'middle' means text is centered on the y position (central)\n const computedDominantBaseline =\n titleYAnchor === 'top'\n ? 'hanging'\n : titleYAnchor === 'bottom'\n ? 'alphabetic'\n : titleYAnchor === 'middle'\n ? 'central'\n : 'auto';\n\n // Calculate x position with padding adjustments\n const computedX = x + (titlePad?.l ?? 0) - (titlePad?.r ?? 0);\n\n // Calculate y position with padding adjustments\n const calculatedY =\n (y ??\n Math.max(\n (typeof titleFont?.size === 'number' ? titleFont.size : 13) + AXIS_TITLE_PADDING,\n CHART_TITLE_PADDING - AXIS_TITLE_PADDING,\n )) +\n (titlePad?.t ?? 0) -\n (titlePad?.b ?? 0);\n\n const commonSvgToolTipProps: Partial<SVGTooltipTextProps> = {\n wrapContent,\n showBackground: true,\n className: tooltipClassName,\n ...tooltipProps,\n };\n return (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={title}\n textProps={{\n x: computedX,\n y: calculatedY,\n textAnchor: computedTextAnchor,\n dominantBaseline: computedDominantBaseline,\n className,\n 'aria-hidden': true,\n style: getChartTitleInlineStyles(titleFont),\n }}\n maxWidth={maxWidth}\n />\n );\n};\n\nChartTitle.displayName = 'ChartTitle';\n"],"names":["React","SVGTooltipText","CHART_TITLE_PADDING","getChartTitleInlineStyles","wrapContent","AXIS_TITLE_PADDING","ChartTitle","props","title","x","y","maxWidth","className","titleStyles","tooltipProps","tooltipClassName","titleFont","titleXAnchor","titleYAnchor","titlePad","computedTextAnchor","computedDominantBaseline","computedX","l","r","calculatedY","Math","max","size","t","b","commonSvgToolTipProps","showBackground","content","textProps","textAnchor","dominantBaseline","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAA6B,mBAAmB;AACvE,SAASC,mBAAmB,EAAEC,yBAAyB,QAAqB,kBAAkB;AAC9F,SAASC,WAAW,QAAQ,cAAc;AAE1C,MAAMC,qBAAqB;AA6C3B;;;CAGC,GACD,OAAO,MAAMC,aAAuDC,CAAAA;IAClE,MAAM,EAAEC,KAAK,EAAEC,CAAC,EAAEC,CAAC,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,gBAAgB,EAAE,GAAGR;IAE1F,MAAM,EAAES,SAAS,EAAEC,YAAY,EAAEC,YAAY,EAAEC,QAAQ,EAAE,GAAGN,wBAAAA,yBAAAA,cAAe,CAAC;IAC5E,MAAMO,qBAAqBH,iBAAiB,SAAS,UAAUA,iBAAiB,UAAU,QAAQ;IAElG,sEAAsE;IACtE,yEAAyE;IACzE,6EAA6E;IAC7E,8DAA8D;IAC9D,MAAMI,2BACJH,iBAAiB,QACb,YACAA,iBAAiB,WACjB,eACAA,iBAAiB,WACjB,YACA;QAGiBC,aAAqBA;IAD5C,gDAAgD;IAChD,MAAMG,YAAYb,IAAKU,CAAAA,CAAAA,cAAAA,qBAAAA,+BAAAA,SAAUI,CAAC,cAAXJ,yBAAAA,cAAe,CAAA,IAAMA,CAAAA,CAAAA,cAAAA,qBAAAA,+BAAAA,SAAUK,CAAC,cAAXL,yBAAAA,cAAe,CAAA;QASxDA,aACAA;IARH,gDAAgD;IAChD,MAAMM,cACJ,AAACf,CAAAA,cAAAA,eAAAA,IACCgB,KAAKC,GAAG,CACN,AAAC,CAAA,QAAOX,sBAAAA,gCAAAA,UAAWY,IAAI,MAAK,WAAWZ,UAAUY,IAAI,GAAG,EAAC,IAAKvB,oBAC9DH,sBAAsBG,mBACxB,IACDc,CAAAA,CAAAA,cAAAA,qBAAAA,+BAAAA,SAAUU,CAAC,cAAXV,yBAAAA,cAAe,CAAA,IACfA,CAAAA,CAAAA,cAAAA,qBAAAA,+BAAAA,SAAUW,CAAC,cAAXX,yBAAAA,cAAe,CAAA;IAElB,MAAMY,wBAAsD;QAC1D3B;QACA4B,gBAAgB;QAChBpB,WAAWG;QACX,GAAGD,YAAY;IACjB;IACA,qBACE,oBAACb;QACE,GAAG8B,qBAAqB;QACzBE,SAASzB;QACT0B,WAAW;YACTzB,GAAGa;YACHZ,GAAGe;YACHU,YAAYf;YACZgB,kBAAkBf;YAClBT;YACA,eAAe;YACfyB,OAAOlC,0BAA0Ba;QACnC;QACAL,UAAUA;;AAGhB,EAAE;AAEFL,WAAWgC,WAAW,GAAG"}
|
|
@@ -25,7 +25,6 @@ const AXIS_TITLE_PADDING = 8;
|
|
|
25
25
|
const DEFAULT_MARGIN_WITH_TICKS = 40;
|
|
26
26
|
const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
27
27
|
const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true, ...props }, forwardedRef)=>{
|
|
28
|
-
var _props_titleStyles_titleFont, _props_titleStyles, _props_titleStyles1;
|
|
29
28
|
const chartContainer = _react.useRef(null);
|
|
30
29
|
let legendContainer;
|
|
31
30
|
const minLegendContainerHeight = 40;
|
|
@@ -580,19 +579,37 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
580
579
|
textAnchor: 'middle'
|
|
581
580
|
},
|
|
582
581
|
maxWidth: xAxisTitleMaxWidth
|
|
583
|
-
}), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' &&
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
582
|
+
}), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && (()=>{
|
|
583
|
+
var _props_titleStyles;
|
|
584
|
+
const { titleFont, titleXAnchor, titleYAnchor, titlePad } = (_props_titleStyles = props.titleStyles) !== null && _props_titleStyles !== void 0 ? _props_titleStyles : {};
|
|
585
|
+
const fontSize = typeof (titleFont === null || titleFont === void 0 ? void 0 : titleFont.size) === 'number' ? titleFont.size : 13;
|
|
586
|
+
var _titlePad_l;
|
|
587
|
+
const padL = (_titlePad_l = titlePad === null || titlePad === void 0 ? void 0 : titlePad.l) !== null && _titlePad_l !== void 0 ? _titlePad_l : 0;
|
|
588
|
+
var _titlePad_r;
|
|
589
|
+
const padR = (_titlePad_r = titlePad === null || titlePad === void 0 ? void 0 : titlePad.r) !== null && _titlePad_r !== void 0 ? _titlePad_r : 0;
|
|
590
|
+
var _titlePad_t;
|
|
591
|
+
const padT = (_titlePad_t = titlePad === null || titlePad === void 0 ? void 0 : titlePad.t) !== null && _titlePad_t !== void 0 ? _titlePad_t : 0;
|
|
592
|
+
var _titlePad_b;
|
|
593
|
+
const padB = (_titlePad_b = titlePad === null || titlePad === void 0 ? void 0 : titlePad.b) !== null && _titlePad_b !== void 0 ? _titlePad_b : 0;
|
|
594
|
+
const xPos = (titleXAnchor === 'left' ? margins.left + AXIS_TITLE_PADDING : titleXAnchor === 'right' ? margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth : margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2) + padL - padR;
|
|
595
|
+
const yPos = Math.max(fontSize + AXIS_TITLE_PADDING, VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING) + padT - padB;
|
|
596
|
+
const textAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';
|
|
597
|
+
const dominantBaseline = titleYAnchor === 'top' ? 'hanging' : titleYAnchor === 'bottom' ? 'alphabetic' : titleYAnchor === 'middle' ? 'central' : 'auto';
|
|
598
|
+
return /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
599
|
+
...commonSvgToolTipProps,
|
|
600
|
+
content: props.xAxisAnnotation,
|
|
601
|
+
textProps: {
|
|
602
|
+
x: xPos,
|
|
603
|
+
y: yPos,
|
|
604
|
+
className: classes.axisAnnotation,
|
|
605
|
+
textAnchor,
|
|
606
|
+
dominantBaseline,
|
|
607
|
+
'aria-hidden': true,
|
|
608
|
+
style: (0, _index.getChartTitleInlineStyles)(titleFont)
|
|
609
|
+
},
|
|
610
|
+
maxWidth: xAxisTitleMaxWidth
|
|
611
|
+
});
|
|
612
|
+
})(), /*#__PURE__*/ _react.createElement("g", {
|
|
596
613
|
ref: (e)=>{
|
|
597
614
|
yAxisElement.current = e;
|
|
598
615
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CommonComponents/CartesianChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { ModifiedCartesianChartProps } from '../../index';\nimport { useCartesianChartStyles } from './useCartesianChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport {\n createNumericXAxis,\n createStringXAxis,\n IAxisData,\n createDateXAxis,\n IMargins,\n XAxisTypes,\n YAxisType,\n createWrapOfXLabels,\n rotateXAxisLabels,\n calculateLongestLabelWidth,\n createYAxisLabels,\n ChartTypes,\n wrapContent,\n useRtl,\n truncateString,\n tooltipOfAxislabels,\n getSecureProps,\n DEFAULT_WRAP_WIDTH,\n autoLayoutXAxisLabels,\n getChartTitleInlineStyles,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { SVGTooltipText, SVGTooltipTextProps } from '../../utilities/SVGTooltipText';\nimport { ChartAnnotationLayer } from './Annotations/ChartAnnotationLayer';\nimport { ChartAnnotationContext } from './Annotations/ChartAnnotationLayer.types';\nimport { ChartPopover } from './ChartPopover';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\n\nconst HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;\nconst VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;\nconst AXIS_TITLE_PADDING = 8;\nconst DEFAULT_MARGIN_WITH_TICKS = 40;\nconst DEFAULT_MARGIN_NO_TICKS = 20;\n\n/**\n * Cartesian Chart component\n * {@docCategory CartesianChart}\n */\nexport const CartesianChart: React.FunctionComponent<ModifiedCartesianChartProps> = React.forwardRef<\n HTMLDivElement,\n ModifiedCartesianChartProps\n>(({ hideTickOverlap = true, ...props }, forwardedRef) => {\n const chartContainer = React.useRef<HTMLDivElement | null>(null);\n let legendContainer: HTMLDivElement;\n const minLegendContainerHeight: number = 40;\n const xAxisElement = React.useRef<SVGSVGElement | null>(null);\n const yAxisElement = React.useRef<SVGSVGElement | null>(null);\n const yAxisElementSecondary = React.useRef<SVGSVGElement | null>(null);\n let margins: IMargins;\n const idForGraph: string = 'chart_';\n let _reqID: number | undefined;\n const _useRtl: boolean = useRtl();\n let _tickLabels: string[];\n const _isFirstRender = React.useRef<boolean>(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xScale: any;\n const isIntegralDataset = React.useMemo(() => {\n return !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n }, [props.points]);\n let _tooltipId: string = useId('tooltip_');\n /* Used for when WrapXAxisLabels props appeared.\n * To display the total word (space separated words), Need to have more space than usual.\n * This height will get total height need to disaply total word.\n * These value need to be removed from actual svg height/graph height.\n * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.\n */\n let _removalValueForTextTuncate: number = 0;\n const _yAxisTickText = React.useRef<string[]>([]);\n\n const [containerWidth, setContainerWidth] = React.useState<number>(0);\n const [containerHeight, setContainerHeight] = React.useState<number>(0);\n const [startFromX, setStartFromX] = React.useState<number>(0);\n const prevWidthRef = React.useRef<number | undefined>(undefined);\n const prevHeightRef = React.useRef<number | undefined>(undefined);\n\n const classes = useCartesianChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n // ComponentdidMount and Componentwillunmount logic\n React.useEffect(() => {\n _fitParentContainer();\n if (props.showYAxisLables) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n return () => {\n if (_reqID !== undefined) {\n cancelAnimationFrame(_reqID);\n }\n };\n }, [props]);\n\n // ComponentDidUpdate logic\n React.useEffect(() => {\n // Check if height or width changed\n if (\n prevWidthRef.current !== undefined &&\n prevHeightRef.current !== undefined &&\n (prevWidthRef.current !== props.width || prevHeightRef.current !== props.height)\n ) {\n _fitParentContainer();\n }\n // Update refs with current values\n prevWidthRef.current = props.width;\n prevHeightRef.current = props.height;\n\n if (props.showYAxisLables) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n }, [props.width, props.height, props.chartType, props.showYAxisLables, props.yAxisType]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainer.current ?? null,\n }),\n [],\n );\n\n /**\n * Dedicated function to return the Callout JSX Element , which can further be used to only call this when\n * only the calloutprops and charthover props changes.\n * @param calloutProps\n * @param chartHoverProps\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _generateCallout(calloutProps: any): JSXElement {\n return <ChartPopover {...calloutProps} />;\n }\n\n function calculateMaxYAxisLabelLength(className: string): number {\n const formatTickLabel = (str: string) => {\n if (props.showYAxisLablesTooltip) {\n return truncateString(str, props.noOfCharsToTruncate || 4);\n }\n\n return str;\n };\n return calculateLongestLabelWidth(\n _yAxisTickText.current.map(label => formatTickLabel(label)),\n `.${className} text`,\n );\n }\n\n const {\n calloutProps,\n points,\n chartType,\n svgProps,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n } = props;\n if (props.parentRef) {\n _fitParentContainer();\n }\n\n margins = _calcMargins();\n // Callback for margins to the chart\n props.getmargins && props.getmargins(margins);\n\n let callout: JSXElement | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScalePrimary: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScaleSecondary: any;\n\n let children = null;\n if ((props.enableFirstRenderOptimization && chartContainer.current) || !props.enableFirstRenderOptimization) {\n _isFirstRender.current = false;\n const XAxisParams = {\n domainNRangeValues: props.getDomainNRangeValues(\n points,\n props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins,\n containerWidth,\n chartType,\n _useRtl,\n props.xAxisType,\n props.barwidth!,\n props.tickValues!,\n ),\n // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.\n // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.\n // However, if transformation props are enabled, the updated _removalValueForTextTuncate\n // will only be available in the next render, as it's set after the axis is created.\n // Solution: Delay the creation of gridlines until after the transformation has been applied,\n // or precompute the required height for transformed labels (_removalValueForTextTuncate).\n containerHeight: containerHeight - _removalValueForTextTuncate,\n margins: margins,\n xAxisElement: xAxisElement.current!,\n showRoundOffXTickValues: props.showRoundOffXTickValues ?? true,\n xAxisCount: props.xAxisTickCount,\n xAxistickSize: props.xAxistickSize,\n tickPadding: props.tickPadding || props.showXAxisLablesTooltip ? 5 : 10,\n xAxisPadding: props.xAxisPadding,\n xAxisInnerPadding: props.xAxisInnerPadding,\n xAxisOuterPadding: props.xAxisOuterPadding,\n containerWidth: containerWidth,\n hideTickOverlap: props.rotateXAxisLables || props.xAxis?.tickLayout === 'auto' ? false : hideTickOverlap,\n calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,\n xMinValue: props.xMinValue,\n xMaxValue: props.xMaxValue,\n ...props.xAxis,\n };\n\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let xScale: any;\n let tickValues: number[] | Date[] | string[];\n let tickLabels: string[];\n switch (props.xAxisType!) {\n case XAxisTypes.NumericAxis:\n ({ xScale, tickValues, tickLabels } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n _useRtl,\n ));\n break;\n case XAxisTypes.DateAxis:\n ({ xScale, tickValues, tickLabels } = createDateXAxis(\n XAxisParams,\n props.tickParams!,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n props.useUTC,\n props.chartType,\n ));\n break;\n case XAxisTypes.StringAxis:\n ({ xScale, tickValues, tickLabels } = createStringXAxis(\n XAxisParams,\n props.tickParams!,\n props.datasetForXAxisDomain!,\n culture,\n _useRtl,\n ));\n break;\n default:\n ({ xScale, tickValues, tickLabels } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n _useRtl,\n ));\n }\n _xScale = xScale;\n _tickLabels = tickLabels;\n\n if (props.xAxis?.tickLayout === 'auto') {\n _removalValueForTextTuncate = autoLayoutXAxisLabels(\n tickValues,\n _tickLabels,\n _xScale,\n xAxisElement.current,\n containerWidth,\n chartContainer.current,\n );\n } else {\n _transformXAxisLabels();\n }\n\n const YAxisParams = {\n margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate,\n yAxisElement: yAxisElement.current!,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.yMinValue || 0,\n yMaxValue: props.yMaxValue || 0,\n tickPadding: 10,\n maxOfYVal: props.maxOfYVal,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),\n // please note these padding default values must be consistent in here\n // and the parent chart(HBWA/Vertical etc..) for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n yAxisPadding: props.yAxisPadding || 0,\n tickValues: props.yAxisTickValues,\n ...props.yAxis,\n };\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n const axisData: IAxisData = { yAxisDomainValues: [], yAxisTickText: [] };\n if (props.yAxisType && props.yAxisType === YAxisType.StringAxis) {\n yScalePrimary = props.createStringYAxis(\n YAxisParams,\n props.stringDatasetForYAxisDomain!,\n _useRtl,\n axisData,\n props.barwidth,\n props.chartType,\n );\n } else {\n // TODO: Since the scale domain values are now computed independently for both the primary and\n // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately\n // rendering the secondary y-axis. Therefore, rather than checking the secondaryYScaleOptions\n // prop to determine whether to create a secondary y-axis, it's more appropriate to check if any\n // data points are assigned to use the secondary y-scale.\n if (props?.secondaryYScaleOptions) {\n const YAxisParamsSecondary = {\n margins: margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate!,\n yAxisElement: yAxisElementSecondary.current,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.secondaryYScaleOptions?.yMinValue || 0,\n yMaxValue: props.secondaryYScaleOptions?.yMaxValue ?? 100,\n tickPadding: 10,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),\n yAxisPadding: props.yAxisPadding,\n };\n\n yScaleSecondary = props.createYAxis(\n YAxisParamsSecondary,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n true,\n props.roundedTicks!,\n props.secondaryYScaleType,\n _useRtl,\n );\n }\n yScalePrimary = props.createYAxis(\n YAxisParams,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n false,\n props.roundedTicks!,\n props.yScaleType,\n _useRtl,\n );\n }\n _yAxisTickText.current = axisData.yAxisTickText;\n props.getAxisData && props.getAxisData(axisData);\n\n // Removing previously created tooltips.\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n // Used to display tooltip at x axis labels.\n if (props.showXAxisLablesTooltip || props.xAxis?.tickLayout === 'auto') {\n const _xAxisElement = xAxisElement.current ? d3Select(xAxisElement.current).call(xScale) : null;\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _xAxisElement,\n container: chartContainer.current,\n };\n _xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n // Used to display tooltip at y axis labels.\n if (props.showYAxisLablesTooltip) {\n // To create y axis tick values by if specified truncating the rest of the text\n // and showing elipsis or showing the whole string,\n yScalePrimary &&\n createYAxisLabels(\n yAxisElement.current!,\n yScalePrimary,\n props.noOfCharsToTruncate || 4,\n props.showYAxisLablesTooltip || false,\n _useRtl,\n );\n\n const _yAxisElement = yAxisElement.current ? d3Select(yAxisElement.current).call(yScalePrimary) : null;\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _yAxisElement,\n container: chartContainer.current,\n };\n _yAxisElement && tooltipOfAxislabels(ytooltipProps);\n }\n\n // Call back to the chart.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _getData = (xScale: any, yScalePrimary: any, yScaleSecondary: any) => {\n props.getGraphData &&\n props.getGraphData(\n xScale,\n yScalePrimary,\n containerHeight - _removalValueForTextTuncate!,\n containerWidth,\n xAxisElement.current,\n yAxisElement.current,\n yScaleSecondary,\n );\n };\n\n // Callback function for chart, returns axis\n _getData(xScale, yScalePrimary, yScaleSecondary);\n\n children = props.children({\n xScale,\n yScalePrimary,\n yScaleSecondary,\n containerHeight,\n containerWidth,\n });\n\n if (!props.hideTooltip && calloutProps!.isPopoverOpen) {\n callout = _generateCallout(calloutProps);\n }\n }\n const svgDimensions = {\n width: containerWidth,\n height: containerHeight,\n };\n\n const plotWidth = Math.max(0, svgDimensions.width - margins.left! - margins.right!);\n const plotHeight = Math.max(0, svgDimensions.height - margins.top! - margins.bottom! - _removalValueForTextTuncate);\n\n const plotRect = {\n x: margins.left!,\n y: margins.top!,\n width: plotWidth,\n height: plotHeight,\n };\n\n const annotations = props.annotations ?? [];\n const hasAnnotations = annotations.length > 0;\n const annotationContext: ChartAnnotationContext | undefined = hasAnnotations\n ? {\n plotRect,\n svgRect: svgDimensions,\n isRtl: _useRtl,\n xScale: _xScale,\n yScalePrimary,\n yScaleSecondary,\n }\n : undefined;\n\n const xAxisTitleMaxWidth = svgDimensions.width - margins.left! - margins.right! - AXIS_TITLE_PADDING * 2;\n const yAxisTitleMaxHeight =\n svgDimensions.height - margins.bottom! - margins.top! - _removalValueForTextTuncate! - AXIS_TITLE_PADDING * 2;\n const yAxisTitleCenterY = margins.top! + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;\n const yAxisTitleCenterX = _useRtl\n ? svgDimensions.width - AXIS_TITLE_PADDING\n : HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;\n const secondaryYAxisTitleCenterX = _useRtl\n ? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING\n : svgDimensions.width - AXIS_TITLE_PADDING;\n\n const commonSvgToolTipProps: SVGTooltipTextProps = {\n wrapContent,\n showBackground: true,\n className: classes.svgTooltip,\n content: '',\n };\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer && getComputedStyle(legendContainer);\n legendContainerHeight =\n ((legendContainer && legendContainer.getBoundingClientRect().height) || minLegendContainerHeight) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || chartContainer.current) {\n const container = props.parentRef ? props.parentRef : chartContainer.current!;\n const currentContainerWidth =\n props.reflowProps?.mode === 'min-width' && !_isFirstRender.current\n ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth())\n : container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 350;\n const shouldResize =\n containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setContainerWidth(currentContainerWidth);\n setContainerHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n function _onChartLeave(): void {\n props.onChartMouseLeave && props.onChartMouseLeave();\n }\n\n function _calculateChartMinWidth(): number {\n // Adding 10px for padding on both sides\n const labelWidth = _calcMaxLabelWidthWithTransform(_tickLabels) + 10;\n\n let minChartWidth = margins.left! + margins.right! + labelWidth * (_tickLabels.length - 1);\n\n if (\n [ChartTypes.GroupedVerticalBarChart, ChartTypes.VerticalBarChart, ChartTypes.VerticalStackedBarChart].includes(\n props.chartType,\n )\n ) {\n const minDomainMargin = 8;\n minChartWidth += minDomainMargin * 2;\n }\n\n return minChartWidth;\n }\n\n function _getChartDescription(): string {\n return (\n (props.chartTitle || 'Chart. ') +\n _getAxisTitle('X', props.xAxisTitle, props.xAxisType) +\n _getAxisTitle('Y', props.yAxisTitle, props.yAxisType || YAxisType.NumericAxis) +\n (props.secondaryYScaleOptions\n ? _getAxisTitle('secondary Y', props.secondaryYAxistitle, YAxisType.NumericAxis)\n : '')\n );\n }\n\n function _getAxisTitle(axisLabel: string, axisTitle: string | undefined, axisType: XAxisTypes | YAxisType): string {\n return (\n `The ${axisLabel} axis displays ` +\n (axisTitle ||\n (axisType === XAxisTypes.StringAxis || axisType === YAxisType.StringAxis\n ? 'categories'\n : axisType === XAxisTypes.DateAxis || axisType === YAxisType.DateAxis\n ? 'time'\n : 'values')) +\n '. '\n );\n }\n\n function _calcMaxLabelWidthWithTransform(x: (string | number)[]) {\n // Case: rotated labels\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));\n }\n\n // Case: truncated labels\n if (props.showXAxisLablesTooltip) {\n const tickLabels = x.map(val => {\n const numChars = props.noOfCharsToTruncate || 4;\n return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;\n });\n\n const longestLabelWidth = calculateLongestLabelWidth(tickLabels, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n // Case: wrapped labels\n if (props.wrapXAxisLables) {\n // FIXME: Calculate the max width of lines instead of words. This requires applying\n // the wrapping transformation earlier to obtain the actual rendered lines.\n const words: string[] = [];\n x.forEach((val: string) => {\n words.push(...val.toString().split(/\\s+/));\n });\n\n // This approach works well in most cases, since overflow typically occurs only when\n // a single word exceeds the specified width — otherwise, the text will wrap as expected.\n const longestLabelWidth = calculateLongestLabelWidth(words, `.${classes.xAxis} text`);\n return Math.max(Math.ceil(longestLabelWidth), DEFAULT_WRAP_WIDTH);\n }\n\n // Default case\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n function _transformXAxisLabels() {\n _removalValueForTextTuncate = 0;\n\n /*\n * To enable wrapping of x axis tick values or to display complete x axis tick values,\n * we need to calculate how much space it needed to render the text.\n * No need to re-calculate every time the chart renders and same time need to get an update. So using setState.\n * Required space will be calculated first time chart rendering and if any width/height of chart updated.\n * */\n if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {\n let maxXAxisLabelWidth: number | undefined;\n if (props.xAxisType === XAxisTypes.StringAxis) {\n if ((props.datasetForXAxisDomain?.length || 0) > 1) {\n maxXAxisLabelWidth = _xScale.step();\n } else {\n maxXAxisLabelWidth = containerWidth;\n }\n }\n\n const wrapLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,\n noOfCharsToTruncate: props.noOfCharsToTruncate || 4,\n width: maxXAxisLabelWidth,\n container: chartContainer.current,\n };\n _removalValueForTextTuncate = createWrapOfXLabels(wrapLabelProps) ?? 0;\n }\n\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const rotateLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n };\n const rotatedHeight = rotateXAxisLabels(rotateLabelProps) ?? 0;\n // margins.bottom is used as padding here\n _removalValueForTextTuncate = rotatedHeight + margins.bottom!;\n }\n }\n\n function _calcMargins(): IMargins {\n let _margins = _getDefaultMargins();\n\n _margins = _applyTitleMargins(_margins);\n _margins = _applyAnnotationMargins(_margins);\n\n if (_useRtl) {\n _margins = _swapRtlMargins(_margins);\n }\n\n return {\n ..._margins,\n ...props.margins,\n };\n }\n\n function _getDefaultMargins(): IMargins {\n return {\n top: DEFAULT_MARGIN_NO_TICKS,\n // Smaller than the default because it is based on the line height rather than\n // the length of the tick labels.\n bottom: DEFAULT_MARGIN_WITH_TICKS - 5,\n // For the actual margin, add the tick size, tick padding, and some extra space to\n // the width of the longest yaxis tick label (startFromX).\n left: Math.max(DEFAULT_MARGIN_WITH_TICKS, startFromX + 20),\n right: props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,\n };\n }\n\n function _applyTitleMargins(_margins: IMargins): IMargins {\n const updated = { ..._margins };\n if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {\n updated.bottom! += VERTICAL_MARGIN_FOR_XAXIS_TITLE;\n }\n if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {\n updated.left! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n if (props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '') {\n updated.right! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n return updated;\n }\n\n function _applyAnnotationMargins(_margins: IMargins): IMargins {\n const updated = { ..._margins };\n if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {\n updated.top! += VERTICAL_MARGIN_FOR_XAXIS_TITLE;\n }\n if (\n props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')\n ) {\n updated.right! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n return updated;\n }\n\n function _swapRtlMargins(_margins: IMargins): IMargins {\n return {\n ..._margins,\n left: _margins.right,\n right: _margins.left,\n };\n }\n\n /**\n * We have use the {@link defaultTabbableElement } to fix\n * the Focus not landing on chart while tabbing, instead goes to legend.\n * This issue is observed in Area, line chart after performance optimization done in the PR {@link https://github.com/microsoft/fluentui/pull/27721 }\n * This issue is observed in Bar charts after the changes done by FocusZone team in the PR: {@link https://github.com/microsoft/fluentui/pull/24175 }\n * The issue in Bar Charts(VB and VSB) is due to a {@link FocusZone } update where previously an event listener was\n * attached on keydown to the window, so that whenever the tab key is pressed all outer FocusZone's\n * tab-indexes are updated (an outer FocusZone is a FocusZone that is not within another one).\n * But now after the above PR : they are attaching the\n * listeners to the FocusZone elements instead of the window. So in the first render cycle in Bar charts\n * bars are not created as in the first render cycle the size of the chart container is not known( or is 0)\n * which creates bars of height 0 so instead we do not create any bars and instead return empty fragments.\n *\n * We have tried 2 Approaches to fix the issue:\n * 1. Using the {@link elementRef} property of FocusZone where we dispatch event for tab keydown\n * after the second render cycle which triggers an update of the tab index in FocusZone.\n * But this is a hacky solution and not a proper fix and also elementRef is deprecated.\n * 2. Using the default tabbable element to fix the issue.\n */\n\n return (\n <div\n id={idForGraph}\n className={classes.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => {\n chartContainer.current = rootElem;\n }}\n onMouseLeave={_onChartLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes} {...arrowAttributes}>\n {_isFirstRender.current}\n <svg\n width={svgDimensions.width}\n height={svgDimensions.height}\n role=\"region\"\n aria-label={_getChartDescription()}\n style={{ display: 'block' }}\n className={classes.chart}\n {...getSecureProps(svgProps)}\n >\n <g\n ref={(e: SVGSVGElement | null) => {\n xAxisElement.current = e!;\n }}\n id={`xAxisGElement${idForGraph}`}\n // To add wrap of x axis lables feature, need to remove word height from svg height.\n transform={`translate(0, ${svgDimensions.height - margins.bottom! - _removalValueForTextTuncate!})`}\n className={classes.xAxis}\n />\n {props.xAxisTitle !== undefined && props.xAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisTitle}\n textProps={{\n x: margins.left! + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,\n y: svgDimensions.height - AXIS_TITLE_PADDING,\n className: classes.axisTitle!,\n textAnchor: 'middle',\n }}\n maxWidth={xAxisTitleMaxWidth}\n />\n )}\n {props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisAnnotation}\n textProps={{\n x: margins.left! + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,\n y: Math.max(\n (typeof props.titleStyles?.titleFont?.size === 'number' ? props.titleStyles.titleFont.size : 13) +\n AXIS_TITLE_PADDING,\n VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,\n ),\n className: classes.axisAnnotation!,\n textAnchor: 'middle',\n 'aria-hidden': true,\n style: getChartTitleInlineStyles(props.titleStyles?.titleFont),\n }}\n maxWidth={xAxisTitleMaxWidth}\n />\n )}\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElement.current = e!;\n }}\n id={`yAxisGElement${idForGraph}`}\n transform={`translate(${_useRtl ? svgDimensions.width - margins.right! : margins.left!}, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYScaleOptions && (\n <g>\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElementSecondary.current = e!;\n }}\n id={`yAxisGElementSecondary${idForGraph}`}\n transform={`translate(${_useRtl ? margins.left! : svgDimensions.width - margins.right!}, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.secondaryYAxistitle}\n textProps={{\n x: secondaryYAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n </g>\n )}\n {children}\n {props.yAxisTitle !== undefined && props.yAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisTitle}\n textProps={{\n x: yAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${yAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n {props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisAnnotation}\n textProps={{\n x: secondaryYAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisAnnotation!,\n 'aria-hidden': true,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n </svg>\n {hasAnnotations && annotationContext && (\n <ChartAnnotationLayer\n annotations={annotations}\n context={annotationContext}\n className={classes.annotationLayer}\n />\n )}\n </div>\n\n {!props.hideLegend && (\n <div\n ref={(e: HTMLDivElement) => {\n legendContainer = e;\n }}\n className={classes.legendContainer}\n >\n {props.legendBars}\n </div>\n )}\n {/** The callout is used for narration, so keep it mounted on the DOM */}\n {callout && <React.Suspense fallback={<div>Loading...</div>}>{callout}</React.Suspense>}\n </div>\n );\n});\nCartesianChart.displayName = 'CartesianChart';\n"],"names":["React","useCartesianChartStyles","select","d3Select","createNumericXAxis","createStringXAxis","createDateXAxis","XAxisTypes","YAxisType","createWrapOfXLabels","rotateXAxisLabels","calculateLongestLabelWidth","createYAxisLabels","ChartTypes","wrapContent","useRtl","truncateString","tooltipOfAxislabels","getSecureProps","DEFAULT_WRAP_WIDTH","autoLayoutXAxisLabels","getChartTitleInlineStyles","useId","SVGTooltipText","ChartAnnotationLayer","ChartPopover","useFocusableGroup","useArrowNavigationGroup","HORIZONTAL_MARGIN_FOR_YAXIS_TITLE","VERTICAL_MARGIN_FOR_XAXIS_TITLE","AXIS_TITLE_PADDING","DEFAULT_MARGIN_WITH_TICKS","DEFAULT_MARGIN_NO_TICKS","CartesianChart","forwardRef","hideTickOverlap","props","forwardedRef","chartContainer","useRef","legendContainer","minLegendContainerHeight","xAxisElement","yAxisElement","yAxisElementSecondary","margins","idForGraph","_reqID","_useRtl","_tickLabels","_isFirstRender","_xScale","isIntegralDataset","useMemo","points","some","point","y","_tooltipId","_removalValueForTextTuncate","_yAxisTickText","containerWidth","setContainerWidth","useState","containerHeight","setContainerHeight","startFromX","setStartFromX","prevWidthRef","undefined","prevHeightRef","classes","focusAttributes","arrowAttributes","circular","axis","useEffect","_fitParentContainer","showYAxisLables","maxYAxisLabelLength","calculateMaxYAxisLabelLength","yAxis","cancelAnimationFrame","current","width","height","chartType","yAxisType","useImperativeHandle","componentRef","_generateCallout","calloutProps","className","formatTickLabel","str","showYAxisLablesTooltip","noOfCharsToTruncate","map","label","svgProps","culture","dateLocalizeOptions","timeFormatLocale","customDateTimeFormatter","parentRef","_calcMargins","getmargins","callout","yScalePrimary","yScaleSecondary","children","enableFirstRenderOptimization","XAxisParams","domainNRangeValues","getDomainNRangeValues","getDomainMargins","xAxisType","barwidth","tickValues","showRoundOffXTickValues","xAxisCount","xAxisTickCount","xAxistickSize","tickPadding","showXAxisLablesTooltip","xAxisPadding","xAxisInnerPadding","xAxisOuterPadding","rotateXAxisLables","xAxis","tickLayout","calcMaxLabelWidth","_calcMaxLabelWidthWithTransform","xMinValue","xMaxValue","xScale","tickLabels","NumericAxis","tickParams","xScaleType","DateAxis","useUTC","StringAxis","datasetForXAxisDomain","_transformXAxisLabels","YAxisParams","getYDomainMargins","yAxisTickFormat","yAxisTickCount","yMinValue","yMaxValue","maxOfYVal","yMinMaxValues","getMinMaxOfYAxis","yAxisPadding","yAxisTickValues","axisData","yAxisDomainValues","yAxisTickText","createStringYAxis","stringDatasetForYAxisDomain","secondaryYScaleOptions","YAxisParamsSecondary","createYAxis","roundedTicks","secondaryYScaleType","yScaleType","getAxisData","document","getElementById","remove","e","_xAxisElement","call","tooltipProps","tooltipCls","tooltip","id","container","_yAxisElement","ytooltipProps","_getData","getGraphData","hideTooltip","isPopoverOpen","svgDimensions","plotWidth","Math","max","left","right","plotHeight","top","bottom","plotRect","x","annotations","hasAnnotations","length","annotationContext","svgRect","isRtl","xAxisTitleMaxWidth","yAxisTitleMaxHeight","yAxisTitleCenterY","yAxisTitleCenterX","secondaryYAxisTitleCenterX","commonSvgToolTipProps","showBackground","svgTooltip","content","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","currentContainerWidth","reflowProps","mode","_calculateChartMinWidth","currentContainerHeight","shouldResize","_onChartLeave","onChartMouseLeave","labelWidth","minChartWidth","GroupedVerticalBarChart","VerticalBarChart","VerticalStackedBarChart","includes","minDomainMargin","_getChartDescription","chartTitle","_getAxisTitle","xAxisTitle","yAxisTitle","secondaryYAxistitle","axisLabel","axisTitle","axisType","wrapXAxisLables","longestLabelWidth","ceil","cos","PI","val","numChars","toString","slice","words","forEach","push","split","maxXAxisLabelWidth","step","wrapLabelProps","node","rotateLabelProps","rotatedHeight","_margins","_getDefaultMargins","_applyTitleMargins","_applyAnnotationMargins","_swapRtlMargins","updated","xAxisAnnotation","yAxisAnnotation","div","root","role","ref","rootElem","onMouseLeave","chartWrapper","svg","aria-label","style","display","chart","g","transform","textProps","textAnchor","maxWidth","titleStyles","titleFont","size","axisAnnotation","context","annotationLayer","legendBars","Suspense","fallback","displayName"],"mappings":"AAAA;;;;;+BA+CaiC;;;;;;;iEA7CU,QAAQ;+CAGS,mCAAmC;6BACxC,eAAe;uBAsB3C,wBAAwB;gCACT,4BAA4B;gCAEE,iCAAiC;sCAChD,qCAAqC;8BAE7C,iBAAiB;8BACa,0BAA0B;AAErF,MAAML,oCAAoC;AAC1C,MAAMC,kCAAkC;AACxC,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAClC,MAAMC,0BAA0B;AAMzB,uBAAMC,WAAAA,GAAuEjC,OAAMkC,UAAU,CAGlG,CAAC,EAAEC,kBAAkB,IAAI,EAAE,GAAGC,OAAO,EAAEC;QAouBfD,8BAAAA,oBAOuBA;IA1uB/C,MAAME,iBAAiBtC,OAAMuC,MAAM,CAAwB;IAC3D,IAAIC;IACJ,MAAMC,2BAAmC;IACzC,MAAMC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AAGmJ;YACHiF,YAAY;YACZF,WAAW,CAAC,YAAY,EAAE9E,kBAAkB,EAAE,EAAED,kBAAkB,CAAC,CAAC;YACpEhH,WAAWrB,QAAQ0K,SAAS;QAC9B;QACA6C,UAAUnF;QAGbvK,MAAMyO,eAAe,KAAKxM,aACzBjC,MAAMyO,eAAe,KAAK,MACzBzO,CAAAA,MAAM2M,mBAAmB,KAAK1K,aAAajC,MAAM2M,mBAAmB,KAAK,EAAA,CAAC,IAAA,WAAA,GACzE,OAAA,aAAA,CAACxN,8BAAAA,EAAAA;QACE,GAAGwL,qBAAqB;QACzBG,SAAS9K,MAAMyO,eAAe;QAC9Be,WAAW;YACTzF,GAAGW;YACHrJ,GAAGmJ;YACHiF,YAAY;YACZF,WAAW,CAAC,YAAY,EAAE7E,2BAA2B,EAAE,EAAEF,kBAAkB,CAAC,CAAC;YAC7EhH,WAAWrB,QAAQ2N,cAAc;YACjC,eAAe;QACjB;QACAJ,UAAUnF;SAIjBN,kBAAkBE,qBAAAA,WAAAA,GACjB,OAAA,aAAA,CAAC/K,0CAAAA,EAAAA;QACC4K,aAAaA;QACb+F,SAAS5F;QACT3G,WAAWrB,QAAQ6N,eAAe;SAKvC,CAAChQ,MAAMgL,UAAU,IAAA,WAAA,GAChB,OAAA,aAAA,CAAC0D,OAAAA;QACCG,KAAK,CAACtG;YACJnI,kBAAkBmI;QACpB;QACA/E,WAAWrB,QAAQ/B,eAAe;OAEjCJ,MAAMiQ,UAAU,GAIpB1L,WAAAA,WAAAA,GAAW,OAAA,aAAA,CAAC3G,OAAMsS,QAAQ,EAAA;QAACC,UAAAA,WAAAA,GAAU,OAAA,aAAA,CAACzB,OAAAA,MAAI;OAAmBnK;AAGpE,GAAG;AACH1E,eAAeuQ,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CommonComponents/CartesianChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { ModifiedCartesianChartProps } from '../../index';\nimport { useCartesianChartStyles } from './useCartesianChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport {\n createNumericXAxis,\n createStringXAxis,\n IAxisData,\n createDateXAxis,\n IMargins,\n XAxisTypes,\n YAxisType,\n createWrapOfXLabels,\n rotateXAxisLabels,\n calculateLongestLabelWidth,\n createYAxisLabels,\n ChartTypes,\n wrapContent,\n useRtl,\n truncateString,\n tooltipOfAxislabels,\n getSecureProps,\n DEFAULT_WRAP_WIDTH,\n autoLayoutXAxisLabels,\n getChartTitleInlineStyles,\n} from '../../utilities/index';\nimport { useId } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { SVGTooltipText, SVGTooltipTextProps } from '../../utilities/SVGTooltipText';\nimport { ChartAnnotationLayer } from './Annotations/ChartAnnotationLayer';\nimport { ChartAnnotationContext } from './Annotations/ChartAnnotationLayer.types';\nimport { ChartPopover } from './ChartPopover';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\n\nconst HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;\nconst VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;\nconst AXIS_TITLE_PADDING = 8;\nconst DEFAULT_MARGIN_WITH_TICKS = 40;\nconst DEFAULT_MARGIN_NO_TICKS = 20;\n\n/**\n * Cartesian Chart component\n * {@docCategory CartesianChart}\n */\nexport const CartesianChart: React.FunctionComponent<ModifiedCartesianChartProps> = React.forwardRef<\n HTMLDivElement,\n ModifiedCartesianChartProps\n>(({ hideTickOverlap = true, ...props }, forwardedRef) => {\n const chartContainer = React.useRef<HTMLDivElement | null>(null);\n let legendContainer: HTMLDivElement;\n const minLegendContainerHeight: number = 40;\n const xAxisElement = React.useRef<SVGSVGElement | null>(null);\n const yAxisElement = React.useRef<SVGSVGElement | null>(null);\n const yAxisElementSecondary = React.useRef<SVGSVGElement | null>(null);\n let margins: IMargins;\n const idForGraph: string = 'chart_';\n let _reqID: number | undefined;\n const _useRtl: boolean = useRtl();\n let _tickLabels: string[];\n const _isFirstRender = React.useRef<boolean>(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let _xScale: any;\n const isIntegralDataset = React.useMemo(() => {\n return !props.points.some((point: { y: number }) => point.y % 1 !== 0);\n }, [props.points]);\n let _tooltipId: string = useId('tooltip_');\n /* Used for when WrapXAxisLabels props appeared.\n * To display the total word (space separated words), Need to have more space than usual.\n * This height will get total height need to disaply total word.\n * These value need to be removed from actual svg height/graph height.\n * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.\n */\n let _removalValueForTextTuncate: number = 0;\n const _yAxisTickText = React.useRef<string[]>([]);\n\n const [containerWidth, setContainerWidth] = React.useState<number>(0);\n const [containerHeight, setContainerHeight] = React.useState<number>(0);\n const [startFromX, setStartFromX] = React.useState<number>(0);\n const prevWidthRef = React.useRef<number | undefined>(undefined);\n const prevHeightRef = React.useRef<number | undefined>(undefined);\n\n const classes = useCartesianChartStyles(props);\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n // ComponentdidMount and Componentwillunmount logic\n React.useEffect(() => {\n _fitParentContainer();\n if (props.showYAxisLables) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n return () => {\n if (_reqID !== undefined) {\n cancelAnimationFrame(_reqID);\n }\n };\n }, [props]);\n\n // ComponentDidUpdate logic\n React.useEffect(() => {\n // Check if height or width changed\n if (\n prevWidthRef.current !== undefined &&\n prevHeightRef.current !== undefined &&\n (prevWidthRef.current !== props.width || prevHeightRef.current !== props.height)\n ) {\n _fitParentContainer();\n }\n // Update refs with current values\n prevWidthRef.current = props.width;\n prevHeightRef.current = props.height;\n\n if (props.showYAxisLables) {\n const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis!);\n if (startFromX !== maxYAxisLabelLength) {\n setStartFromX(maxYAxisLabelLength);\n }\n } else if (startFromX !== 0) {\n setStartFromX(0);\n }\n }, [props.width, props.height, props.chartType, props.showYAxisLables, props.yAxisType]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: chartContainer.current ?? null,\n }),\n [],\n );\n\n /**\n * Dedicated function to return the Callout JSX Element , which can further be used to only call this when\n * only the calloutprops and charthover props changes.\n * @param calloutProps\n * @param chartHoverProps\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _generateCallout(calloutProps: any): JSXElement {\n return <ChartPopover {...calloutProps} />;\n }\n\n function calculateMaxYAxisLabelLength(className: string): number {\n const formatTickLabel = (str: string) => {\n if (props.showYAxisLablesTooltip) {\n return truncateString(str, props.noOfCharsToTruncate || 4);\n }\n\n return str;\n };\n return calculateLongestLabelWidth(\n _yAxisTickText.current.map(label => formatTickLabel(label)),\n `.${className} text`,\n );\n }\n\n const {\n calloutProps,\n points,\n chartType,\n svgProps,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n } = props;\n if (props.parentRef) {\n _fitParentContainer();\n }\n\n margins = _calcMargins();\n // Callback for margins to the chart\n props.getmargins && props.getmargins(margins);\n\n let callout: JSXElement | null = null;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScalePrimary: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let yScaleSecondary: any;\n\n let children = null;\n if ((props.enableFirstRenderOptimization && chartContainer.current) || !props.enableFirstRenderOptimization) {\n _isFirstRender.current = false;\n const XAxisParams = {\n domainNRangeValues: props.getDomainNRangeValues(\n points,\n props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins,\n containerWidth,\n chartType,\n _useRtl,\n props.xAxisType,\n props.barwidth!,\n props.tickValues!,\n ),\n // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.\n // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.\n // However, if transformation props are enabled, the updated _removalValueForTextTuncate\n // will only be available in the next render, as it's set after the axis is created.\n // Solution: Delay the creation of gridlines until after the transformation has been applied,\n // or precompute the required height for transformed labels (_removalValueForTextTuncate).\n containerHeight: containerHeight - _removalValueForTextTuncate,\n margins: margins,\n xAxisElement: xAxisElement.current!,\n showRoundOffXTickValues: props.showRoundOffXTickValues ?? true,\n xAxisCount: props.xAxisTickCount,\n xAxistickSize: props.xAxistickSize,\n tickPadding: props.tickPadding || props.showXAxisLablesTooltip ? 5 : 10,\n xAxisPadding: props.xAxisPadding,\n xAxisInnerPadding: props.xAxisInnerPadding,\n xAxisOuterPadding: props.xAxisOuterPadding,\n containerWidth: containerWidth,\n hideTickOverlap: props.rotateXAxisLables || props.xAxis?.tickLayout === 'auto' ? false : hideTickOverlap,\n calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,\n xMinValue: props.xMinValue,\n xMaxValue: props.xMaxValue,\n ...props.xAxis,\n };\n\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let xScale: any;\n let tickValues: number[] | Date[] | string[];\n let tickLabels: string[];\n switch (props.xAxisType!) {\n case XAxisTypes.NumericAxis:\n ({ xScale, tickValues, tickLabels } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n _useRtl,\n ));\n break;\n case XAxisTypes.DateAxis:\n ({ xScale, tickValues, tickLabels } = createDateXAxis(\n XAxisParams,\n props.tickParams!,\n culture,\n dateLocalizeOptions,\n timeFormatLocale,\n customDateTimeFormatter,\n props.useUTC,\n props.chartType,\n ));\n break;\n case XAxisTypes.StringAxis:\n ({ xScale, tickValues, tickLabels } = createStringXAxis(\n XAxisParams,\n props.tickParams!,\n props.datasetForXAxisDomain!,\n culture,\n _useRtl,\n ));\n break;\n default:\n ({ xScale, tickValues, tickLabels } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n _useRtl,\n ));\n }\n _xScale = xScale;\n _tickLabels = tickLabels;\n\n if (props.xAxis?.tickLayout === 'auto') {\n _removalValueForTextTuncate = autoLayoutXAxisLabels(\n tickValues,\n _tickLabels,\n _xScale,\n xAxisElement.current,\n containerWidth,\n chartContainer.current,\n );\n } else {\n _transformXAxisLabels();\n }\n\n const YAxisParams = {\n margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate,\n yAxisElement: yAxisElement.current!,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.yMinValue || 0,\n yMaxValue: props.yMaxValue || 0,\n tickPadding: 10,\n maxOfYVal: props.maxOfYVal,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),\n // please note these padding default values must be consistent in here\n // and the parent chart(HBWA/Vertical etc..) for more details refer example\n // http://using-d3js.com/04_07_ordinal_scales.html\n yAxisPadding: props.yAxisPadding || 0,\n tickValues: props.yAxisTickValues,\n ...props.yAxis,\n };\n /**\n * These scales used for 2 purposes.\n * 1. To create x and y axis\n * 2. To draw the graph.\n * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.\n */\n const axisData: IAxisData = { yAxisDomainValues: [], yAxisTickText: [] };\n if (props.yAxisType && props.yAxisType === YAxisType.StringAxis) {\n yScalePrimary = props.createStringYAxis(\n YAxisParams,\n props.stringDatasetForYAxisDomain!,\n _useRtl,\n axisData,\n props.barwidth,\n props.chartType,\n );\n } else {\n // TODO: Since the scale domain values are now computed independently for both the primary and\n // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately\n // rendering the secondary y-axis. Therefore, rather than checking the secondaryYScaleOptions\n // prop to determine whether to create a secondary y-axis, it's more appropriate to check if any\n // data points are assigned to use the secondary y-scale.\n if (props?.secondaryYScaleOptions) {\n const YAxisParamsSecondary = {\n margins: margins,\n containerWidth: containerWidth,\n containerHeight: containerHeight - _removalValueForTextTuncate!,\n yAxisElement: yAxisElementSecondary.current,\n yAxisTickFormat: props.yAxisTickFormat!,\n yAxisTickCount: props.yAxisTickCount!,\n yMinValue: props.secondaryYScaleOptions?.yMinValue || 0,\n yMaxValue: props.secondaryYScaleOptions?.yMaxValue ?? 100,\n tickPadding: 10,\n yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),\n yAxisPadding: props.yAxisPadding,\n };\n\n yScaleSecondary = props.createYAxis(\n YAxisParamsSecondary,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n true,\n props.roundedTicks!,\n props.secondaryYScaleType,\n _useRtl,\n );\n }\n yScalePrimary = props.createYAxis(\n YAxisParams,\n _useRtl,\n axisData,\n isIntegralDataset,\n chartType,\n false,\n props.roundedTicks!,\n props.yScaleType,\n _useRtl,\n );\n }\n _yAxisTickText.current = axisData.yAxisTickText;\n props.getAxisData && props.getAxisData(axisData);\n\n // Removing previously created tooltips.\n try {\n // eslint-disable-next-line @nx/workspace-no-restricted-globals\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n // Used to display tooltip at x axis labels.\n if (props.showXAxisLablesTooltip || props.xAxis?.tickLayout === 'auto') {\n const _xAxisElement = xAxisElement.current ? d3Select(xAxisElement.current).call(xScale) : null;\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _xAxisElement,\n container: chartContainer.current,\n };\n _xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n // Used to display tooltip at y axis labels.\n if (props.showYAxisLablesTooltip) {\n // To create y axis tick values by if specified truncating the rest of the text\n // and showing elipsis or showing the whole string,\n yScalePrimary &&\n createYAxisLabels(\n yAxisElement.current!,\n yScalePrimary,\n props.noOfCharsToTruncate || 4,\n props.showYAxisLablesTooltip || false,\n _useRtl,\n );\n\n const _yAxisElement = yAxisElement.current ? d3Select(yAxisElement.current).call(yScalePrimary) : null;\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _yAxisElement,\n container: chartContainer.current,\n };\n _yAxisElement && tooltipOfAxislabels(ytooltipProps);\n }\n\n // Call back to the chart.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _getData = (xScale: any, yScalePrimary: any, yScaleSecondary: any) => {\n props.getGraphData &&\n props.getGraphData(\n xScale,\n yScalePrimary,\n containerHeight - _removalValueForTextTuncate!,\n containerWidth,\n xAxisElement.current,\n yAxisElement.current,\n yScaleSecondary,\n );\n };\n\n // Callback function for chart, returns axis\n _getData(xScale, yScalePrimary, yScaleSecondary);\n\n children = props.children({\n xScale,\n yScalePrimary,\n yScaleSecondary,\n containerHeight,\n containerWidth,\n });\n\n if (!props.hideTooltip && calloutProps!.isPopoverOpen) {\n callout = _generateCallout(calloutProps);\n }\n }\n const svgDimensions = {\n width: containerWidth,\n height: containerHeight,\n };\n\n const plotWidth = Math.max(0, svgDimensions.width - margins.left! - margins.right!);\n const plotHeight = Math.max(0, svgDimensions.height - margins.top! - margins.bottom! - _removalValueForTextTuncate);\n\n const plotRect = {\n x: margins.left!,\n y: margins.top!,\n width: plotWidth,\n height: plotHeight,\n };\n\n const annotations = props.annotations ?? [];\n const hasAnnotations = annotations.length > 0;\n const annotationContext: ChartAnnotationContext | undefined = hasAnnotations\n ? {\n plotRect,\n svgRect: svgDimensions,\n isRtl: _useRtl,\n xScale: _xScale,\n yScalePrimary,\n yScaleSecondary,\n }\n : undefined;\n\n const xAxisTitleMaxWidth = svgDimensions.width - margins.left! - margins.right! - AXIS_TITLE_PADDING * 2;\n const yAxisTitleMaxHeight =\n svgDimensions.height - margins.bottom! - margins.top! - _removalValueForTextTuncate! - AXIS_TITLE_PADDING * 2;\n const yAxisTitleCenterY = margins.top! + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;\n const yAxisTitleCenterX = _useRtl\n ? svgDimensions.width - AXIS_TITLE_PADDING\n : HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;\n const secondaryYAxisTitleCenterX = _useRtl\n ? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING\n : svgDimensions.width - AXIS_TITLE_PADDING;\n\n const commonSvgToolTipProps: SVGTooltipTextProps = {\n wrapContent,\n showBackground: true,\n className: classes.svgTooltip,\n content: '',\n };\n /**\n * When screen resizes, along with screen, chart also auto adjusted.\n * This method used to adjust height and width of the charts.\n */\n function _fitParentContainer(): void {\n //_reqID = requestAnimationFrame(() => {\n let legendContainerHeight;\n if (props.hideLegend) {\n // If there is no legend, need not to allocate some space from total chart space.\n legendContainerHeight = 0;\n } else {\n const legendContainerComputedStyles = legendContainer && getComputedStyle(legendContainer);\n legendContainerHeight =\n ((legendContainer && legendContainer.getBoundingClientRect().height) || minLegendContainerHeight) +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginTop) || '0') +\n parseFloat((legendContainerComputedStyles && legendContainerComputedStyles.marginBottom) || '0');\n }\n if (props.parentRef || chartContainer.current) {\n const container = props.parentRef ? props.parentRef : chartContainer.current!;\n const currentContainerWidth =\n props.reflowProps?.mode === 'min-width' && !_isFirstRender.current\n ? Math.max(container.getBoundingClientRect().width, _calculateChartMinWidth())\n : container.getBoundingClientRect().width;\n const currentContainerHeight =\n container.getBoundingClientRect().height > legendContainerHeight\n ? container.getBoundingClientRect().height\n : 350;\n const shouldResize =\n containerWidth !== currentContainerWidth || containerHeight !== currentContainerHeight - legendContainerHeight;\n if (shouldResize) {\n setContainerWidth(currentContainerWidth);\n setContainerHeight(currentContainerHeight - legendContainerHeight);\n }\n }\n //});\n }\n\n function _onChartLeave(): void {\n props.onChartMouseLeave && props.onChartMouseLeave();\n }\n\n function _calculateChartMinWidth(): number {\n // Adding 10px for padding on both sides\n const labelWidth = _calcMaxLabelWidthWithTransform(_tickLabels) + 10;\n\n let minChartWidth = margins.left! + margins.right! + labelWidth * (_tickLabels.length - 1);\n\n if (\n [ChartTypes.GroupedVerticalBarChart, ChartTypes.VerticalBarChart, ChartTypes.VerticalStackedBarChart].includes(\n props.chartType,\n )\n ) {\n const minDomainMargin = 8;\n minChartWidth += minDomainMargin * 2;\n }\n\n return minChartWidth;\n }\n\n function _getChartDescription(): string {\n return (\n (props.chartTitle || 'Chart. ') +\n _getAxisTitle('X', props.xAxisTitle, props.xAxisType) +\n _getAxisTitle('Y', props.yAxisTitle, props.yAxisType || YAxisType.NumericAxis) +\n (props.secondaryYScaleOptions\n ? _getAxisTitle('secondary Y', props.secondaryYAxistitle, YAxisType.NumericAxis)\n : '')\n );\n }\n\n function _getAxisTitle(axisLabel: string, axisTitle: string | undefined, axisType: XAxisTypes | YAxisType): string {\n return (\n `The ${axisLabel} axis displays ` +\n (axisTitle ||\n (axisType === XAxisTypes.StringAxis || axisType === YAxisType.StringAxis\n ? 'categories'\n : axisType === XAxisTypes.DateAxis || axisType === YAxisType.DateAxis\n ? 'time'\n : 'values')) +\n '. '\n );\n }\n\n function _calcMaxLabelWidthWithTransform(x: (string | number)[]) {\n // Case: rotated labels\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));\n }\n\n // Case: truncated labels\n if (props.showXAxisLablesTooltip) {\n const tickLabels = x.map(val => {\n const numChars = props.noOfCharsToTruncate || 4;\n return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;\n });\n\n const longestLabelWidth = calculateLongestLabelWidth(tickLabels, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n // Case: wrapped labels\n if (props.wrapXAxisLables) {\n // FIXME: Calculate the max width of lines instead of words. This requires applying\n // the wrapping transformation earlier to obtain the actual rendered lines.\n const words: string[] = [];\n x.forEach((val: string) => {\n words.push(...val.toString().split(/\\s+/));\n });\n\n // This approach works well in most cases, since overflow typically occurs only when\n // a single word exceeds the specified width — otherwise, the text will wrap as expected.\n const longestLabelWidth = calculateLongestLabelWidth(words, `.${classes.xAxis} text`);\n return Math.max(Math.ceil(longestLabelWidth), DEFAULT_WRAP_WIDTH);\n }\n\n // Default case\n const longestLabelWidth = calculateLongestLabelWidth(x, `.${classes.xAxis} text`);\n return Math.ceil(longestLabelWidth);\n }\n\n function _transformXAxisLabels() {\n _removalValueForTextTuncate = 0;\n\n /*\n * To enable wrapping of x axis tick values or to display complete x axis tick values,\n * we need to calculate how much space it needed to render the text.\n * No need to re-calculate every time the chart renders and same time need to get an update. So using setState.\n * Required space will be calculated first time chart rendering and if any width/height of chart updated.\n * */\n if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {\n let maxXAxisLabelWidth: number | undefined;\n if (props.xAxisType === XAxisTypes.StringAxis) {\n if ((props.datasetForXAxisDomain?.length || 0) > 1) {\n maxXAxisLabelWidth = _xScale.step();\n } else {\n maxXAxisLabelWidth = containerWidth;\n }\n }\n\n const wrapLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,\n noOfCharsToTruncate: props.noOfCharsToTruncate || 4,\n width: maxXAxisLabelWidth,\n container: chartContainer.current,\n };\n _removalValueForTextTuncate = createWrapOfXLabels(wrapLabelProps) ?? 0;\n }\n\n if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType! === XAxisTypes.StringAxis) {\n const rotateLabelProps = {\n node: xAxisElement.current!,\n xAxis: _xScale,\n };\n const rotatedHeight = rotateXAxisLabels(rotateLabelProps) ?? 0;\n // margins.bottom is used as padding here\n _removalValueForTextTuncate = rotatedHeight + margins.bottom!;\n }\n }\n\n function _calcMargins(): IMargins {\n let _margins = _getDefaultMargins();\n\n _margins = _applyTitleMargins(_margins);\n _margins = _applyAnnotationMargins(_margins);\n\n if (_useRtl) {\n _margins = _swapRtlMargins(_margins);\n }\n\n return {\n ..._margins,\n ...props.margins,\n };\n }\n\n function _getDefaultMargins(): IMargins {\n return {\n top: DEFAULT_MARGIN_NO_TICKS,\n // Smaller than the default because it is based on the line height rather than\n // the length of the tick labels.\n bottom: DEFAULT_MARGIN_WITH_TICKS - 5,\n // For the actual margin, add the tick size, tick padding, and some extra space to\n // the width of the longest yaxis tick label (startFromX).\n left: Math.max(DEFAULT_MARGIN_WITH_TICKS, startFromX + 20),\n right: props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,\n };\n }\n\n function _applyTitleMargins(_margins: IMargins): IMargins {\n const updated = { ..._margins };\n if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {\n updated.bottom! += VERTICAL_MARGIN_FOR_XAXIS_TITLE;\n }\n if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {\n updated.left! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n if (props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '') {\n updated.right! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n return updated;\n }\n\n function _applyAnnotationMargins(_margins: IMargins): IMargins {\n const updated = { ..._margins };\n if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {\n updated.top! += VERTICAL_MARGIN_FOR_XAXIS_TITLE;\n }\n if (\n props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')\n ) {\n updated.right! += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;\n }\n return updated;\n }\n\n function _swapRtlMargins(_margins: IMargins): IMargins {\n return {\n ..._margins,\n left: _margins.right,\n right: _margins.left,\n };\n }\n\n /**\n * We have use the {@link defaultTabbableElement } to fix\n * the Focus not landing on chart while tabbing, instead goes to legend.\n * This issue is observed in Area, line chart after performance optimization done in the PR {@link https://github.com/microsoft/fluentui/pull/27721 }\n * This issue is observed in Bar charts after the changes done by FocusZone team in the PR: {@link https://github.com/microsoft/fluentui/pull/24175 }\n * The issue in Bar Charts(VB and VSB) is due to a {@link FocusZone } update where previously an event listener was\n * attached on keydown to the window, so that whenever the tab key is pressed all outer FocusZone's\n * tab-indexes are updated (an outer FocusZone is a FocusZone that is not within another one).\n * But now after the above PR : they are attaching the\n * listeners to the FocusZone elements instead of the window. So in the first render cycle in Bar charts\n * bars are not created as in the first render cycle the size of the chart container is not known( or is 0)\n * which creates bars of height 0 so instead we do not create any bars and instead return empty fragments.\n *\n * We have tried 2 Approaches to fix the issue:\n * 1. Using the {@link elementRef} property of FocusZone where we dispatch event for tab keydown\n * after the second render cycle which triggers an update of the tab index in FocusZone.\n * But this is a hacky solution and not a proper fix and also elementRef is deprecated.\n * 2. Using the default tabbable element to fix the issue.\n */\n\n return (\n <div\n id={idForGraph}\n className={classes.root}\n role={'presentation'}\n ref={(rootElem: HTMLDivElement) => {\n chartContainer.current = rootElem;\n }}\n onMouseLeave={_onChartLeave}\n >\n <div className={classes.chartWrapper} {...focusAttributes} {...arrowAttributes}>\n {_isFirstRender.current}\n <svg\n width={svgDimensions.width}\n height={svgDimensions.height}\n role=\"region\"\n aria-label={_getChartDescription()}\n style={{ display: 'block' }}\n className={classes.chart}\n {...getSecureProps(svgProps)}\n >\n <g\n ref={(e: SVGSVGElement | null) => {\n xAxisElement.current = e!;\n }}\n id={`xAxisGElement${idForGraph}`}\n // To add wrap of x axis lables feature, need to remove word height from svg height.\n transform={`translate(0, ${svgDimensions.height - margins.bottom! - _removalValueForTextTuncate!})`}\n className={classes.xAxis}\n />\n {props.xAxisTitle !== undefined && props.xAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisTitle}\n textProps={{\n x: margins.left! + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,\n y: svgDimensions.height - AXIS_TITLE_PADDING,\n className: classes.axisTitle!,\n textAnchor: 'middle',\n }}\n maxWidth={xAxisTitleMaxWidth}\n />\n )}\n {props.xAxisAnnotation !== undefined &&\n props.xAxisAnnotation !== '' &&\n (() => {\n const { titleFont, titleXAnchor, titleYAnchor, titlePad } = props.titleStyles ?? {};\n const fontSize = typeof titleFont?.size === 'number' ? titleFont.size : 13;\n const padL = titlePad?.l ?? 0;\n const padR = titlePad?.r ?? 0;\n const padT = titlePad?.t ?? 0;\n const padB = titlePad?.b ?? 0;\n\n const xPos =\n (titleXAnchor === 'left'\n ? margins.left! + AXIS_TITLE_PADDING\n : titleXAnchor === 'right'\n ? margins.left! + AXIS_TITLE_PADDING + xAxisTitleMaxWidth\n : margins.left! + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2) +\n padL -\n padR;\n\n const yPos =\n Math.max(fontSize + AXIS_TITLE_PADDING, VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING) +\n padT -\n padB;\n\n const textAnchor = titleXAnchor === 'left' ? 'start' : titleXAnchor === 'right' ? 'end' : 'middle';\n\n const dominantBaseline =\n titleYAnchor === 'top'\n ? 'hanging'\n : titleYAnchor === 'bottom'\n ? 'alphabetic'\n : titleYAnchor === 'middle'\n ? 'central'\n : 'auto';\n\n return (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.xAxisAnnotation}\n textProps={{\n x: xPos,\n y: yPos,\n className: classes.axisAnnotation!,\n textAnchor,\n dominantBaseline,\n 'aria-hidden': true,\n style: getChartTitleInlineStyles(titleFont),\n }}\n maxWidth={xAxisTitleMaxWidth}\n />\n );\n })()}\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElement.current = e!;\n }}\n id={`yAxisGElement${idForGraph}`}\n transform={`translate(${_useRtl ? svgDimensions.width - margins.right! : margins.left!}, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYScaleOptions && (\n <g>\n <g\n ref={(e: SVGSVGElement | null) => {\n yAxisElementSecondary.current = e!;\n }}\n id={`yAxisGElementSecondary${idForGraph}`}\n transform={`translate(${_useRtl ? margins.left! : svgDimensions.width - margins.right!}, 0)`}\n className={classes.yAxis}\n />\n {props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.secondaryYAxistitle}\n textProps={{\n x: secondaryYAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n </g>\n )}\n {children}\n {props.yAxisTitle !== undefined && props.yAxisTitle !== '' && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisTitle}\n textProps={{\n x: yAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${yAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisTitle!,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n {props.yAxisAnnotation !== undefined &&\n props.yAxisAnnotation !== '' &&\n (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && (\n <SVGTooltipText\n {...commonSvgToolTipProps}\n content={props.yAxisAnnotation}\n textProps={{\n x: secondaryYAxisTitleCenterX,\n y: yAxisTitleCenterY,\n textAnchor: 'middle',\n transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,\n className: classes.axisAnnotation!,\n 'aria-hidden': true,\n }}\n maxWidth={yAxisTitleMaxHeight}\n />\n )}\n </svg>\n {hasAnnotations && annotationContext && (\n <ChartAnnotationLayer\n annotations={annotations}\n context={annotationContext}\n className={classes.annotationLayer}\n />\n )}\n </div>\n\n {!props.hideLegend && (\n <div\n ref={(e: HTMLDivElement) => {\n legendContainer = e;\n }}\n className={classes.legendContainer}\n >\n {props.legendBars}\n </div>\n )}\n {/** The callout is used for narration, so keep it mounted on the DOM */}\n {callout && <React.Suspense fallback={<div>Loading...</div>}>{callout}</React.Suspense>}\n </div>\n );\n});\nCartesianChart.displayName = 'CartesianChart';\n"],"names":["React","useCartesianChartStyles","select","d3Select","createNumericXAxis","createStringXAxis","createDateXAxis","XAxisTypes","YAxisType","createWrapOfXLabels","rotateXAxisLabels","calculateLongestLabelWidth","createYAxisLabels","ChartTypes","wrapContent","useRtl","truncateString","tooltipOfAxislabels","getSecureProps","DEFAULT_WRAP_WIDTH","autoLayoutXAxisLabels","getChartTitleInlineStyles","useId","SVGTooltipText","ChartAnnotationLayer","ChartPopover","useFocusableGroup","useArrowNavigationGroup","HORIZONTAL_MARGIN_FOR_YAXIS_TITLE","VERTICAL_MARGIN_FOR_XAXIS_TITLE","AXIS_TITLE_PADDING","DEFAULT_MARGIN_WITH_TICKS","DEFAULT_MARGIN_NO_TICKS","CartesianChart","forwardRef","hideTickOverlap","props","forwardedRef","chartContainer","useRef","legendContainer","minLegendContainerHeight","xAxisElement","yAxisElement","yAxisElementSecondary","margins","idForGraph","_reqID","_useRtl","_tickLabels","_isFirstRender","_xScale","isIntegralDataset","useMemo","points","some","point","y","_tooltipId","_removalValueForTextTuncate","_yAxisTickText","containerWidth","setContainerWidth","useState","containerHeight","setContainerHeight","startFromX","setStartFromX","prevWidthRef","undefined","prevHeightRef","classes","focusAttributes","arrowAttributes","circular","axis","useEffect","_fitParentContainer","showYAxisLables","maxYAxisLabelLength","calculateMaxYAxisLabelLength","yAxis","cancelAnimationFrame","current","width","height","chartType","yAxisType","useImperativeHandle","componentRef","_generateCallout","calloutProps","className","formatTickLabel","str","showYAxisLablesTooltip","noOfCharsToTruncate","map","label","svgProps","culture","dateLocalizeOptions","timeFormatLocale","customDateTimeFormatter","parentRef","_calcMargins","getmargins","callout","yScalePrimary","yScaleSecondary","children","enableFirstRenderOptimization","XAxisParams","domainNRangeValues","getDomainNRangeValues","getDomainMargins","xAxisType","barwidth","tickValues","showRoundOffXTickValues","xAxisCount","xAxisTickCount","xAxistickSize","tickPadding","showXAxisLablesTooltip","xAxisPadding","xAxisInnerPadding","xAxisOuterPadding","rotateXAxisLables","xAxis","tickLayout","calcMaxLabelWidth","_calcMaxLabelWidthWithTransform","xMinValue","xMaxValue","xScale","tickLabels","NumericAxis","tickParams","xScaleType","DateAxis","useUTC","StringAxis","datasetForXAxisDomain","_transformXAxisLabels","YAxisParams","getYDomainMargins","yAxisTickFormat","yAxisTickCount","yMinValue","yMaxValue","maxOfYVal","yMinMaxValues","getMinMaxOfYAxis","yAxisPadding","yAxisTickValues","axisData","yAxisDomainValues","yAxisTickText","createStringYAxis","stringDatasetForYAxisDomain","secondaryYScaleOptions","YAxisParamsSecondary","createYAxis","roundedTicks","secondaryYScaleType","yScaleType","getAxisData","document","getElementById","remove","e","_xAxisElement","call","tooltipProps","tooltipCls","tooltip","id","container","_yAxisElement","ytooltipProps","_getData","getGraphData","hideTooltip","isPopoverOpen","svgDimensions","plotWidth","Math","max","left","right","plotHeight","top","bottom","plotRect","x","annotations","hasAnnotations","length","annotationContext","svgRect","isRtl","xAxisTitleMaxWidth","yAxisTitleMaxHeight","yAxisTitleCenterY","yAxisTitleCenterX","secondaryYAxisTitleCenterX","commonSvgToolTipProps","showBackground","svgTooltip","content","legendContainerHeight","hideLegend","legendContainerComputedStyles","getComputedStyle","getBoundingClientRect","parseFloat","marginTop","marginBottom","currentContainerWidth","reflowProps","mode","_calculateChartMinWidth","currentContainerHeight","shouldResize","_onChartLeave","onChartMouseLeave","labelWidth","minChartWidth","GroupedVerticalBarChart","VerticalBarChart","VerticalStackedBarChart","includes","minDomainMargin","_getChartDescription","chartTitle","_getAxisTitle","xAxisTitle","yAxisTitle","secondaryYAxistitle","axisLabel","axisTitle","axisType","wrapXAxisLables","longestLabelWidth","ceil","cos","PI","val","numChars","toString","slice","words","forEach","push","split","maxXAxisLabelWidth","step","wrapLabelProps","node","rotateLabelProps","rotatedHeight","_margins","_getDefaultMargins","_applyTitleMargins","_applyAnnotationMargins","_swapRtlMargins","updated","xAxisAnnotation","yAxisAnnotation","div","root","role","ref","rootElem","onMouseLeave","chartWrapper","svg","aria-label","style","display","chart","g","transform","textProps","textAnchor","maxWidth","titleFont","titleXAnchor","titleYAnchor","titlePad","titleStyles","fontSize","size","padL","l","padR","r","padT","t","padB","b","xPos","yPos","dominantBaseline","axisAnnotation","context","annotationLayer","legendBars","Suspense","fallback","displayName"],"mappings":"AAAA;;;;;+BA+CaiC;;;;;;;iEA7CU,QAAQ;+CAGS,mCAAmC;6BACxC,eAAe;uBAsB3C,wBAAwB;gCACT,4BAA4B;gCAEE,iCAAiC;sCAChD,qCAAqC;8BAE7C,iBAAiB;8BACa,0BAA0B;AAErF,MAAML,oCAAoC;AAC1C,MAAMC,kCAAkC;AACxC,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAClC,MAAMC,0BAA0B;AAMzB,uBAAMC,WAAAA,GAAuEjC,OAAMkC,UAAU,CAGlG,CAAC,EAAEC,kBAAkB,IAAI,EAAE,GAAGC,OAAO,EAAEC;IACvC,MAAMC,iBAAiBtC,OAAMuC,MAAM,CAAwB;IAC3D,IAAIC;IACJ,MAAMC,2BAAmC;IACzC,MAAMC,eAAe1C,OAAMuC,MAAM,CAAuB;IACxD,MAAMI,eAAe3C,OAAMuC,MAAM,CAAuB;IACxD,MAAMK,wBAAwB5C,OAAMuC,MAAM,CAAuB;IACjE,IAAIM;IACJ,MAAMC,aAAqB;IAC3B,IAAIC;IACJ,MAAMC,cAAmBjC,aAAAA;IACzB,IAAIkC;IACJ,MAAMC,iBAAiBlD,OAAMuC,MAAM,CAAU;IAC7C,8DAA8D;IAC9D,IAAIY;IACJ,MAAMC,oBAAoBpD,OAAMqD,OAAO,CAAC;QACtC,OAAO,CAACjB,MAAMkB,MAAM,CAACC,IAAI,CAAC,CAACC,QAAyBA,MAAMC,CAAC,GAAG,MAAM;IACtE,GAAG;QAACrB,MAAMkB,MAAM;KAAC;IACjB,IAAII,iBAAqBpC,qBAAAA,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WAAWrB,QAAQ/B,eAAe;OAEjCJ,MAAMgR,UAAU,GAIpBzM,WAAAA,WAAAA,GAAW,OAAA,aAAA,CAAC3G,OAAMqT,QAAQ,EAAA;QAACC,UAAAA,WAAAA,GAAU,OAAA,aAAA,CAACxC,OAAAA,MAAI;OAAmBnK;AAGpE,GAAG;AACH1E,eAAesR,WAAW,GAAG"}
|
|
@@ -1180,7 +1180,9 @@ const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayT
|
|
|
1180
1180
|
].includes(firstData.textinfo) : true,
|
|
1181
1181
|
roundCorners: true,
|
|
1182
1182
|
order: 'sorted',
|
|
1183
|
-
...titleStyles
|
|
1183
|
+
...titleStyles ? {
|
|
1184
|
+
titleStyles
|
|
1185
|
+
} : {}
|
|
1184
1186
|
};
|
|
1185
1187
|
};
|
|
1186
1188
|
const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
|
|
@@ -2235,7 +2237,9 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
|
|
|
2235
2237
|
// TODO
|
|
2236
2238
|
// styles,
|
|
2237
2239
|
hideLegend: isMultiPlot || ((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : _input_layout4.showlegend) === false,
|
|
2238
|
-
...titleStyles
|
|
2240
|
+
...titleStyles ? {
|
|
2241
|
+
titleStyles
|
|
2242
|
+
} : {}
|
|
2239
2243
|
};
|
|
2240
2244
|
};
|
|
2241
2245
|
const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -2308,7 +2312,9 @@ const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayT
|
|
|
2308
2312
|
variant: ((_firstData_gauge9 = firstData.gauge) === null || _firstData_gauge9 === void 0 ? void 0 : (_firstData_gauge_steps1 = _firstData_gauge9.steps) === null || _firstData_gauge_steps1 === void 0 ? void 0 : _firstData_gauge_steps1.length) ? 'multiple-segments' : 'single-segment',
|
|
2309
2313
|
styles,
|
|
2310
2314
|
roundCorners: true,
|
|
2311
|
-
...titleStyles
|
|
2315
|
+
...titleStyles ? {
|
|
2316
|
+
titleStyles
|
|
2317
|
+
} : {}
|
|
2312
2318
|
};
|
|
2313
2319
|
};
|
|
2314
2320
|
const cleanText = (text)=>{
|
|
@@ -2460,7 +2466,9 @@ const transformPlotlyJsonToChartTableProps = (input, isMultiPlot, colorMap, colo
|
|
|
2460
2466
|
height: (_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : _input_layout4.height,
|
|
2461
2467
|
styles,
|
|
2462
2468
|
chartTitle,
|
|
2463
|
-
...titleStyles
|
|
2469
|
+
...titleStyles ? {
|
|
2470
|
+
titleStyles
|
|
2471
|
+
} : {}
|
|
2464
2472
|
};
|
|
2465
2473
|
};
|
|
2466
2474
|
function getCategoriesAndValues(series) {
|
|
@@ -2612,7 +2620,9 @@ const transformPlotlyJsonToFunnelChartProps = (input, isMultiPlot, colorMap, col
|
|
|
2612
2620
|
height: (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height,
|
|
2613
2621
|
orientation: ((_input_data_ = input.data[0]) === null || _input_data_ === void 0 ? void 0 : _input_data_.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
2614
2622
|
hideLegend: isMultiPlot || ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.showlegend) === false,
|
|
2615
|
-
...titleStyles
|
|
2623
|
+
...titleStyles ? {
|
|
2624
|
+
titleStyles
|
|
2625
|
+
} : {}
|
|
2616
2626
|
};
|
|
2617
2627
|
};
|
|
2618
2628
|
const transformPlotlyJsonToPolarChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|