@fluentui/react-charts 9.3.28 → 9.3.29
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 +12 -3
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -4
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +2 -2
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/AreaChart/index.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/index.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +19 -29
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +11 -15
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +1 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -9
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -4
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +92 -110
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- 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.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/index.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/index.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +5 -5
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/FunnelChart/index.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +3 -3
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GanttChart/index.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +1 -1
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/index.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +20 -21
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/index.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +5 -6
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -3
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/Legends.js +1 -2
- 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 +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +23 -23
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +3 -4
- package/lib/components/PolarChart/PolarChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.utils.js +3 -3
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -1
- package/lib/components/PolarChart/index.js.map +1 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/index.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/index.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +1 -2
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/index.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.js +1 -3
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib/components/Sparkline/index.js.map +1 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +2 -2
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +37 -45
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -5
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/types/ChartAnnotation.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/EventAnnotation.js.map +1 -1
- package/lib/types/LegendDataItem.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/ChartTitle.js +3 -4
- package/lib/utilities/ChartTitle.js.map +1 -1
- package/lib/utilities/Common.styles.js +1 -4
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +1 -4
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/async-utils.js.map +1 -1
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js.map +1 -1
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +3 -4
- package/lib/utilities/scatterpolar-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data/specialChartNames.js.map +1 -1
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +9 -9
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs +1 -4
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.cjs +2 -2
- package/lib-commonjs/components/AreaChart/AreaChart.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/index.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs +19 -29
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs +11 -15
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs +9 -9
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs +13 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs +122 -140
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs +5 -5
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs +6 -6
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/index.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.cjs +3 -3
- package/lib-commonjs/components/GanttChart/GanttChart.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs +9 -9
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs +20 -21
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs +5 -6
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs +2 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.cjs +1 -2
- package/lib-commonjs/components/Legends/Legends.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.cjs.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.cjs +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.cjs.map +1 -1
- package/lib-commonjs/components/Legends/index.cjs.map +1 -1
- package/lib-commonjs/components/Legends/shape.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.cjs +23 -23
- package/lib-commonjs/components/LineChart/LineChart.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/index.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.cjs +3 -4
- package/lib-commonjs/components/PolarChart/PolarChart.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs +10 -10
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs +5 -5
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs +1 -2
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.cjs +1 -3
- package/lib-commonjs/components/Sparkline/Sparkline.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/index.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs +3 -3
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs +7 -7
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs +54 -62
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs +5 -5
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/DataPoint.cjs.map +1 -1
- package/lib-commonjs/types/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/LegendDataItem.cjs.map +1 -1
- package/lib-commonjs/types/index.cjs.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.cjs +3 -4
- package/lib-commonjs/utilities/ChartTitle.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.raw.cjs.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.cjs.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/async-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/colors.cjs +7 -7
- package/lib-commonjs/utilities/colors.cjs.map +1 -1
- package/lib-commonjs/utilities/getWindow.cjs.map +1 -1
- package/lib-commonjs/utilities/hooks.cjs.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.cjs +3 -3
- package/lib-commonjs/utilities/image-export-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/index.cjs.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.cjs +4 -4
- package/lib-commonjs/utilities/overflow-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.cjs +6 -7
- package/lib-commonjs/utilities/scatterpolar-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/string.cjs +1 -1
- package/lib-commonjs/utilities/string.cjs.map +1 -1
- package/lib-commonjs/utilities/test-data/specialChartNames.cjs.map +1 -1
- package/lib-commonjs/utilities/test-data.cjs +18 -18
- package/lib-commonjs/utilities/test-data.cjs.map +1 -1
- package/lib-commonjs/utilities/utilities.cjs +92 -92
- package/lib-commonjs/utilities/utilities.cjs.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.cjs +7 -7
- package/lib-commonjs/utilities/vbc-utils.cjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/GaugeChart/GaugeChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport type { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatScientificLimitWidth,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n ChartTitle,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport type { Legend, LegendShape } from '../Legends/index';\nimport { Legends, Shape } from '../Legends/index';\nimport type {\n GaugeChartCalloutData,\n GaugeChartVariant,\n GaugeValueFormat,\n GaugeChartProps,\n ExtendedSegment,\n} from './GaugeChart.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { useImageExport } from '../../utilities/hooks';\n\nconst GAUGE_MARGIN = 16;\nconst LABEL_WIDTH = 36;\nconst LABEL_HEIGHT = 16;\nconst LABEL_OFFSET = 4;\nconst TITLE_OFFSET = 11;\nconst EXTRA_NEEDLE_LENGTH = 4;\nexport const ARC_PADDING = 2;\nexport const BREAKPOINTS = [\n { minRadius: 52, arcWidth: 12, fontSize: 20 },\n { minRadius: 70, arcWidth: 16, fontSize: 24 },\n { minRadius: 88, arcWidth: 20, fontSize: 32 },\n { minRadius: 106, arcWidth: 24, fontSize: 32 },\n { minRadius: 124, arcWidth: 28, fontSize: 40 },\n { minRadius: 142, arcWidth: 32, fontSize: 40 },\n];\n\nexport const calcNeedleRotation = (chartValue: number, minValue: number, maxValue: number): number => {\n let needleRotation = ((chartValue - minValue) / (maxValue - minValue)) * 180;\n if (needleRotation < 0) {\n needleRotation = 0;\n } else if (needleRotation > 180) {\n needleRotation = 180;\n }\n\n return needleRotation;\n};\n\nexport const getSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant?: GaugeChartVariant,\n isAriaLabel: boolean = false,\n): string => {\n if (isAriaLabel) {\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${((segment.size / maxValue) * 100).toFixed()}%`\n : `${segment.legend}, ${segment.start} to ${segment.end}`;\n }\n\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.size} (${((segment.size / maxValue) * 100).toFixed()}%)`\n : `${segment.start} - ${segment.end}`;\n};\n\nexport const getChartValueLabel = (\n chartValue: number,\n minValue: number,\n maxValue: number,\n chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string),\n forCallout: boolean = false,\n): string => {\n if (typeof chartValueFormat === 'function') {\n return chartValueFormat([chartValue - minValue, maxValue - minValue]);\n }\n\n if (chartValueFormat === 'fraction') {\n return `${chartValue}/${maxValue}`;\n }\n\n return `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\n/**\n * Returns a GaugeChart segment label formatted for the chart's value format.\n * {@docCategory GaugeChart}\n */\nexport const getGaugeChartSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant: GaugeChartVariant | undefined,\n chartValueFormat: GaugeChartProps['chartValueFormat'],\n isAriaLabel: boolean = false,\n): string => {\n if ((minValue === 0 && variant === 'single-segment') || typeof chartValueFormat === 'function') {\n return getSegmentLabel(segment, minValue, maxValue, variant, isAriaLabel);\n }\n\n if (!chartValueFormat || chartValueFormat === 'percentage') {\n const startPercentage = ((segment.start / maxValue) * 100).toFixed();\n const endPercentage = ((segment.end / maxValue) * 100).toFixed();\n return isAriaLabel\n ? `${segment.legend}, ${startPercentage}% to ${endPercentage}%`\n : `${startPercentage}% - ${endPercentage}%`;\n }\n\n return isAriaLabel ? `${segment.legend}, ${segment.start} to ${segment.end}` : `${segment.start} - ${segment.end}`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport type { ExtendedSegment } from './GaugeChart.types';\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\n const _gaugeChartId = useId('gauge-chart');\n const _getMargins = () => {\n const { hideMinMax, chartTitle, sublabel } = props;\n return {\n left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,\n bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN,\n };\n };\n const _margins: { left: number; right: number; top: number; bottom: number } = _getMargins();\n const _legendsHeight: number = !props.hideLegend ? 32 : 0;\n const { chartContainerRef: _rootElem, legendsRef: _legendsRef } = useImageExport(\n props.componentRef,\n props.hideLegend,\n false,\n );\n const _isRTL: boolean = useRtl();\n const [width, setWidth] = React.useState<number>(140 + _getMargins().left + _getMargins().right);\n const [height, setHeight] = React.useState<number>(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedElement, setFocusedElement] = React.useState<string | undefined>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [calloutLegend, setCalloutLegend] = React.useState('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\n const [refSelected, setRefSelected] = React.useState<HTMLElement | null>(null);\n const prevPropsRef = React.useRef<GaugeChartProps | null>(null);\n const _width = props.width || width;\n const _height = props.height || height;\n const _outerRadius: number = Math.min(\n (_width - (_margins.left + _margins.right)) / 2,\n _height - (_margins.top + _margins.bottom + _legendsHeight),\n );\n const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();\n const _innerRadius: number = _outerRadius - arcWidth;\n let _minValue!: number;\n let _maxValue!: number;\n let _segments!: ExtendedSegment[];\n let _calloutAnchor: string = '';\n\n React.useEffect(() => {\n if (_rootElem.current) {\n setWidth(_rootElem.current.clientWidth);\n setHeight(_rootElem.current.clientHeight);\n }\n }, []);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n const classes = useGaugeChartStyles(props);\n function _getStylesBasedOnBreakpoint() {\n for (let index = BREAKPOINTS.length - 1; index >= 0; index -= 1) {\n if (_outerRadius >= BREAKPOINTS[index].minRadius) {\n return {\n arcWidth: BREAKPOINTS[index].arcWidth,\n chartValueSize: BREAKPOINTS[index].fontSize,\n };\n }\n }\n return {\n arcWidth: BREAKPOINTS[0].arcWidth,\n chartValueSize: BREAKPOINTS[0].fontSize,\n };\n }\n\n function _processProps() {\n const { minValue = 0, maxValue, segments, roundCorners } = props;\n\n let total = minValue;\n const processedSegments: ExtendedSegment[] = segments.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (segment: { size: number; legend: any; color: string; accessibilityData: any }, index: number) => {\n const size = Math.max(segment.size, 0);\n total += size;\n return {\n legend: segment.legend,\n size,\n color:\n typeof segment.color !== 'undefined'\n ? getColorFromToken(segment.color, false)\n : getNextColor(index, 0, false),\n accessibilityData: segment.accessibilityData,\n start: total - size,\n end: total,\n };\n },\n );\n if (typeof maxValue !== 'undefined' && total < maxValue) {\n processedSegments.push({\n legend: 'Unknown',\n size: maxValue - total,\n color: 'neutralLight',\n start: total,\n end: maxValue,\n });\n total = maxValue;\n }\n\n const arcGenerator = d3Arc()\n .cornerRadius(roundCorners ? 3 : 0)\n .padAngle(ARC_PADDING / _outerRadius)\n .padRadius(_outerRadius);\n const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;\n let prevAngle = -Math.PI / 2;\n\n const arcs = rtlSafeSegments.map((segment, index) => {\n const endAngle = prevAngle + (segment.size / (total - minValue)) * Math.PI;\n const d = arcGenerator({\n innerRadius: _innerRadius,\n outerRadius: _outerRadius,\n startAngle: prevAngle,\n endAngle,\n })!;\n prevAngle = endAngle;\n return {\n d,\n segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,\n startAngle: prevAngle - (segment.size / (total - minValue)) * Math.PI,\n endAngle,\n };\n });\n\n _minValue = minValue;\n _maxValue = total;\n _segments = processedSegments;\n\n return {\n arcs,\n };\n }\n\n function _renderNeedle() {\n const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);\n const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;\n const strokeWidth = 2;\n const halfStrokeWidth = strokeWidth / 2;\n const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;\n const needleId = `${_gaugeChartId}-needle`;\n return (\n <g transform={`rotate(${rtlSafeNeedleRotation}, 0, 0)`}>\n <path\n d={`\n M 0,${-halfStrokeWidth - 3}\n L ${-needleLength},${-halfStrokeWidth - 1}\n A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}\n L 0,${halfStrokeWidth + 3}\n A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}\n `}\n id={needleId}\n strokeWidth={strokeWidth}\n className={classes.needle}\n transform={`translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`}\n data-is-focusable={true}\n onFocus={e => _handleFocus(e, 'Needle', needleId)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle', needleId)}\n onMouseMove={e => _handleMouseOver(e, 'Needle', needleId)}\n role=\"img\"\n aria-label={\n 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)\n }\n />\n </g>\n );\n }\n\n function _renderLegends() {\n if (props.hideLegend) {\n return null;\n }\n\n const legends: Legend[] = _segments.map((segment, index) => {\n const color: string = segment.color || getNextColor(index, 0, false);\n\n return {\n title: segment.legend,\n color,\n hoverAction: () => {\n setHoveredLegend(segment.legend);\n },\n onMouseOutAction: () => {\n setHoveredLegend('');\n },\n };\n });\n\n return (\n <div className={classes.legendsContainer}>\n <Legends\n legends={legends}\n centerLegends\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n </div>\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _handleFocus(focusEvent: React.FocusEvent<SVGElement>, focusedElement: string, elementId?: string) {\n _showCallout(focusEvent, focusedElement, true, elementId);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string, elementId?: string) {\n _showCallout(mouseEvent, hoveredElement, false, elementId);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n elementId?: string,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n const targetElement = elementId\n ? document.getElementById(elementId)\n : (event.currentTarget as unknown as HTMLElement);\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments\n .filter(segment => _noLegendHighlighted() || _legendHighlighted(segment.legend))\n .map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getGaugeChartSegmentLabel(segment, _minValue, _maxValue, props.variant, props.chartValueFormat),\n color: segment.color,\n };\n return yValue;\n });\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setRefSelected(targetElement);\n setCalloutLegend(legend);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setCalloutLegend('');\n setHoverYValues([]);\n if (isBlurEvent) {\n setFocusedElement('');\n }\n }\n\n function _wrapContent(content: string, id: string, maxWidth: number) {\n const textElement = d3Select<SVGTextElement, {}>(`#${id}`);\n textElement.text(content);\n if (!textElement.node()) {\n return false;\n }\n\n let isOverflowing = false;\n let textLength = textElement.node()!.getComputedTextLength();\n while (textLength > maxWidth && content.length > 0) {\n content = content.slice(0, -1);\n textElement.text(content + '...');\n isOverflowing = true;\n textLength = textElement.node()!.getComputedTextLength();\n }\n return isOverflowing;\n }\n\n // TO DO: Write a common functional component for Multi value callout and divide sub count method\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout(calloutProps: any) {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(calloutProps.YValueHover);\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(calloutProps!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {formatToLocaleString(calloutProps!.hoverXValue, props.culture) as React.ReactNode}\n </div>\n </div>\n <div className={classes.calloutInfoContainer} style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {calloutProps!.YValueHover &&\n calloutProps!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const { shouldDrawBorderBottom = false } = yValue;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!calloutProps.descriptionMessage && (\n <div className={classes.descriptionMessage}>{calloutProps.descriptionMessage}</div>\n )}\n </div>\n </div>\n );\n }\n\n function _renderCallout(calloutData?: GaugeChartCalloutData): React.ReactElement | null {\n return calloutData\n ? _multiValueCallout({\n hoverXValue: `Current value is ${calloutData.chartValueLabel}`,\n YValueHover: calloutData.segmentValues,\n })\n : null;\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]) {\n if (yValueHover) {\n return yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n );\n }\n return false;\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = formatToLocaleString(xValue.y, culture) as React.ReactNode;\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{ borderInlineStart: `4px solid ${xValue.color}` }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n style={{ display: 'flex' }}\n />\n )}\n <div>\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY}>\n {\n formatToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data,\n culture,\n ) as React.ReactNode\n }\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {' '}\n {formatToLocaleString(subcountName, culture) as React.ReactNode}\n </div>\n <div className={classes.calloutContentY}>\n {formatToLocaleString(subcounts[subcountName], culture) as React.ReactNode}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n return (\n <div\n className={classes.root}\n ref={el => {\n _rootElem.current = el;\n }}\n >\n <div className={classes.chartWrapper} {...arrowAttributes}>\n <svg\n className={classes.chart}\n width={_width}\n height={_height - _legendsHeight}\n role=\"region\"\n aria-label={_getChartTitle()}\n onMouseLeave={_handleMouseOut}\n >\n <g transform={`translate(${_width / 2}, ${_height - (_margins.bottom + _legendsHeight)})`}>\n {props.chartTitle && (\n <ChartTitle\n title={props.chartTitle}\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n className={classes.chartTitle}\n titleStyles={props.titleStyles}\n tooltipClassName={classes.svgTooltip}\n />\n )}\n {!props.hideMinMax && (\n <>\n <text\n x={(_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"end\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Min value: ${_minValue}`}\n >\n {formatScientificLimitWidth(_minValue)}\n </text>\n <text\n x={(_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"start\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Max value: ${_maxValue}`}\n >\n {formatScientificLimitWidth(_maxValue)}\n </text>\n </>\n )}\n <g role=\"listbox\" aria-label={`${_segments.length} ${_segments.length === 1 ? 'segment' : 'segments'}`}>\n {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n const arcId = `${_gaugeChartId}-arc-${index}`;\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\n id={arcId}\n strokeWidth={focusedElement === segment.legend ? ARC_PADDING : 0}\n className={classes.segment}\n fill={segment.color}\n opacity={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1}\n {...getAccessibleDataObject(\n {\n ariaLabel: getGaugeChartSegmentLabel(\n segment,\n _minValue,\n _maxValue,\n props.variant,\n props.chartValueFormat,\n true,\n ),\n ...segment.accessibilityData,\n },\n 'option',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend, arcId)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend, arcId)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend, arcId)}\n tabIndex={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\n </g>\n {_renderNeedle()}\n <g\n onMouseEnter={e => _handleMouseOver(e, 'Chart value')}\n onMouseMove={e => _handleMouseOver(e, 'Chart value')}\n >\n <SVGTooltipText\n content={getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)}\n textProps={{\n x: 0,\n y: 0,\n textAnchor: 'middle',\n className: classes.chartValue,\n fontSize: chartValueSize,\n 'aria-hidden': 'true',\n }}\n maxWidth={_innerRadius * 2 - 24}\n wrapContent={_wrapContent}\n />\n </g>\n {props.sublabel && (\n <SVGTooltipText\n content={props.sublabel}\n textProps={{\n x: 0,\n y: 4,\n textAnchor: 'middle',\n dominantBaseline: 'hanging',\n className: classes.sublabel,\n }}\n maxWidth={_innerRadius * 2}\n wrapContent={_wrapContent}\n />\n )}\n </g>\n </svg>\n </div>\n {_renderLegends()}\n {!props.hideTooltip && isPopoverOpen && (\n <ChartPopover\n {...props.calloutProps}\n positioning={{\n target: refSelected,\n }}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout:\n (() => {\n const calloutData: GaugeChartCalloutData = {\n legend: calloutLegend,\n chartTitle: props.chartTitle,\n chartValue: props.chartValue,\n minValue: _minValue,\n maxValue: _maxValue,\n chartValueLabel: getChartValueLabel(\n props.chartValue,\n _minValue,\n _maxValue,\n props.chartValueFormat,\n true,\n ),\n segments: _segments.slice(0, props.segments.length).map(segment => ({ ...segment })),\n segmentValues: hoverYValues,\n };\n\n return props.onRenderCallout\n ? props.onRenderCallout(calloutData, _renderCallout)\n : _renderCallout(calloutData);\n })() ?? undefined,\n }}\n />\n )}\n </div>\n );\n },\n);\nGaugeChart.displayName = 'GaugeChart';\n"],"names":["React","useGaugeChartStyles","select","d3Select","arc","d3Arc","Points","areArraysEqual","formatScientificLimitWidth","getAccessibleDataObject","getColorFromToken","getNextColor","pointTypes","useRtl","ChartTitle","formatToLocaleString","SVGTooltipText","Legends","Shape","useArrowNavigationGroup","useId","ChartPopover","useImageExport","GAUGE_MARGIN","LABEL_WIDTH","LABEL_HEIGHT","LABEL_OFFSET","TITLE_OFFSET","EXTRA_NEEDLE_LENGTH","ARC_PADDING","BREAKPOINTS","minRadius","arcWidth","fontSize","calcNeedleRotation","chartValue","minValue","maxValue","needleRotation","getSegmentLabel","segment","variant","isAriaLabel","legend","size","toFixed","start","end","getChartValueLabel","chartValueFormat","forCallout","getGaugeChartSegmentLabel","startPercentage","endPercentage","GaugeChart","forwardRef","props","forwardedRef","_gaugeChartId","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","chartContainerRef","_rootElem","legendsRef","_legendsRef","componentRef","_isRTL","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","hoverYValues","setHoverYValues","refSelected","setRefSelected","prevPropsRef","useRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","clientWidth","clientHeight","prevProps","classes","index","length","_processProps","segments","roundCorners","total","processedSegments","map","max","color","accessibilityData","push","arcGenerator","cornerRadius","padAngle","padRadius","rtlSafeSegments","Array","from","reverse","prevAngle","PI","arcs","endAngle","d","innerRadius","outerRadius","startAngle","segmentIndex","_renderNeedle","rtlSafeNeedleRotation","strokeWidth","halfStrokeWidth","needleLength","needleId","g","transform","path","id","className","needle","data-is-focusable","onFocus","e","_handleFocus","onBlur","_handleBlur","onMouseEnter","_handleMouseOver","onMouseMove","role","aria-label","_renderLegends","legends","title","hoverAction","onMouseOutAction","div","legendsContainer","centerLegends","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","elementId","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","targetElement","document","getElementById","currentTarget","filter","yValue","y","isBlurEvent","_wrapContent","content","maxWidth","textElement","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","style","marginBottom","calloutContentX","xAxisCalloutAccessibilityData","hoverXValue","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","_renderCallout","calloutData","chartValueLabel","segmentValues","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutlegendText","calloutContentY","data","subcounts","subcountName","_getChartTitle","arrowAttributes","circular","axis","root","ref","el","chartWrapper","svg","chart","onMouseLeave","x","titleStyles","tooltipClassName","svgTooltip","textAnchor","limits","arcId","Fragment","opacity","ariaLabel","tabIndex","textProps","wrapContent","dominantBaseline","hideTooltip","positioning","target","customCallout","customizedCallout","onRenderCallout","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,kCAA+B;AACnE,SAASC,UAAUC,QAAQ,QAAQ,eAAe;AAClD,SAASC,OAAOC,KAAK,QAAQ,WAAW;AAExC,SACEC,MAAM,EACNC,cAAc,EACdC,0BAA0B,EAC1BC,uBAAuB,EACvBC,iBAAiB,EACjBC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,UAAU,QAC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{"version":3,"sources":["../../../src/components/GaugeChart/GaugeChart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport type { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatScientificLimitWidth,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n ChartTitle,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport type { Legend, LegendShape } from '../Legends/index';\nimport { Legends, Shape } from '../Legends/index';\nimport type {\n GaugeChartCalloutData,\n GaugeChartVariant,\n GaugeValueFormat,\n GaugeChartProps,\n ExtendedSegment,\n} from './GaugeChart.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\nimport { useImageExport } from '../../utilities/hooks';\n\nconst GAUGE_MARGIN = 16;\nconst LABEL_WIDTH = 36;\nconst LABEL_HEIGHT = 16;\nconst LABEL_OFFSET = 4;\nconst TITLE_OFFSET = 11;\nconst EXTRA_NEEDLE_LENGTH = 4;\nexport const ARC_PADDING = 2;\nexport const BREAKPOINTS = [\n { minRadius: 52, arcWidth: 12, fontSize: 20 },\n { minRadius: 70, arcWidth: 16, fontSize: 24 },\n { minRadius: 88, arcWidth: 20, fontSize: 32 },\n { minRadius: 106, arcWidth: 24, fontSize: 32 },\n { minRadius: 124, arcWidth: 28, fontSize: 40 },\n { minRadius: 142, arcWidth: 32, fontSize: 40 },\n];\n\nexport const calcNeedleRotation = (chartValue: number, minValue: number, maxValue: number): number => {\n let needleRotation = ((chartValue - minValue) / (maxValue - minValue)) * 180;\n if (needleRotation < 0) {\n needleRotation = 0;\n } else if (needleRotation > 180) {\n needleRotation = 180;\n }\n\n return needleRotation;\n};\n\nexport const getSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant?: GaugeChartVariant,\n isAriaLabel: boolean = false,\n): string => {\n if (isAriaLabel) {\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${((segment.size / maxValue) * 100).toFixed()}%`\n : `${segment.legend}, ${segment.start} to ${segment.end}`;\n }\n\n return minValue === 0 && variant === 'single-segment'\n ? `${segment.size} (${((segment.size / maxValue) * 100).toFixed()}%)`\n : `${segment.start} - ${segment.end}`;\n};\n\nexport const getChartValueLabel = (\n chartValue: number,\n minValue: number,\n maxValue: number,\n chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string),\n forCallout: boolean = false,\n): string => {\n if (typeof chartValueFormat === 'function') {\n return chartValueFormat([chartValue - minValue, maxValue - minValue]);\n }\n\n if (chartValueFormat === 'fraction') {\n return `${chartValue}/${maxValue}`;\n }\n\n return `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\n/**\n * Returns a GaugeChart segment label formatted for the chart's value format.\n * {@docCategory GaugeChart}\n */\nexport const getGaugeChartSegmentLabel = (\n segment: ExtendedSegment,\n minValue: number,\n maxValue: number,\n variant: GaugeChartVariant | undefined,\n chartValueFormat: GaugeChartProps['chartValueFormat'],\n isAriaLabel: boolean = false,\n): string => {\n if ((minValue === 0 && variant === 'single-segment') || typeof chartValueFormat === 'function') {\n return getSegmentLabel(segment, minValue, maxValue, variant, isAriaLabel);\n }\n\n if (!chartValueFormat || chartValueFormat === 'percentage') {\n const startPercentage = ((segment.start / maxValue) * 100).toFixed();\n const endPercentage = ((segment.end / maxValue) * 100).toFixed();\n return isAriaLabel\n ? `${segment.legend}, ${startPercentage}% to ${endPercentage}%`\n : `${startPercentage}% - ${endPercentage}%`;\n }\n\n return isAriaLabel ? `${segment.legend}, ${segment.start} to ${segment.end}` : `${segment.start} - ${segment.end}`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport type { ExtendedSegment } from './GaugeChart.types';\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\n const _gaugeChartId = useId('gauge-chart');\n const _getMargins = () => {\n const { hideMinMax, chartTitle, sublabel } = props;\n return {\n left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,\n top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,\n bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN,\n };\n };\n const _margins: { left: number; right: number; top: number; bottom: number } = _getMargins();\n const _legendsHeight: number = !props.hideLegend ? 32 : 0;\n const { chartContainerRef: _rootElem, legendsRef: _legendsRef } = useImageExport(\n props.componentRef,\n props.hideLegend,\n false,\n );\n const _isRTL: boolean = useRtl();\n const [width, setWidth] = React.useState<number>(140 + _getMargins().left + _getMargins().right);\n const [height, setHeight] = React.useState<number>(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [focusedElement, setFocusedElement] = React.useState<string | undefined>('');\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [calloutLegend, setCalloutLegend] = React.useState('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\n const [refSelected, setRefSelected] = React.useState<HTMLElement | null>(null);\n const prevPropsRef = React.useRef<GaugeChartProps | null>(null);\n const _width = props.width || width;\n const _height = props.height || height;\n const _outerRadius: number = Math.min(\n (_width - (_margins.left + _margins.right)) / 2,\n _height - (_margins.top + _margins.bottom + _legendsHeight),\n );\n const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();\n const _innerRadius: number = _outerRadius - arcWidth;\n let _minValue!: number;\n let _maxValue!: number;\n let _segments!: ExtendedSegment[];\n let _calloutAnchor: string = '';\n\n React.useEffect(() => {\n if (_rootElem.current) {\n setWidth(_rootElem.current.clientWidth);\n setHeight(_rootElem.current.clientHeight);\n }\n }, []);\n\n React.useEffect(() => {\n if (prevPropsRef.current) {\n const prevProps = prevPropsRef.current;\n if (!areArraysEqual(prevProps.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }\n prevPropsRef.current = props;\n }, [props]);\n\n const classes = useGaugeChartStyles(props);\n function _getStylesBasedOnBreakpoint() {\n for (let index = BREAKPOINTS.length - 1; index >= 0; index -= 1) {\n if (_outerRadius >= BREAKPOINTS[index].minRadius) {\n return {\n arcWidth: BREAKPOINTS[index].arcWidth,\n chartValueSize: BREAKPOINTS[index].fontSize,\n };\n }\n }\n return {\n arcWidth: BREAKPOINTS[0].arcWidth,\n chartValueSize: BREAKPOINTS[0].fontSize,\n };\n }\n\n function _processProps() {\n const { minValue = 0, maxValue, segments, roundCorners } = props;\n\n let total = minValue;\n const processedSegments: ExtendedSegment[] = segments.map(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (segment: { size: number; legend: any; color: string; accessibilityData: any }, index: number) => {\n const size = Math.max(segment.size, 0);\n total += size;\n return {\n legend: segment.legend,\n size,\n color:\n typeof segment.color !== 'undefined'\n ? getColorFromToken(segment.color, false)\n : getNextColor(index, 0, false),\n accessibilityData: segment.accessibilityData,\n start: total - size,\n end: total,\n };\n },\n );\n if (typeof maxValue !== 'undefined' && total < maxValue) {\n processedSegments.push({\n legend: 'Unknown',\n size: maxValue - total,\n color: 'neutralLight',\n start: total,\n end: maxValue,\n });\n total = maxValue;\n }\n\n const arcGenerator = d3Arc()\n .cornerRadius(roundCorners ? 3 : 0)\n .padAngle(ARC_PADDING / _outerRadius)\n .padRadius(_outerRadius);\n const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;\n let prevAngle = -Math.PI / 2;\n\n const arcs = rtlSafeSegments.map((segment, index) => {\n const endAngle = prevAngle + (segment.size / (total - minValue)) * Math.PI;\n const d = arcGenerator({\n innerRadius: _innerRadius,\n outerRadius: _outerRadius,\n startAngle: prevAngle,\n endAngle,\n })!;\n prevAngle = endAngle;\n return {\n d,\n segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,\n startAngle: prevAngle - (segment.size / (total - minValue)) * Math.PI,\n endAngle,\n };\n });\n\n _minValue = minValue;\n _maxValue = total;\n _segments = processedSegments;\n\n return {\n arcs,\n };\n }\n\n function _renderNeedle() {\n const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);\n const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;\n const strokeWidth = 2;\n const halfStrokeWidth = strokeWidth / 2;\n const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;\n const needleId = `${_gaugeChartId}-needle`;\n return (\n <g transform={`rotate(${rtlSafeNeedleRotation}, 0, 0)`}>\n <path\n d={`\n M 0,${-halfStrokeWidth - 3}\n L ${-needleLength},${-halfStrokeWidth - 1}\n A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}\n L 0,${halfStrokeWidth + 3}\n A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}\n `}\n id={needleId}\n strokeWidth={strokeWidth}\n className={classes.needle}\n transform={`translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`}\n data-is-focusable={true}\n onFocus={e => _handleFocus(e, 'Needle', needleId)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle', needleId)}\n onMouseMove={e => _handleMouseOver(e, 'Needle', needleId)}\n role=\"img\"\n aria-label={\n 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)\n }\n />\n </g>\n );\n }\n\n function _renderLegends() {\n if (props.hideLegend) {\n return null;\n }\n\n const legends: Legend[] = _segments.map((segment, index) => {\n const color: string = segment.color || getNextColor(index, 0, false);\n\n return {\n title: segment.legend,\n color,\n hoverAction: () => {\n setHoveredLegend(segment.legend);\n },\n onMouseOutAction: () => {\n setHoveredLegend('');\n },\n };\n });\n\n return (\n <div className={classes.legendsContainer}>\n <Legends\n legends={legends}\n centerLegends\n {...props.legendProps}\n onChange={_onLegendSelectionChange}\n legendRef={_legendsRef}\n />\n </div>\n );\n }\n\n function _onLegendSelectionChange(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: Legend,\n ): void {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(selectedLegends);\n } else {\n setSelectedLegends(selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(selectedLegends, event, currentLegend);\n }\n }\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n function _legendHighlighted(legend: string) {\n return _getHighlightedLegend().includes(legend!);\n }\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n function _noLegendHighlighted() {\n return _getHighlightedLegend().length === 0;\n }\n\n function _getHighlightedLegend() {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n function _handleFocus(focusEvent: React.FocusEvent<SVGElement>, focusedElement: string, elementId?: string) {\n _showCallout(focusEvent, focusedElement, true, elementId);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string, elementId?: string) {\n _showCallout(mouseEvent, hoveredElement, false, elementId);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n elementId?: string,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n const targetElement = elementId\n ? document.getElementById(elementId)\n : (event.currentTarget as unknown as HTMLElement);\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments\n .filter(segment => _noLegendHighlighted() || _legendHighlighted(segment.legend))\n .map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getGaugeChartSegmentLabel(segment, _minValue, _maxValue, props.variant, props.chartValueFormat),\n color: segment.color,\n };\n return yValue;\n });\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setRefSelected(targetElement);\n setCalloutLegend(legend);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setCalloutLegend('');\n setHoverYValues([]);\n if (isBlurEvent) {\n setFocusedElement('');\n }\n }\n\n function _wrapContent(content: string, id: string, maxWidth: number) {\n const textElement = d3Select<SVGTextElement, {}>(`#${id}`);\n textElement.text(content);\n if (!textElement.node()) {\n return false;\n }\n\n let isOverflowing = false;\n let textLength = textElement.node()!.getComputedTextLength();\n while (textLength > maxWidth && content.length > 0) {\n content = content.slice(0, -1);\n textElement.text(content + '...');\n isOverflowing = true;\n textLength = textElement.node()!.getComputedTextLength();\n }\n return isOverflowing;\n }\n\n // TO DO: Write a common functional component for Multi value callout and divide sub count method\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout(calloutProps: any) {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(calloutProps.YValueHover);\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(calloutProps!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {formatToLocaleString(calloutProps!.hoverXValue, props.culture) as React.ReactNode}\n </div>\n </div>\n <div className={classes.calloutInfoContainer} style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {calloutProps!.YValueHover &&\n calloutProps!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const { shouldDrawBorderBottom = false } = yValue;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!calloutProps.descriptionMessage && (\n <div className={classes.descriptionMessage}>{calloutProps.descriptionMessage}</div>\n )}\n </div>\n </div>\n );\n }\n\n function _renderCallout(calloutData?: GaugeChartCalloutData): React.ReactElement | null {\n return calloutData\n ? _multiValueCallout({\n hoverXValue: `Current value is ${calloutData.chartValueLabel}`,\n YValueHover: calloutData.segmentValues,\n })\n : null;\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]) {\n if (yValueHover) {\n return yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n );\n }\n return false;\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = formatToLocaleString(xValue.y, culture) as React.ReactNode;\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{ borderInlineStart: `4px solid ${xValue.color}` }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n style={{ display: 'flex' }}\n />\n )}\n <div>\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY}>\n {\n formatToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data,\n culture,\n ) as React.ReactNode\n }\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {' '}\n {formatToLocaleString(subcountName, culture) as React.ReactNode}\n </div>\n <div className={classes.calloutContentY}>\n {formatToLocaleString(subcounts[subcountName], culture) as React.ReactNode}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const arrowAttributes = useArrowNavigationGroup({ circular: true, axis: 'horizontal' });\n return (\n <div\n className={classes.root}\n ref={el => {\n _rootElem.current = el;\n }}\n >\n <div className={classes.chartWrapper} {...arrowAttributes}>\n <svg\n className={classes.chart}\n width={_width}\n height={_height - _legendsHeight}\n role=\"region\"\n aria-label={_getChartTitle()}\n onMouseLeave={_handleMouseOut}\n >\n <g transform={`translate(${_width / 2}, ${_height - (_margins.bottom + _legendsHeight)})`}>\n {props.chartTitle && (\n <ChartTitle\n title={props.chartTitle}\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n className={classes.chartTitle}\n titleStyles={props.titleStyles}\n tooltipClassName={classes.svgTooltip}\n />\n )}\n {!props.hideMinMax && (\n <>\n <text\n x={(_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"end\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Min value: ${_minValue}`}\n >\n {formatScientificLimitWidth(_minValue)}\n </text>\n <text\n x={(_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET)}\n y={0}\n textAnchor=\"start\"\n className={classes.limits}\n role=\"img\"\n aria-label={`Max value: ${_maxValue}`}\n >\n {formatScientificLimitWidth(_maxValue)}\n </text>\n </>\n )}\n <g role=\"listbox\" aria-label={`${_segments.length} ${_segments.length === 1 ? 'segment' : 'segments'}`}>\n {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n const arcId = `${_gaugeChartId}-arc-${index}`;\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\n id={arcId}\n strokeWidth={focusedElement === segment.legend ? ARC_PADDING : 0}\n className={classes.segment}\n fill={segment.color}\n opacity={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1}\n {...getAccessibleDataObject(\n {\n ariaLabel: getGaugeChartSegmentLabel(\n segment,\n _minValue,\n _maxValue,\n props.variant,\n props.chartValueFormat,\n true,\n ),\n ...segment.accessibilityData,\n },\n 'option',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend, arcId)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend, arcId)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend, arcId)}\n tabIndex={_legendHighlighted(segment.legend) || _noLegendHighlighted() ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\n </g>\n {_renderNeedle()}\n <g\n onMouseEnter={e => _handleMouseOver(e, 'Chart value')}\n onMouseMove={e => _handleMouseOver(e, 'Chart value')}\n >\n <SVGTooltipText\n content={getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)}\n textProps={{\n x: 0,\n y: 0,\n textAnchor: 'middle',\n className: classes.chartValue,\n fontSize: chartValueSize,\n 'aria-hidden': 'true',\n }}\n maxWidth={_innerRadius * 2 - 24}\n wrapContent={_wrapContent}\n />\n </g>\n {props.sublabel && (\n <SVGTooltipText\n content={props.sublabel}\n textProps={{\n x: 0,\n y: 4,\n textAnchor: 'middle',\n dominantBaseline: 'hanging',\n className: classes.sublabel,\n }}\n maxWidth={_innerRadius * 2}\n wrapContent={_wrapContent}\n />\n )}\n </g>\n </svg>\n </div>\n {_renderLegends()}\n {!props.hideTooltip && isPopoverOpen && (\n <ChartPopover\n {...props.calloutProps}\n positioning={{\n target: refSelected,\n }}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout:\n (() => {\n const calloutData: GaugeChartCalloutData = {\n legend: calloutLegend,\n chartTitle: props.chartTitle,\n chartValue: props.chartValue,\n minValue: _minValue,\n maxValue: _maxValue,\n chartValueLabel: getChartValueLabel(\n props.chartValue,\n _minValue,\n _maxValue,\n props.chartValueFormat,\n true,\n ),\n segments: _segments.slice(0, props.segments.length).map(segment => ({ ...segment })),\n segmentValues: hoverYValues,\n };\n\n return props.onRenderCallout\n ? props.onRenderCallout(calloutData, _renderCallout)\n : _renderCallout(calloutData);\n })() ?? undefined,\n }}\n />\n )}\n </div>\n );\n },\n);\nGaugeChart.displayName = 'GaugeChart';\n"],"names":["React","useGaugeChartStyles","select","d3Select","arc","d3Arc","Points","areArraysEqual","formatScientificLimitWidth","getAccessibleDataObject","getColorFromToken","getNextColor","pointTypes","useRtl","ChartTitle","formatToLocaleString","SVGTooltipText","Legends","Shape","useArrowNavigationGroup","useId","ChartPopover","useImageExport","GAUGE_MARGIN","LABEL_WIDTH","LABEL_HEIGHT","LABEL_OFFSET","TITLE_OFFSET","EXTRA_NEEDLE_LENGTH","ARC_PADDING","BREAKPOINTS","minRadius","arcWidth","fontSize","calcNeedleRotation","chartValue","minValue","maxValue","needleRotation","getSegmentLabel","segment","variant","isAriaLabel","legend","size","toFixed","start","end","getChartValueLabel","chartValueFormat","forCallout","getGaugeChartSegmentLabel","startPercentage","endPercentage","GaugeChart","forwardRef","props","forwardedRef","_gaugeChartId","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","chartContainerRef","_rootElem","legendsRef","_legendsRef","componentRef","_isRTL","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","isPopoverOpen","setPopoverOpen","calloutLegend","setCalloutLegend","hoverYValues","setHoverYValues","refSelected","setRefSelected","prevPropsRef","useRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","clientWidth","clientHeight","prevProps","classes","index","length","_processProps","segments","roundCorners","total","processedSegments","map","max","color","accessibilityData","push","arcGenerator","cornerRadius","padAngle","padRadius","rtlSafeSegments","Array","from","reverse","prevAngle","PI","arcs","endAngle","d","innerRadius","outerRadius","startAngle","segmentIndex","_renderNeedle","rtlSafeNeedleRotation","strokeWidth","halfStrokeWidth","needleLength","needleId","g","transform","path","id","className","needle","data-is-focusable","onFocus","e","_handleFocus","onBlur","_handleBlur","onMouseEnter","_handleMouseOver","onMouseMove","role","aria-label","_renderLegends","legends","title","hoverAction","onMouseOutAction","div","legendsContainer","centerLegends","onChange","_onLegendSelectionChange","legendRef","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","elementId","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","targetElement","document","getElementById","currentTarget","filter","yValue","y","isBlurEvent","_wrapContent","content","maxWidth","textElement","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","style","marginBottom","calloutContentX","xAxisCalloutAccessibilityData","hoverXValue","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","_renderCallout","calloutData","chartValueLabel","segmentValues","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutlegendText","calloutContentY","data","subcounts","subcountName","_getChartTitle","arrowAttributes","circular","axis","root","ref","el","chartWrapper","svg","chart","onMouseLeave","x","titleStyles","tooltipClassName","svgTooltip","textAnchor","limits","arcId","Fragment","opacity","ariaLabel","tabIndex","textProps","wrapContent","dominantBaseline","hideTooltip","positioning","target","customCallout","customizedCallout","onRenderCallout","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,kCAA+B;AACnE,SAASC,UAAUC,QAAQ,QAAQ,eAAe;AAClD,SAASC,OAAOC,KAAK,QAAQ,WAAW;AAExC,SACEC,MAAM,EACNC,cAAc,EACdC,0BAA0B,EAC1BC,uBAAuB,EACvBC,iBAAiB,EACjBC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,UAAU,QACL,2BAAwB;AAC/B,SAASC,oBAAoB,QAAQ,4B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1
|
+
{"version":3,"sources":["../../../src/components/GaugeChart/GaugeChart.types.ts"],"sourcesContent":["import type { LegendsProps } from '../Legends/index';\nimport type { AccessibilityProps, Chart } from '../../types/index';\nimport type { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\nimport type { YValueHover } from '../CommonComponents/CartesianChart.types';\nimport type { TitleStyles } from '../../utilities/Common.styles';\nimport type { RenderFunction } from '../../utilities/index';\n\n/**\n * Gauge Chart segment interface.\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartSegment {\n /**\n * Legend text for a segment\n */\n legend: string;\n\n /**\n * Size of the segment\n */\n size: number;\n\n /**\n * Color of the segment\n */\n color?: string;\n\n /**\n * Gradient color of the segment\n */\n gradient?: [string, string];\n\n /**\n * Accessibility data for the segment\n */\n accessibilityData?: AccessibilityProps;\n}\n\n/**\n * {@docCategory GaugeChart}\n */\nexport type GaugeValueFormat = 'percentage' | 'fraction';\n\n/**\n * {@docCategory GaugeChart}\n */\nexport type GaugeChartVariant = 'single-segment' | 'multiple-segments';\n\n/**\n * GaugeChart segment data with its calculated range.\n * {@docCategory GaugeChart}\n */\nexport interface ExtendedSegment extends GaugeChartSegment {\n /**\n * Start of the segment range.\n */\n start: number;\n\n /**\n * End of the segment range.\n */\n end: number;\n}\n\n/**\n * GaugeChart segment data provided to a custom callout renderer.\n * @deprecated Use `ExtendedSegment` instead.\n * {@docCategory GaugeChart}\n */\nexport type GaugeChartCalloutSegment = ExtendedSegment;\n\n/**\n * Data provided to a custom GaugeChart callout renderer.\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartCalloutData {\n /**\n * Legend of the segment or gauge element that opened the callout.\n */\n legend: string;\n\n /**\n * Title of the gauge.\n */\n chartTitle?: string;\n\n /**\n * Current value of the gauge.\n */\n chartValue: number;\n\n /**\n * Minimum value of the gauge.\n */\n minValue: number;\n\n /**\n * Maximum value of the gauge.\n */\n maxValue: number;\n\n /**\n * Formatted current value displayed in the default callout.\n */\n chartValueLabel: string;\n\n /**\n * Gauge segments with their calculated ranges.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- Preserve the public type name for compatibility.\n segments?: GaugeChartCalloutSegment[];\n\n /**\n * Segment values displayed in the default callout.\n */\n segmentValues: YValueHover[];\n}\n\n/**\n * Gauge Chart properties\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartProps {\n /**\n * Title styles configuration for the chart title\n */\n titleStyles?: TitleStyles;\n\n /**\n * Width of the chart\n */\n width?: number;\n\n /**\n * Height of the chart\n */\n height?: number;\n\n /**\n * Title of the chart\n */\n chartTitle?: string;\n\n /**\n * Current value of the gauge\n */\n chartValue: number;\n\n /**\n * Sections of the gauge\n */\n segments: GaugeChartSegment[];\n\n /**\n * Minimum value of the gauge\n * @defaultvalue 0\n */\n minValue?: number;\n\n /**\n * Maximum value of the gauge\n */\n maxValue?: number;\n\n /**\n * Additional text to display below the chart value\n */\n sublabel?: string;\n\n /**\n * Hide the min and max values of the gauge\n * @defaultvalue false\n */\n hideMinMax?: boolean;\n\n /**\n * Format of the chart value\n * A custom formatter applies to the chart value and the current value in the callout.\n * Use `onRenderCallout` to customize units for segment ranges.\n * @defaultvalue GaugeValueFormat.Percentage\n */\n chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string);\n\n /**\n * Decides whether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /*\n * Props for the legends in the chart\n */\n legendProps?: Partial<LegendsProps>;\n\n /**\n * Do not show tooltips in chart\n * @defaultvalue false\n */\n hideTooltip?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: GaugeChartStyles;\n\n /**\n * Defines the culture to localize the numbers and dates\n */\n culture?: string;\n\n /**\n * Props for the callout in the chart\n */\n calloutProps?: Partial<ChartPopoverProps>;\n\n /**\n * Defines a custom callout renderer. The second argument can be used to render the default callout content.\n */\n onRenderCallout?: RenderFunction<GaugeChartCalloutData>;\n\n /**\n * Specifies the variant of GaugeChart to be rendered\n * @defaultvalue GaugeChartVariant.MultipleSegments\n */\n variant?: GaugeChartVariant;\n\n /**\n * Prop to enable the gradient in the chart\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * Prop to enable the round corners in the chart\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Optional callback to access the Chart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.Ref<Chart>;\n}\n\n/**\n * Gauge Chart styles\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartStyles {\n /**\n * Styles for the root element\n */\n root?: string;\n\n /**\n * Styles for the chart\n */\n chart?: string;\n\n /**\n * Styles for the min and max values\n */\n limits?: string;\n\n /**\n * Styles for the chart value\n */\n chartValue?: string;\n\n /**\n * Styles for the sublabel\n */\n sublabel?: string;\n\n /**\n * Styles for the needle\n */\n needle?: string;\n\n /**\n * Styles for the chart title\n */\n chartTitle?: string;\n\n /**\n * Style for SVG tooltip text\n */\n svgTooltip?: string;\n\n /**\n * Styles for the segments\n */\n segment?: string;\n\n /**\n * Styles for gradient segments\n */\n gradientSegment?: string;\n\n /**\n * Styles for the legends container\n */\n legendsContainer?: string;\n\n /**\n * Styles for callout root-content\n */\n calloutContentRoot?: string;\n\n /**\n * Styles for callout x-content\n */\n calloutContentX?: string;\n\n /**\n * Styles for callout y-content\n */\n calloutContentY?: string;\n\n /**\n * Styles for description message\n */\n descriptionMessage?: string;\n\n /**\n * Styles for callout Date time container\n */\n calloutDateTimeContainer?: string;\n\n /**\n * Styles for callout info container\n */\n calloutInfoContainer?: string;\n\n /**\n * Styles for callout block container\n */\n calloutBlockContainer?: string;\n\n /**\n * Styles for callout legend text\n */\n calloutlegendText?: string;\n\n /**\n * Styles for the shape object in the callout\n */\n shapeStyles?: string;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: string;\n}\n"],"names":[],"mappings":"AAqPA;;;CAGC,GACD,WAyGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/GaugeChart/index.ts"],"sourcesContent":["export * from './GaugeChart';\nexport * from './GaugeChart.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAe;AAC7B,cAAc,wBAAqB;AACnC,cAAc,uBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/GaugeChart/useGaugeChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport type { GriffelStyle } from '@griffel/react';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { GaugeChartProps, GaugeChartStyles } from './GaugeChart.types';\nimport { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';\n\nexport const gaugeChartClassNames: SlotClassNames<GaugeChartStyles> = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper',\n svgTooltip: 'fui-gc__svgTooltip',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left',\n },\n chart: {\n display: 'block',\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1,\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n chartTitle: getChartTitleStyles() as GriffelStyle,\n segment: {\n outline: 'none',\n stroke: tokens.colorStrokeFocus2,\n },\n gradientSegment: {\n width: '100%',\n height: '100%',\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity',\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85',\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none',\n },\n shapeStyles: {\n marginRight: '8px',\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto',\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto',\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`,\n },\n legendsContainer: {\n width: '100%',\n },\n});\nexport const useGaugeChartStyles = (props: GaugeChartProps): GaugeChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, props.styles?.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, props.styles?.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, props.styles?.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, props.styles?.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, props.styles?.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, props.styles?.svgTooltip),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, props.styles?.segment),\n gradientSegment: mergeClasses(\n gaugeChartClassNames.gradientSegment,\n baseStyles.gradientSegment,\n props.styles?.gradientSegment,\n ),\n calloutContentRoot: mergeClasses(\n gaugeChartClassNames.calloutContentRoot,\n baseStyles.calloutContentRoot,\n props.styles?.calloutContentRoot,\n ),\n calloutDateTimeContainer: mergeClasses(\n gaugeChartClassNames.calloutDateTimeContainer,\n baseStyles.calloutDateTimeContainer,\n props.styles?.calloutDateTimeContainer,\n ),\n calloutContentX: mergeClasses(\n gaugeChartClassNames.calloutContentX,\n baseStyles.calloutContentX,\n props.styles?.calloutContentX,\n ),\n calloutBlockContainer: mergeClasses(\n gaugeChartClassNames.calloutBlockContainer,\n baseStyles.calloutBlockContainer,\n props.styles?.calloutBlockContainer,\n ),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, props.styles?.shapeStyles),\n calloutlegendText: mergeClasses(\n gaugeChartClassNames.calloutlegendText,\n baseStyles.calloutlegendText,\n props.styles?.calloutlegendText,\n ),\n calloutContentY: mergeClasses(\n gaugeChartClassNames.calloutContentY,\n baseStyles.calloutContentY,\n props.styles?.calloutContentY,\n ),\n descriptionMessage: mergeClasses(\n gaugeChartClassNames.descriptionMessage,\n baseStyles.descriptionMessage,\n props.styles?.descriptionMessage,\n ),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, props.styles?.chartWrapper),\n legendsContainer: mergeClasses(\n gaugeChartClassNames.legendsContainer,\n baseStyles.legendsContainer,\n props.styles?.legendsContainer,\n ),\n };\n};\n"],"names":["tokens","typographyStyles","makeStyles","mergeClasses","getChartTitleStyles","HighContrastSelector","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","svgTooltip","useStyles","body1","display","flexDirection","alignItems","width","height","textAlign","caption1Strong","fill","colorNeutralForeground1","forcedColorAdjust","fontWeight","fontWeightSemibold","stroke","colorNeutralBackground1","outline","colorStrokeFocus2","overflow","backgroundColor","backgroundBlendMode","justifyContent","caption1","lineHeight","opacity","body1Strong","marginTop","color","paddingLeft","marginRight","colorNeutralForeground2","paddingTop","borderTop","colorNeutralStroke1","useGaugeChartStyles","props","baseStyles","styles"],"mappings":"AAAA;AAEA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAGjE,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE1D,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,2BAAwB;AAElF,OAAO,MAAMC,uBAAyD;IACpEC,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,YAAY;IACZC,SAAS;IACTC,iBAAiB;IACjBC,oBAAoB;IACpBC,0BAA0B;IAC1BC,iBAAiB;IACjBC,uBAAuB;IACvBC,aAAa;IACbC,mBAAmB;IACnBC,iBAAiB;IACjBC,oBAAoB;IACpBC,sBAAsB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AAZF,sCAAAA,gBAAc3C,WAAW;QAC7GC,mBAAmBlB,aACjBG,qBAAqBe,iBAAiB,EACtC2C,WAAW3C,iBAAiB,GAC5B0C,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAc1C,iBAAiB;QAEjCC,iBAAiBnB,aACfG,qBAAqBgB,eAAe,EACpC0C,WAAW1C,eAAe,GAC1ByC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAczC,eAAe;QAE/BC,oBAAoBpB,aAClBG,qBAAqBiB,kBAAkB,EACvCyC,WAAWzC,kBAAkB,GAC7BwC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcxC,kBAAkB;QAElCG,cAAcvB,aAAaG,qBAAqBoB,YAAY,GAAEqC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAAcrC,YAAY;QACxFD,kBAAkBtB,aAChBG,qBAAqBmB,gBAAgB,EACrCuC,WAAWvC,gBAAgB,GAC3BsC,kBAAAA,MAAME,MAAM,cAAZF,sCAAAA,gBAActC,gBAAgB;IAElC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/GaugeChart/useGaugeChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport type { GriffelStyle } from '@griffel/react';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { GaugeChartProps, GaugeChartStyles } from './GaugeChart.types';\nimport { getChartTitleStyles, HighContrastSelector } from '../../utilities/index';\n\nexport const gaugeChartClassNames: SlotClassNames<GaugeChartStyles> = {\n root: 'fui-gc__root',\n chart: 'fui-gc__chart',\n limits: 'fui-gc__limits',\n chartValue: 'fui-gc__chartValue',\n sublabel: 'fui-gc__sublabel',\n needle: 'fui-gc__needle',\n chartTitle: 'fui-gc__chartTitle',\n segment: 'fui-gc__segment',\n gradientSegment: 'fui-gc__gradientSegment',\n calloutContentRoot: 'fui-gc__calloutContentRoot',\n calloutDateTimeContainer: 'fui-gc__calloutDateTimeContainer',\n calloutContentX: 'fui-gc__calloutContentX',\n calloutBlockContainer: 'fui-gc__calloutBlockContainer',\n shapeStyles: 'fui-gc__shapeStyles',\n calloutlegendText: 'fui-gc__calloutlegendText',\n calloutContentY: 'fui-gc__calloutContentY',\n descriptionMessage: 'fui-gc__descriptionMessage',\n calloutInfoContainer: '',\n legendsContainer: 'fui-gc__legendsContainer',\n chartWrapper: 'fui-gc__chartWrapper',\n svgTooltip: 'fui-gc__svgTooltip',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n textAlign: 'left',\n },\n chart: {\n display: 'block',\n },\n limits: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n chartValue: {\n fontWeight: tokens.fontWeightSemibold,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n sublabel: {\n ...typographyStyles.caption1Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n needle: {\n fill: tokens.colorNeutralForeground1,\n stroke: tokens.colorNeutralBackground1,\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n chartTitle: getChartTitleStyles() as GriffelStyle,\n segment: {\n outline: 'none',\n stroke: tokens.colorStrokeFocus2,\n },\n gradientSegment: {\n width: '100%',\n height: '100%',\n },\n calloutContentRoot: {\n display: 'grid',\n overflow: 'hidden',\n backgroundColor: tokens.colorNeutralBackground1,\n backgroundBlendMode: 'normal, luminosity',\n },\n calloutDateTimeContainer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n calloutContentX: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n opacity: '0.85',\n },\n calloutBlockContainer: {\n ...typographyStyles.body1Strong,\n marginTop: '13px',\n color: tokens.colorNeutralForeground1,\n paddingLeft: '8px',\n display: 'block',\n forcedColorAdjust: 'none',\n },\n shapeStyles: {\n marginRight: '8px',\n },\n calloutlegendText: {\n ...typographyStyles.caption1,\n lineHeight: '16px',\n color: tokens.colorNeutralForeground2,\n forcedColorAdjust: 'auto',\n },\n calloutContentY: {\n ...typographyStyles.body1Strong,\n lineHeight: '22px',\n forcedColorAdjust: 'auto',\n },\n descriptionMessage: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n marginTop: '10px',\n paddingTop: '10px',\n borderTop: `1px solid ${tokens.colorNeutralStroke1}`,\n },\n legendsContainer: {\n width: '100%',\n },\n});\nexport const useGaugeChartStyles = (props: GaugeChartProps): GaugeChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(gaugeChartClassNames.root, baseStyles.root, props.styles?.root),\n chart: mergeClasses(gaugeChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n limits: mergeClasses(gaugeChartClassNames.limits, baseStyles.limits, props.styles?.limits),\n chartValue: mergeClasses(gaugeChartClassNames.chartValue, baseStyles.chartValue, props.styles?.chartValue),\n sublabel: mergeClasses(gaugeChartClassNames.sublabel, baseStyles.sublabel, props.styles?.sublabel),\n needle: mergeClasses(gaugeChartClassNames.needle, baseStyles.needle, props.styles?.needle),\n chartTitle: mergeClasses(gaugeChartClassNames.chartTitle, baseStyles.chartTitle, props.styles?.chartTitle),\n svgTooltip: mergeClasses(gaugeChartClassNames.svgTooltip, baseStyles.svgTooltip, props.styles?.svgTooltip),\n segment: mergeClasses(gaugeChartClassNames.segment, baseStyles.segment, props.styles?.segment),\n gradientSegment: mergeClasses(\n gaugeChartClassNames.gradientSegment,\n baseStyles.gradientSegment,\n props.styles?.gradientSegment,\n ),\n calloutContentRoot: mergeClasses(\n gaugeChartClassNames.calloutContentRoot,\n baseStyles.calloutContentRoot,\n props.styles?.calloutContentRoot,\n ),\n calloutDateTimeContainer: mergeClasses(\n gaugeChartClassNames.calloutDateTimeContainer,\n baseStyles.calloutDateTimeContainer,\n props.styles?.calloutDateTimeContainer,\n ),\n calloutContentX: mergeClasses(\n gaugeChartClassNames.calloutContentX,\n baseStyles.calloutContentX,\n props.styles?.calloutContentX,\n ),\n calloutBlockContainer: mergeClasses(\n gaugeChartClassNames.calloutBlockContainer,\n baseStyles.calloutBlockContainer,\n props.styles?.calloutBlockContainer,\n ),\n shapeStyles: mergeClasses(gaugeChartClassNames.shapeStyles, baseStyles.shapeStyles, props.styles?.shapeStyles),\n calloutlegendText: mergeClasses(\n gaugeChartClassNames.calloutlegendText,\n baseStyles.calloutlegendText,\n props.styles?.calloutlegendText,\n ),\n calloutContentY: mergeClasses(\n gaugeChartClassNames.calloutContentY,\n baseStyles.calloutContentY,\n props.styles?.calloutContentY,\n ),\n descriptionMessage: mergeClasses(\n gaugeChartClassNames.descriptionMessage,\n baseStyles.descriptionMessage,\n props.styles?.descriptionMessage,\n ),\n chartWrapper: mergeClasses(gaugeChartClassNames.chartWrapper, props.styles?.chartWrapper),\n legendsContainer: mergeClasses(\n gaugeChartClassNames.legendsContainer,\n baseStyles.legendsContainer,\n props.styles?.legendsContainer,\n ),\n };\n};\n"],"names":["tokens","typographyStyles","makeStyles","mergeClasses","getChartTitleStyles","HighContrastSelector","gaugeChartClassNames","root","chart","limits","chartValue","sublabel","needle","chartTitle","segment","gradientSegment","calloutContentRoot","calloutDateTimeContainer","calloutContentX","calloutBlockContainer","shapeStyles","calloutlegendText","calloutContentY","descriptionMessage","calloutInfoContainer","legendsContainer","chartWrapper","svgTooltip","useStyles","body1","display","flexDirection","alignItems","width","height","textAlign","caption1Strong","fill","colorNeutralForeground1","forcedColorAdjust","fontWeight","fontWeightSemibold","stroke","colorNeutralBackground1","outline","colorStrokeFocus2","overflow","backgroundColor","backgroundBlendMode","justifyContent","caption1","lineHeight","opacity","body1Strong","marginTop","color","paddingLeft","marginRight","colorNeutralForeground2","paddingTop","borderTop","colorNeutralStro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
|
|
16
16
|
const MIN_BAR_HEIGHT = 1;
|
|
17
17
|
export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, forwardedRef)=>{
|
|
18
|
+
var _ref;
|
|
18
19
|
var _props_legendProps, _props_legendProps1, _barData_, _lineData__data_, _lineData_;
|
|
19
20
|
const props = {
|
|
20
21
|
xAxisCategoryOrder: 'default',
|
|
@@ -96,6 +97,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
96
97
|
});
|
|
97
98
|
});
|
|
98
99
|
barData.forEach((point, index)=>{
|
|
100
|
+
var _linePointsByX_point_name;
|
|
99
101
|
const barPointsByLegend = Object.create(null);
|
|
100
102
|
const legendToBarPoint = Object.create(null);
|
|
101
103
|
point.series.forEach((seriesPoint)=>{
|
|
@@ -115,7 +117,6 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
115
117
|
legendToBarPoint[seriesPoint.legend].data += seriesPoint.data;
|
|
116
118
|
}
|
|
117
119
|
});
|
|
118
|
-
var _linePointsByX_point_name;
|
|
119
120
|
datasetForBars.push({
|
|
120
121
|
barPointsByLegend,
|
|
121
122
|
xAxisPoint: point.name,
|
|
@@ -202,13 +203,13 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
202
203
|
dataV2.forEach((series)=>{
|
|
203
204
|
if (series.type === 'bar') {
|
|
204
205
|
series.data.forEach((point)=>{
|
|
206
|
+
var _series_key, _point_color;
|
|
205
207
|
if (!barPointsByX[point.x]) {
|
|
206
208
|
barPointsByX[point.x] = {
|
|
207
209
|
name: point.x,
|
|
208
210
|
series: []
|
|
209
211
|
};
|
|
210
212
|
}
|
|
211
|
-
var _series_key, _point_color;
|
|
212
213
|
barPointsByX[point.x].series.push({
|
|
213
214
|
key: (_series_key = series.key) !== null && _series_key !== void 0 ? _series_key : series.legend,
|
|
214
215
|
data: point.y,
|
|
@@ -231,6 +232,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
231
232
|
};
|
|
232
233
|
};
|
|
233
234
|
const _prepareChartData = ()=>{
|
|
235
|
+
var _ref, _ref1;
|
|
234
236
|
let barData = props.data;
|
|
235
237
|
let lineData;
|
|
236
238
|
if (Array.isArray(props.dataV2) && props.dataV2.length > 0) {
|
|
@@ -238,14 +240,14 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
238
240
|
}
|
|
239
241
|
_legendColorMap = Object.create(null);
|
|
240
242
|
let colorIndex = 0;
|
|
241
|
-
var _barData_map, _lineData_map;
|
|
242
243
|
return {
|
|
243
|
-
barData: (
|
|
244
|
+
barData: (_ref = barData === null || barData === void 0 ? void 0 : barData.map((point)=>{
|
|
245
|
+
var _ref;
|
|
244
246
|
var _point_series;
|
|
245
|
-
var _point_series_map;
|
|
246
247
|
return {
|
|
247
248
|
...point,
|
|
248
|
-
series: (
|
|
249
|
+
series: (_ref = (_point_series = point.series) === null || _point_series === void 0 ? void 0 : _point_series.map((seriesPoint)=>{
|
|
250
|
+
var _seriesPoint_color;
|
|
249
251
|
// TODO: Add support for gradient colors
|
|
250
252
|
const startColor = seriesPoint.color ? seriesPoint.color : getNextColor(colorIndex, 0);
|
|
251
253
|
const endColor = startColor;
|
|
@@ -256,15 +258,14 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
256
258
|
];
|
|
257
259
|
}
|
|
258
260
|
colorIndex += 1;
|
|
259
|
-
var _seriesPoint_color;
|
|
260
261
|
return {
|
|
261
262
|
...seriesPoint,
|
|
262
263
|
color: (_seriesPoint_color = seriesPoint.color) !== null && _seriesPoint_color !== void 0 ? _seriesPoint_color : _legendColorMap[seriesPoint.legend][0]
|
|
263
264
|
};
|
|
264
|
-
})) !== null &&
|
|
265
|
+
})) !== null && _ref !== void 0 ? _ref : []
|
|
265
266
|
};
|
|
266
|
-
})) !== null &&
|
|
267
|
-
lineData: (
|
|
267
|
+
})) !== null && _ref !== void 0 ? _ref : [],
|
|
268
|
+
lineData: (_ref1 = lineData === null || lineData === void 0 ? void 0 : lineData.map((series)=>{
|
|
268
269
|
let lineColor;
|
|
269
270
|
if (typeof series.color === 'undefined') {
|
|
270
271
|
lineColor = getNextColor(colorIndex, 0);
|
|
@@ -282,7 +283,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
282
283
|
...series,
|
|
283
284
|
color: _legendColorMap[series.legend][0]
|
|
284
285
|
};
|
|
285
|
-
})) !== null &&
|
|
286
|
+
})) !== null && _ref1 !== void 0 ? _ref1 : []
|
|
286
287
|
};
|
|
287
288
|
};
|
|
288
289
|
const _getOrderedXAxisLabels = (barData, lineData)=>{
|
|
@@ -312,8 +313,7 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
312
313
|
return categoryToValues;
|
|
313
314
|
};
|
|
314
315
|
const { barData, lineData } = _prepareChartData();
|
|
315
|
-
|
|
316
|
-
const firstXValue = (_barData__name = (_barData_ = barData[0]) === null || _barData_ === void 0 ? void 0 : _barData_.name) !== null && _barData__name !== void 0 ? _barData__name : (_lineData_ = lineData[0]) === null || _lineData_ === void 0 ? void 0 : (_lineData__data_ = _lineData_.data[0]) === null || _lineData__data_ === void 0 ? void 0 : _lineData__data_.x;
|
|
316
|
+
const firstXValue = (_ref = (_barData_ = barData[0]) === null || _barData_ === void 0 ? void 0 : _barData_.name) !== null && _ref !== void 0 ? _ref : (_lineData_ = lineData[0]) === null || _lineData_ === void 0 ? void 0 : (_lineData__data_ = _lineData_.data[0]) === null || _lineData__data_ === void 0 ? void 0 : _lineData__data_.x;
|
|
317
317
|
const _xAxisType = isInvalidValue(firstXValue) ? XAxisTypes.StringAxis : getTypeOfAxis(firstXValue, true);
|
|
318
318
|
const { barLegends, lineLegends, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(barData, lineData);
|
|
319
319
|
_barLegends = barLegends;
|
|
@@ -429,8 +429,8 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
429
429
|
_barLegends.forEach((legendTitle, legendIndex)=>{
|
|
430
430
|
const barPoints = singleSet.barPointsByLegend[legendTitle];
|
|
431
431
|
if (barPoints) {
|
|
432
|
-
const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
|
|
433
432
|
var _localScale;
|
|
433
|
+
const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
|
|
434
434
|
const xPoint = ((_localScale = localScale(legendTitle)) !== null && _localScale !== void 0 ? _localScale : 0) + (localScale.bandwidth() - _barWidth) / 2;
|
|
435
435
|
const isLegendActive = _legendHighlighted(legendTitle) || _noLegendHighlighted();
|
|
436
436
|
const barOpacity = isLegendActive ? '' : '0.1';
|
|
@@ -643,12 +643,13 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
643
643
|
const x2 = scaleLineX(point.x);
|
|
644
644
|
const y2 = yScale(point.y);
|
|
645
645
|
if (pointIdx > 0) {
|
|
646
|
+
var _ref, _ref1;
|
|
646
647
|
var _series_lineOptions, _series_lineOptions1, _series_lineOptions2;
|
|
647
648
|
const x1 = scaleLineX(series.data[pointIdx - 1].x);
|
|
648
649
|
const y1 = yScale(series.data[pointIdx - 1].y);
|
|
649
650
|
if (lineBorderWidth > 0) {
|
|
651
|
+
var _ref2;
|
|
650
652
|
var _series_lineOptions3;
|
|
651
|
-
var _series_lineOptions_lineBorderColor;
|
|
652
653
|
lineBorderGroup.push(/*#__PURE__*/ React.createElement("line", {
|
|
653
654
|
key: `lineBorder-${seriesIdx}-${pointIdx}`,
|
|
654
655
|
x1: x1,
|
|
@@ -656,13 +657,12 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
656
657
|
x2: x2,
|
|
657
658
|
y2: y2,
|
|
658
659
|
fill: "transparent",
|
|
659
|
-
stroke: (
|
|
660
|
+
stroke: (_ref2 = (_series_lineOptions3 = series.lineOptions) === null || _series_lineOptions3 === void 0 ? void 0 : _series_lineOptions3.lineBorderColor) !== null && _ref2 !== void 0 ? _ref2 : tokens.colorNeutralBackground1,
|
|
660
661
|
strokeWidth: 3 + lineBorderWidth * 2,
|
|
661
662
|
strokeLinecap: "round",
|
|
662
663
|
opacity: shouldHighlight ? 1 : 0.1
|
|
663
664
|
}));
|
|
664
665
|
}
|
|
665
|
-
var _series_lineOptions_strokeWidth, _series_lineOptions_strokeLinecap;
|
|
666
666
|
lineGroup.push(/*#__PURE__*/ React.createElement("line", {
|
|
667
667
|
key: `line-${seriesIdx}-${pointIdx}`,
|
|
668
668
|
x1: x1,
|
|
@@ -670,8 +670,8 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
670
670
|
x2: x2,
|
|
671
671
|
y2: y2,
|
|
672
672
|
stroke: series.color,
|
|
673
|
-
strokeWidth: (
|
|
674
|
-
strokeLinecap: (
|
|
673
|
+
strokeWidth: (_ref = (_series_lineOptions = series.lineOptions) === null || _series_lineOptions === void 0 ? void 0 : _series_lineOptions.strokeWidth) !== null && _ref !== void 0 ? _ref : 3,
|
|
674
|
+
strokeLinecap: (_ref1 = (_series_lineOptions1 = series.lineOptions) === null || _series_lineOptions1 === void 0 ? void 0 : _series_lineOptions1.strokeLinecap) !== null && _ref1 !== void 0 ? _ref1 : 'round',
|
|
675
675
|
strokeDasharray: (_series_lineOptions2 = series.lineOptions) === null || _series_lineOptions2 === void 0 ? void 0 : _series_lineOptions2.strokeDasharray,
|
|
676
676
|
opacity: shouldHighlight ? 1 : 0.1,
|
|
677
677
|
onMouseOver: (e)=>_onLineHover(e, series, seriesIdx, pointIdx, scaleLineX),
|
|
@@ -751,17 +751,16 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((_props, f
|
|
|
751
751
|
};
|
|
752
752
|
const _showCallout = (target, pointData, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
753
753
|
groupData, _activeLinePoint = '')=>{
|
|
754
|
+
var _pointData_xAxisCalloutData, _pointData_xAxisCalloutData1;
|
|
754
755
|
setPopoverTarget(target);
|
|
755
756
|
setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
|
|
756
757
|
setCalloutLegend(pointData.legend);
|
|
757
758
|
setDataForHoverCard(pointData.data);
|
|
758
759
|
setColor(pointData.color);
|
|
759
|
-
var _pointData_xAxisCalloutData;
|
|
760
760
|
setXCalloutValue((_pointData_xAxisCalloutData = pointData.xAxisCalloutData) !== null && _pointData_xAxisCalloutData !== void 0 ? _pointData_xAxisCalloutData : groupData.xAxisPoint);
|
|
761
761
|
setYCalloutValue(pointData.yAxisCalloutData);
|
|
762
762
|
setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
|
|
763
763
|
setYValueHover(groupData.groupSeries.filter((item)=>_noLegendHighlighted() || _legendHighlighted(item.legend)));
|
|
764
|
-
var _pointData_xAxisCalloutData1;
|
|
765
764
|
setHoverXValue((_pointData_xAxisCalloutData1 = pointData.xAxisCalloutData) !== null && _pointData_xAxisCalloutData1 !== void 0 ? _pointData_xAxisCalloutData1 : groupData.xAxisPoint);
|
|
766
765
|
setActiveLinePoint(props.isCalloutForStack ? groupData.xAxisPoint : _activeLinePoint);
|
|
767
766
|
};
|