@fluentui/react-charts 9.1.9 → 9.1.10
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 +21 -2
- package/dist/index.d.ts +309 -8
- package/lib/AreaChart.js.map +1 -1
- package/lib/CartesianChart.js.map +1 -1
- package/lib/DeclarativeChart.js.map +1 -1
- package/lib/DonutChart.js.map +1 -1
- package/lib/FunnelChart.js +1 -0
- package/lib/FunnelChart.js.map +1 -0
- package/lib/GanttChart.js +1 -0
- package/lib/GanttChart.js.map +1 -0
- package/lib/GaugeChart.js.map +1 -1
- package/lib/GroupedVerticalBarChart.js.map +1 -1
- package/lib/HeatMapChart.js.map +1 -1
- package/lib/HorizontalBarChart.js.map +1 -1
- package/lib/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/Legends.js.map +1 -1
- package/lib/LineChart.js.map +1 -1
- package/lib/Popover.js.map +1 -1
- package/lib/ResponsiveContainer.js.map +1 -1
- package/lib/SankeyChart.js.map +1 -1
- package/lib/ScatterChart.js.map +1 -1
- package/lib/Sparkline.js.map +1 -1
- package/lib/VerticalBarChart.js.map +1 -1
- package/lib/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +13 -5
- 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/CommonComponents/CartesianChart.js +10 -7
- 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.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/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +5 -5
- 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/DonutChart.js +7 -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/index.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +391 -0
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js +1 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib/components/FunnelChart/funnelGeometry.js +220 -0
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib/components/FunnelChart/index.js +2 -0
- package/lib/components/FunnelChart/index.js.map +1 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +59 -0
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.js +530 -0
- package/lib/components/GanttChart/GanttChart.js.map +1 -0
- package/lib/components/GanttChart/GanttChart.types.js +4 -0
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib/components/GanttChart/index.js +2 -0
- package/lib/components/GanttChart/index.js.map +1 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +25 -0
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- 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/GroupedVerticalBarChart/GroupedVerticalBarChart.js +10 -5
- 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/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/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +5 -3
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -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/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js +3 -3
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +14 -7
- 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 +2 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +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/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/ScatterChart/ScatterChart.js +8 -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/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/VerticalBarChart/VerticalBarChart.js +10 -4
- 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/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -4
- 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/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/types/DataPoint.js +3 -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/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 +12 -0
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data.js +236 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +90 -22
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js +2 -2
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/AreaChart.js.map +1 -1
- package/lib-commonjs/CartesianChart.js.map +1 -1
- package/lib-commonjs/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/DonutChart.js.map +1 -1
- package/lib-commonjs/FunnelChart.js +6 -0
- package/lib-commonjs/FunnelChart.js.map +1 -0
- package/lib-commonjs/GanttChart.js +6 -0
- package/lib-commonjs/GanttChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js.map +1 -1
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/HeatMapChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/Legends.js.map +1 -1
- package/lib-commonjs/LineChart.js.map +1 -1
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/SankeyChart.js.map +1 -1
- package/lib-commonjs/ScatterChart.js.map +1 -1
- package/lib-commonjs/Sparkline.js.map +1 -1
- package/lib-commonjs/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +13 -5
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib-commonjs/components/AreaChart/index.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +9 -6
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +5 -5
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +7 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/index.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +402 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +6 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +248 -0
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/index.js +7 -0
- package/lib-commonjs/components/FunnelChart/index.js.map +1 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +79 -0
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js +541 -0
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +7 -0
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -0
- package/lib-commonjs/components/GanttChart/index.js +7 -0
- package/lib-commonjs/components/GanttChart/index.js.map +1 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +39 -0
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +10 -5
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +3 -3
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Legends/index.js.map +1 -1
- package/lib-commonjs/components/Legends/shape.js +2 -2
- package/lib-commonjs/components/Legends/shape.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +14 -7
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +2 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-commonjs/components/LineChart/index.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +8 -2
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib-commonjs/components/Sparkline/index.js.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +10 -4
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -4
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +2 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js +3 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/types/EventAnnotation.js.map +1 -1
- package/lib-commonjs/types/LegendDataItem.js.map +1 -1
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/async-utils.js.map +1 -1
- package/lib-commonjs/utilities/colors.js +18 -0
- package/lib-commonjs/utilities/colors.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -1
- package/lib-commonjs/utilities/string.js.map +1 -1
- package/lib-commonjs/utilities/test-data.js +245 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +86 -17
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.js +2 -2
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/export const ganttClassNames = {
|
|
4
|
+
root: '',
|
|
5
|
+
xAxis: '',
|
|
6
|
+
yAxis: '',
|
|
7
|
+
legendContainer: '',
|
|
8
|
+
hover: '',
|
|
9
|
+
descriptionMessage: '',
|
|
10
|
+
tooltip: '',
|
|
11
|
+
axisTitle: '',
|
|
12
|
+
chartTitle: '',
|
|
13
|
+
opacityChangeOnHover: '',
|
|
14
|
+
shapeStyles: '',
|
|
15
|
+
chartWrapper: '',
|
|
16
|
+
svgTooltip: '',
|
|
17
|
+
chart: ''
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Apply styling to the GanttChart component
|
|
21
|
+
*/
|
|
22
|
+
export const useGanttChartStyles = props => {
|
|
23
|
+
return {};
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useGanttChartStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ganttClassNames","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","tooltip","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","useGanttChartStyles","props"],"sources":["useGanttChartStyles.styles.js"],"sourcesContent":["/**\n * @internal\n */ export const ganttClassNames = {\n root: '',\n xAxis: '',\n yAxis: '',\n legendContainer: '',\n hover: '',\n descriptionMessage: '',\n tooltip: '',\n axisTitle: '',\n chartTitle: '',\n opacityChangeOnHover: '',\n shapeStyles: '',\n chartWrapper: '',\n svgTooltip: '',\n chart: ''\n};\n/**\n * Apply styling to the GanttChart component\n */ export const useGanttChartStyles = (props)=>{\n return {};\n};\n"],"mappings":"AAAA;AACA;AACA,GAAI,OAAO,MAAMA,eAAe,GAAG;EAC/BC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,KAAK,EAAE,EAAE;EACTC,eAAe,EAAE,EAAE;EACnBC,KAAK,EAAE,EAAE;EACTC,kBAAkB,EAAE,EAAE;EACtBC,OAAO,EAAE,EAAE;EACXC,SAAS,EAAE,EAAE;EACbC,UAAU,EAAE,EAAE;EACdC,oBAAoB,EAAE,EAAE;EACxBC,WAAW,EAAE,EAAE;EACfC,YAAY,EAAE,EAAE;EAChBC,UAAU,EAAE,EAAE;EACdC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,mBAAmB,GAAIC,KAAK,IAAG;EAC5C,OAAO,CAAC,CAAC;AACb,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GaugeChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatScientificLimitWidth,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport { Legend, LegendShape, Legends, Shape } from '../Legends/index';\nimport { GaugeChartVariant, GaugeValueFormat, GaugeChartProps, GaugeChartSegment } from './GaugeChart.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\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) => {\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) => {\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 (forCallout) {\n // When displaying the chart value as a percentage, use fractions in the callout, and vice versa.\n // This helps clarify the actual value and avoid repetition.\n return minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${((chartValue / maxValue) * 100).toFixed()}%`\n : `${chartValue}/${maxValue}`;\n }\n\n return typeof chartValueFormat === 'function'\n ? chartValueFormat([chartValue - minValue, maxValue - minValue])\n : minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${chartValue}/${maxValue}`\n : `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport interface ExtendedSegment extends GaugeChartSegment {\n start: number;\n end: number;\n}\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\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 _rootElem = React.useRef<HTMLDivElement | null>(null);\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\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 React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\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 // eslint-disable-next-line @typescript-eslint/no-shadow\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\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 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')}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle')}\n onMouseMove={e => _handleMouseOver(e, 'Needle')}\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 // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\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) {\n _showCallout(focusEvent, focusedElement, true);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string) {\n _showCallout(mouseEvent, hoveredElement, false);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const target = event.currentTarget as HTMLElement | SVGElement;\n if (target && 'getBoundingClientRect' in target) {\n const boundingRect = target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n }\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverXValue: string =\n 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments.map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),\n color: segment.color,\n };\n return yValue;\n });\n _updatePosition(clientX, clientY);\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setHoverXValue(hoverXValue);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setHoverXValue('');\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 _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 _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const focusAttributes = useFocusableGroup();\n return (\n <div className={classes.root} ref={el => (_rootElem.current = el)}>\n <div className={classes.chartWrapper} {...focusAttributes}>\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 <text\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n textAnchor=\"middle\"\n className={classes.chartTitle}\n aria-hidden={true}\n >\n {props.chartTitle}\n </text>\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 {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\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: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),\n ...segment.accessibilityData,\n },\n 'img',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend)}\n data-is-focusable={_legendHighlighted(segment.legend) || _noLegendHighlighted()}\n tabIndex={segment.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\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 clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout: _multiValueCallout({ hoverXValue: hoverXValue, YValueHover: hoverYValues }),\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","formatToLocaleString","SVGTooltipText","Legends","Shape","useFocusableGroup","ChartPopover","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","toString","GaugeChart","forwardRef","props","forwardedRef","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","_rootElem","useRef","_isRTL","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","hoverXValue","setHoverXValue","hoverYValues","setHoverYValues","prevPropsRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","clientWidth","clientHeight","prevProps","useImperativeHandle","componentRef","chartContainer","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","g","transform","path","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","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","clientX","clientY","target","currentTarget","boundingRect","getBoundingClientRect","yValue","_updatePosition","isBlurEvent","_wrapContent","content","id","maxWidth","textElement","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","style","marginBottom","calloutContentX","xAxisCalloutAccessibilityData","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutlegendText","calloutContentY","data","subcounts","subcountName","newX","newY","threshold","distance","sqrt","pow","_getChartTitle","focusAttributes","root","ref","el","chartWrapper","svg","chart","onMouseLeave","textAnchor","aria-hidden","limits","Fragment","opacity","ariaLabel","tabIndex","textProps","wrapContent","dominantBaseline","hideTooltip","customCallout","customizedCallout","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,+BAA+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,QACD,wBAAwB;AAC/B,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAA8BC,OAAO,EAAEC,KAAK,QAAQ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ACA+I,UAAUtG,eAAe;QACzBgL,aAAa7E;WAMtBnC,kBACA,CAAC9G,MAAMgO,WAAW,IAAIhM,+BACrB,oBAAChE;QACE,GAAGgC,MAAM4J,YAAY;QACtBhI,eAAeA;QACfI,eAAeA;QACfiM,eAAe;YACbC,mBAAmBvE,mBAAmB;gBAAEzH,aAAaA;gBAAa6H,aAAa3H;YAAa;QAC9F;;AAKV,GACA;AACFtC,WAAWqO,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["GaugeChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGaugeChartStyles } from './useGaugeChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { arc as d3Arc } from 'd3-shape';\nimport { YValueHover } from '../../index';\nimport {\n Points,\n areArraysEqual,\n formatScientificLimitWidth,\n getAccessibleDataObject,\n getColorFromToken,\n getNextColor,\n pointTypes,\n useRtl,\n} from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { SVGTooltipText } from '../../utilities/SVGTooltipText';\nimport { Legend, LegendShape, Legends, Shape } from '../Legends/index';\nimport { GaugeChartVariant, GaugeValueFormat, GaugeChartProps, GaugeChartSegment } from './GaugeChart.types';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { ChartPopover } from '../CommonComponents/ChartPopover';\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) => {\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) => {\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 (forCallout) {\n // When displaying the chart value as a percentage, use fractions in the callout, and vice versa.\n // This helps clarify the actual value and avoid repetition.\n return minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${((chartValue / maxValue) * 100).toFixed()}%`\n : `${chartValue}/${maxValue}`;\n }\n\n return typeof chartValueFormat === 'function'\n ? chartValueFormat([chartValue - minValue, maxValue - minValue])\n : minValue !== 0\n ? chartValue.toString()\n : chartValueFormat === 'fraction'\n ? `${chartValue}/${maxValue}`\n : `${((chartValue / maxValue) * 100).toFixed()}%`;\n};\n\ninterface YValue extends Omit<YValueHover, 'y'> {\n y?: string | number;\n}\nexport interface ExtendedSegment extends GaugeChartSegment {\n start: number;\n end: number;\n}\n\nexport const GaugeChart: React.FunctionComponent<GaugeChartProps> = React.forwardRef<HTMLDivElement, GaugeChartProps>(\n (props, forwardedRef) => {\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 _rootElem = React.useRef<HTMLDivElement | null>(null);\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState(false);\n const [hoverXValue, setHoverXValue] = React.useState<string | number>('');\n const [hoverYValues, setHoverYValues] = React.useState<YValue[]>([]);\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 React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n }),\n [],\n );\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 // eslint-disable-next-line @typescript-eslint/no-shadow\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\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 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')}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, 'Needle')}\n onMouseMove={e => _handleMouseOver(e, 'Needle')}\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 // eslint-disable-next-line react/jsx-no-bind\n onChange={_onLegendSelectionChange}\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) {\n _showCallout(focusEvent, focusedElement, true);\n }\n\n function _handleBlur() {\n _hideCallout(true);\n }\n\n function _handleMouseOver(mouseEvent: React.MouseEvent<SVGElement>, hoveredElement: string) {\n _showCallout(mouseEvent, hoveredElement, false);\n }\n\n function _handleMouseOut() {\n _hideCallout(false);\n }\n\n function _handleCalloutDismiss() {\n _hideCallout(false);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _showCallout(\n event: React.MouseEvent<SVGElement, MouseEvent> | React.FocusEvent<SVGElement, Element>,\n legend: string,\n isFocusEvent: boolean,\n ) {\n if (_calloutAnchor === legend) {\n return;\n }\n let clientX = 0;\n let clientY = 0;\n if ('clientX' in event) {\n clientX = event.clientX;\n clientY = event.clientY;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const target = event.currentTarget as HTMLElement | SVGElement;\n if (target && 'getBoundingClientRect' in target) {\n const boundingRect = target.getBoundingClientRect();\n clientX = boundingRect.left + boundingRect.width / 2;\n clientY = boundingRect.top + boundingRect.height / 2;\n }\n }\n _calloutAnchor = legend;\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverXValue: string =\n 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const hoverYValues: YValue[] = _segments.map(segment => {\n const yValue: YValue = {\n legend: segment.legend,\n y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),\n color: segment.color,\n };\n return yValue;\n });\n _updatePosition(clientX, clientY);\n setPopoverOpen(\n ['Needle', 'Chart value'].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend),\n );\n setHoverXValue(hoverXValue);\n setHoverYValues(hoverYValues);\n if (isFocusEvent) {\n setFocusedElement(legend);\n }\n }\n\n function _hideCallout(isBlurEvent?: boolean) {\n _calloutAnchor = '';\n setPopoverOpen(false);\n setHoverXValue('');\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 _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 _updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n function _getChartTitle(): string {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;\n }\n const { arcs } = _processProps();\n const focusAttributes = useFocusableGroup();\n return (\n <div className={classes.root} ref={el => (_rootElem.current = el)}>\n <div className={classes.chartWrapper} {...focusAttributes}>\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 <text\n x={0}\n y={-(_outerRadius + TITLE_OFFSET)}\n textAnchor=\"middle\"\n className={classes.chartTitle}\n aria-hidden={true}\n >\n {props.chartTitle}\n </text>\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 {arcs.map((arc, index) => {\n const segment = _segments[arc.segmentIndex];\n return (\n <React.Fragment key={index}>\n <path\n d={arc.d}\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: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),\n ...segment.accessibilityData,\n },\n 'img',\n true,\n )}\n onFocus={e => _handleFocus(e, segment.legend)}\n onBlur={_handleBlur}\n onMouseEnter={e => _handleMouseOver(e, segment.legend)}\n onMouseLeave={e => _handleCalloutDismiss()}\n onMouseMove={e => _handleMouseOver(e, segment.legend)}\n data-is-focusable={_legendHighlighted(segment.legend) || _noLegendHighlighted()}\n tabIndex={segment.legend !== '' ? 0 : undefined}\n />\n </React.Fragment>\n );\n })}\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 clickPosition={clickPosition}\n isPopoverOpen={isPopoverOpen}\n customCallout={{\n customizedCallout: _multiValueCallout({ hoverXValue: hoverXValue, YValueHover: hoverYValues }),\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","formatToLocaleString","SVGTooltipText","Legends","Shape","useFocusableGroup","ChartPopover","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","toString","GaugeChart","forwardRef","props","forwardedRef","_getMargins","hideMinMax","chartTitle","sublabel","left","right","top","bottom","_margins","_legendsHeight","hideLegend","_rootElem","useRef","_isRTL","width","setWidth","useState","height","setHeight","hoveredLegend","setHoveredLegend","selectedLegends","setSelectedLegends","legendProps","focusedElement","setFocusedElement","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","hoverXValue","setHoverXValue","hoverYValues","setHoverYValues","prevPropsRef","_width","_height","_outerRadius","Math","min","chartValueSize","_getStylesBasedOnBreakpoint","_innerRadius","_minValue","_maxValue","_segments","_calloutAnchor","useEffect","current","clientWidth","clientHeight","prevProps","useImperativeHandle","componentRef","chartContainer","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","g","transform","path","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","event","currentLegend","canSelectMultipleLegends","slice","_legendHighlighted","_getHighlightedLegend","includes","_noLegendHighlighted","focusEvent","_showCallout","_hideCallout","mouseEvent","hoveredElement","_handleMouseOut","_handleCalloutDismiss","isFocusEvent","clientX","clientY","target","currentTarget","boundingRect","getBoundingClientRect","yValue","_updatePosition","isBlurEvent","_wrapContent","content","id","maxWidth","textElement","text","node","isOverflowing","textLength","getComputedTextLength","_multiValueCallout","calloutProps","yValueHoverSubCountsExists","_yValueHoverSubCountsExists","YValueHover","calloutContentRoot","calloutDateTimeContainer","style","marginBottom","calloutContentX","xAxisCalloutAccessibilityData","culture","calloutInfoContainer","display","yValues","isLast","shouldDrawBorderBottom","callOutAccessibilityData","key","paddingBottom","_getCalloutContent","descriptionMessage","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","calloutBlockContainer","borderInlineStart","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutlegendText","calloutContentY","data","subcounts","subcountName","newX","newY","threshold","distance","sqrt","pow","_getChartTitle","focusAttributes","root","ref","el","chartWrapper","svg","chart","onMouseLeave","textAnchor","aria-hidden","limits","Fragment","opacity","ariaLabel","tabIndex","textProps","wrapContent","dominantBaseline","hideTooltip","customCallout","customizedCallout","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,+BAA+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,QACD,wBAAwB;AAC/B,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAA8BC,OAAO,EAAEC,KAAK,QAAQ,mBAAmB;AAEvE,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,YAAY,QAAQ,mCAAmC;AAEhE,MAAMC,eAAe;AACrB,MAAMC,cAAc;AACpB,MAAMC,eAAe;AACrB,MAAMC,eAAe;AACrB,MAAMC,eAAe;AACrB,MAAMC,sBAAsB;AAC5B,OAAO,MAAMC,cAAc,EAAE;AAC7B,OAAO,MAAMC,cAAc;IACzB;QAAEC,WAAW;QAAIC,UAAU;QAAIC,UAAU;IAAG;IAC5C;QAAEF,WAAW;QAAIC,UAAU;QAAIC,UAAU;IAAG;IAC5C;QAAEF,WAAW;QAAIC,UAAU;QA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3B,aAAaN,CAAAA,IAAKK,iBAAiBL,GAAGnH,QAAQG,MAAM;YACpD8G,qBAAmByB,mBAAmB1I,QAAQG,MAAM,KAAK0I;YACzD6F,UAAU1O,QAAQG,MAAM,KAAK,KAAK,IAAImM;;IAI9C,IACC/F,+BACD,oBAACK;QACCW,cAAcJ,CAAAA,IAAKK,iBAAiBL,GAAG;QACvCM,aAAaN,CAAAA,IAAKK,iBAAiBL,GAAG;qBAEtC,oBAACzI;QACCsL,SAASxJ,mBAAmBM,MAAMnB,UAAU,EAAEkE,WAAWC,WAAWhD,MAAML,gBAAgB;QAC1FkO,WAAW;YACT/L,GAAG;YACHC,GAAG;YACHuL,YAAY;YACZrH,WAAWtC,QAAQ9E,UAAU;YAC7BF,UAAUiE;YACV,eAAe;QACjB;QACAwG,UAAUtG,eAAe,IAAI;QAC7BgL,aAAa7E;SAGhBjJ,MAAMK,QAAQ,kBACb,oBAACzC;QACCsL,SAASlJ,MAAMK,QAAQ;QACvBwN,WAAW;YACT/L,GAAG;YACHC,GAAG;YACHuL,YAAY;YACZS,kBAAkB;YAClB9H,WAAWtC,QAAQtD,QAAQ;QAC7B;QACA+I,UAAUtG,eAAe;QACzBgL,aAAa7E;WAMtBnC,kBACA,CAAC9G,MAAMgO,WAAW,IAAIhM,+BACrB,oBAAChE;QACE,GAAGgC,MAAM4J,YAAY;QACtBhI,eAAeA;QACfI,eAAeA;QACfiM,eAAe;YACbC,mBAAmBvE,mBAAmB;gBAAEzH,aAAaA;gBAAa6H,aAAa3H;YAAa;QAC9F;;AAKV,GACA;AACFtC,WAAWqO,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GaugeChart.types.ts"],"sourcesContent":["import { LegendsProps } from '../Legends/index';\nimport { AccessibilityProps, Chart } from '../../types/index';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\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 * Gauge Chart properties\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartProps {\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 * @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 * 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.RefObject<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 * 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":[],"
|
|
1
|
+
{"version":3,"sources":["GaugeChart.types.ts"],"sourcesContent":["import { LegendsProps } from '../Legends/index';\nimport { AccessibilityProps, Chart } from '../../types/index';\nimport { ChartPopoverProps } from '../CommonComponents/ChartPopover.types';\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 * Gauge Chart properties\n * {@docCategory GaugeChart}\n */\nexport interface GaugeChartProps {\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 * @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 * 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.RefObject<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 * 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":"AAgKA;;;CAGC,GACD,WAoGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GaugeChart';\nexport * from './GaugeChart.types';\nexport * from '../../types/index';\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GaugeChart';\nexport * from './GaugeChart.types';\nexport * from '../../types/index';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,oBAAoB"}
|
|
@@ -287,8 +287,14 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((props = {
|
|
|
287
287
|
_calloutAnchorPoint = null;
|
|
288
288
|
setPopoverOpen(false);
|
|
289
289
|
};
|
|
290
|
-
const onBarFocus = (pointData, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
290
|
+
const onBarFocus = (event, pointData, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
291
291
|
groupData, refArrayIndexNumber)=>{
|
|
292
|
+
let x = 0;
|
|
293
|
+
let y = 0;
|
|
294
|
+
const targetRect = event.target.getBoundingClientRect();
|
|
295
|
+
x = targetRect.left + targetRect.width / 2;
|
|
296
|
+
y = targetRect.top + targetRect.height / 2;
|
|
297
|
+
updatePosition(x, y);
|
|
292
298
|
_refArray.forEach((obj, index)=>{
|
|
293
299
|
if (obj.index === pointData.legend && refArrayIndexNumber === index) {
|
|
294
300
|
setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
|
|
@@ -346,17 +352,16 @@ export const GroupedVerticalBarChart = /*#__PURE__*/ React.forwardRef((props = {
|
|
|
346
352
|
width: _barWidth,
|
|
347
353
|
x: xPoint,
|
|
348
354
|
y: yPoint,
|
|
349
|
-
"data-is-focusable": !props.hideTooltip && (_legendHighlighted(pointData.legend) || _noLegendHighlighted()),
|
|
350
355
|
opacity: _getOpacity(pointData.legend),
|
|
351
356
|
ref: (e)=>{
|
|
352
357
|
_refCallback(e, pointData.legend, refIndexNumber);
|
|
353
358
|
},
|
|
354
359
|
fill: startColor,
|
|
355
360
|
rx: 0,
|
|
356
|
-
onMouseOver: onBarHover
|
|
357
|
-
onMouseMove: onBarHover
|
|
361
|
+
onMouseOver: (event)=>onBarHover(pointData, singleSet, event),
|
|
362
|
+
onMouseMove: (event)=>onBarHover(pointData, singleSet, event),
|
|
358
363
|
onMouseOut: _onBarLeave,
|
|
359
|
-
onFocus: onBarFocus
|
|
364
|
+
onFocus: (event)=>onBarFocus(event, pointData, singleSet, refIndexNumber),
|
|
360
365
|
onBlur: _onBarLeave,
|
|
361
366
|
onClick: pointData.onClick,
|
|
362
367
|
"aria-label": getAriaLabel(pointData, singleSet.xAxisPoint),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GroupedVerticalBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport { useId } from '@fluentui/react-utilities';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n tooltipOfAxislabels,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n YAxisType,\n} from '../../utilities/index';\n\nimport {\n AccessibilityProps,\n CartesianChart,\n Margins,\n Legend,\n RefArrayData,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n Legends,\n YValueHover,\n DataVizPalette,\n getColorFromToken,\n ChartPopoverProps,\n Chart,\n} from '../../index';\n\ntype StringAxis = D3Axis<string>;\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\nconst MIN_DOMAIN_MARGIN = 8;\nconst X1_INNER_PADDING = 0.1;\n// x1_inner_padding = space_between_bars / (space_between_bars + bar_width)\n// => space_between_bars = (x1_inner_padding / (1 - x1_inner_padding)) * bar_width\n/** Rate at which the space between the bars in a group changes wrt the bar width */\nconst BAR_GAP_RATE = X1_INNER_PADDING / (1 - X1_INNER_PADDING);\nconst VERTICAL_BAR_GAP = 1;\nconst MIN_BAR_HEIGHT = 1;\n\n// This interface used for - While forming datapoints from given prop \"data\" in code\ninterface GVDataPoint {\n [key: string]: number | string;\n}\n\n// While forming datapoints from given prop \"data\" in code. These datapoints are used for to draw graph easily.\ninterface GVSingleDataPoint {\n [key: string]: GVDataPoint;\n}\n\nexport const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n GroupedVerticalBarChartProps\n>((props = { maxBarWidth: 24 }, forwardedRef) => {\n const _tooltipId: string = useId('GVBCTooltipId_');\n const _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _keys: string[] = [];\n let _xAxisLabels: string[] = [];\n let _datasetForBars: any[] = [];\n let _margins: Margins = { top: 0, right: 0, bottom: 0, left: 0 };\n let _groupedVerticalBarGraph: JSX.Element[] = [];\n let _refArray: RefArrayData[] = [];\n let _yMax: number = 0;\n let _calloutAnchorPoint: GVBarChartSeriesPoint | null = null;\n let _barWidth: number = 0;\n let _groupWidth: number = 0;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_ORIGIN: number = 0;\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = keys.length * bar_width + (keys.length - 1) * space_between_bars\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n undefined,\n 2 / (2 + keys.length + (keys.length - 1) * BAR_GAP_RATE),\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);\n };\n\n const _createDataset = (points: GroupedVerticalBarChartData[]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const datasetForBars: any = [];\n const dataset: GVDataPoint[] = [];\n\n points.forEach((point: GroupedVerticalBarChartData, index: number) => {\n const singleDatasetPoint: GVDataPoint = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDatasetPointForBars: any = {};\n const singleDataSeries: GVBarChartSeriesPoint[] = [];\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint, seriesIndex) => {\n singleDatasetPoint[seriesPoint.key] = seriesPoint.data;\n singleDatasetPointForBars[seriesPoint.key] = {\n ...seriesPoint,\n };\n singleDataSeries.push(seriesPoint);\n });\n\n singleDatasetPointForBars.xAxisPoint = point.name;\n singleDatasetPointForBars.indexNum = index;\n singleDatasetPointForBars.groupSeries = singleDataSeries;\n singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;\n datasetForBars.push(singleDatasetPointForBars);\n dataset.push(singleDatasetPoint);\n });\n return datasetForBars;\n };\n\n const _createDataSetOfGVBC = (points: GroupedVerticalBarChartData[]) => {\n const keys: string[] = [];\n const xAxisLabels: string[] = points.map(singlePoint => singlePoint.name);\n points[0].series.forEach((singleKey: GVBarChartSeriesPoint) => {\n keys.push(singleKey.key);\n });\n const datasetForBars = _createDataset(points);\n return {\n keys,\n xAxisLabels,\n datasetForBars,\n };\n };\n\n const onLegendSelectionChange = (\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 const _getLegendData = (points: GroupedVerticalBarChartData[]): JSX.Element => {\n const data = points;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color2),\n getColorFromToken(DataVizPalette.color3),\n getColorFromToken(DataVizPalette.color4),\n getColorFromToken(DataVizPalette.color5),\n ];\n const actions: Legend[] = [];\n\n data.forEach((singleChartData: GroupedVerticalBarChartData) => {\n singleChartData.series.forEach((point: GVBarChartSeriesPoint) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n const checkSimilarLegends = actions.filter((leg: Legend) => leg.title === point.legend && leg.color === color);\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: Legend = {\n title: point.legend,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n });\n return (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={onLegendSelectionChange}\n />\n );\n };\n\n const points = props.data;\n const { keys, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points!);\n _keys = keys;\n _xAxisLabels = xAxisLabels;\n _datasetForBars = datasetForBars;\n const _xAxisType: XAxisTypes = getTypeOfAxis(points![0].name, true) as XAxisTypes;\n const legends: JSX.Element = _getLegendData(points!);\n _adjustProps();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-anyAdd commentMore actions\n function _getMinMaxOfYAxis(datasetForBars: any, yAxisType?: YAxisType, useSecondaryYScale?: boolean) {\n const values: number[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n datasetForBars.forEach((data: any) => {\n data.groupSeries.forEach((point: GVBarChartSeriesPoint) => {\n if (!useSecondaryYScale === !point.useSecondaryYScale) {\n values.push(point.data);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _getDomainNRangeValues(\n points: GroupedVerticalBarChartData[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n // The maxOfYVal prop is only required for the primary y-axis, so yMax should be calculated\n // using only the data points associated with the primary y-axis.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const yMax = _getMinMaxOfYAxis(_datasetForBars).endValue;\n _yMax = Math.max(yMax, props.yMaxValue || 0);\n\n const calloutProps: ChartPopoverProps = {\n clickPosition,\n isPopoverOpen,\n color,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover,\n hoverXValue,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues!,\n tickFormat: props.tickFormat!,\n };\n\n const _getGraphData = (\n xScale: StringAxis | NumericAxis,\n yScalePrimary: ScaleLinear<number, number>,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) => {\n const xScale0 = _createX0Scale(containerWidth);\n\n // Setting the bar width here is safe because there are no dependencies earlier in the code\n // that rely on the width of bars in vertical bar charts with string x-axis.\n _barWidth = getBarWidth(\n props.barWidth,\n props.maxBarWidth,\n xScale0.bandwidth() / (_keys.length + (_keys.length - 1) * BAR_GAP_RATE),\n );\n _groupWidth = (_keys.length + (_keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n\n const xScale1 = _createX1Scale();\n const allGroupsBars: JSX.Element[] = [];\n _datasetForBars.forEach((singleSet: GVSingleDataPoint) => {\n allGroupsBars.push(\n _buildGraph(singleSet, xScale0, xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement!),\n );\n });\n _groupedVerticalBarGraph = allGroupsBars;\n };\n\n const _getMargins = (margins: Margins) => {\n _margins = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '' : '0.1';\n return opacity;\n };\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n const onBarHover = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint !== pointData) {\n _calloutAnchorPoint = pointData;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n };\n\n const _onBarLeave = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n };\n\n const onBarFocus = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n refArrayIndexNumber: number,\n ): void => {\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (obj.index === pointData.legend && refArrayIndexNumber === index) {\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n });\n };\n\n const _refCallback = (element: SVGRectElement, legendTitle: string, refIndexNumber: number): void => {\n _refArray[refIndexNumber] = { index: legendTitle, refElement: element };\n };\n\n const _buildGraph = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n singleSet: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale0: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale1: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n containerHeight: number,\n xElement: SVGElement,\n ): JSX.Element => {\n const singleGroup: JSX.Element[] = [];\n const barLabelsForGroup: JSX.Element[] = [];\n\n const tempDataSet = Object.keys(datasetForBars[0]).splice(0, keys.length);\n tempDataSet.forEach((datasetKey: string, index: number) => {\n const refIndexNumber = singleSet.indexNum * tempDataSet.length + index;\n const pointData = singleSet[datasetKey];\n const yBarScale = pointData.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n // To align the centers of the generated bandwidth and the calculated one when they differ,\n // use the following addend.\n const xPoint = xScale1(datasetKey) + (xScale1.bandwidth() - _barWidth) / 2;\n const startColor = pointData.color ? pointData.color : getNextColor(index, 0);\n\n const yBaseline = yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = Y_ORIGIN;\n\n const barGap = (VERTICAL_BAR_GAP / 2) * (index > 0 ? 2 : 0);\n const height = Math.max(yBarScale(Y_ORIGIN) - yBarScale(Math.abs(pointData.data)), MIN_BAR_HEIGHT);\n if (pointData.data >= Y_ORIGIN) {\n yPositiveStart -= height + barGap;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + barGap;\n yNegativeStart = yPoint + height;\n }\n // Not rendering data with 0.\n pointData.data &&\n singleGroup.push(\n <React.Fragment key={`${singleSet.indexNum}-${index}`}>\n <rect\n className={classes.opacityChangeOnHover}\n height={height}\n width={_barWidth}\n x={xPoint}\n y={yPoint}\n data-is-focusable={!props.hideTooltip && (_legendHighlighted(pointData.legend) || _noLegendHighlighted())}\n opacity={_getOpacity(pointData.legend)}\n ref={(e: SVGRectElement | null) => {\n _refCallback(e!, pointData.legend, refIndexNumber);\n }}\n fill={startColor}\n rx={0}\n onMouseOver={onBarHover.bind(null, pointData, singleSet)}\n onMouseMove={onBarHover.bind(null, pointData, singleSet)}\n onMouseOut={_onBarLeave}\n onFocus={onBarFocus.bind(null, pointData, singleSet, refIndexNumber)}\n onBlur={_onBarLeave}\n onClick={pointData.onClick}\n aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}\n tabIndex={_legendHighlighted(pointData.legend) || _noLegendHighlighted() ? 0 : undefined}\n role=\"img\"\n />\n </React.Fragment>,\n );\n if (\n pointData.data &&\n !props.hideLabels &&\n _barWidth >= 16 &&\n (_legendHighlighted(pointData.legend) || _noLegendHighlighted())\n ) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${index}`}\n x={xPoint + _barWidth / 2}\n y={pointData.data >= Y_ORIGIN ? yPositiveStart - 6 : yNegativeStart + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(pointData.data)\n : formatScientificLimitWidth(pointData.data)}\n </text>,\n );\n }\n });\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale0);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return (\n <g\n key={singleSet.indexNum}\n transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - _groupWidth) / 2}, 0)`}\n >\n {singleGroup}\n {barLabelsForGroup}\n </g>\n );\n };\n\n // For grouped vertical bar chart, First need to define total scale (from start to end)\n // From that need to define scale for single group of bars - done by createX1Scale\n const _createX0Scale = (containerWidth: number) => {\n const x0Axis = d3ScaleBand()\n .domain(xAxisLabels)\n .range(\n _useRtl\n ? [containerWidth! - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth! - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n return x0Axis;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _createX1Scale = (): any => {\n return (\n d3ScaleBand()\n .domain(keys)\n // When there is only one group, xScale0 adds padding around it,\n // causing the bandwidth to become smaller than the actual group width.\n // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.\n .range(_useRtl ? [_groupWidth, 0] : [0, _groupWidth])\n .paddingInner(X1_INNER_PADDING)\n );\n };\n\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n\n const _getAxisData = React.useCallback(\n (yAxisData: IAxisData) => {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || 0);\n }\n },\n [props.yMaxValue],\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 const _legendHighlighted = (legendTitle: string) => {\n return _getHighlightedLegend().includes(legendTitle!);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return _getHighlightedLegend().length === 0;\n };\n\n const _getHighlightedLegend = () => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n };\n\n const getAriaLabel = (point: GVBarChartSeriesPoint, xAxisPoint: string): string => {\n const xValue = point.xAxisCalloutData || xAxisPoint;\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n };\n\n const _getDomainMargins = (containerWidth: number): Margins => {\n /** Total width available to render the bars */\n const totalWidth = containerWidth - (_margins.left! + MIN_DOMAIN_MARGIN) - (_margins.right! + MIN_DOMAIN_MARGIN);\n /** Rate at which the space between the groups changes wrt the group width */\n const groupGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first group and after the last group.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n /** Total width required to render the groups. Directly proportional to group width */\n const reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering groups at their maximum allowable width\n const groupBandwidth = totalWidth / (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate);\n const barBandwidth = groupBandwidth / (keys.length + (keys.length - 1) * BAR_GAP_RATE);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);\n const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * barWidth;\n let reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\n const margin1 = (totalWidth - reqWidth) / 2;\n\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(xAxisLabels) + 20;\n reqWidth = (xAxisLabels.length - _xAxisInnerPadding) * step;\n const margin2 = (totalWidth - reqWidth) / 2;\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n };\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.filter((item: GroupedVerticalBarChartData) => item.series.length).length > 0\n );\n };\n\n const _getChartTitle = (): string => {\n return (\n (props.chartTitle ? `${props.chartTitle}. ` : '') +\n `Vertical bar chart with ${_xAxisLabels.length} groups of ${_keys.length} bars each. `\n );\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_datasetForBars}\n chartType={ChartTypes.GroupedVerticalBarChart}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n createStringYAxis={createStringYAxis}\n calloutProps={calloutProps}\n legendBars={legends}\n xAxisType={_xAxisType}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_xAxisLabels}\n tickParams={tickParams}\n tickPadding={props.tickPadding || 5}\n maxOfYVal={_yMax}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n barwidth={_barWidth}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["React","useGroupedVerticalBarChartStyles_unstable","select","d3Select","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","tooltipOfAxislabels","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","CartesianChart","Legends","DataVizPalette","getColorFromToken","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","BAR_GAP_RATE","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","props","maxBarWidth","forwardedRef","_tooltipId","_emptyChartId","_useRtl","_domainMargin","_keys","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_refArray","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","useRef","Y_ORIGIN","color","setColor","useState","dataForHoverCard","setDataForHoverCard","selectedLegends","setSelectedLegends","legendProps","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","YValueHover","setYValueHover","hoverXValue","setHoverXValue","calloutLegend","setCalloutLegend","activeLegend","setActiveLegend","callOutAccessibilityData","setCallOutAccessibilityData","undefined","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","classes","useEffect","useImperativeHandle","componentRef","chartContainer","current","_adjustProps","barWidth","xAxisInnerPadding","keys","length","xAxisOuterPadding","_createDataset","points","datasetForBars","dataset","forEach","point","index","singleDatasetPoint","singleDatasetPointForBars","singleDataSeries","series","seriesPoint","seriesIndex","key","data","push","xAxisPoint","name","indexNum","groupSeries","stackCallOutAccessibilityData","_createDataSetOfGVBC","xAxisLabels","map","singlePoint","singleKey","onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","defaultPalette","color1","color2","color3","color4","color5","actions","singleChartData","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_xAxisType","_getMinMaxOfYAxis","yAxisType","useSecondaryYScale","values","startValue","endValue","_getDomainNRangeValues","margins","width","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","yMax","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","tickParams","tickFormat","_getGraphData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","xScale0","_createX0Scale","bandwidth","xScale1","_createX1Scale","allGroupsBars","singleSet","_buildGraph","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","updatePosition","newX","newY","threshold","distance","sqrt","pow","onBarHover","pointData","groupData","mouseEvent","persist","clientX","clientY","xAxisCalloutData","yAxisCalloutData","isCalloutForStack","_onBarLeave","onBarFocus","refArrayIndexNumber","obj","_refCallback","element","refIndexNumber","refElement","singleGroup","barLabelsForGroup","tempDataSet","Object","splice","datasetKey","yBarScale","xPoint","startColor","yBaseline","yPositiveStart","yNegativeStart","yPoint","barGap","height","abs","Fragment","rect","className","opacityChangeOnHover","data-is-focusable","hideTooltip","ref","e","fill","rx","onMouseOver","bind","onMouseMove","onMouseOut","onFocus","onBlur","onClick","aria-label","getAriaLabel","tabIndex","role","hideLabels","text","textAnchor","barLabel","aria-hidden","yAxisTickFormat","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","call","document","getElementById","remove","tooltipProps","tooltipCls","tooltip","id","axis","g","transform","x0Axis","domain","range","paddingInner","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupGapRate","StringAxis","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","step","margin2","_isChartEmpty","item","_getChartTitle","chartTitle","getDomainNRangeValues","getMinMaxOfYAxis","legendBars","createYAxis","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getD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IACVjF,MAAMiF,IAAI,CAAChB,MAAM,GAAG,KACpBjE,MAAMiF,IAAI,CAAC+B,MAAM,CAAC,CAACiL,OAAsCA,KAAKpN,MAAM,CAACZ,MAAM,EAAEA,MAAM,GAAG,CAAA;IAE1F;IAEA,MAAMiO,iBAAiB;QACrB,OACE,AAAClS,CAAAA,MAAMmS,UAAU,GAAG,CAAC,EAAEnS,MAAMmS,UAAU,CAAC,EAAE,CAAC,GAAG,EAAC,IAC/C,CAAC,wBAAwB,EAAE3R,aAAayD,MAAM,CAAC,WAAW,EAAE1D,MAAM0D,MAAM,CAAC,YAAY,CAAC;IAE1F;IAEA,OAAO,CAAC+N,gCACN,oBAAC3S;QACE,GAAGW,KAAK;QACTmS,YAAYD;QACZ9N,QAAQ3D;QACR+H,WAAWnK,WAAWyB,uBAAuB;QAC7CsS,uBAAuB/J;QACvBgK,kBAAkBtK;QAClB/I,mBAAmBA;QACnBsK,cAAcA;QACdgJ,YAAY7K;QACZiB,WAAWZ;QACXyK,aAAazT;QACb0T,uBAAuBhS;QACvBmJ,YAAYA;QACZ8I,aAAazS,MAAMyS,WAAW,IAAI;QAClCC,WAAWzR;QACX0R,YAAY9H;QACZ+H,cAAc/I;QACdgJ,aAAanC;QACboC,mBAAmBzL;QACnB0L,kBAAkB3B;QACjB,GAAItJ,eAAetJ,WAAW+S,UAAU,IAAI;YAC3CxN,mBAAmB1C;YACnB6C,mBAAmB5C;QACrB,CAAC;QACD0R,UAAU7R;QACVuC,cAAcnC;QACd,oCAAoC,GACpC0R,UAAU;YACR,qBAAO,oBAAC9C,WAAGpP;QACb;uBAGF,oBAACmS;QAAIjD,IAAI7P;QAAe4O,MAAM;QAASmE,OAAO;YAAEnI,SAAS;QAAI;QAAG6D,cAAY;;AAEhF,GAAG;AACH/O,wBAAwBsT,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["GroupedVerticalBarChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGroupedVerticalBarChartStyles_unstable } from './useGroupedVerticalBarChartStyles.styles';\nimport { select as d3Select } from 'd3-selection';\nimport { Axis as D3Axis } from 'd3-axis';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, scaleBand as d3ScaleBand } from 'd3-scale';\n\nimport { useId } from '@fluentui/react-utilities';\nimport {\n ChartTypes,\n IAxisData,\n getAccessibleDataObject,\n tooltipOfAxislabels,\n XAxisTypes,\n getTypeOfAxis,\n formatScientificLimitWidth,\n getScalePadding,\n getBarWidth,\n isScalePaddingDefined,\n createNumericYAxis,\n IDomainNRange,\n domainRangeOfXStringAxis,\n createStringYAxis,\n getNextColor,\n areArraysEqual,\n calculateLongestLabelWidth,\n useRtl,\n YAxisType,\n} from '../../utilities/index';\n\nimport {\n AccessibilityProps,\n CartesianChart,\n Margins,\n Legend,\n RefArrayData,\n GroupedVerticalBarChartProps,\n GroupedVerticalBarChartData,\n GVBarChartSeriesPoint,\n Legends,\n YValueHover,\n DataVizPalette,\n getColorFromToken,\n ChartPopoverProps,\n Chart,\n} from '../../index';\n\ntype StringAxis = D3Axis<string>;\ntype NumericAxis = D3Axis<number | { valueOf(): number }>;\n\nconst MIN_DOMAIN_MARGIN = 8;\nconst X1_INNER_PADDING = 0.1;\n// x1_inner_padding = space_between_bars / (space_between_bars + bar_width)\n// => space_between_bars = (x1_inner_padding / (1 - x1_inner_padding)) * bar_width\n/** Rate at which the space between the bars in a group changes wrt the bar width */\nconst BAR_GAP_RATE = X1_INNER_PADDING / (1 - X1_INNER_PADDING);\nconst VERTICAL_BAR_GAP = 1;\nconst MIN_BAR_HEIGHT = 1;\n\n// This interface used for - While forming datapoints from given prop \"data\" in code\ninterface GVDataPoint {\n [key: string]: number | string;\n}\n\n// While forming datapoints from given prop \"data\" in code. These datapoints are used for to draw graph easily.\ninterface GVSingleDataPoint {\n [key: string]: GVDataPoint;\n}\n\nexport const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = React.forwardRef<\n HTMLDivElement,\n GroupedVerticalBarChartProps\n>((props = { maxBarWidth: 24 }, forwardedRef) => {\n const _tooltipId: string = useId('GVBCTooltipId_');\n const _emptyChartId: string = useId('_GVBC_empty');\n const _useRtl: boolean = useRtl();\n let _domainMargin: number = MIN_DOMAIN_MARGIN;\n let _keys: string[] = [];\n let _xAxisLabels: string[] = [];\n let _datasetForBars: any[] = [];\n let _margins: Margins = { top: 0, right: 0, bottom: 0, left: 0 };\n let _groupedVerticalBarGraph: JSX.Element[] = [];\n let _refArray: RefArrayData[] = [];\n let _yMax: number = 0;\n let _calloutAnchorPoint: GVBarChartSeriesPoint | null = null;\n let _barWidth: number = 0;\n let _groupWidth: number = 0;\n let _xAxisInnerPadding: number = 0;\n let _xAxisOuterPadding: number = 0;\n const cartesianChartRef = React.useRef<Chart>(null);\n const Y_ORIGIN: number = 0;\n\n const [color, setColor] = React.useState<string>('');\n const [dataForHoverCard, setDataForHoverCard] = React.useState<number>(0);\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [YValueHover, setYValueHover] = React.useState<YValueHover[]>([]);\n const [hoverXValue, setHoverXValue] = React.useState<string>('');\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [activeLegend, setActiveLegend] = React.useState<string>('');\n const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState<AccessibilityProps | undefined>(\n undefined,\n );\n const [clickPosition, setClickPosition] = React.useState({ x: 0, y: 0 });\n const [isPopoverOpen, setPopoverOpen] = React.useState<boolean>(false);\n const classes = useGroupedVerticalBarChartStyles_unstable(props);\n\n React.useEffect(() => {\n if (!areArraysEqual(props.legendProps?.selectedLegends, selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n }, [props.legendProps?.selectedLegends]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: cartesianChartRef.current?.chartContainer ?? null,\n }),\n [],\n );\n\n const _adjustProps = () => {\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n // x0_inner_padding = space_between_groups / (space_between_groups + group_width)\n // space_between_groups = 2 * bar_width\n // group_width = keys.length * bar_width + (keys.length - 1) * space_between_bars\n _xAxisInnerPadding = getScalePadding(\n props.xAxisInnerPadding,\n undefined,\n 2 / (2 + keys.length + (keys.length - 1) * BAR_GAP_RATE),\n );\n _xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding);\n };\n\n const _createDataset = (points: GroupedVerticalBarChartData[]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const datasetForBars: any = [];\n const dataset: GVDataPoint[] = [];\n\n points.forEach((point: GroupedVerticalBarChartData, index: number) => {\n const singleDatasetPoint: GVDataPoint = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const singleDatasetPointForBars: any = {};\n const singleDataSeries: GVBarChartSeriesPoint[] = [];\n\n point.series.forEach((seriesPoint: GVBarChartSeriesPoint, seriesIndex) => {\n singleDatasetPoint[seriesPoint.key] = seriesPoint.data;\n singleDatasetPointForBars[seriesPoint.key] = {\n ...seriesPoint,\n };\n singleDataSeries.push(seriesPoint);\n });\n\n singleDatasetPointForBars.xAxisPoint = point.name;\n singleDatasetPointForBars.indexNum = index;\n singleDatasetPointForBars.groupSeries = singleDataSeries;\n singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;\n datasetForBars.push(singleDatasetPointForBars);\n dataset.push(singleDatasetPoint);\n });\n return datasetForBars;\n };\n\n const _createDataSetOfGVBC = (points: GroupedVerticalBarChartData[]) => {\n const keys: string[] = [];\n const xAxisLabels: string[] = points.map(singlePoint => singlePoint.name);\n points[0].series.forEach((singleKey: GVBarChartSeriesPoint) => {\n keys.push(singleKey.key);\n });\n const datasetForBars = _createDataset(points);\n return {\n keys,\n xAxisLabels,\n datasetForBars,\n };\n };\n\n const onLegendSelectionChange = (\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 const _getLegendData = (points: GroupedVerticalBarChartData[]): JSX.Element => {\n const data = points;\n const defaultPalette: string[] = [\n getColorFromToken(DataVizPalette.color1),\n getColorFromToken(DataVizPalette.color2),\n getColorFromToken(DataVizPalette.color3),\n getColorFromToken(DataVizPalette.color4),\n getColorFromToken(DataVizPalette.color5),\n ];\n const actions: Legend[] = [];\n\n data.forEach((singleChartData: GroupedVerticalBarChartData) => {\n singleChartData.series.forEach((point: GVBarChartSeriesPoint) => {\n let color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n const checkSimilarLegends = actions.filter((leg: Legend) => leg.title === point.legend && leg.color === color);\n if (checkSimilarLegends!.length > 0) {\n return;\n }\n const legend: Legend = {\n title: point.legend,\n color,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(point.legend);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n });\n return (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowText={props.legendsOverflowText}\n {...props.legendProps}\n onChange={onLegendSelectionChange}\n />\n );\n };\n\n const points = props.data;\n const { keys, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points!);\n _keys = keys;\n _xAxisLabels = xAxisLabels;\n _datasetForBars = datasetForBars;\n const _xAxisType: XAxisTypes = getTypeOfAxis(points![0].name, true) as XAxisTypes;\n const legends: JSX.Element = _getLegendData(points!);\n _adjustProps();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-anyAdd commentMore actions\n function _getMinMaxOfYAxis(datasetForBars: any, yAxisType?: YAxisType, useSecondaryYScale?: boolean) {\n const values: number[] = [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n datasetForBars.forEach((data: any) => {\n data.groupSeries.forEach((point: GVBarChartSeriesPoint) => {\n if (!useSecondaryYScale === !point.useSecondaryYScale) {\n values.push(point.data);\n }\n });\n });\n\n return { startValue: d3Min(values)!, endValue: d3Max(values)! };\n }\n\n function _getDomainNRangeValues(\n points: GroupedVerticalBarChartData[],\n margins: Margins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ) {\n let domainNRangeValue: IDomainNRange;\n if (xAxisType === XAxisTypes.NumericAxis || xAxisType === XAxisTypes.DateAxis) {\n domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };\n } else {\n domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);\n }\n return domainNRangeValue;\n }\n\n // The maxOfYVal prop is only required for the primary y-axis, so yMax should be calculated\n // using only the data points associated with the primary y-axis.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const yMax = _getMinMaxOfYAxis(_datasetForBars).endValue;\n _yMax = Math.max(yMax, props.yMaxValue || 0);\n\n const calloutProps: ChartPopoverProps = {\n clickPosition,\n isPopoverOpen,\n color,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,\n YValueHover,\n hoverXValue,\n culture: props.culture ?? 'en-us',\n isCartesian: true,\n ...props.calloutProps,\n ...getAccessibleDataObject(callOutAccessibilityData, 'text', false),\n };\n const tickParams = {\n tickValues: props.tickValues!,\n tickFormat: props.tickFormat!,\n };\n\n const _getGraphData = (\n xScale: StringAxis | NumericAxis,\n yScalePrimary: ScaleLinear<number, number>,\n containerHeight: number,\n containerWidth: number,\n xElement?: SVGElement | null,\n yAxisElement?: SVGElement | null,\n yScaleSecondary?: ScaleLinear<number, number>,\n ) => {\n const xScale0 = _createX0Scale(containerWidth);\n\n // Setting the bar width here is safe because there are no dependencies earlier in the code\n // that rely on the width of bars in vertical bar charts with string x-axis.\n _barWidth = getBarWidth(\n props.barWidth,\n props.maxBarWidth,\n xScale0.bandwidth() / (_keys.length + (_keys.length - 1) * BAR_GAP_RATE),\n );\n _groupWidth = (_keys.length + (_keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n\n const xScale1 = _createX1Scale();\n const allGroupsBars: JSX.Element[] = [];\n _datasetForBars.forEach((singleSet: GVSingleDataPoint) => {\n allGroupsBars.push(\n _buildGraph(singleSet, xScale0, xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement!),\n );\n });\n _groupedVerticalBarGraph = allGroupsBars;\n };\n\n const _getMargins = (margins: Margins) => {\n _margins = margins;\n };\n\n const _getOpacity = (legendTitle: string): string => {\n const opacity = _legendHighlighted(legendTitle) || _noLegendHighlighted() ? '' : '0.1';\n return opacity;\n };\n\n function updatePosition(newX: number, newY: number) {\n const threshold = 1; // Set a threshold for movement\n const { x, y } = clickPosition;\n // Calculate the distance moved\n const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));\n // Update the position only if the distance moved is greater than the threshold\n if (distance > threshold) {\n setClickPosition({ x: newX, y: newY });\n setPopoverOpen(true);\n }\n }\n\n const onBarHover = (\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n mouseEvent: React.MouseEvent<SVGElement>,\n ): void => {\n mouseEvent.persist();\n if (_calloutAnchorPoint !== pointData) {\n _calloutAnchorPoint = pointData;\n updatePosition(mouseEvent.clientX, mouseEvent.clientY);\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n };\n\n const _onBarLeave = (): void => {\n /**/\n };\n\n const _handleChartMouseLeave = (): void => {\n _calloutAnchorPoint = null;\n setPopoverOpen(false);\n };\n\n const onBarFocus = (\n event: React.FocusEvent<SVGRectElement, Element>,\n pointData: GVBarChartSeriesPoint,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n groupData: any,\n refArrayIndexNumber: number,\n ): void => {\n let x = 0;\n let y = 0;\n\n const targetRect = (event.target as SVGRectElement).getBoundingClientRect();\n x = targetRect.left + targetRect.width / 2;\n y = targetRect.top + targetRect.height / 2;\n updatePosition(x, y);\n _refArray.forEach((obj: RefArrayData, index: number) => {\n if (obj.index === pointData.legend && refArrayIndexNumber === index) {\n setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));\n setCalloutLegend(pointData.legend);\n setDataForHoverCard(pointData.data);\n setColor(pointData.color);\n setXCalloutValue(pointData.xAxisCalloutData!);\n setYCalloutValue(pointData.yAxisCalloutData!);\n setCallOutAccessibilityData(\n props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData,\n );\n setYValueHover(groupData.groupSeries);\n setHoverXValue(pointData.xAxisCalloutData!);\n }\n });\n };\n\n const _refCallback = (element: SVGRectElement, legendTitle: string, refIndexNumber: number): void => {\n _refArray[refIndexNumber] = { index: legendTitle, refElement: element };\n };\n\n const _buildGraph = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n singleSet: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale0: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale1: any,\n yScalePrimary: ScaleLinear<number, number>,\n yScaleSecondary: ScaleLinear<number, number> | undefined,\n containerHeight: number,\n xElement: SVGElement,\n ): JSX.Element => {\n const singleGroup: JSX.Element[] = [];\n const barLabelsForGroup: JSX.Element[] = [];\n\n const tempDataSet = Object.keys(datasetForBars[0]).splice(0, keys.length);\n tempDataSet.forEach((datasetKey: string, index: number) => {\n const refIndexNumber = singleSet.indexNum * tempDataSet.length + index;\n const pointData = singleSet[datasetKey];\n const yBarScale = pointData.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;\n // To align the centers of the generated bandwidth and the calculated one when they differ,\n // use the following addend.\n const xPoint = xScale1(datasetKey) + (xScale1.bandwidth() - _barWidth) / 2;\n const startColor = pointData.color ? pointData.color : getNextColor(index, 0);\n\n const yBaseline = yBarScale(Y_ORIGIN);\n let yPositiveStart = yBaseline;\n let yNegativeStart = yBaseline;\n let yPoint = Y_ORIGIN;\n\n const barGap = (VERTICAL_BAR_GAP / 2) * (index > 0 ? 2 : 0);\n const height = Math.max(yBarScale(Y_ORIGIN) - yBarScale(Math.abs(pointData.data)), MIN_BAR_HEIGHT);\n if (pointData.data >= Y_ORIGIN) {\n yPositiveStart -= height + barGap;\n yPoint = yPositiveStart;\n } else {\n yPoint = yNegativeStart + barGap;\n yNegativeStart = yPoint + height;\n }\n // Not rendering data with 0.\n pointData.data &&\n singleGroup.push(\n <React.Fragment key={`${singleSet.indexNum}-${index}`}>\n <rect\n className={classes.opacityChangeOnHover}\n height={height}\n width={_barWidth}\n x={xPoint}\n y={yPoint}\n opacity={_getOpacity(pointData.legend)}\n ref={(e: SVGRectElement | null) => {\n _refCallback(e!, pointData.legend, refIndexNumber);\n }}\n fill={startColor}\n rx={0}\n onMouseOver={event => onBarHover(pointData, singleSet, event)}\n onMouseMove={event => onBarHover(pointData, singleSet, event)}\n onMouseOut={_onBarLeave}\n onFocus={event => onBarFocus(event, pointData, singleSet, refIndexNumber)}\n onBlur={_onBarLeave}\n onClick={pointData.onClick}\n aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}\n tabIndex={_legendHighlighted(pointData.legend) || _noLegendHighlighted() ? 0 : undefined}\n role=\"img\"\n />\n </React.Fragment>,\n );\n if (\n pointData.data &&\n !props.hideLabels &&\n _barWidth >= 16 &&\n (_legendHighlighted(pointData.legend) || _noLegendHighlighted())\n ) {\n barLabelsForGroup.push(\n <text\n key={`${singleSet.indexNum}-${index}`}\n x={xPoint + _barWidth / 2}\n y={pointData.data >= Y_ORIGIN ? yPositiveStart - 6 : yNegativeStart + 12}\n textAnchor=\"middle\"\n className={classes.barLabel}\n aria-hidden={true}\n >\n {typeof props.yAxisTickFormat === 'function'\n ? props.yAxisTickFormat(pointData.data)\n : formatScientificLimitWidth(pointData.data)}\n </text>,\n );\n }\n });\n // Used to display tooltip at x axis labels.\n if (!props.wrapXAxisLables && props.showXAxisLablesTooltip) {\n const xAxisElement = d3Select(xElement).call(xScale0);\n try {\n document.getElementById(_tooltipId) && document.getElementById(_tooltipId)!.remove();\n // eslint-disable-next-line no-empty\n } catch (e) {}\n const tooltipProps = {\n tooltipCls: classes.tooltip!,\n id: _tooltipId,\n axis: xAxisElement,\n };\n xAxisElement && tooltipOfAxislabels(tooltipProps);\n }\n return (\n <g\n key={singleSet.indexNum}\n transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - _groupWidth) / 2}, 0)`}\n >\n {singleGroup}\n {barLabelsForGroup}\n </g>\n );\n };\n\n // For grouped vertical bar chart, First need to define total scale (from start to end)\n // From that need to define scale for single group of bars - done by createX1Scale\n const _createX0Scale = (containerWidth: number) => {\n const x0Axis = d3ScaleBand()\n .domain(xAxisLabels)\n .range(\n _useRtl\n ? [containerWidth! - _margins.right! - _domainMargin, _margins.left! + _domainMargin]\n : [_margins.left! + _domainMargin, containerWidth! - _margins.right! - _domainMargin],\n )\n .paddingInner(_xAxisInnerPadding)\n .paddingOuter(_xAxisOuterPadding);\n return x0Axis;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _createX1Scale = (): any => {\n return (\n d3ScaleBand()\n .domain(keys)\n // When there is only one group, xScale0 adds padding around it,\n // causing the bandwidth to become smaller than the actual group width.\n // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.\n .range(_useRtl ? [_groupWidth, 0] : [0, _groupWidth])\n .paddingInner(X1_INNER_PADDING)\n );\n };\n\n const _onLegendHover = (legendTitle: string): void => {\n setActiveLegend(legendTitle);\n };\n\n const _onLegendLeave = (): void => {\n setActiveLegend('');\n };\n\n const _getAxisData = React.useCallback(\n (yAxisData: IAxisData) => {\n if (yAxisData && yAxisData.yAxisDomainValues.length) {\n const { yAxisDomainValues: domainValue } = yAxisData;\n _yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || 0);\n }\n },\n [props.yMaxValue],\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 const _legendHighlighted = (legendTitle: string) => {\n return _getHighlightedLegend().includes(legendTitle!);\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = () => {\n return _getHighlightedLegend().length === 0;\n };\n\n const _getHighlightedLegend = () => {\n return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [activeLegend] : [];\n };\n\n const getAriaLabel = (point: GVBarChartSeriesPoint, xAxisPoint: string): string => {\n const xValue = point.xAxisCalloutData || xAxisPoint;\n const legend = point.legend;\n const yValue = point.yAxisCalloutData || point.data;\n return point.callOutAccessibilityData?.ariaLabel || `${xValue}. ${legend}, ${yValue}.`;\n };\n\n const _getDomainMargins = (containerWidth: number): Margins => {\n /** Total width available to render the bars */\n const totalWidth = containerWidth - (_margins.left! + MIN_DOMAIN_MARGIN) - (_margins.right! + MIN_DOMAIN_MARGIN);\n /** Rate at which the space between the groups changes wrt the group width */\n const groupGapRate = _xAxisInnerPadding / (1 - _xAxisInnerPadding);\n\n if (_xAxisType === XAxisTypes.StringAxis) {\n if (isScalePaddingDefined(props.xAxisOuterPadding)) {\n // Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available\n // to adjust the space before the first group and after the last group.\n _domainMargin = 0;\n } else if (props.barWidth !== 'auto') {\n // Update the bar width so that when CartesianChart rerenders,\n // the following calculations don't use the previous bar width.\n _barWidth = getBarWidth(props.barWidth, props.maxBarWidth);\n const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * _barWidth;\n /** Total width required to render the groups. Directly proportional to group width */\n const reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\n\n if (totalWidth >= reqWidth) {\n // Center align the chart by setting equal left and right margins for domain\n _domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;\n }\n } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {\n // Calculate the remaining width after rendering groups at their maximum allowable width\n const groupBandwidth = totalWidth / (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate);\n const barBandwidth = groupBandwidth / (keys.length + (keys.length - 1) * BAR_GAP_RATE);\n const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, barBandwidth);\n const groupWidth = (keys.length + (keys.length - 1) * BAR_GAP_RATE) * barWidth;\n let reqWidth = (xAxisLabels.length + (xAxisLabels.length - 1) * groupGapRate) * groupWidth;\n const margin1 = (totalWidth - reqWidth) / 2;\n\n // Calculate the remaining width after accounting for the space required to render x-axis labels\n const step = calculateLongestLabelWidth(xAxisLabels) + 20;\n reqWidth = (xAxisLabels.length - _xAxisInnerPadding) * step;\n const margin2 = (totalWidth - reqWidth) / 2;\n\n _domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));\n }\n }\n\n return {\n ..._margins,\n left: _margins.left! + _domainMargin,\n right: _margins.right! + _domainMargin,\n };\n };\n\n const _isChartEmpty = (): boolean => {\n return !(\n props.data &&\n props.data.length > 0 &&\n props.data.filter((item: GroupedVerticalBarChartData) => item.series.length).length > 0\n );\n };\n\n const _getChartTitle = (): string => {\n return (\n (props.chartTitle ? `${props.chartTitle}. ` : '') +\n `Vertical bar chart with ${_xAxisLabels.length} groups of ${_keys.length} bars each. `\n );\n };\n\n return !_isChartEmpty() ? (\n <CartesianChart\n {...props}\n chartTitle={_getChartTitle()}\n points={_datasetForBars}\n chartType={ChartTypes.GroupedVerticalBarChart}\n getDomainNRangeValues={_getDomainNRangeValues}\n getMinMaxOfYAxis={_getMinMaxOfYAxis}\n createStringYAxis={createStringYAxis}\n calloutProps={calloutProps}\n legendBars={legends}\n xAxisType={_xAxisType}\n createYAxis={createNumericYAxis}\n datasetForXAxisDomain={_xAxisLabels}\n tickParams={tickParams}\n tickPadding={props.tickPadding || 5}\n maxOfYVal={_yMax}\n getmargins={_getMargins}\n getGraphData={_getGraphData}\n getAxisData={_getAxisData}\n onChartMouseLeave={_handleChartMouseLeave}\n getDomainMargins={_getDomainMargins}\n {...(_xAxisType === XAxisTypes.StringAxis && {\n xAxisInnerPadding: _xAxisInnerPadding,\n xAxisOuterPadding: _xAxisOuterPadding,\n })}\n barwidth={_barWidth}\n componentRef={cartesianChartRef}\n /* eslint-disable react/jsx-no-bind */\n children={() => {\n return <g>{_groupedVerticalBarGraph}</g>;\n }}\n />\n ) : (\n <div id={_emptyChartId} role={'alert'} style={{ opacity: '0' }} aria-label={'Graph has no data to display'} />\n );\n});\nGroupedVerticalBarChart.displayName = 'GroupedVerticalBarChart';\n"],"names":["React","useGroupedVerticalBarChartStyles_unstable","select","d3Select","max","d3Max","min","d3Min","scaleBand","d3ScaleBand","useId","ChartTypes","getAccessibleDataObject","tooltipOfAxislabels","XAxisTypes","getTypeOfAxis","formatScientificLimitWidth","getScalePadding","getBarWidth","isScalePaddingDefined","createNumericYAxis","domainRangeOfXStringAxis","createStringYAxis","getNextColor","areArraysEqual","calculateLongestLabelWidth","useRtl","CartesianChart","Legends","DataVizPalette","getColorFromToken","MIN_DOMAIN_MARGIN","X1_INNER_PADDING","BAR_GAP_RATE","VERTICAL_BAR_GAP","MIN_BAR_HEIGHT","GroupedVerticalBarChart","forwardRef","props","maxBarWidth","forwardedRef","_tooltipId","_emptyChartId","_useRtl","_domainMargin","_keys","_xAxisLabels","_datasetForBars","_margins","top","right","bottom","left","_groupedVerticalBarGraph","_refArray","_yMax","_calloutAnchorPoint","_barWidth","_groupWidth","_xAxisInnerPadding","_xAxisOuterPadding","cartesianChartRef","useRef","Y_ORIGIN","color","setColor","useState","dataForHoverCard","setDataForHoverCard","selectedLegends","setSelectedLegends","legendProps","xCalloutValue","setXCalloutValue","yCalloutValue","setYCalloutValue","YValueHover","setYValueHover","hoverXValue","setHoverXValue","calloutLegend","setCalloutLegend","activeLegend","setActiveLegend","callOutAccessibilityData","setCallOutAccessibilityData","undefined","clickPosition","setClickPosition","x","y","isPopoverOpen","setPopoverOpen","classes","useEffect","useImperativeHandle","componentRef","chartContainer","current","_adjustProps","barWidth","xAxisInnerPadding","keys","length","xAxisOuterPadding","_createDataset","points","datasetForBars","dataset","forEach","point","index","singleDatasetPoint","singleDatasetPointForBars","singleDataSeries","series","seriesPoint","seriesIndex","key","data","push","xAxisPoint","name","indexNum","groupSeries","stackCallOutAccessibilityData","_createDataSetOfGVBC","xAxisLabels","map","singlePoint","singleKey","onLegendSelectionChange","event","currentLegend","canSelectMultipleLegends","slice","onChange","_getLegendData","defaultPalette","color1","color2","color3","color4","color5","actions","singleChartData","Math","floor","random","checkSimilarLegends","filter","leg","title","legend","hoverAction","_handleChartMouseLeave","_onLegendHover","onMouseOutAction","_onLegendLeave","legends","enabledWrapLines","enabledLegendsWrapLines","overflowText","legendsOverflowText","_xAxisType","_getMinMaxOfYAxis","yAxisType","useSecondaryYScale","values","startValue","endValue","_getDomainNRangeValues","margins","width","chartType","isRTL","xAxisType","tickValues","shiftX","domainNRangeValue","NumericAxis","DateAxis","dStartValue","dEndValue","rStartValue","rEndValue","yMax","yMaxValue","calloutProps","XValue","YValue","culture","isCartesian","tickParams","tickFormat","_getGraphData","xScale","yScalePrimary","containerHeight","containerWidth","xElement","yAxisElement","yScaleSecondary","xScale0","_createX0Scale","bandwidth","xScale1","_createX1Scale","allGroupsBars","singleSet","_buildGraph","_getMargins","_getOpacity","legendTitle","opacity","_legendHighlighted","_noLegendHighlighted","updatePosition","newX","newY","threshold","distance","sqrt","pow","onBarHover","pointData","groupData","mouseEvent","persist","clientX","clientY","xAxisCalloutData","yAxisCalloutData","isCalloutForStack","_onBarLeave","onBarFocus","refArrayIndexNumber","targetRect","target","getBoundingClientRect","height","obj","_refCallback","element","refIndexNumber","refElement","singleGroup","barLabelsForGroup","tempDataSet","Object","splice","datasetKey","yBarScale","xPoint","startColor","yBaseline","yPositiveStart","yNegativeStart","yPoint","barGap","abs","Fragment","rect","className","opacityChangeOnHover","ref","e","fill","rx","onMouseOver","onMouseMove","onMouseOut","onFocus","onBlur","onClick","aria-label","getAriaLabel","tabIndex","role","hideLabels","text","textAnchor","barLabel","aria-hidden","yAxisTickFormat","wrapXAxisLables","showXAxisLablesTooltip","xAxisElement","call","document","getElementById","remove","tooltipProps","tooltipCls","tooltip","id","axis","g","transform","x0Axis","domain","range","paddingInner","paddingOuter","_getAxisData","useCallback","yAxisData","yAxisDomainValues","domainValue","_getHighlightedLegend","includes","xValue","yValue","ariaLabel","_getDomainMargins","totalWidth","groupGapRate","StringAxis","groupWidth","reqWidth","mode","groupBandwidth","barBandwidth","margin1","step","margin2","_isChartEmpty","item","_getChartTitle","chartTitle","getDomainNRangeValues","getMinMaxOfYAxis","legendBars","createYAxis","datasetForXAxisDomain","tickPadding","maxOfYVal","getmargins","getGraphData","getAxisData","onChartMouseLeave","getDomainMargins","barwidth","children","div","style","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yCAAyC,QAAQ,4CAA4C;AACtG,SAASC,UAAUC,QAAQ,QAAQ,eAAe;AAElD,SAASC,OAAOC,KAAK,EAAEC,OAAOC,KAAK,QAAQ,WAAW;AACtD,SAAsBC,aAAaC,WAAW,QAAQ,WAAW;AAEjE,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SACEC,UAAU,EAEVC,uBAAuB,EACvBC,mBAAmB,EACnBC,UAAU,EACVC,aAAa,EACbC,0BAA0B,EAC1B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