@fluentui/react-charts 0.0.0-nightly-20250423-0405.1 → 0.0.0-nightly-20250423-1415.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -16
- package/dist/index.d.ts +3337 -0
- package/lib/AreaChart.js +1 -0
- package/lib/AreaChart.js.map +1 -0
- package/lib/CartesianChart.js +1 -0
- package/lib/CartesianChart.js.map +1 -0
- package/lib/DeclarativeChart.js +1 -0
- package/lib/DeclarativeChart.js.map +1 -0
- package/lib/DonutChart.js +1 -0
- package/lib/DonutChart.js.map +1 -0
- package/lib/GaugeChart.js +1 -0
- package/lib/GaugeChart.js.map +1 -0
- package/lib/GroupedVerticalBarChart.js +1 -0
- package/lib/GroupedVerticalBarChart.js.map +1 -0
- package/lib/HeatMapChart.js +1 -0
- package/lib/HeatMapChart.js.map +1 -0
- package/lib/HorizontalBarChart.js +1 -0
- package/lib/HorizontalBarChart.js.map +1 -0
- package/lib/HorizontalBarChartWithAxis.js +1 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/Legends.js +1 -0
- package/lib/Legends.js.map +1 -0
- package/lib/LineChart.js +1 -0
- package/lib/LineChart.js.map +1 -0
- package/lib/Popover.js +1 -0
- package/lib/Popover.js.map +1 -0
- package/lib/ResponsiveContainer.js +1 -0
- package/lib/ResponsiveContainer.js.map +1 -0
- package/lib/SankeyChart.js +1 -0
- package/lib/SankeyChart.js.map +1 -0
- package/lib/ScatterChart.js +1 -0
- package/lib/ScatterChart.js.map +1 -0
- package/lib/Sparkline.js +1 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/VerticalBarChart.js +1 -0
- package/lib/VerticalBarChart.js.map +1 -0
- package/lib/VerticalStackedBarChart.js +1 -0
- package/lib/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js +775 -0
- package/lib/components/AreaChart/AreaChart.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.types.js +4 -0
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib/components/AreaChart/index.js +3 -0
- package/lib/components/AreaChart/index.js.map +1 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +64 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +478 -0
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js +1 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.js +187 -0
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js +1 -0
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib/components/CommonComponents/index.js +4 -0
- package/lib/components/CommonComponents/index.js.map +1 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +229 -0
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +178 -0
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +197 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +811 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib/components/DeclarativeChart/imageExporter.js +221 -0
- package/lib/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib/components/DeclarativeChart/index.js +1 -0
- package/lib/components/DeclarativeChart/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.js +110 -0
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js +1 -0
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib/components/DonutChart/Arc/index.js +2 -0
- package/lib/components/DonutChart/Arc/index.js.map +1 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +54 -0
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.js +291 -0
- package/lib/components/DonutChart/DonutChart.js.map +1 -0
- package/lib/components/DonutChart/DonutChart.types.js +1 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.js +72 -0
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js +1 -0
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib/components/DonutChart/Pie/index.js +2 -0
- package/lib/components/DonutChart/Pie/index.js.map +1 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +44 -0
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib/components/DonutChart/index.js +3 -0
- package/lib/components/DonutChart/index.js.map +1 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +58 -0
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.js +592 -0
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib/components/GaugeChart/GaugeChart.types.js +4 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib/components/GaugeChart/index.js +3 -0
- package/lib/components/GaugeChart/index.js.map +1 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +174 -0
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +501 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +4 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/index.js +3 -0
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +90 -0
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js +588 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js +4 -0
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib/components/HeatMapChart/index.js +3 -0
- package/lib/components/HeatMapChart/index.js.map +1 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +46 -0
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +402 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +6 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib/components/HorizontalBarChart/index.js +3 -0
- package/lib/components/HorizontalBarChart/index.js.map +1 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +163 -0
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +571 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +4 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +76 -0
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib/components/Legends/Legends.js +303 -0
- package/lib/components/Legends/Legends.js.map +1 -0
- package/lib/components/Legends/Legends.types.js +1 -0
- package/lib/components/Legends/Legends.types.js.map +1 -0
- package/lib/components/Legends/OverflowMenu.js +25 -0
- package/lib/components/Legends/OverflowMenu.js.map +1 -0
- package/lib/components/Legends/index.js +3 -0
- package/lib/components/Legends/index.js.map +1 -0
- package/lib/components/Legends/shape.js +35 -0
- package/lib/components/Legends/shape.js.map +1 -0
- package/lib/components/Legends/useLegendsStyles.styles.js +147 -0
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib/components/LineChart/LineChart.js +1034 -0
- package/lib/components/LineChart/LineChart.js.map +1 -0
- package/lib/components/LineChart/LineChart.types.js +3 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +119 -0
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +57 -0
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js +40 -0
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib/components/LineChart/index.js +4 -0
- package/lib/components/LineChart/index.js.map +1 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js +65 -0
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +65 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +1 -0
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib/components/ResponsiveContainer/index.js +1 -0
- package/lib/components/ResponsiveContainer/index.js.map +1 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +23 -0
- package/lib/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.js +1022 -0
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.types.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib/components/SankeyChart/index.js +3 -0
- package/lib/components/SankeyChart/index.js.map +1 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +109 -0
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.js +465 -0
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib/components/ScatterChart/ScatterChart.types.js +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib/components/ScatterChart/index.js +3 -0
- package/lib/components/ScatterChart/index.js.map +1 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +65 -0
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.js +119 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.js +4 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js +49 -0
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js +926 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +4 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib/components/VerticalBarChart/index.js +3 -0
- package/lib/components/VerticalBarChart/index.js.map +1 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +74 -0
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +904 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/index.js +3 -0
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +73 -0
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/types/DataPoint.js +1 -0
- package/lib/types/DataPoint.js.map +1 -0
- package/lib/types/EventAnnotation.js +1 -0
- package/lib/types/EventAnnotation.js.map +1 -0
- package/lib/types/LegendDataItem.js +1 -0
- package/lib/types/LegendDataItem.js.map +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -0
- package/lib/utilities/FocusableTooltipText.js +65 -0
- package/lib/utilities/FocusableTooltipText.js.map +1 -0
- package/lib/utilities/KeyCodes.js +8 -0
- package/lib/utilities/KeyCodes.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js +183 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -0
- package/lib/utilities/async-utils.js +380 -0
- package/lib/utilities/async-utils.js.map +1 -0
- package/lib/utilities/colors.js +269 -0
- package/lib/utilities/colors.js.map +1 -0
- package/lib/utilities/getWindow.js +25 -0
- package/lib/utilities/getWindow.js.map +1 -0
- package/lib/utilities/index.js +3 -0
- package/lib/utilities/index.js.map +1 -0
- package/lib/utilities/locale-util.js +15 -0
- package/lib/utilities/locale-util.js.map +1 -0
- package/lib/utilities/overflow-utils.js +27 -0
- package/lib/utilities/overflow-utils.js.map +1 -0
- package/lib/utilities/string.js +32 -0
- package/lib/utilities/string.js.map +1 -0
- package/lib/utilities/test-data.js +329 -0
- package/lib/utilities/test-data.js.map +1 -0
- package/lib/utilities/utilities.js +1405 -0
- package/lib/utilities/utilities.js.map +1 -0
- package/lib/utilities/vbc-utils.js +27 -0
- package/lib/utilities/vbc-utils.js.map +1 -0
- package/lib-commonjs/AreaChart.js +6 -0
- package/lib-commonjs/AreaChart.js.map +1 -0
- package/lib-commonjs/CartesianChart.js +6 -0
- package/lib-commonjs/CartesianChart.js.map +1 -0
- package/lib-commonjs/DeclarativeChart.js +6 -0
- package/lib-commonjs/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/DonutChart.js +6 -0
- package/lib-commonjs/DonutChart.js.map +1 -0
- package/lib-commonjs/GaugeChart.js +6 -0
- package/lib-commonjs/GaugeChart.js.map +1 -0
- package/lib-commonjs/GroupedVerticalBarChart.js +6 -0
- package/lib-commonjs/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/HeatMapChart.js +6 -0
- package/lib-commonjs/HeatMapChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChart.js +6 -0
- package/lib-commonjs/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +6 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/Legends.js +6 -0
- package/lib-commonjs/Legends.js.map +1 -0
- package/lib-commonjs/LineChart.js +6 -0
- package/lib-commonjs/LineChart.js.map +1 -0
- package/lib-commonjs/Popover.js +6 -0
- package/lib-commonjs/Popover.js.map +1 -0
- package/lib-commonjs/ResponsiveContainer.js +6 -0
- package/lib-commonjs/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/SankeyChart.js +6 -0
- package/lib-commonjs/SankeyChart.js.map +1 -0
- package/lib-commonjs/ScatterChart.js +6 -0
- package/lib-commonjs/ScatterChart.js.map +1 -0
- package/lib-commonjs/Sparkline.js +6 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/VerticalBarChart.js +6 -0
- package/lib-commonjs/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/VerticalStackedBarChart.js +6 -0
- package/lib-commonjs/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js +781 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +7 -0
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +1 -0
- package/lib-commonjs/components/AreaChart/index.js +8 -0
- package/lib-commonjs/components/AreaChart/index.js.map +1 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +104 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +484 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +6 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +197 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/index.js +9 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +356 -0
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +261 -0
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +205 -0
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +859 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +231 -0
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -0
- package/lib-commonjs/components/DeclarativeChart/index.js +6 -0
- package/lib-commonjs/components/DeclarativeChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +117 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +83 -0
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js +298 -0
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +6 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +79 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +4 -0
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js +7 -0
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +61 -0
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -0
- package/lib-commonjs/components/DonutChart/index.js +8 -0
- package/lib-commonjs/components/DonutChart/index.js.map +1 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +82 -0
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +621 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +7 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/index.js +8 -0
- package/lib-commonjs/components/GaugeChart/index.js.map +1 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +252 -0
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +507 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +139 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +599 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +7 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/index.js +8 -0
- package/lib-commonjs/components/HeatMapChart/index.js.map +1 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +68 -0
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +408 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +17 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +251 -0
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +580 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +7 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +8 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +116 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.js +313 -0
- package/lib-commonjs/components/Legends/Legends.js.map +1 -0
- package/lib-commonjs/components/Legends/Legends.types.js +6 -0
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js +36 -0
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -0
- package/lib-commonjs/components/Legends/index.js +8 -0
- package/lib-commonjs/components/Legends/index.js.map +1 -0
- package/lib-commonjs/components/Legends/shape.js +46 -0
- package/lib-commonjs/components/Legends/shape.js.map +1 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +304 -0
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.js +1040 -0
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js +6 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +129 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +68 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +51 -0
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -0
- package/lib-commonjs/components/LineChart/index.js +9 -0
- package/lib-commonjs/components/LineChart/index.js.map +1 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +96 -0
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +76 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js +6 -0
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +1 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js +47 -0
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveContainerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1038 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +6 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/index.js +8 -0
- package/lib-commonjs/components/SankeyChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +179 -0
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +471 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +7 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/index.js +8 -0
- package/lib-commonjs/components/ScatterChart/index.js.map +1 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +96 -0
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +125 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +7 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.js +8 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +77 -0
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +928 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +7 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +117 -0
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +915 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +6 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +8 -0
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +120 -0
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -0
- package/lib-commonjs/index.js +25 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/types/DataPoint.js +4 -0
- package/lib-commonjs/types/DataPoint.js.map +1 -0
- package/lib-commonjs/types/EventAnnotation.js +6 -0
- package/lib-commonjs/types/EventAnnotation.js.map +1 -0
- package/lib-commonjs/types/LegendDataItem.js +4 -0
- package/lib-commonjs/types/LegendDataItem.js.map +1 -0
- package/lib-commonjs/types/index.js +7 -0
- package/lib-commonjs/types/index.js.map +1 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js +75 -0
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/KeyCodes.js +18 -0
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js +193 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -0
- package/lib-commonjs/utilities/async-utils.js +382 -0
- package/lib-commonjs/utilities/async-utils.js.map +1 -0
- package/lib-commonjs/utilities/colors.js +293 -0
- package/lib-commonjs/utilities/colors.js.map +1 -0
- package/lib-commonjs/utilities/getWindow.js +28 -0
- package/lib-commonjs/utilities/getWindow.js.map +1 -0
- package/lib-commonjs/utilities/index.js +8 -0
- package/lib-commonjs/utilities/index.js.map +1 -0
- package/lib-commonjs/utilities/locale-util.js +25 -0
- package/lib-commonjs/utilities/locale-util.js.map +1 -0
- package/lib-commonjs/utilities/overflow-utils.js +36 -0
- package/lib-commonjs/utilities/overflow-utils.js.map +1 -0
- package/lib-commonjs/utilities/string.js +29 -0
- package/lib-commonjs/utilities/string.js.map +1 -0
- package/lib-commonjs/utilities/test-data.js +383 -0
- package/lib-commonjs/utilities/test-data.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +1371 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -0
- package/lib-commonjs/utilities/vbc-utils.js +45 -0
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -0
- package/package.json +13 -13
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
ARC_PADDING: function() {
|
|
13
|
+
return ARC_PADDING;
|
|
14
|
+
},
|
|
15
|
+
BREAKPOINTS: function() {
|
|
16
|
+
return BREAKPOINTS;
|
|
17
|
+
},
|
|
18
|
+
GaugeChart: function() {
|
|
19
|
+
return GaugeChart;
|
|
20
|
+
},
|
|
21
|
+
calcNeedleRotation: function() {
|
|
22
|
+
return calcNeedleRotation;
|
|
23
|
+
},
|
|
24
|
+
getChartValueLabel: function() {
|
|
25
|
+
return getChartValueLabel;
|
|
26
|
+
},
|
|
27
|
+
getSegmentLabel: function() {
|
|
28
|
+
return getSegmentLabel;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
32
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
33
|
+
const _useGaugeChartStylesstyles = require("./useGaugeChartStyles.styles");
|
|
34
|
+
const _d3selection = require("d3-selection");
|
|
35
|
+
const _d3shape = require("d3-shape");
|
|
36
|
+
const _index = require("../../utilities/index");
|
|
37
|
+
const _localeutil = require("../../utilities/locale-util");
|
|
38
|
+
const _SVGTooltipText = require("../../utilities/SVGTooltipText");
|
|
39
|
+
const _index1 = require("../Legends/index");
|
|
40
|
+
const _reacttabster = require("@fluentui/react-tabster");
|
|
41
|
+
const _ChartPopover = require("../CommonComponents/ChartPopover");
|
|
42
|
+
const GAUGE_MARGIN = 16;
|
|
43
|
+
const LABEL_WIDTH = 36;
|
|
44
|
+
const LABEL_HEIGHT = 16;
|
|
45
|
+
const LABEL_OFFSET = 4;
|
|
46
|
+
const TITLE_OFFSET = 11;
|
|
47
|
+
const EXTRA_NEEDLE_LENGTH = 4;
|
|
48
|
+
const ARC_PADDING = 2;
|
|
49
|
+
const BREAKPOINTS = [
|
|
50
|
+
{
|
|
51
|
+
minRadius: 52,
|
|
52
|
+
arcWidth: 12,
|
|
53
|
+
fontSize: 20
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
minRadius: 70,
|
|
57
|
+
arcWidth: 16,
|
|
58
|
+
fontSize: 24
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
minRadius: 88,
|
|
62
|
+
arcWidth: 20,
|
|
63
|
+
fontSize: 32
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
minRadius: 106,
|
|
67
|
+
arcWidth: 24,
|
|
68
|
+
fontSize: 32
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
minRadius: 124,
|
|
72
|
+
arcWidth: 28,
|
|
73
|
+
fontSize: 40
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
minRadius: 142,
|
|
77
|
+
arcWidth: 32,
|
|
78
|
+
fontSize: 40
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
const calcNeedleRotation = (chartValue, minValue, maxValue)=>{
|
|
82
|
+
let needleRotation = (chartValue - minValue) / (maxValue - minValue) * 180;
|
|
83
|
+
if (needleRotation < 0) {
|
|
84
|
+
needleRotation = 0;
|
|
85
|
+
} else if (needleRotation > 180) {
|
|
86
|
+
needleRotation = 180;
|
|
87
|
+
}
|
|
88
|
+
return needleRotation;
|
|
89
|
+
};
|
|
90
|
+
const getSegmentLabel = (segment, minValue, maxValue, variant, isAriaLabel = false)=>{
|
|
91
|
+
if (isAriaLabel) {
|
|
92
|
+
return minValue === 0 && variant === 'single-segment' ? `${segment.legend}, ${segment.size} out of ${maxValue} or ${(segment.size / maxValue * 100).toFixed()}%` : `${segment.legend}, ${segment.start} to ${segment.end}`;
|
|
93
|
+
}
|
|
94
|
+
return minValue === 0 && variant === 'single-segment' ? `${segment.size} (${(segment.size / maxValue * 100).toFixed()}%)` : `${segment.start} - ${segment.end}`;
|
|
95
|
+
};
|
|
96
|
+
const getChartValueLabel = (chartValue, minValue, maxValue, chartValueFormat, forCallout = false)=>{
|
|
97
|
+
if (forCallout) {
|
|
98
|
+
// When displaying the chart value as a percentage, use fractions in the callout, and vice versa.
|
|
99
|
+
// This helps clarify the actual value and avoid repetition.
|
|
100
|
+
return minValue !== 0 ? chartValue.toString() : chartValueFormat === 'fraction' ? `${(chartValue / maxValue * 100).toFixed()}%` : `${chartValue}/${maxValue}`;
|
|
101
|
+
}
|
|
102
|
+
return typeof chartValueFormat === 'function' ? chartValueFormat([
|
|
103
|
+
chartValue - minValue,
|
|
104
|
+
maxValue - minValue
|
|
105
|
+
]) : minValue !== 0 ? chartValue.toString() : chartValueFormat === 'fraction' ? `${chartValue}/${maxValue}` : `${(chartValue / maxValue * 100).toFixed()}%`;
|
|
106
|
+
};
|
|
107
|
+
const GaugeChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
108
|
+
var _props_legendProps;
|
|
109
|
+
const _getMargins = ()=>{
|
|
110
|
+
const { hideMinMax, chartTitle, sublabel } = props;
|
|
111
|
+
return {
|
|
112
|
+
left: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,
|
|
113
|
+
right: (!hideMinMax ? LABEL_OFFSET + LABEL_WIDTH : 0) + GAUGE_MARGIN,
|
|
114
|
+
top: (chartTitle ? TITLE_OFFSET + LABEL_HEIGHT : EXTRA_NEEDLE_LENGTH / 2) + GAUGE_MARGIN,
|
|
115
|
+
bottom: (sublabel ? LABEL_OFFSET + LABEL_HEIGHT : 0) + GAUGE_MARGIN
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
const _margins = _getMargins();
|
|
119
|
+
const _legendsHeight = !props.hideLegend ? 24 : 0;
|
|
120
|
+
const _rootElem = _react.useRef(null);
|
|
121
|
+
const _isRTL = (0, _index.useRtl)();
|
|
122
|
+
const [width, setWidth] = _react.useState(140 + _getMargins().left + _getMargins().right);
|
|
123
|
+
const [height, setHeight] = _react.useState(70 + _getMargins().top + _getMargins().bottom + _legendsHeight);
|
|
124
|
+
const [hoveredLegend, setHoveredLegend] = _react.useState('');
|
|
125
|
+
const [selectedLegends, setSelectedLegends] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
|
|
126
|
+
const [focusedElement, setFocusedElement] = _react.useState('');
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
const [clickPosition, setClickPosition] = _react.useState({
|
|
129
|
+
x: 0,
|
|
130
|
+
y: 0
|
|
131
|
+
});
|
|
132
|
+
const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
|
|
133
|
+
const [hoverXValue, setHoverXValue] = _react.useState('');
|
|
134
|
+
const [hoverYValues, setHoverYValues] = _react.useState([]);
|
|
135
|
+
const prevPropsRef = _react.useRef(null);
|
|
136
|
+
const _width = props.width || width;
|
|
137
|
+
const _height = props.height || height;
|
|
138
|
+
const _outerRadius = Math.min((_width - (_margins.left + _margins.right)) / 2, _height - (_margins.top + _margins.bottom + _legendsHeight));
|
|
139
|
+
const { arcWidth, chartValueSize } = _getStylesBasedOnBreakpoint();
|
|
140
|
+
const _innerRadius = _outerRadius - arcWidth;
|
|
141
|
+
let _minValue;
|
|
142
|
+
let _maxValue;
|
|
143
|
+
let _segments;
|
|
144
|
+
let _calloutAnchor = '';
|
|
145
|
+
_react.useEffect(()=>{
|
|
146
|
+
if (prevPropsRef.current) {
|
|
147
|
+
var _prevProps_legendProps, _props_legendProps;
|
|
148
|
+
const prevProps = prevPropsRef.current;
|
|
149
|
+
if (!(0, _index.areArraysEqual)((_prevProps_legendProps = prevProps.legendProps) === null || _prevProps_legendProps === void 0 ? void 0 : _prevProps_legendProps.selectedLegends, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
|
|
150
|
+
var _props_legendProps1;
|
|
151
|
+
setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
|
|
152
|
+
}
|
|
153
|
+
if (prevProps.height !== props.height || prevProps.width !== props.width) {
|
|
154
|
+
setWidth(props.width);
|
|
155
|
+
setHeight(props.height);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
prevPropsRef.current = props;
|
|
159
|
+
}, [
|
|
160
|
+
props
|
|
161
|
+
]);
|
|
162
|
+
_react.useImperativeHandle(props.componentRef, ()=>({
|
|
163
|
+
chartContainer: _rootElem.current
|
|
164
|
+
}), []);
|
|
165
|
+
const classes = (0, _useGaugeChartStylesstyles.useGaugeChartStyles)(props);
|
|
166
|
+
function _getStylesBasedOnBreakpoint() {
|
|
167
|
+
for(let index = BREAKPOINTS.length - 1; index >= 0; index -= 1){
|
|
168
|
+
if (_outerRadius >= BREAKPOINTS[index].minRadius) {
|
|
169
|
+
return {
|
|
170
|
+
arcWidth: BREAKPOINTS[index].arcWidth,
|
|
171
|
+
chartValueSize: BREAKPOINTS[index].fontSize
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
arcWidth: BREAKPOINTS[0].arcWidth,
|
|
177
|
+
chartValueSize: BREAKPOINTS[0].fontSize
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function _processProps() {
|
|
181
|
+
const { minValue = 0, maxValue, segments, roundCorners } = props;
|
|
182
|
+
let total = minValue;
|
|
183
|
+
const processedSegments = segments.map((segment, index)=>{
|
|
184
|
+
const size = Math.max(segment.size, 0);
|
|
185
|
+
total += size;
|
|
186
|
+
return {
|
|
187
|
+
legend: segment.legend,
|
|
188
|
+
size,
|
|
189
|
+
color: typeof segment.color !== 'undefined' ? (0, _index.getColorFromToken)(segment.color, false) : (0, _index.getNextColor)(index, 0, false),
|
|
190
|
+
accessibilityData: segment.accessibilityData,
|
|
191
|
+
start: total - size,
|
|
192
|
+
end: total
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
if (typeof maxValue !== 'undefined' && total < maxValue) {
|
|
196
|
+
processedSegments.push({
|
|
197
|
+
legend: 'Unknown',
|
|
198
|
+
size: maxValue - total,
|
|
199
|
+
color: 'neutralLight',
|
|
200
|
+
start: total,
|
|
201
|
+
end: maxValue
|
|
202
|
+
});
|
|
203
|
+
total = maxValue;
|
|
204
|
+
}
|
|
205
|
+
const arcGenerator = (0, _d3shape.arc)().cornerRadius(roundCorners ? 3 : 0).padAngle(ARC_PADDING / _outerRadius).padRadius(_outerRadius);
|
|
206
|
+
const rtlSafeSegments = _isRTL ? Array.from(processedSegments).reverse() : processedSegments;
|
|
207
|
+
let prevAngle = -Math.PI / 2;
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
209
|
+
const arcs = rtlSafeSegments.map((segment, index)=>{
|
|
210
|
+
const endAngle = prevAngle + segment.size / (total - minValue) * Math.PI;
|
|
211
|
+
const d = arcGenerator({
|
|
212
|
+
innerRadius: _innerRadius,
|
|
213
|
+
outerRadius: _outerRadius,
|
|
214
|
+
startAngle: prevAngle,
|
|
215
|
+
endAngle
|
|
216
|
+
});
|
|
217
|
+
prevAngle = endAngle;
|
|
218
|
+
return {
|
|
219
|
+
d,
|
|
220
|
+
segmentIndex: _isRTL ? processedSegments.length - 1 - index : index,
|
|
221
|
+
startAngle: prevAngle - segment.size / (total - minValue) * Math.PI,
|
|
222
|
+
endAngle
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
_minValue = minValue;
|
|
226
|
+
_maxValue = total;
|
|
227
|
+
_segments = processedSegments;
|
|
228
|
+
return {
|
|
229
|
+
arcs
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function _renderNeedle() {
|
|
233
|
+
const needleRotation = calcNeedleRotation(props.chartValue, _minValue, _maxValue);
|
|
234
|
+
const rtlSafeNeedleRotation = _isRTL ? 180 - needleRotation : needleRotation;
|
|
235
|
+
const strokeWidth = 2;
|
|
236
|
+
const halfStrokeWidth = strokeWidth / 2;
|
|
237
|
+
const needleLength = _outerRadius - _innerRadius + EXTRA_NEEDLE_LENGTH;
|
|
238
|
+
return /*#__PURE__*/ _react.createElement("g", {
|
|
239
|
+
transform: `rotate(${rtlSafeNeedleRotation}, 0, 0)`
|
|
240
|
+
}, /*#__PURE__*/ _react.createElement("path", {
|
|
241
|
+
d: `
|
|
242
|
+
M 0,${-halfStrokeWidth - 3}
|
|
243
|
+
L ${-needleLength},${-halfStrokeWidth - 1}
|
|
244
|
+
A ${halfStrokeWidth + 1},${halfStrokeWidth + 1},0,0,0,${-needleLength},${halfStrokeWidth + 1}
|
|
245
|
+
L 0,${halfStrokeWidth + 3}
|
|
246
|
+
A ${halfStrokeWidth + 3},${halfStrokeWidth + 3},0,0,0,0,${-halfStrokeWidth - 3}
|
|
247
|
+
`,
|
|
248
|
+
strokeWidth: strokeWidth,
|
|
249
|
+
className: classes.needle,
|
|
250
|
+
transform: `translate(${-_innerRadius + EXTRA_NEEDLE_LENGTH / 2})`,
|
|
251
|
+
"data-is-focusable": true,
|
|
252
|
+
onFocus: (e)=>_handleFocus(e, 'Needle'),
|
|
253
|
+
onBlur: _handleBlur,
|
|
254
|
+
onMouseEnter: (e)=>_handleMouseOver(e, 'Needle'),
|
|
255
|
+
onMouseMove: (e)=>_handleMouseOver(e, 'Needle'),
|
|
256
|
+
role: "img",
|
|
257
|
+
"aria-label": 'Current value: ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat)
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
260
|
+
function _renderLegends() {
|
|
261
|
+
if (props.hideLegend) {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
const legends = _segments.map((segment, index)=>{
|
|
265
|
+
const color = segment.color || (0, _index.getNextColor)(index, 0, false);
|
|
266
|
+
return {
|
|
267
|
+
title: segment.legend,
|
|
268
|
+
color,
|
|
269
|
+
hoverAction: ()=>{
|
|
270
|
+
setHoveredLegend(segment.legend);
|
|
271
|
+
},
|
|
272
|
+
onMouseOutAction: ()=>{
|
|
273
|
+
setHoveredLegend('');
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
278
|
+
className: classes.legendsContainer,
|
|
279
|
+
style: {
|
|
280
|
+
width: props.width
|
|
281
|
+
}
|
|
282
|
+
}, /*#__PURE__*/ _react.createElement(_index1.Legends, {
|
|
283
|
+
legends: legends,
|
|
284
|
+
centerLegends: true,
|
|
285
|
+
...props.legendProps,
|
|
286
|
+
// eslint-disable-next-line react/jsx-no-bind
|
|
287
|
+
onChange: _onLegendSelectionChange
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
function _onLegendSelectionChange(selectedLegends, event, currentLegend) {
|
|
291
|
+
var _props_legendProps, _props_legendProps1;
|
|
292
|
+
if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
|
|
293
|
+
setSelectedLegends(selectedLegends);
|
|
294
|
+
} else {
|
|
295
|
+
setSelectedLegends(selectedLegends.slice(-1));
|
|
296
|
+
}
|
|
297
|
+
if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
|
|
298
|
+
props.legendProps.onChange(selectedLegends, event, currentLegend);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* This function checks if the given legend is highlighted or not.
|
|
303
|
+
* A legend can be highlighted in 2 ways:
|
|
304
|
+
* 1. selection: if the user clicks on it
|
|
305
|
+
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
306
|
+
*/ function _legendHighlighted(legend) {
|
|
307
|
+
return _getHighlightedLegend().includes(legend);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* This function checks if none of the legends is selected or hovered.
|
|
311
|
+
*/ function _noLegendHighlighted() {
|
|
312
|
+
return _getHighlightedLegend().length === 0;
|
|
313
|
+
}
|
|
314
|
+
function _getHighlightedLegend() {
|
|
315
|
+
return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [
|
|
316
|
+
hoveredLegend
|
|
317
|
+
] : [];
|
|
318
|
+
}
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
320
|
+
function _handleFocus(focusEvent, focusedElement) {
|
|
321
|
+
_showCallout(focusEvent, focusedElement, true);
|
|
322
|
+
}
|
|
323
|
+
function _handleBlur() {
|
|
324
|
+
_hideCallout(true);
|
|
325
|
+
}
|
|
326
|
+
function _handleMouseOver(mouseEvent, hoveredElement) {
|
|
327
|
+
_showCallout(mouseEvent, hoveredElement, false);
|
|
328
|
+
}
|
|
329
|
+
function _handleMouseOut() {
|
|
330
|
+
_hideCallout(false);
|
|
331
|
+
}
|
|
332
|
+
function _handleCalloutDismiss() {
|
|
333
|
+
_hideCallout(false);
|
|
334
|
+
}
|
|
335
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
336
|
+
function _showCallout(event, legend, isFocusEvent) {
|
|
337
|
+
if (_calloutAnchor === legend) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
let clientX = 0;
|
|
341
|
+
let clientY = 0;
|
|
342
|
+
if ('clientX' in event) {
|
|
343
|
+
clientX = event.clientX;
|
|
344
|
+
clientY = event.clientY;
|
|
345
|
+
} else {
|
|
346
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
347
|
+
const target = event.currentTarget;
|
|
348
|
+
if (target && 'getBoundingClientRect' in target) {
|
|
349
|
+
const boundingRect = target.getBoundingClientRect();
|
|
350
|
+
clientX = boundingRect.left + boundingRect.width / 2;
|
|
351
|
+
clientY = boundingRect.top + boundingRect.height / 2;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
_calloutAnchor = legend;
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
356
|
+
const hoverXValue = 'Current value is ' + getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat, true);
|
|
357
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
358
|
+
const hoverYValues = _segments.map((segment)=>{
|
|
359
|
+
const yValue = {
|
|
360
|
+
legend: segment.legend,
|
|
361
|
+
y: getSegmentLabel(segment, _minValue, _maxValue, props.variant),
|
|
362
|
+
color: segment.color
|
|
363
|
+
};
|
|
364
|
+
return yValue;
|
|
365
|
+
});
|
|
366
|
+
_updatePosition(clientX, clientY);
|
|
367
|
+
setPopoverOpen([
|
|
368
|
+
'Needle',
|
|
369
|
+
'Chart value'
|
|
370
|
+
].includes(legend) || _noLegendHighlighted() || _legendHighlighted(legend));
|
|
371
|
+
setHoverXValue(hoverXValue);
|
|
372
|
+
setHoverYValues(hoverYValues);
|
|
373
|
+
if (isFocusEvent) {
|
|
374
|
+
setFocusedElement(legend);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function _hideCallout(isBlurEvent) {
|
|
378
|
+
_calloutAnchor = '';
|
|
379
|
+
setPopoverOpen(false);
|
|
380
|
+
setHoverXValue('');
|
|
381
|
+
setHoverYValues([]);
|
|
382
|
+
if (isBlurEvent) {
|
|
383
|
+
setFocusedElement('');
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function _wrapContent(content, id, maxWidth) {
|
|
387
|
+
const textElement = (0, _d3selection.select)(`#${id}`);
|
|
388
|
+
textElement.text(content);
|
|
389
|
+
if (!textElement.node()) {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
let isOverflowing = false;
|
|
393
|
+
let textLength = textElement.node().getComputedTextLength();
|
|
394
|
+
while(textLength > maxWidth && content.length > 0){
|
|
395
|
+
content = content.slice(0, -1);
|
|
396
|
+
textElement.text(content + '...');
|
|
397
|
+
isOverflowing = true;
|
|
398
|
+
textLength = textElement.node().getComputedTextLength();
|
|
399
|
+
}
|
|
400
|
+
return isOverflowing;
|
|
401
|
+
}
|
|
402
|
+
// TO DO: Write a common functional component for Multi value callout and divide sub count method
|
|
403
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
404
|
+
function _multiValueCallout(calloutProps) {
|
|
405
|
+
const yValueHoverSubCountsExists = _yValueHoverSubCountsExists(calloutProps.YValueHover);
|
|
406
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
407
|
+
className: classes.calloutContentRoot
|
|
408
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
409
|
+
className: classes.calloutDateTimeContainer,
|
|
410
|
+
style: yValueHoverSubCountsExists ? {
|
|
411
|
+
marginBottom: '11px'
|
|
412
|
+
} : {}
|
|
413
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
414
|
+
className: classes.calloutContentX,
|
|
415
|
+
...(0, _index.getAccessibleDataObject)(calloutProps.xAxisCalloutAccessibilityData, 'text', false)
|
|
416
|
+
}, (0, _localeutil.convertToLocaleString)(calloutProps.hoverXValue, props.culture))), /*#__PURE__*/ _react.createElement("div", {
|
|
417
|
+
className: classes.calloutInfoContainer,
|
|
418
|
+
style: yValueHoverSubCountsExists ? {
|
|
419
|
+
display: 'flex'
|
|
420
|
+
} : {}
|
|
421
|
+
}, calloutProps.YValueHover && calloutProps.YValueHover.map((yValue, index, yValues)=>{
|
|
422
|
+
const isLast = index + 1 === yValues.length;
|
|
423
|
+
const { shouldDrawBorderBottom = false } = yValue;
|
|
424
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
425
|
+
...(0, _index.getAccessibleDataObject)(yValue.callOutAccessibilityData, 'text', false),
|
|
426
|
+
key: `callout-content-${index}`,
|
|
427
|
+
style: yValueHoverSubCountsExists ? {
|
|
428
|
+
display: 'inline-block',
|
|
429
|
+
...shouldDrawBorderBottom && {
|
|
430
|
+
paddingBottom: '10px'
|
|
431
|
+
}
|
|
432
|
+
} : {
|
|
433
|
+
...shouldDrawBorderBottom && {
|
|
434
|
+
paddingBottom: '10px'
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}, _getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast));
|
|
438
|
+
}), !!calloutProps.descriptionMessage && /*#__PURE__*/ _react.createElement("div", {
|
|
439
|
+
className: classes.descriptionMessage
|
|
440
|
+
}, calloutProps.descriptionMessage)));
|
|
441
|
+
}
|
|
442
|
+
function _yValueHoverSubCountsExists(yValueHover) {
|
|
443
|
+
if (yValueHover) {
|
|
444
|
+
return yValueHover.some((yValue)=>yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string');
|
|
445
|
+
}
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
function _getCalloutContent(xValue, index, yValueHoverSubCountsExists, isLast) {
|
|
449
|
+
const marginStyle = isLast ? {} : {
|
|
450
|
+
marginRight: '16px'
|
|
451
|
+
};
|
|
452
|
+
const toDrawShape = xValue.index !== undefined && xValue.index !== -1;
|
|
453
|
+
const { culture } = props;
|
|
454
|
+
const yValue = (0, _localeutil.convertToLocaleString)(xValue.y, culture);
|
|
455
|
+
if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {
|
|
456
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
457
|
+
style: yValueHoverSubCountsExists ? marginStyle : {}
|
|
458
|
+
}, yValueHoverSubCountsExists && /*#__PURE__*/ _react.createElement("div", {
|
|
459
|
+
className: "ms-fontWeight-semibold",
|
|
460
|
+
style: {
|
|
461
|
+
fontSize: '12pt'
|
|
462
|
+
}
|
|
463
|
+
}, xValue.legend, " (", yValue, ")"), /*#__PURE__*/ _react.createElement("div", {
|
|
464
|
+
id: `${index}_${xValue.y}`,
|
|
465
|
+
className: classes.calloutBlockContainer,
|
|
466
|
+
style: {
|
|
467
|
+
borderLeft: `4px solid ${xValue.color}`
|
|
468
|
+
}
|
|
469
|
+
}, toDrawShape && /*#__PURE__*/ _react.createElement(_index1.Shape, {
|
|
470
|
+
svgProps: {
|
|
471
|
+
className: classes.shapeStyles
|
|
472
|
+
},
|
|
473
|
+
pathProps: {
|
|
474
|
+
fill: xValue.color
|
|
475
|
+
},
|
|
476
|
+
shape: _index.Points[xValue.index % Object.keys(_index.pointTypes).length],
|
|
477
|
+
style: {
|
|
478
|
+
display: 'flex'
|
|
479
|
+
}
|
|
480
|
+
}), /*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement("div", {
|
|
481
|
+
className: classes.calloutlegendText
|
|
482
|
+
}, " ", xValue.legend), /*#__PURE__*/ _react.createElement("div", {
|
|
483
|
+
className: classes.calloutContentY
|
|
484
|
+
}, (0, _localeutil.convertToLocaleString)(xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, culture)))));
|
|
485
|
+
} else {
|
|
486
|
+
const subcounts = xValue.yAxisCalloutData;
|
|
487
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
488
|
+
style: marginStyle
|
|
489
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
490
|
+
className: "ms-fontWeight-semibold",
|
|
491
|
+
style: {
|
|
492
|
+
fontSize: '12pt'
|
|
493
|
+
}
|
|
494
|
+
}, xValue.legend, " (", yValue, ")"), Object.keys(subcounts).map((subcountName)=>{
|
|
495
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
496
|
+
key: subcountName,
|
|
497
|
+
className: classes.calloutBlockContainer
|
|
498
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
499
|
+
className: classes.calloutlegendText
|
|
500
|
+
}, " ", (0, _localeutil.convertToLocaleString)(subcountName, culture)), /*#__PURE__*/ _react.createElement("div", {
|
|
501
|
+
className: classes.calloutContentY
|
|
502
|
+
}, (0, _localeutil.convertToLocaleString)(subcounts[subcountName], culture)));
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function _updatePosition(newX, newY) {
|
|
507
|
+
const threshold = 1; // Set a threshold for movement
|
|
508
|
+
const { x, y } = clickPosition;
|
|
509
|
+
// Calculate the distance moved
|
|
510
|
+
const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
|
|
511
|
+
// Update the position only if the distance moved is greater than the threshold
|
|
512
|
+
if (distance > threshold) {
|
|
513
|
+
setClickPosition({
|
|
514
|
+
x: newX,
|
|
515
|
+
y: newY
|
|
516
|
+
});
|
|
517
|
+
setPopoverOpen(true);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function _getChartTitle() {
|
|
521
|
+
const { chartTitle } = props;
|
|
522
|
+
return (chartTitle ? `${chartTitle}. ` : '') + `Gauge chart with ${_segments.length} segments. `;
|
|
523
|
+
}
|
|
524
|
+
const { arcs } = _processProps();
|
|
525
|
+
const focusAttributes = (0, _reacttabster.useFocusableGroup)();
|
|
526
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
527
|
+
className: classes.root,
|
|
528
|
+
ref: (el)=>_rootElem.current = el,
|
|
529
|
+
...focusAttributes
|
|
530
|
+
}, /*#__PURE__*/ _react.createElement("svg", {
|
|
531
|
+
className: classes.chart,
|
|
532
|
+
style: {
|
|
533
|
+
width: props.width,
|
|
534
|
+
height: props.height - _legendsHeight
|
|
535
|
+
},
|
|
536
|
+
role: "region",
|
|
537
|
+
"aria-label": _getChartTitle(),
|
|
538
|
+
onMouseLeave: _handleMouseOut
|
|
539
|
+
}, /*#__PURE__*/ _react.createElement("g", {
|
|
540
|
+
transform: `translate(${width / 2}, ${height - (_margins.bottom + _legendsHeight)})`
|
|
541
|
+
}, props.chartTitle && /*#__PURE__*/ _react.createElement("text", {
|
|
542
|
+
x: 0,
|
|
543
|
+
y: -(_outerRadius + TITLE_OFFSET),
|
|
544
|
+
textAnchor: "middle",
|
|
545
|
+
className: classes.chartTitle,
|
|
546
|
+
"aria-hidden": true
|
|
547
|
+
}, props.chartTitle), !props.hideMinMax && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("text", {
|
|
548
|
+
x: (_isRTL ? 1 : -1) * (_outerRadius + LABEL_OFFSET),
|
|
549
|
+
y: 0,
|
|
550
|
+
textAnchor: "end",
|
|
551
|
+
className: classes.limits,
|
|
552
|
+
role: "img",
|
|
553
|
+
"aria-label": `Min value: ${_minValue}`
|
|
554
|
+
}, (0, _index.formatValueWithSIPrefix)(_minValue)), /*#__PURE__*/ _react.createElement("text", {
|
|
555
|
+
x: (_isRTL ? -1 : 1) * (_outerRadius + LABEL_OFFSET),
|
|
556
|
+
y: 0,
|
|
557
|
+
textAnchor: "start",
|
|
558
|
+
className: classes.limits,
|
|
559
|
+
role: "img",
|
|
560
|
+
"aria-label": `Max value: ${_maxValue}`
|
|
561
|
+
}, (0, _index.formatValueWithSIPrefix)(_maxValue))), arcs.map((arc, index)=>{
|
|
562
|
+
const segment = _segments[arc.segmentIndex];
|
|
563
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, {
|
|
564
|
+
key: index
|
|
565
|
+
}, /*#__PURE__*/ _react.createElement("path", {
|
|
566
|
+
d: arc.d,
|
|
567
|
+
strokeWidth: focusedElement === segment.legend ? ARC_PADDING : 0,
|
|
568
|
+
className: classes.segment,
|
|
569
|
+
fill: segment.color,
|
|
570
|
+
opacity: _legendHighlighted(segment.legend) || _noLegendHighlighted() ? 1 : 0.1,
|
|
571
|
+
...(0, _index.getAccessibleDataObject)({
|
|
572
|
+
ariaLabel: getSegmentLabel(segment, _minValue, _maxValue, props.variant, true),
|
|
573
|
+
...segment.accessibilityData
|
|
574
|
+
}, 'img', true),
|
|
575
|
+
onFocus: (e)=>_handleFocus(e, segment.legend),
|
|
576
|
+
onBlur: _handleBlur,
|
|
577
|
+
onMouseEnter: (e)=>_handleMouseOver(e, segment.legend),
|
|
578
|
+
onMouseLeave: (e)=>_handleCalloutDismiss(),
|
|
579
|
+
onMouseMove: (e)=>_handleMouseOver(e, segment.legend),
|
|
580
|
+
"data-is-focusable": _legendHighlighted(segment.legend) || _noLegendHighlighted(),
|
|
581
|
+
tabIndex: segment.legend !== '' ? 0 : undefined
|
|
582
|
+
}));
|
|
583
|
+
}), _renderNeedle(), /*#__PURE__*/ _react.createElement("g", {
|
|
584
|
+
onMouseEnter: (e)=>_handleMouseOver(e, 'Chart value'),
|
|
585
|
+
onMouseMove: (e)=>_handleMouseOver(e, 'Chart value')
|
|
586
|
+
}, /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
587
|
+
content: getChartValueLabel(props.chartValue, _minValue, _maxValue, props.chartValueFormat),
|
|
588
|
+
textProps: {
|
|
589
|
+
x: 0,
|
|
590
|
+
y: 0,
|
|
591
|
+
textAnchor: 'middle',
|
|
592
|
+
className: classes.chartValue,
|
|
593
|
+
fontSize: chartValueSize,
|
|
594
|
+
'aria-hidden': 'true'
|
|
595
|
+
},
|
|
596
|
+
maxWidth: _innerRadius * 2 - 24,
|
|
597
|
+
wrapContent: _wrapContent
|
|
598
|
+
})), props.sublabel && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
599
|
+
content: props.sublabel,
|
|
600
|
+
textProps: {
|
|
601
|
+
x: 0,
|
|
602
|
+
y: 4,
|
|
603
|
+
textAnchor: 'middle',
|
|
604
|
+
dominantBaseline: 'hanging',
|
|
605
|
+
className: classes.sublabel
|
|
606
|
+
},
|
|
607
|
+
maxWidth: _innerRadius * 2,
|
|
608
|
+
wrapContent: _wrapContent
|
|
609
|
+
}))), _renderLegends(), !props.hideTooltip && isPopoverOpen && /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, {
|
|
610
|
+
...props.calloutProps,
|
|
611
|
+
clickPosition: clickPosition,
|
|
612
|
+
isPopoverOpen: isPopoverOpen,
|
|
613
|
+
customCallout: {
|
|
614
|
+
customizedCallout: _multiValueCallout({
|
|
615
|
+
hoverXValue: hoverXValue,
|
|
616
|
+
YValueHover: hoverYValues
|
|
617
|
+
})
|
|
618
|
+
}
|
|
619
|
+
}));
|
|
620
|
+
});
|
|
621
|
+
GaugeChart.displayName = 'GaugeChart';
|