@fluentui/react-charts 9.3.6 → 9.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -2
- package/dist/index.d.ts +70 -17
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +3 -43
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +8 -11
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +52 -32
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +1 -2
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +9 -7
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +8 -5
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +48 -25
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -209
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +9 -15
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +4 -2
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +8 -13
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +4 -17
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +8 -13
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +24 -36
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +3 -16
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -25
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/Legends/Legends.js +3 -4
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +68 -75
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +4 -10
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +41 -49
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.js +11 -7
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +15 -92
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -49
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/types/ChartAnnotation.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/Common.styles.js +0 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +0 -1
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/getWindow.js +0 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js +34 -0
- package/lib/utilities/hooks.js.map +1 -0
- package/lib/utilities/image-export-utils.js +118 -78
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +243 -102
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +2 -41
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -2
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +9 -11
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +51 -31
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +7 -6
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +7 -4
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +48 -25
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -208
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +7 -13
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +7 -12
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +3 -16
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +7 -12
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +22 -34
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -15
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -23
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js +3 -4
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +67 -74
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -2
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +4 -10
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -2
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +38 -46
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -2
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +14 -91
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +26 -47
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +0 -1
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +0 -1
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js +0 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/hooks.js +45 -0
- package/lib-commonjs/utilities/hooks.js.map +1 -0
- package/lib-commonjs/utilities/image-export-utils.js +119 -79
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +253 -101
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +9 -9
- package/lib/components/DeclarativeChart/imageExporter.js +0 -223
- package/lib/components/DeclarativeChart/imageExporter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +0 -233
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +0 -1
|
@@ -8,7 +8,7 @@ export const DEFAULT_CONNECTOR_START_PADDING = 12;
|
|
|
8
8
|
export const DEFAULT_CONNECTOR_END_PADDING = 0;
|
|
9
9
|
export const DEFAULT_CONNECTOR_STROKE_WIDTH = 2;
|
|
10
10
|
export const DEFAULT_CONNECTOR_ARROW = 'end';
|
|
11
|
-
export const applyOpacityToColor = (color, opacity)=>{
|
|
11
|
+
export const applyOpacityToColor = (color, opacity, options)=>{
|
|
12
12
|
if (!color) {
|
|
13
13
|
return undefined;
|
|
14
14
|
}
|
|
@@ -16,6 +16,12 @@ export const applyOpacityToColor = (color, opacity)=>{
|
|
|
16
16
|
if (!parsed) {
|
|
17
17
|
return color;
|
|
18
18
|
}
|
|
19
|
+
const originalOpacity = typeof parsed.opacity === 'number' ? parsed.opacity : 1;
|
|
20
|
+
var _options_preserveOriginalOpacity;
|
|
21
|
+
const preserveOriginalOpacity = (_options_preserveOriginalOpacity = options === null || options === void 0 ? void 0 : options.preserveOriginalOpacity) !== null && _options_preserveOriginalOpacity !== void 0 ? _options_preserveOriginalOpacity : true;
|
|
22
|
+
if (preserveOriginalOpacity && originalOpacity < 1) {
|
|
23
|
+
return parsed.toString();
|
|
24
|
+
}
|
|
19
25
|
parsed.opacity = Math.max(0, Math.min(1, opacity));
|
|
20
26
|
return parsed.toString();
|
|
21
27
|
};
|
package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { color as d3Color } from 'd3-color';\nimport { ChartAnnotationArrowHead } from '../../../types/ChartAnnotation';\n\nexport interface ChartAnnotationLayerStyles {\n root?: string;\n annotation?: string;\n connectorLayer?: string;\n measurement?: string;\n annotationContent?: string;\n annotationForeignObject?: string;\n annotationContentInteractive?: string;\n annotationForeignObjectInteractive?: string;\n connectorGroup?: string;\n}\n\nexport interface ChartAnnotationLayerStyleProps {\n className?: string;\n styles?: Partial<ChartAnnotationLayerStyles>;\n}\n\nexport const DEFAULT_ANNOTATION_BACKGROUND_OPACITY = 0.8;\nexport const DEFAULT_ANNOTATION_PADDING = '4px 8px';\nexport const DEFAULT_CONNECTOR_START_PADDING = 12;\nexport const DEFAULT_CONNECTOR_END_PADDING = 0;\nexport const DEFAULT_CONNECTOR_STROKE_WIDTH = 2;\nexport const DEFAULT_CONNECTOR_ARROW: ChartAnnotationArrowHead = 'end';\n\nexport const applyOpacityToColor = (color: string | undefined, opacity: number): string | undefined => {\n if (!color) {\n return undefined;\n }\n\n const parsed = d3Color(color);\n if (!parsed) {\n return color;\n }\n\n parsed.opacity = Math.max(0, Math.min(1, opacity));\n return parsed.toString();\n};\n\n/**\n * Get default annotation background color with opacity applied\n * Updated for v9 - uses tokens instead of theme\n */\nexport const getDefaultAnnotationBackgroundColor = (): string | undefined =>\n applyOpacityToColor(tokens.colorNeutralBackground1, DEFAULT_ANNOTATION_BACKGROUND_OPACITY);\n\n/**\n * Get default connector stroke color\n * Updated for v9 - uses tokens instead of theme\n */\nexport const getDefaultConnectorStrokeColor = (): string => tokens.colorNeutralForeground1;\n\n/**\n * @internal\n */\nexport const chartAnnotationLayerClassNames: SlotClassNames<ChartAnnotationLayerStyles> = {\n root: 'fui-chartAnnotationLayer__root',\n annotation: 'fui-chartAnnotationLayer__annotation',\n connectorLayer: 'fui-chartAnnotationLayer__connectorLayer',\n measurement: 'fui-chartAnnotationLayer__measurement',\n annotationContent: 'fui-chartAnnotationLayer__annotationContent',\n annotationForeignObject: 'fui-chartAnnotationLayer__annotationForeignObject',\n annotationContentInteractive: 'fui-chartAnnotationLayer__annotationContentInteractive',\n annotationForeignObjectInteractive: 'fui-chartAnnotationLayer__annotationForeignObjectInteractive',\n connectorGroup: 'fui-chartAnnotationLayer__connectorGroup',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n zIndex: 1,\n },\n annotation: {\n ...typographyStyles.caption1,\n position: 'absolute',\n pointerEvents: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n color: tokens.colorNeutralForeground1,\n paddingTop: '4px',\n paddingBottom: '4px',\n paddingLeft: '8px',\n paddingRight: '8px',\n borderRadius: tokens.borderRadiusMedium,\n boxShadow: tokens.shadow16,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n whiteSpace: 'pre-wrap',\n zIndex: 2,\n },\n connectorLayer: {\n position: 'absolute',\n top: '0',\n left: '0',\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n },\n measurement: {\n position: 'absolute',\n visibility: 'hidden',\n pointerEvents: 'none',\n },\n annotationContent: {\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n },\n annotationForeignObject: {\n overflow: 'visible',\n pointerEvents: 'none',\n },\n annotationContentInteractive: {\n pointerEvents: 'auto',\n },\n annotationForeignObjectInteractive: {\n pointerEvents: 'auto',\n },\n connectorGroup: {\n pointerEvents: 'none',\n },\n});\n\n/**\n * Apply styling to the ChartAnnotationLayer slots based on the state\n */\nexport const useChartAnnotationLayerStyles = (props: ChartAnnotationLayerStyleProps): ChartAnnotationLayerStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(chartAnnotationLayerClassNames.root, baseStyles.root, props.className, props.styles?.root),\n annotation: mergeClasses(\n chartAnnotationLayerClassNames.annotation,\n baseStyles.annotation,\n props.styles?.annotation,\n ),\n connectorLayer: mergeClasses(\n chartAnnotationLayerClassNames.connectorLayer,\n baseStyles.connectorLayer,\n props.styles?.connectorLayer,\n ),\n measurement: mergeClasses(\n chartAnnotationLayerClassNames.measurement,\n baseStyles.measurement,\n props.styles?.measurement,\n ),\n annotationContent: mergeClasses(\n chartAnnotationLayerClassNames.annotationContent,\n baseStyles.annotationContent,\n props.styles?.annotationContent,\n ),\n annotationForeignObject: mergeClasses(\n chartAnnotationLayerClassNames.annotationForeignObject,\n baseStyles.annotationForeignObject,\n props.styles?.annotationForeignObject,\n ),\n annotationContentInteractive: mergeClasses(\n chartAnnotationLayerClassNames.annotationContentInteractive,\n baseStyles.annotationContentInteractive,\n props.styles?.annotationContentInteractive,\n ),\n annotationForeignObjectInteractive: mergeClasses(\n chartAnnotationLayerClassNames.annotationForeignObjectInteractive,\n baseStyles.annotationForeignObjectInteractive,\n props.styles?.annotationForeignObjectInteractive,\n ),\n connectorGroup: mergeClasses(\n chartAnnotationLayerClassNames.connectorGroup,\n baseStyles.connectorGroup,\n props.styles?.connectorGroup,\n ),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","color","d3Color","DEFAULT_ANNOTATION_BACKGROUND_OPACITY","DEFAULT_ANNOTATION_PADDING","DEFAULT_CONNECTOR_START_PADDING","DEFAULT_CONNECTOR_END_PADDING","DEFAULT_CONNECTOR_STROKE_WIDTH","DEFAULT_CONNECTOR_ARROW","applyOpacityToColor","opacity","undefined","parsed","Math","max","min","toString","getDefaultAnnotationBackgroundColor","colorNeutralBackground1","getDefaultConnectorStrokeColor","colorNeutralForeground1","chartAnnotationLayerClassNames","root","annotation","connectorLayer","measurement","annotationContent","annotationForeignObject","annotationContentInteractive","annotationForeignObjectInteractive","connectorGroup","useStyles","position","top","left","right","bottom","width","height","pointerEvents","overflow","zIndex","caption1","display","alignItems","justifyContent","textAlign","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderRadiusMedium","boxShadow","shadow16","border","colorNeutralStroke1","whiteSpace","visibility","useChartAnnotationLayerStyles","props","baseStyles","className","styles"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAASC,SAASC,OAAO,QAAQ,WAAW;AAoB5C,OAAO,MAAMC,wCAAwC,IAAI;AACzD,OAAO,MAAMC,6BAA6B,UAAU;AACpD,OAAO,MAAMC,kCAAkC,GAAG;AAClD,OAAO,MAAMC,gCAAgC,EAAE;AAC/C,OAAO,MAAMC,iCAAiC,EAAE;AAChD,OAAO,MAAMC,0BAAoD,MAAM;AAEvE,OAAO,MAAMC,sBAAsB,CAACR,OAA2BS;IAC7D,IAAI,CAACT,OAAO;QACV,OAAOU;IACT;IAEA,MAAMC,SAASV,QAAQD;IACvB,IAAI,CAACW,QAAQ;QACX,OAAOX;IACT;IAEAW,OAAOF,OAAO,GAAGG,KAAKC,GAAG,CAAC,GAAGD,KAAKE,GAAG,CAAC,GAAGL;IACzC,OAAOE,OAAOI,QAAQ;AACxB,EAAE;AAEF;;;CAGC,GACD,OAAO,MAAMC,sCAAsC,IACjDR,oBAAoBV,OAAOmB,uBAAuB,EAAEf,uCAAuC;AAE7F;;;CAGC,GACD,OAAO,MAAMgB,iCAAiC,IAAcpB,OAAOqB,uBAAuB,CAAC;AAE3F;;CAEC,GACD,OAAO,MAAMC,iCAA6E;IACxFC,MAAM;IACNC,YAAY;IACZC,gBAAgB;IAChBC,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I,EAAEsC,MAAME,SAAS,GAAEF,gBAAAA,MAAMG,MAAM,cAAZH,oCAAAA,cAActC,IAAI;QAC5GC,YAAYzB,aACVuB,+BAA+BE,UAAU,EACzCsC,WAAWtC,UAAU,GACrBqC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcrC,UAAU;QAE1BC,gBAAgB1B,aACduB,+BAA+BG,cAAc,EAC7CqC,WAAWrC,cAAc,GACzBoC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcpC,cAAc;QAE9BC,aAAa3B,aACXuB,+BAA+BI,WAAW,EAC1CoC,WAAWpC,WAAW,GACtBmC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcnC,WAAW;QAE3BC,mBAAmB5B,aACjBuB,+BAA+BK,iBAAiB,EAChDmC,WAAWnC,iBAAiB,GAC5BkC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAclC,iBAAiB;QAEjCC,yBAAyB7B,aACvBuB,+BAA+BM,uBAAuB,EACtDkC,WAAWlC,uBAAuB,GAClCiC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAcjC,uBAAuB;QAEvCC,8BAA8B9B,aAC5BuB,+BAA+BO,4BAA4B,EAC3DiC,WAAWjC,4BAA4B,GACvCgC,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAchC,4BAA4B;QAE5CC,oCAAoC/B,aAClCuB,+BAA+BQ,kCAAkC,EACjEgC,WAAWhC,kCAAkC,GAC7C+B,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAc/B,kCAAkC;QAElDC,gBAAgBhC,aACduB,+BAA+BS,cAAc,EAC7C+B,WAAW/B,cAAc,GACzB8B,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAc9B,cAAc;IAEhC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { color as d3Color } from 'd3-color';\nimport { ChartAnnotationArrowHead } from '../../../types/ChartAnnotation';\n\nexport interface ChartAnnotationLayerStyles {\n root?: string;\n annotation?: string;\n connectorLayer?: string;\n measurement?: string;\n annotationContent?: string;\n annotationForeignObject?: string;\n annotationContentInteractive?: string;\n annotationForeignObjectInteractive?: string;\n connectorGroup?: string;\n}\n\nexport interface ChartAnnotationLayerStyleProps {\n className?: string;\n styles?: Partial<ChartAnnotationLayerStyles>;\n}\n\nexport const DEFAULT_ANNOTATION_BACKGROUND_OPACITY = 0.8;\nexport const DEFAULT_ANNOTATION_PADDING = '4px 8px';\nexport const DEFAULT_CONNECTOR_START_PADDING = 12;\nexport const DEFAULT_CONNECTOR_END_PADDING = 0;\nexport const DEFAULT_CONNECTOR_STROKE_WIDTH = 2;\nexport const DEFAULT_CONNECTOR_ARROW: ChartAnnotationArrowHead = 'end';\n\nexport const applyOpacityToColor = (\n color: string | undefined,\n opacity: number,\n options?: {\n preserveOriginalOpacity?: boolean;\n },\n): string | undefined => {\n if (!color) {\n return undefined;\n }\n\n const parsed = d3Color(color);\n if (!parsed) {\n return color;\n }\n\n const originalOpacity = typeof parsed.opacity === 'number' ? parsed.opacity : 1;\n const preserveOriginalOpacity = options?.preserveOriginalOpacity ?? true;\n\n if (preserveOriginalOpacity && originalOpacity < 1) {\n return parsed.toString();\n }\n\n parsed.opacity = Math.max(0, Math.min(1, opacity));\n return parsed.toString();\n};\n\n/**\n * Get default annotation background color with opacity applied\n * Updated for v9 - uses tokens instead of theme\n */\nexport const getDefaultAnnotationBackgroundColor = (): string | undefined =>\n applyOpacityToColor(tokens.colorNeutralBackground1, DEFAULT_ANNOTATION_BACKGROUND_OPACITY);\n\n/**\n * Get default connector stroke color\n * Updated for v9 - uses tokens instead of theme\n */\nexport const getDefaultConnectorStrokeColor = (): string => tokens.colorNeutralForeground1;\n\n/**\n * @internal\n */\nexport const chartAnnotationLayerClassNames: SlotClassNames<ChartAnnotationLayerStyles> = {\n root: 'fui-chartAnnotationLayer__root',\n annotation: 'fui-chartAnnotationLayer__annotation',\n connectorLayer: 'fui-chartAnnotationLayer__connectorLayer',\n measurement: 'fui-chartAnnotationLayer__measurement',\n annotationContent: 'fui-chartAnnotationLayer__annotationContent',\n annotationForeignObject: 'fui-chartAnnotationLayer__annotationForeignObject',\n annotationContentInteractive: 'fui-chartAnnotationLayer__annotationContentInteractive',\n annotationForeignObjectInteractive: 'fui-chartAnnotationLayer__annotationForeignObjectInteractive',\n connectorGroup: 'fui-chartAnnotationLayer__connectorGroup',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n zIndex: 1,\n },\n annotation: {\n ...typographyStyles.caption1,\n position: 'absolute',\n pointerEvents: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n color: tokens.colorNeutralForeground1,\n paddingTop: '4px',\n paddingBottom: '4px',\n paddingLeft: '8px',\n paddingRight: '8px',\n borderRadius: tokens.borderRadiusMedium,\n boxShadow: tokens.shadow16,\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n whiteSpace: 'pre-wrap',\n zIndex: 2,\n },\n connectorLayer: {\n position: 'absolute',\n top: '0',\n left: '0',\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n },\n measurement: {\n position: 'absolute',\n visibility: 'hidden',\n pointerEvents: 'none',\n },\n annotationContent: {\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n },\n annotationForeignObject: {\n overflow: 'visible',\n pointerEvents: 'none',\n },\n annotationContentInteractive: {\n pointerEvents: 'auto',\n },\n annotationForeignObjectInteractive: {\n pointerEvents: 'auto',\n },\n connectorGroup: {\n pointerEvents: 'none',\n },\n});\n\n/**\n * Apply styling to the ChartAnnotationLayer slots based on the state\n */\nexport const useChartAnnotationLayerStyles = (props: ChartAnnotationLayerStyleProps): ChartAnnotationLayerStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(chartAnnotationLayerClassNames.root, baseStyles.root, props.className, props.styles?.root),\n annotation: mergeClasses(\n chartAnnotationLayerClassNames.annotation,\n baseStyles.annotation,\n props.styles?.annotation,\n ),\n connectorLayer: mergeClasses(\n chartAnnotationLayerClassNames.connectorLayer,\n baseStyles.connectorLayer,\n props.styles?.connectorLayer,\n ),\n measurement: mergeClasses(\n chartAnnotationLayerClassNames.measurement,\n baseStyles.measurement,\n props.styles?.measurement,\n ),\n annotationContent: mergeClasses(\n chartAnnotationLayerClassNames.annotationContent,\n baseStyles.annotationContent,\n props.styles?.annotationContent,\n ),\n annotationForeignObject: mergeClasses(\n chartAnnotationLayerClassNames.annotationForeignObject,\n baseStyles.annotationForeignObject,\n props.styles?.annotationForeignObject,\n ),\n annotationContentInteractive: mergeClasses(\n chartAnnotationLayerClassNames.annotationContentInteractive,\n baseStyles.annotationContentInteractive,\n props.styles?.annotationContentInteractive,\n ),\n annotationForeignObjectInteractive: mergeClasses(\n chartAnnotationLayerClassNames.annotationForeignObjectInteractive,\n baseStyles.annotationForeignObjectInteractive,\n props.styles?.annotationForeignObjectInteractive,\n ),\n connectorGroup: mergeClasses(\n chartAnnotationLayerClassNames.connectorGroup,\n baseStyles.connectorGroup,\n props.styles?.connectorGroup,\n ),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","color","d3Color","DEFAULT_ANNOTATION_BACKGROUND_OPACITY","DEFAULT_ANNOTATION_PADDING","DEFAULT_CONNECTOR_START_PADDING","DEFAULT_CONNECTOR_END_PADDING","DEFAULT_CONNECTOR_STROKE_WIDTH","DEFAULT_CONNECTOR_ARROW","applyOpacityToColor","opacity","options","undefined","parsed","originalOpacity","preserveOriginalOpacity","toString","Math","max","min","getDefaultAnnotationBackgroundColor","colorNeutralBackground1","getDefaultConnectorStrokeColor","colorNeutralForeground1","chartAnnotationLayerClassNames","root","annotation","connectorLayer","measurement","annotationContent","annotationForeignObject","annotationContentInteractive","annotationForeignObjectInteractive","connectorGroup","useStyles","position","top","left","right","bottom","width","height","pointerEvents","overflow","zIndex","caption1","display","alignItems","justifyContent","textAlign","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderRadiusMedium","boxShadow","shadow16","border","colorNeutralStroke1","whiteSpace","visibility","useChartAnnotationLayerStyles","props","baseStyles","className","styles"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAASC,SAASC,OAAO,QAAQ,WAAW;AAoB5C,OAAO,MAAMC,wCAAwC,IAAI;AACzD,OAAO,MAAMC,6BAA6B,UAAU;AACpD,OAAO,MAAMC,kCAAkC,GAAG;AAClD,OAAO,MAAMC,gCAAgC,EAAE;AAC/C,OAAO,MAAMC,iCAAiC,EAAE;AAChD,OAAO,MAAMC,0BAAoD,MAAM;AAEvE,OAAO,MAAMC,sBAAsB,CACjCR,OACAS,SACAC;IAIA,IAAI,CAACV,OAAO;QACV,OAAOW;IACT;IAEA,MAAMC,SAASX,QAAQD;IACvB,IAAI,CAACY,QAAQ;QACX,OAAOZ;IACT;IAEA,MAAMa,kBAAkB,OAAOD,OAAOH,OAAO,KAAK,WAAWG,OAAOH,OAAO,GAAG;QAC9CC;IAAhC,MAAMI,0BAA0BJ,CAAAA,mCAAAA,oBAAAA,8BAAAA,QAASI,uBAAuB,cAAhCJ,8CAAAA,mCAAoC;IAEpE,IAAII,2BAA2BD,kBAAkB,GAAG;QAClD,OAAOD,OAAOG,QAAQ;IACxB;IAEAH,OAAOH,OAAO,GAAGO,KAAKC,GAAG,CAAC,GAAGD,KAAKE,GAAG,CAAC,GAAGT;IACzC,OAAOG,OAAOG,QA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ZH,qCAAAA,eAAc/B,kCAAkC;QAElDC,gBAAgBnC,aACd0B,+BAA+BS,cAAc,EAC7C+B,WAAW/B,cAAc,GACzB8B,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAc9B,cAAc;IAEhC;AACF,EAAE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useCartesianChartStyles } from './useCartesianChartStyles.styles';
|
|
4
4
|
import { select as d3Select } from 'd3-selection';
|
|
5
|
-
import { createNumericXAxis, createStringXAxis, createDateXAxis, XAxisTypes, YAxisType, createWrapOfXLabels, rotateXAxisLabels, calculateLongestLabelWidth, createYAxisLabels, ChartTypes, wrapContent, useRtl, truncateString, tooltipOfAxislabels, getSecureProps, DEFAULT_WRAP_WIDTH } from '../../utilities/index';
|
|
5
|
+
import { createNumericXAxis, createStringXAxis, createDateXAxis, XAxisTypes, YAxisType, createWrapOfXLabels, rotateXAxisLabels, calculateLongestLabelWidth, createYAxisLabels, ChartTypes, wrapContent, useRtl, truncateString, tooltipOfAxislabels, getSecureProps, DEFAULT_WRAP_WIDTH, autoLayoutXAxisLabels } from '../../utilities/index';
|
|
6
6
|
import { useId } from '@fluentui/react-utilities';
|
|
7
7
|
import { SVGTooltipText } from '../../utilities/SVGTooltipText';
|
|
8
8
|
import { ChartAnnotationLayer } from './Annotations/ChartAnnotationLayer';
|
|
@@ -27,7 +27,7 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
27
27
|
const idForGraph = 'chart_';
|
|
28
28
|
let _reqID;
|
|
29
29
|
const _useRtl = useRtl();
|
|
30
|
-
let
|
|
30
|
+
let _tickLabels;
|
|
31
31
|
const _isFirstRender = React.useRef(true);
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
33
|
let _xScale;
|
|
@@ -52,6 +52,7 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
52
52
|
const classes = useCartesianChartStyles(props);
|
|
53
53
|
const focusAttributes = useFocusableGroup();
|
|
54
54
|
const arrowAttributes = useArrowNavigationGroup({
|
|
55
|
+
circular: true,
|
|
55
56
|
axis: 'horizontal'
|
|
56
57
|
});
|
|
57
58
|
// ComponentdidMount and Componentwillunmount logic
|
|
@@ -136,6 +137,7 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
136
137
|
let yScaleSecondary;
|
|
137
138
|
let children = null;
|
|
138
139
|
if (props.enableFirstRenderOptimization && chartContainer.current || !props.enableFirstRenderOptimization) {
|
|
140
|
+
var _props_xAxis, _props_xAxis1, _props_xAxis2;
|
|
139
141
|
_isFirstRender.current = false;
|
|
140
142
|
var _props_showRoundOffXTickValues;
|
|
141
143
|
const XAxisParams = {
|
|
@@ -157,8 +159,10 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
157
159
|
xAxisInnerPadding: props.xAxisInnerPadding,
|
|
158
160
|
xAxisOuterPadding: props.xAxisOuterPadding,
|
|
159
161
|
containerWidth: containerWidth,
|
|
160
|
-
hideTickOverlap: props.rotateXAxisLables ? false : hideTickOverlap,
|
|
162
|
+
hideTickOverlap: props.rotateXAxisLables || ((_props_xAxis = props.xAxis) === null || _props_xAxis === void 0 ? void 0 : _props_xAxis.tickLayout) === 'auto' ? false : hideTickOverlap,
|
|
161
163
|
calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,
|
|
164
|
+
xMinValue: props.xMinValue,
|
|
165
|
+
xMaxValue: props.xMaxValue,
|
|
162
166
|
...props.xAxis
|
|
163
167
|
};
|
|
164
168
|
/**
|
|
@@ -169,22 +173,27 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
169
173
|
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
170
174
|
let xScale;
|
|
171
175
|
let tickValues;
|
|
176
|
+
let tickLabels;
|
|
172
177
|
switch(props.xAxisType){
|
|
173
178
|
case XAxisTypes.NumericAxis:
|
|
174
|
-
({ xScale, tickValues } = createNumericXAxis(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
|
|
179
|
+
({ xScale, tickValues, tickLabels } = createNumericXAxis(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
|
|
175
180
|
break;
|
|
176
181
|
case XAxisTypes.DateAxis:
|
|
177
|
-
({ xScale, tickValues } = createDateXAxis(XAxisParams, props.tickParams, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter, props.useUTC, props.chartType));
|
|
182
|
+
({ xScale, tickValues, tickLabels } = createDateXAxis(XAxisParams, props.tickParams, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter, props.useUTC, props.chartType));
|
|
178
183
|
break;
|
|
179
184
|
case XAxisTypes.StringAxis:
|
|
180
|
-
({ xScale, tickValues } = createStringXAxis(XAxisParams, props.tickParams, props.datasetForXAxisDomain, culture, _useRtl));
|
|
185
|
+
({ xScale, tickValues, tickLabels } = createStringXAxis(XAxisParams, props.tickParams, props.datasetForXAxisDomain, culture, _useRtl));
|
|
181
186
|
break;
|
|
182
187
|
default:
|
|
183
|
-
({ xScale, tickValues } = createNumericXAxis(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
|
|
188
|
+
({ xScale, tickValues, tickLabels } = createNumericXAxis(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
|
|
184
189
|
}
|
|
185
190
|
_xScale = xScale;
|
|
186
|
-
|
|
187
|
-
|
|
191
|
+
_tickLabels = tickLabels;
|
|
192
|
+
if (((_props_xAxis1 = props.xAxis) === null || _props_xAxis1 === void 0 ? void 0 : _props_xAxis1.tickLayout) === 'auto') {
|
|
193
|
+
_removalValueForTextTuncate = autoLayoutXAxisLabels(tickValues, _tickLabels, _xScale, xAxisElement.current, containerWidth, chartContainer.current);
|
|
194
|
+
} else {
|
|
195
|
+
_transformXAxisLabels();
|
|
196
|
+
}
|
|
188
197
|
const YAxisParams = {
|
|
189
198
|
margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,
|
|
190
199
|
containerWidth: containerWidth,
|
|
@@ -243,31 +252,34 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
243
252
|
}
|
|
244
253
|
_yAxisTickText.current = axisData.yAxisTickText;
|
|
245
254
|
props.getAxisData && props.getAxisData(axisData);
|
|
246
|
-
// Removing
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
// Removing previously created tooltips.
|
|
256
|
+
try {
|
|
257
|
+
// eslint-disable-next-line @nx/workspace-no-restricted-globals
|
|
258
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
259
|
+
// eslint-disable-next-line no-empty
|
|
260
|
+
} catch (e) {}
|
|
261
|
+
// Used to display tooltip at x axis labels.
|
|
262
|
+
if (props.showXAxisLablesTooltip || ((_props_xAxis2 = props.xAxis) === null || _props_xAxis2 === void 0 ? void 0 : _props_xAxis2.tickLayout) === 'auto') {
|
|
263
|
+
const _xAxisElement = xAxisElement.current ? d3Select(xAxisElement.current).call(xScale) : null;
|
|
264
|
+
const tooltipProps = {
|
|
265
|
+
tooltipCls: classes.tooltip,
|
|
266
|
+
id: _tooltipId,
|
|
267
|
+
axis: _xAxisElement,
|
|
268
|
+
container: chartContainer.current
|
|
269
|
+
};
|
|
270
|
+
_xAxisElement && tooltipOfAxislabels(tooltipProps);
|
|
254
271
|
}
|
|
255
272
|
// Used to display tooltip at y axis labels.
|
|
256
273
|
if (props.showYAxisLablesTooltip) {
|
|
257
274
|
// To create y axis tick values by if specified truncating the rest of the text
|
|
258
275
|
// and showing elipsis or showing the whole string,
|
|
259
|
-
yScalePrimary &&
|
|
260
|
-
|
|
261
|
-
createYAxisLabels(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, _useRtl);
|
|
262
|
-
const _yAxisElement = d3Select(yAxisElement.current).call(yScalePrimary);
|
|
263
|
-
try {
|
|
264
|
-
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
265
|
-
//eslint-disable-next-line no-empty
|
|
266
|
-
} catch (e) {}
|
|
276
|
+
yScalePrimary && createYAxisLabels(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, _useRtl);
|
|
277
|
+
const _yAxisElement = yAxisElement.current ? d3Select(yAxisElement.current).call(yScalePrimary) : null;
|
|
267
278
|
const ytooltipProps = {
|
|
268
279
|
tooltipCls: classes.tooltip,
|
|
269
280
|
id: _tooltipId,
|
|
270
|
-
axis: _yAxisElement
|
|
281
|
+
axis: _yAxisElement,
|
|
282
|
+
container: chartContainer.current
|
|
271
283
|
};
|
|
272
284
|
_yAxisElement && tooltipOfAxislabels(ytooltipProps);
|
|
273
285
|
}
|
|
@@ -354,8 +366,8 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
354
366
|
}
|
|
355
367
|
function _calculateChartMinWidth() {
|
|
356
368
|
// Adding 10px for padding on both sides
|
|
357
|
-
const labelWidth = _calcMaxLabelWidthWithTransform(
|
|
358
|
-
let minChartWidth = margins.left + margins.right + labelWidth * (
|
|
369
|
+
const labelWidth = _calcMaxLabelWidthWithTransform(_tickLabels) + 10;
|
|
370
|
+
let minChartWidth = margins.left + margins.right + labelWidth * (_tickLabels.length - 1);
|
|
359
371
|
if ([
|
|
360
372
|
ChartTypes.GroupedVerticalBarChart,
|
|
361
373
|
ChartTypes.VerticalBarChart,
|
|
@@ -366,6 +378,12 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
366
378
|
}
|
|
367
379
|
return minChartWidth;
|
|
368
380
|
}
|
|
381
|
+
function _getChartDescription() {
|
|
382
|
+
return (props.chartTitle || 'Chart. ') + _getAxisTitle('X', props.xAxisTitle, props.xAxisType) + _getAxisTitle('Y', props.yAxisTitle, props.yAxisType || YAxisType.NumericAxis) + (props.secondaryYScaleOptions ? _getAxisTitle('secondary Y', props.secondaryYAxistitle, YAxisType.NumericAxis) : '');
|
|
383
|
+
}
|
|
384
|
+
function _getAxisTitle(axisLabel, axisTitle, axisType) {
|
|
385
|
+
return `The ${axisLabel} axis displays ` + (axisTitle || (axisType === XAxisTypes.StringAxis || axisType === YAxisType.StringAxis ? 'categories' : axisType === XAxisTypes.DateAxis || axisType === YAxisType.DateAxis ? 'time' : 'values')) + '. ';
|
|
386
|
+
}
|
|
369
387
|
function _calcMaxLabelWidthWithTransform(x) {
|
|
370
388
|
// Case: rotated labels
|
|
371
389
|
if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType === XAxisTypes.StringAxis) {
|
|
@@ -374,11 +392,11 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
374
392
|
}
|
|
375
393
|
// Case: truncated labels
|
|
376
394
|
if (props.showXAxisLablesTooltip) {
|
|
377
|
-
const
|
|
395
|
+
const tickLabels = x.map((val)=>{
|
|
378
396
|
const numChars = props.noOfCharsToTruncate || 4;
|
|
379
397
|
return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;
|
|
380
398
|
});
|
|
381
|
-
const longestLabelWidth = calculateLongestLabelWidth(
|
|
399
|
+
const longestLabelWidth = calculateLongestLabelWidth(tickLabels, `.${classes.xAxis} text`);
|
|
382
400
|
return Math.ceil(longestLabelWidth);
|
|
383
401
|
}
|
|
384
402
|
// Case: wrapped labels
|
|
@@ -420,7 +438,8 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
420
438
|
xAxis: _xScale,
|
|
421
439
|
showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,
|
|
422
440
|
noOfCharsToTruncate: props.noOfCharsToTruncate || 4,
|
|
423
|
-
width: maxXAxisLabelWidth
|
|
441
|
+
width: maxXAxisLabelWidth,
|
|
442
|
+
container: chartContainer.current
|
|
424
443
|
};
|
|
425
444
|
var _createWrapOfXLabels;
|
|
426
445
|
_removalValueForTextTuncate = (_createWrapOfXLabels = createWrapOfXLabels(wrapLabelProps)) !== null && _createWrapOfXLabels !== void 0 ? _createWrapOfXLabels : 0;
|
|
@@ -527,7 +546,8 @@ const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
|
527
546
|
}, _isFirstRender.current, /*#__PURE__*/ React.createElement("svg", {
|
|
528
547
|
width: svgDimensions.width,
|
|
529
548
|
height: svgDimensions.height,
|
|
530
|
-
"
|
|
549
|
+
role: "region",
|
|
550
|
+
"aria-label": _getChartDescription(),
|
|
531
551
|
style: {
|
|
532
552
|
display: 'block'
|
|
533
553
|
},
|
|
@@ -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} 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 _tickValues: (string | number)[];\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({ 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 ? false : hideTickOverlap,\n calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,\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: (string | number)[];\n switch (props.xAxisType!) {\n case XAxisTypes.NumericAxis:\n ({ xScale, tickValues } = 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 } = 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 } = createStringXAxis(\n XAxisParams,\n props.tickParams!,\n props.datasetForXAxisDomain!,\n culture,\n _useRtl,\n ));\n break;\n default:\n ({ xScale, tickValues } = createNumericXAxis(\n XAxisParams,\n props.tickParams!,\n props.chartType,\n culture,\n props.xScaleType,\n _useRtl,\n ));\n }\n _xScale = xScale;\n _tickValues = tickValues;\n\n _transformXAxisLabels();\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 un wanted tooltip div from DOM, when prop not provided, for proper cleanup\n // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur\n // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)\n if (!props.showYAxisLablesTooltip) {\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 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 // Note: This function should be invoked within the showYAxisLablesTooltip check,\n // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.\n createYAxisLabels(\n yAxisElement.current!,\n yScalePrimary,\n props.noOfCharsToTruncate || 4,\n props.showYAxisLablesTooltip || false,\n _useRtl,\n );\n const _yAxisElement = d3Select(yAxisElement.current!).call(yScalePrimary);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n //eslint-disable-next-line no-empty\n } catch (e) {}\n const ytooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: _yAxisElement,\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(_tickValues) + 10;\n\n let minChartWidth = margins.left! + margins.right! + labelWidth * (_tickValues.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 _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 tickValues = 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(tickValues, `.${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 };\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 aria-label={props.chartTitle}\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: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,\n className: classes.axisAnnotation!,\n textAnchor: 'middle',\n 'aria-hidden': true,\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","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","_tickValues","_isFirstRender","_xScale","isIntegralDataset","useMemo","points","some","point","y","_tooltipId","_removalValueForTextTuncate","_yAxisTickText","containerWidth","setContainerWidth","useState","containerHeight","setContainerHeight","startFromX","setStartFromX","prevWidthRef","undefined","prevHeightRef","classes","focusAttributes","arrowAttributes","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","calcMaxLabelWidth","_calcMaxLabelWidthWithTransform","xAxis","xScale","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","_yAxisElement","call","ytooltipProps","tooltipCls","tooltip","id","_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","container","currentContainerWidth","reflowProps","mode","_calculateChartMinWidth","currentContainerHeight","shouldResize","_onChartLeave","onChartMouseLeave","labelWidth","minChartWidth","GroupedVerticalBarChart","VerticalBarChart","VerticalStackedBarChart","includes","minDomainMargin","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","xAxisTitle","yAxisTitle","secondaryYAxistitle","xAxisAnnotation","yAxisAnnotation","div","root","role","ref","rootElem","onMouseLeave","chartWrapper","svg","aria-label","chartTitle","style","display","chart","g","transform","textProps","axisTitle","textAnchor","maxWidth","axisAnnotation","context","annotationLayer","legendBars","Suspense","fallback","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,uBAAuB,QAAQ,mCAAmC;AAC3E,SAASC,UAAUC,QAAQ,QAAQ,eAAe;AAClD,SACEC,kBAAkB,EAClBC,iBAAiB,EAEjBC,eAAe,EAEfC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,iBAAiB,EACjBC,0BAA0B,EAC1BC,iBAAiB,EACjBC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,cAAc,EACdC,mBAAmB,EACnBC,cAAc,EACdC,kBAAkB,QACb,wBAAwB;AAC/B,SAASC,KAAK,QAAQ,4BAA4B;AAElD,SAASC,cAAc,QAA6B,iCAAiC;AACrF,SAASC,oBAAoB,QAAQ,qCAAqC;AAE1E,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,iBAAiB,EAAEC,uBAAuB,QAAQ,0BAA0B;AAErF,MAAMC,oCAAoC;AAC1C,MAAMC,kCAAkC;AACxC,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAClC,MAAMC,0BAA0B;AAEhC;;;CAGC,GACD,OAAO,MAAMC,+BAAuE/B,MAAMgC,UAAU,CAGlG,CAAC,EAAEC,kBAAkB,IAAI,EAAE,GAAGC,OAAO,EAAEC;IACvC,MAAMC,iBAAiBpC,MAAMqC,MAAM,CAAwB;IAC3D,IAAIC;IACJ,MAAMC,2BAAmC;IACzC,MAAMC,eAAex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,SAAStF;QACTpG,WAAWpB,QAAQ+M,eAAe;SAKvC,CAAClP,MAAMwK,UAAU,kBAChB,oBAACqD;QACCG,KAAK,CAAC9F;YACJ9H,kBAAkB8H;QACpB;QACA3E,WAAWpB,QAAQ/B,eAAe;OAEjCJ,MAAMmP,UAAU,GAIpB7K,yBAAW,oBAACxG,MAAMsR,QAAQ;QAACC,wBAAU,oBAACxB,aAAI;OAAmBvJ;AAGpE,GAAG;AACHzE,eAAeyP,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} 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: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,\n className: classes.axisAnnotation!,\n textAnchor: 'middle',\n 'aria-hidden': true,\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","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","axisAnnotation","context","annotationLayer","legendBars","Suspense","fallback","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,uBAAuB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