@fluentui/react-charts 9.3.21 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0
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 +20 -2
- package/package.json +15 -17
- package/dist/index.d.ts +0 -5724
- package/lib/AnnotationOnlyChart.js +0 -1
- package/lib/AnnotationOnlyChart.js.map +0 -1
- package/lib/AreaChart.js +0 -1
- package/lib/AreaChart.js.map +0 -1
- package/lib/CartesianChart.js +0 -1
- package/lib/CartesianChart.js.map +0 -1
- package/lib/ChartTable.js +0 -1
- package/lib/ChartTable.js.map +0 -1
- package/lib/DeclarativeChart.js +0 -1
- package/lib/DeclarativeChart.js.map +0 -1
- package/lib/DonutChart.js +0 -1
- package/lib/DonutChart.js.map +0 -1
- package/lib/FunnelChart.js +0 -1
- package/lib/FunnelChart.js.map +0 -1
- package/lib/GanttChart.js +0 -1
- package/lib/GanttChart.js.map +0 -1
- package/lib/GaugeChart.js +0 -1
- package/lib/GaugeChart.js.map +0 -1
- package/lib/GroupedVerticalBarChart.js +0 -1
- package/lib/GroupedVerticalBarChart.js.map +0 -1
- package/lib/HeatMapChart.js +0 -1
- package/lib/HeatMapChart.js.map +0 -1
- package/lib/HorizontalBarChart.js +0 -1
- package/lib/HorizontalBarChart.js.map +0 -1
- package/lib/HorizontalBarChartWithAxis.js +0 -1
- package/lib/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib/Legends.js +0 -1
- package/lib/Legends.js.map +0 -1
- package/lib/LineChart.js +0 -1
- package/lib/LineChart.js.map +0 -1
- package/lib/PolarChart.js +0 -1
- package/lib/PolarChart.js.map +0 -1
- package/lib/Popover.js +0 -1
- package/lib/Popover.js.map +0 -1
- package/lib/ResponsiveContainer.js +0 -1
- package/lib/ResponsiveContainer.js.map +0 -1
- package/lib/SankeyChart.js +0 -1
- package/lib/SankeyChart.js.map +0 -1
- package/lib/ScatterChart.js +0 -1
- package/lib/ScatterChart.js.map +0 -1
- package/lib/Sparkline.js +0 -1
- package/lib/Sparkline.js.map +0 -1
- package/lib/VegaDeclarativeChart.js +0 -1
- package/lib/VegaDeclarativeChart.js.map +0 -1
- package/lib/VerticalBarChart.js +0 -1
- package/lib/VerticalBarChart.js.map +0 -1
- package/lib/VerticalStackedBarChart.js +0 -1
- package/lib/VerticalStackedBarChart.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +0 -196
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +0 -3
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/index.js +0 -2
- package/lib/components/AnnotationOnlyChart/index.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +0 -33
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +0 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +0 -24
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +0 -1
- package/lib/components/AreaChart/AreaChart.js +0 -932
- package/lib/components/AreaChart/AreaChart.js.map +0 -1
- package/lib/components/AreaChart/AreaChart.types.js +0 -4
- package/lib/components/AreaChart/AreaChart.types.js.map +0 -1
- package/lib/components/AreaChart/index.js +0 -3
- package/lib/components/AreaChart/index.js.map +0 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +0 -63
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +0 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +0 -33
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ChartTable/ChartTable.js +0 -160
- package/lib/components/ChartTable/ChartTable.js.map +0 -1
- package/lib/components/ChartTable/ChartTable.types.js +0 -4
- package/lib/components/ChartTable/ChartTable.types.js.map +0 -1
- package/lib/components/ChartTable/index.js +0 -3
- package/lib/components/ChartTable/index.js.map +0 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +0 -136
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +0 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +0 -68
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +0 -659
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +0 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/index.js +0 -2
- package/lib/components/CommonComponents/Annotations/index.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +0 -223
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +0 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +0 -139
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/CartesianChart.js +0 -665
- package/lib/components/CommonComponents/CartesianChart.js.map +0 -1
- package/lib/components/CommonComponents/CartesianChart.types.js +0 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +0 -1
- package/lib/components/CommonComponents/ChartPopover.js +0 -197
- package/lib/components/CommonComponents/ChartPopover.js.map +0 -1
- package/lib/components/CommonComponents/ChartPopover.types.js +0 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +0 -1
- package/lib/components/CommonComponents/index.js +0 -6
- package/lib/components/CommonComponents/index.js.map +0 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +0 -189
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +0 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +0 -131
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +0 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +0 -171
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +0 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -127
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +0 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +0 -397
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +0 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +0 -163
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +0 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -3490
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +0 -1
- package/lib/components/DeclarativeChart/index.js +0 -1
- package/lib/components/DeclarativeChart/index.js.map +0 -1
- package/lib/components/DonutChart/Arc/Arc.js +0 -118
- package/lib/components/DonutChart/Arc/Arc.js.map +0 -1
- package/lib/components/DonutChart/Arc/Arc.types.js +0 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +0 -1
- package/lib/components/DonutChart/Arc/index.js +0 -2
- package/lib/components/DonutChart/Arc/index.js.map +0 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +0 -80
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +0 -49
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +0 -1
- package/lib/components/DonutChart/DonutChart.js +0 -349
- package/lib/components/DonutChart/DonutChart.js.map +0 -1
- package/lib/components/DonutChart/DonutChart.types.js +0 -4
- package/lib/components/DonutChart/DonutChart.types.js.map +0 -1
- package/lib/components/DonutChart/Pie/Pie.js +0 -72
- package/lib/components/DonutChart/Pie/Pie.js.map +0 -1
- package/lib/components/DonutChart/Pie/Pie.types.js +0 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +0 -1
- package/lib/components/DonutChart/Pie/index.js +0 -2
- package/lib/components/DonutChart/Pie/index.js.map +0 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js +0 -41
- package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +0 -30
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +0 -1
- package/lib/components/DonutChart/index.js +0 -3
- package/lib/components/DonutChart/index.js.map +0 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +0 -98
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +0 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +0 -62
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +0 -1
- package/lib/components/FunnelChart/FunnelChart.js +0 -401
- package/lib/components/FunnelChart/FunnelChart.js.map +0 -1
- package/lib/components/FunnelChart/FunnelChart.types.js +0 -4
- package/lib/components/FunnelChart/FunnelChart.types.js.map +0 -1
- package/lib/components/FunnelChart/funnelGeometry.js +0 -219
- package/lib/components/FunnelChart/funnelGeometry.js.map +0 -1
- package/lib/components/FunnelChart/index.js +0 -2
- package/lib/components/FunnelChart/index.js.map +0 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +0 -83
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +0 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +0 -65
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GanttChart/GanttChart.js +0 -535
- package/lib/components/GanttChart/GanttChart.js.map +0 -1
- package/lib/components/GanttChart/GanttChart.types.js +0 -4
- package/lib/components/GanttChart/GanttChart.types.js.map +0 -1
- package/lib/components/GanttChart/index.js +0 -2
- package/lib/components/GanttChart/index.js.map +0 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +0 -27
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +0 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +0 -26
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GaugeChart/GaugeChart.js +0 -568
- package/lib/components/GaugeChart/GaugeChart.js.map +0 -1
- package/lib/components/GaugeChart/GaugeChart.types.js +0 -4
- package/lib/components/GaugeChart/GaugeChart.types.js.map +0 -1
- package/lib/components/GaugeChart/index.js +0 -3
- package/lib/components/GaugeChart/index.js.map +0 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +0 -197
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +0 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +0 -149
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +0 -813
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +0 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/index.js +0 -3
- package/lib/components/GroupedVerticalBarChart/index.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -77
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +0 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +0 -40
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +0 -677
- package/lib/components/HeatMapChart/HeatMapChart.js.map +0 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js +0 -4
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +0 -1
- package/lib/components/HeatMapChart/index.js +0 -3
- package/lib/components/HeatMapChart/index.js.map +0 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +0 -48
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +0 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +0 -42
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +0 -411
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +0 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js +0 -7
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +0 -1
- package/lib/components/HorizontalBarChart/index.js +0 -3
- package/lib/components/HorizontalBarChart/index.js.map +0 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +0 -175
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +0 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +0 -125
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -720
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +0 -4
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js +0 -3
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +0 -62
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +0 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +0 -54
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +0 -1
- package/lib/components/Legends/Legends.js +0 -323
- package/lib/components/Legends/Legends.js.map +0 -1
- package/lib/components/Legends/Legends.types.js +0 -3
- package/lib/components/Legends/Legends.types.js.map +0 -1
- package/lib/components/Legends/OverflowMenu.js +0 -33
- package/lib/components/Legends/OverflowMenu.js.map +0 -1
- package/lib/components/Legends/index.js +0 -3
- package/lib/components/Legends/index.js.map +0 -1
- package/lib/components/Legends/shape.js +0 -36
- package/lib/components/Legends/shape.js.map +0 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +0 -262
- package/lib/components/Legends/useLegendsStyles.styles.js.map +0 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +0 -142
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +0 -1
- package/lib/components/LineChart/LineChart.js +0 -1332
- package/lib/components/LineChart/LineChart.js.map +0 -1
- package/lib/components/LineChart/LineChart.types.js +0 -3
- package/lib/components/LineChart/LineChart.types.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +0 -118
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +0 -59
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +0 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js +0 -42
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +0 -1
- package/lib/components/LineChart/index.js +0 -4
- package/lib/components/LineChart/index.js.map +0 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +0 -93
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +0 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +0 -50
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.js +0 -577
- package/lib/components/PolarChart/PolarChart.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.types.js +0 -4
- package/lib/components/PolarChart/PolarChart.types.js.map +0 -1
- package/lib/components/PolarChart/PolarChart.utils.js +0 -174
- package/lib/components/PolarChart/PolarChart.utils.js.map +0 -1
- package/lib/components/PolarChart/index.js +0 -2
- package/lib/components/PolarChart/index.js.map +0 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.js +0 -72
- package/lib/components/PolarChart/usePolarChartStyles.styles.js.map +0 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js +0 -61
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +0 -99
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +0 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js +0 -4
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +0 -1
- package/lib/components/ResponsiveContainer/index.js +0 -3
- package/lib/components/ResponsiveContainer/index.js.map +0 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +0 -30
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +0 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +0 -29
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +0 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js +0 -20
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +0 -1
- package/lib/components/SankeyChart/SankeyChart.js +0 -1026
- package/lib/components/SankeyChart/SankeyChart.js.map +0 -1
- package/lib/components/SankeyChart/SankeyChart.types.js +0 -3
- package/lib/components/SankeyChart/SankeyChart.types.js.map +0 -1
- package/lib/components/SankeyChart/index.js +0 -3
- package/lib/components/SankeyChart/index.js.map +0 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +0 -123
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +0 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +0 -79
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +0 -1
- package/lib/components/ScatterChart/ScatterChart.js +0 -544
- package/lib/components/ScatterChart/ScatterChart.js.map +0 -1
- package/lib/components/ScatterChart/ScatterChart.types.js +0 -4
- package/lib/components/ScatterChart/ScatterChart.types.js.map +0 -1
- package/lib/components/ScatterChart/index.js +0 -3
- package/lib/components/ScatterChart/index.js.map +0 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +0 -84
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +0 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +0 -41
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +0 -1
- package/lib/components/Sparkline/Sparkline.js +0 -123
- package/lib/components/Sparkline/Sparkline.js.map +0 -1
- package/lib/components/Sparkline/Sparkline.types.js +0 -4
- package/lib/components/Sparkline/Sparkline.types.js.map +0 -1
- package/lib/components/Sparkline/index.js +0 -3
- package/lib/components/Sparkline/index.js.map +0 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.js +0 -40
- package/lib/components/Sparkline/useSparklineStyles.styles.js.map +0 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +0 -31
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +0 -405
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +0 -20
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +0 -415
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +0 -537
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +0 -3279
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js +0 -28
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +0 -1
- package/lib/components/VegaDeclarativeChart/index.js +0 -1
- package/lib/components/VegaDeclarativeChart/index.js.map +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +0 -930
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js +0 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +0 -1
- package/lib/components/VerticalBarChart/index.js +0 -3
- package/lib/components/VerticalBarChart/index.js.map +0 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -86
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +0 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +0 -48
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +0 -1077
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +0 -4
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/index.js +0 -3
- package/lib/components/VerticalStackedBarChart/index.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -74
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +0 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +0 -38
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +0 -1
- package/lib/index.js +0 -26
- package/lib/index.js.map +0 -1
- package/lib/types/ChartAnnotation.js +0 -1
- package/lib/types/ChartAnnotation.js.map +0 -1
- package/lib/types/DataPoint.js +0 -3
- package/lib/types/DataPoint.js.map +0 -1
- package/lib/types/EventAnnotation.js +0 -1
- package/lib/types/EventAnnotation.js.map +0 -1
- package/lib/types/LegendDataItem.js +0 -1
- package/lib/types/LegendDataItem.js.map +0 -1
- package/lib/types/index.js +0 -3
- package/lib/types/index.js.map +0 -1
- package/lib/utilities/ChartTitle.js +0 -45
- package/lib/utilities/ChartTitle.js.map +0 -1
- package/lib/utilities/Common.styles.js +0 -117
- package/lib/utilities/Common.styles.js.map +0 -1
- package/lib/utilities/Common.styles.raw.js +0 -115
- package/lib/utilities/Common.styles.raw.js.map +0 -1
- package/lib/utilities/FocusableTooltipText.js +0 -65
- package/lib/utilities/FocusableTooltipText.js.map +0 -1
- package/lib/utilities/KeyCodes.js +0 -11
- package/lib/utilities/KeyCodes.js.map +0 -1
- package/lib/utilities/SVGTooltipText.js +0 -179
- package/lib/utilities/SVGTooltipText.js.map +0 -1
- package/lib/utilities/async-utils.js +0 -380
- package/lib/utilities/async-utils.js.map +0 -1
- package/lib/utilities/colors.js +0 -281
- package/lib/utilities/colors.js.map +0 -1
- package/lib/utilities/getWindow.js +0 -25
- package/lib/utilities/getWindow.js.map +0 -1
- package/lib/utilities/hooks.js +0 -34
- package/lib/utilities/hooks.js.map +0 -1
- package/lib/utilities/image-export-utils.js +0 -405
- package/lib/utilities/image-export-utils.js.map +0 -1
- package/lib/utilities/index.js +0 -5
- package/lib/utilities/index.js.map +0 -1
- package/lib/utilities/overflow-utils.js +0 -27
- package/lib/utilities/overflow-utils.js.map +0 -1
- package/lib/utilities/scatterpolar-utils.js +0 -52
- package/lib/utilities/scatterpolar-utils.js.map +0 -1
- package/lib/utilities/string.js +0 -32
- package/lib/utilities/string.js.map +0 -1
- package/lib/utilities/test-data.js +0 -565
- package/lib/utilities/test-data.js.map +0 -1
- package/lib/utilities/utilities.js +0 -1990
- package/lib/utilities/utilities.js.map +0 -1
- package/lib/utilities/vbc-utils.js +0 -51
- package/lib/utilities/vbc-utils.js.map +0 -1
- package/lib-commonjs/AnnotationOnlyChart.js +0 -6
- package/lib-commonjs/AnnotationOnlyChart.js.map +0 -1
- package/lib-commonjs/AreaChart.js +0 -6
- package/lib-commonjs/AreaChart.js.map +0 -1
- package/lib-commonjs/CartesianChart.js +0 -6
- package/lib-commonjs/CartesianChart.js.map +0 -1
- package/lib-commonjs/ChartTable.js +0 -6
- package/lib-commonjs/ChartTable.js.map +0 -1
- package/lib-commonjs/DeclarativeChart.js +0 -6
- package/lib-commonjs/DeclarativeChart.js.map +0 -1
- package/lib-commonjs/DonutChart.js +0 -6
- package/lib-commonjs/DonutChart.js.map +0 -1
- package/lib-commonjs/FunnelChart.js +0 -6
- package/lib-commonjs/FunnelChart.js.map +0 -1
- package/lib-commonjs/GanttChart.js +0 -6
- package/lib-commonjs/GanttChart.js.map +0 -1
- package/lib-commonjs/GaugeChart.js +0 -6
- package/lib-commonjs/GaugeChart.js.map +0 -1
- package/lib-commonjs/GroupedVerticalBarChart.js +0 -6
- package/lib-commonjs/GroupedVerticalBarChart.js.map +0 -1
- package/lib-commonjs/HeatMapChart.js +0 -6
- package/lib-commonjs/HeatMapChart.js.map +0 -1
- package/lib-commonjs/HorizontalBarChart.js +0 -6
- package/lib-commonjs/HorizontalBarChart.js.map +0 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.js +0 -6
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib-commonjs/Legends.js +0 -6
- package/lib-commonjs/Legends.js.map +0 -1
- package/lib-commonjs/LineChart.js +0 -6
- package/lib-commonjs/LineChart.js.map +0 -1
- package/lib-commonjs/PolarChart.js +0 -6
- package/lib-commonjs/PolarChart.js.map +0 -1
- package/lib-commonjs/Popover.js +0 -6
- package/lib-commonjs/Popover.js.map +0 -1
- package/lib-commonjs/ResponsiveContainer.js +0 -6
- package/lib-commonjs/ResponsiveContainer.js.map +0 -1
- package/lib-commonjs/SankeyChart.js +0 -6
- package/lib-commonjs/SankeyChart.js.map +0 -1
- package/lib-commonjs/ScatterChart.js +0 -6
- package/lib-commonjs/ScatterChart.js.map +0 -1
- package/lib-commonjs/Sparkline.js +0 -6
- package/lib-commonjs/Sparkline.js.map +0 -1
- package/lib-commonjs/VegaDeclarativeChart.js +0 -6
- package/lib-commonjs/VegaDeclarativeChart.js.map +0 -1
- package/lib-commonjs/VerticalBarChart.js +0 -6
- package/lib-commonjs/VerticalBarChart.js.map +0 -1
- package/lib-commonjs/VerticalStackedBarChart.js +0 -6
- package/lib-commonjs/VerticalStackedBarChart.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +0 -207
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +0 -6
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/index.js +0 -7
- package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +0 -57
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +0 -34
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +0 -938
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.js +0 -7
- package/lib-commonjs/components/AreaChart/AreaChart.types.js.map +0 -1
- package/lib-commonjs/components/AreaChart/index.js +0 -8
- package/lib-commonjs/components/AreaChart/index.js.map +0 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -96
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +0 -49
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +0 -171
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +0 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js +0 -7
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +0 -1
- package/lib-commonjs/components/ChartTable/index.js +0 -8
- package/lib-commonjs/components/ChartTable/index.js.map +0 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +0 -200
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +0 -82
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +0 -670
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +0 -4
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.js +0 -7
- package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +0 -325
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +0 -174
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +0 -673
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js +0 -5
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +0 -207
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js +0 -4
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/index.js +0 -11
- package/lib-commonjs/components/CommonComponents/index.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +0 -268
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +0 -144
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -238
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -141
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +0 -400
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +0 -195
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +0 -3577
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/index.js +0 -6
- package/lib-commonjs/components/DeclarativeChart/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +0 -125
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js +0 -4
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/index.js +0 -7
- package/lib-commonjs/components/DonutChart/Arc/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +0 -110
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +0 -63
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +0 -356
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +0 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js +0 -7
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +0 -79
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js +0 -4
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/index.js +0 -7
- package/lib-commonjs/components/DonutChart/Pie/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +0 -55
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +0 -44
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/DonutChart/index.js +0 -8
- package/lib-commonjs/components/DonutChart/index.js.map +0 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +0 -145
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +0 -76
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +0 -412
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js +0 -7
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js +0 -246
- package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/index.js +0 -7
- package/lib-commonjs/components/FunnelChart/index.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +0 -118
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +0 -79
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +0 -546
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +0 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.js +0 -7
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +0 -1
- package/lib-commonjs/components/GanttChart/index.js +0 -7
- package/lib-commonjs/components/GanttChart/index.js.map +0 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +0 -42
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +0 -42
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +0 -597
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js +0 -7
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/index.js +0 -8
- package/lib-commonjs/components/GaugeChart/index.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +0 -281
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +0 -167
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +0 -818
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js +0 -7
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js +0 -8
- package/lib-commonjs/components/GroupedVerticalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -116
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +0 -56
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +0 -688
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js +0 -7
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/index.js +0 -8
- package/lib-commonjs/components/HeatMapChart/index.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +0 -71
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +0 -60
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +0 -417
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js +0 -17
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/index.js +0 -8
- package/lib-commonjs/components/HorizontalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +0 -264
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +0 -139
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +0 -726
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +0 -7
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +0 -8
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +0 -86
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +0 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +0 -70
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/Legends/Legends.js +0 -333
- package/lib-commonjs/components/Legends/Legends.js.map +0 -1
- package/lib-commonjs/components/Legends/Legends.types.js +0 -6
- package/lib-commonjs/components/Legends/Legends.types.js.map +0 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js +0 -44
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +0 -1
- package/lib-commonjs/components/Legends/index.js +0 -8
- package/lib-commonjs/components/Legends/index.js.map +0 -1
- package/lib-commonjs/components/Legends/shape.js +0 -47
- package/lib-commonjs/components/Legends/shape.js.map +0 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +0 -456
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +0 -178
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/LineChart/LineChart.js +0 -1337
- package/lib-commonjs/components/LineChart/LineChart.js.map +0 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js +0 -6
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +0 -129
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +0 -70
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +0 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +0 -53
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +0 -1
- package/lib-commonjs/components/LineChart/index.js +0 -9
- package/lib-commonjs/components/LineChart/index.js.map +0 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -132
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +0 -63
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.js +0 -587
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +0 -7
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +0 -1
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +0 -204
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +0 -1
- package/lib-commonjs/components/PolarChart/index.js +0 -7
- package/lib-commonjs/components/PolarChart/index.js.map +0 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js +0 -107
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js +0 -75
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +0 -107
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js +0 -7
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/index.js +0 -8
- package/lib-commonjs/components/ResponsiveContainer/index.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +0 -50
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +0 -47
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +0 -28
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +0 -1042
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js +0 -6
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/index.js +0 -8
- package/lib-commonjs/components/SankeyChart/index.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -202
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +0 -97
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +0 -550
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js +0 -7
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/index.js +0 -8
- package/lib-commonjs/components/ScatterChart/index.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -120
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +0 -55
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/Sparkline/Sparkline.js +0 -129
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +0 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +0 -7
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +0 -1
- package/lib-commonjs/components/Sparkline/index.js +0 -8
- package/lib-commonjs/components/Sparkline/index.js.map +0 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +0 -57
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +0 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +0 -45
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +0 -274
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js +0 -35
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +0 -412
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +0 -533
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +0 -3214
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js +0 -31
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +0 -1
- package/lib-commonjs/components/VegaDeclarativeChart/index.js +0 -6
- package/lib-commonjs/components/VegaDeclarativeChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +0 -932
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js +0 -7
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/index.js +0 -8
- package/lib-commonjs/components/VerticalBarChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -128
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +0 -64
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +0 -1088
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js +0 -7
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.js +0 -8
- package/lib-commonjs/components/VerticalStackedBarChart/index.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -116
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +0 -56
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/index.js +0 -31
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/types/ChartAnnotation.js +0 -4
- package/lib-commonjs/types/ChartAnnotation.js.map +0 -1
- package/lib-commonjs/types/DataPoint.js +0 -6
- package/lib-commonjs/types/DataPoint.js.map +0 -1
- package/lib-commonjs/types/EventAnnotation.js +0 -4
- package/lib-commonjs/types/EventAnnotation.js.map +0 -1
- package/lib-commonjs/types/LegendDataItem.js +0 -4
- package/lib-commonjs/types/LegendDataItem.js.map +0 -1
- package/lib-commonjs/types/index.js +0 -8
- package/lib-commonjs/types/index.js.map +0 -1
- package/lib-commonjs/utilities/ChartTitle.js +0 -53
- package/lib-commonjs/utilities/ChartTitle.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.js +0 -138
- package/lib-commonjs/utilities/Common.styles.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +0 -138
- package/lib-commonjs/utilities/Common.styles.raw.js.map +0 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js +0 -75
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +0 -1
- package/lib-commonjs/utilities/KeyCodes.js +0 -21
- package/lib-commonjs/utilities/KeyCodes.js.map +0 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +0 -189
- package/lib-commonjs/utilities/SVGTooltipText.js.map +0 -1
- package/lib-commonjs/utilities/async-utils.js +0 -382
- package/lib-commonjs/utilities/async-utils.js.map +0 -1
- package/lib-commonjs/utilities/colors.js +0 -311
- package/lib-commonjs/utilities/colors.js.map +0 -1
- package/lib-commonjs/utilities/getWindow.js +0 -28
- package/lib-commonjs/utilities/getWindow.js.map +0 -1
- package/lib-commonjs/utilities/hooks.js +0 -45
- package/lib-commonjs/utilities/hooks.js.map +0 -1
- package/lib-commonjs/utilities/image-export-utils.js +0 -423
- package/lib-commonjs/utilities/image-export-utils.js.map +0 -1
- package/lib-commonjs/utilities/index.js +0 -10
- package/lib-commonjs/utilities/index.js.map +0 -1
- package/lib-commonjs/utilities/overflow-utils.js +0 -36
- package/lib-commonjs/utilities/overflow-utils.js.map +0 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +0 -67
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +0 -1
- package/lib-commonjs/utilities/string.js +0 -29
- package/lib-commonjs/utilities/string.js.map +0 -1
- package/lib-commonjs/utilities/test-data.js +0 -628
- package/lib-commonjs/utilities/test-data.js.map +0 -1
- package/lib-commonjs/utilities/utilities.js +0 -2016
- package/lib-commonjs/utilities/utilities.js.map +0 -1
- package/lib-commonjs/utilities/vbc-utils.js +0 -72
- package/lib-commonjs/utilities/vbc-utils.js.map +0 -1
|
@@ -1,1077 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { max as d3Max, min as d3Min } from 'd3-array';
|
|
4
|
-
import { useVerticalStackedBarChartStyles } from './useVerticalStackedBarChartStyles.styles';
|
|
5
|
-
import { scaleLinear as d3ScaleLinear, scaleBand as d3ScaleBand, scaleUtc as d3ScaleUtc, scaleTime as d3ScaleTime } from 'd3-scale';
|
|
6
|
-
import { useId } from '@fluentui/react-utilities';
|
|
7
|
-
import { tokens } from '@fluentui/react-theme';
|
|
8
|
-
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
9
|
-
import { CartesianChart, ChartPopover, Legends } from '../../index';
|
|
10
|
-
import { ChartTypes, getAccessibleDataObject, XAxisTypes, getTypeOfAxis, formatScientificLimitWidth, getBarWidth, getScalePadding, isScalePaddingDefined, calculateAppropriateBarWidth, areArraysEqual, calculateLongestLabelWidth, useRtl, DataVizPalette, getColorFromToken, findVSBCNumericMinMaxOfY, YAxisType, createNumericYAxis, domainRangeOfDateForAreaLineScatterVerticalBarCharts, domainRangeOfVSBCNumeric, domainRangeOfXStringAxis, createStringYAxis, calcTotalWidth, calcBandwidth, calcRequiredWidth, sortAxisCategories } from '../../utilities/index';
|
|
11
|
-
import { formatDateToLocaleString, isInvalidValue, isSafeUrl } from '@fluentui/chart-utilities';
|
|
12
|
-
import { useImageExport } from '../../utilities/hooks';
|
|
13
|
-
const barGapMultiplier = 0.2;
|
|
14
|
-
const barGapMin = 1;
|
|
15
|
-
const MIN_DOMAIN_MARGIN = 8;
|
|
16
|
-
export const VerticalStackedBarChart = /*#__PURE__*/ React.forwardRef((_props, forwardedRef)=>{
|
|
17
|
-
var _props_legendProps;
|
|
18
|
-
const props = {
|
|
19
|
-
xAxisCategoryOrder: 'default',
|
|
20
|
-
yAxisCategoryOrder: 'default',
|
|
21
|
-
maxBarWidth: 24,
|
|
22
|
-
..._props
|
|
23
|
-
};
|
|
24
|
-
const _isRtl = useRtl();
|
|
25
|
-
const _createLegendsForLine = (data)=>_getLineLegends(data);
|
|
26
|
-
const _emptyChartId = useId('_VSBC_empty');
|
|
27
|
-
const _arrowNavigationAttributes = useArrowNavigationGroup({
|
|
28
|
-
axis: 'vertical',
|
|
29
|
-
circular: true
|
|
30
|
-
});
|
|
31
|
-
let _points = [];
|
|
32
|
-
let _dataset;
|
|
33
|
-
let _xAxisLabels = [];
|
|
34
|
-
let _bars;
|
|
35
|
-
let _xAxisType = props.data && props.data.length > 0 ? getTypeOfAxis(props.data[0].xAxisPoint, true) : XAxisTypes.StringAxis;
|
|
36
|
-
let _barWidth = 0;
|
|
37
|
-
let _colors;
|
|
38
|
-
let _margins;
|
|
39
|
-
let _lineObject;
|
|
40
|
-
let _yMax;
|
|
41
|
-
let _yMin;
|
|
42
|
-
let _calloutAnchorPoint;
|
|
43
|
-
let _domainMargin = MIN_DOMAIN_MARGIN;
|
|
44
|
-
let _xAxisInnerPadding = 0;
|
|
45
|
-
let _xAxisOuterPadding = 0;
|
|
46
|
-
const { cartesianChartRef, legendsRef: _legendsRef } = useImageExport(props.componentRef, props.hideLegend);
|
|
47
|
-
const Y_ORIGIN = 0;
|
|
48
|
-
let _yAxisType;
|
|
49
|
-
let _yAxisLabels = [];
|
|
50
|
-
const [selectedLegends, setSelectedLegends] = React.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
|
|
51
|
-
const [activeLegend, setActiveLegend] = React.useState(undefined);
|
|
52
|
-
const [dataForHoverCard, setDataForHoverCard] = React.useState(0);
|
|
53
|
-
const [color, setColor] = React.useState('');
|
|
54
|
-
const [hoverXValue, setHoverXValue] = React.useState('');
|
|
55
|
-
const [YValueHover, setYValueHover] = React.useState([]);
|
|
56
|
-
const [xCalloutValue, setXCalloutValue] = React.useState('');
|
|
57
|
-
const [yCalloutValue, setYCalloutValue] = React.useState('');
|
|
58
|
-
const [activeXAxisDataPoint, setActiveXAxisDataPoint] = React.useState('');
|
|
59
|
-
const [calloutLegend, setCalloutLegend] = React.useState('');
|
|
60
|
-
const [stackCalloutProps, setStackCalloutProps] = React.useState();
|
|
61
|
-
const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState();
|
|
62
|
-
const [callOutAccessibilityData, setCallOutAccessibilityData] = React.useState();
|
|
63
|
-
const [clickPosition, setClickPosition] = React.useState({
|
|
64
|
-
x: 0,
|
|
65
|
-
y: 0
|
|
66
|
-
});
|
|
67
|
-
const [isPopoverOpen, setPopoverOpen] = React.useState(false);
|
|
68
|
-
const prevPropsRef = React.useRef(null);
|
|
69
|
-
React.useEffect(()=>{
|
|
70
|
-
if (prevPropsRef.current) {
|
|
71
|
-
var _prevProps_legendProps, _props_legendProps;
|
|
72
|
-
const prevProps = prevPropsRef.current;
|
|
73
|
-
if (!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)) {
|
|
74
|
-
var _props_legendProps1;
|
|
75
|
-
setSelectedLegends(((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.selectedLegends) || []);
|
|
76
|
-
}
|
|
77
|
-
if (prevProps.height !== props.height || prevProps.width !== props.width || prevProps.data !== props.data) {
|
|
78
|
-
_adjustProps();
|
|
79
|
-
_dataset = _createDataSetLayer();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
prevPropsRef.current = props;
|
|
83
|
-
}, [
|
|
84
|
-
props
|
|
85
|
-
]);
|
|
86
|
-
function _getLegendData(data, lineLegends) {
|
|
87
|
-
if (props.hideLegend) {
|
|
88
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null);
|
|
89
|
-
}
|
|
90
|
-
const defaultPalette = [
|
|
91
|
-
getColorFromToken(DataVizPalette.color6),
|
|
92
|
-
getColorFromToken(DataVizPalette.color1),
|
|
93
|
-
getColorFromToken(DataVizPalette.color5),
|
|
94
|
-
getColorFromToken(DataVizPalette.color7),
|
|
95
|
-
getColorFromToken(DataVizPalette.color10)
|
|
96
|
-
];
|
|
97
|
-
const actions = [];
|
|
98
|
-
const { allowHoverOnLegend = true } = props;
|
|
99
|
-
data.forEach((singleChartData)=>{
|
|
100
|
-
singleChartData.chartData.forEach((point)=>{
|
|
101
|
-
const color = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];
|
|
102
|
-
const checkSimilarLegends = actions.filter((leg)=>leg.title === point.legend && leg.color === color);
|
|
103
|
-
if (checkSimilarLegends.length > 0) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const legend = {
|
|
107
|
-
title: point.legend,
|
|
108
|
-
color,
|
|
109
|
-
hoverAction: allowHoverOnLegend ? ()=>{
|
|
110
|
-
_handleChartMouseLeave();
|
|
111
|
-
_onLegendHover(point.legend);
|
|
112
|
-
} : undefined,
|
|
113
|
-
onMouseOutAction: allowHoverOnLegend ? ()=>_onLegendLeave() : undefined
|
|
114
|
-
};
|
|
115
|
-
actions.push(legend);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
const legendsOfLine = [];
|
|
119
|
-
if (lineLegends && lineLegends.length > 0) {
|
|
120
|
-
lineLegends.forEach((point)=>{
|
|
121
|
-
const legend = {
|
|
122
|
-
title: point.title,
|
|
123
|
-
color: point.color,
|
|
124
|
-
isLineLegendInBarChart: true,
|
|
125
|
-
hoverAction: allowHoverOnLegend ? ()=>{
|
|
126
|
-
_handleChartMouseLeave();
|
|
127
|
-
_onLegendHover(point.title);
|
|
128
|
-
} : undefined,
|
|
129
|
-
onMouseOutAction: allowHoverOnLegend ? ()=>_onLegendLeave() : undefined
|
|
130
|
-
};
|
|
131
|
-
legendsOfLine.push(legend);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
const totalLegends = actions.concat(legendsOfLine);
|
|
135
|
-
return /*#__PURE__*/ React.createElement(Legends, {
|
|
136
|
-
legends: totalLegends,
|
|
137
|
-
enabledWrapLines: props.enabledLegendsWrapLines,
|
|
138
|
-
overflowText: props.legendsOverflowText,
|
|
139
|
-
...props.legendProps,
|
|
140
|
-
onChange: _onLegendSelectionChange,
|
|
141
|
-
legendRef: _legendsRef
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function _getHighlightedLegend() {
|
|
145
|
-
return selectedLegends.length > 0 ? selectedLegends : activeLegend ? [
|
|
146
|
-
activeLegend
|
|
147
|
-
] : [];
|
|
148
|
-
}
|
|
149
|
-
function _lineHoverFocus(lineData, event) {
|
|
150
|
-
let clientX = 0;
|
|
151
|
-
let clientY = 0;
|
|
152
|
-
if ('clientX' in event) {
|
|
153
|
-
clientX = event.clientX;
|
|
154
|
-
clientY = event.clientY;
|
|
155
|
-
} else {
|
|
156
|
-
const boundingRect = event.target.getBoundingClientRect();
|
|
157
|
-
clientX = boundingRect.left + boundingRect.width / 2;
|
|
158
|
-
clientY = boundingRect.top + boundingRect.height / 2;
|
|
159
|
-
}
|
|
160
|
-
if (_noLegendHighlighted() || _isLegendHighlighted(lineData.legend)) {
|
|
161
|
-
_updatePosition(clientX, clientY);
|
|
162
|
-
setPopoverOpen(true);
|
|
163
|
-
setXCalloutValue(`${lineData.xItem.xAxisPoint}`);
|
|
164
|
-
setYCalloutValue(`${lineData.yAxisCalloutData || lineData.data || lineData.y}`);
|
|
165
|
-
setCalloutLegend(lineData.legend);
|
|
166
|
-
setActiveXAxisDataPoint(lineData.xItem.xAxisPoint);
|
|
167
|
-
setColor(lineData.color);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function _onStackHoverFocus(stack, event) {
|
|
171
|
-
var _stack_lineData;
|
|
172
|
-
let clientX = 0;
|
|
173
|
-
let clientY = 0;
|
|
174
|
-
if ('clientX' in event) {
|
|
175
|
-
clientX = event.clientX;
|
|
176
|
-
clientY = event.clientY;
|
|
177
|
-
} else {
|
|
178
|
-
// Handle React FocusEvent or SVGGElement
|
|
179
|
-
const element = 'target' in event ? event.target : event;
|
|
180
|
-
const boundingRect = element.getBoundingClientRect();
|
|
181
|
-
clientX = boundingRect.left + boundingRect.width / 2;
|
|
182
|
-
clientY = boundingRect.top + boundingRect.height / 2;
|
|
183
|
-
}
|
|
184
|
-
if (!_noLegendHighlighted()) {
|
|
185
|
-
var _stack_lineData1;
|
|
186
|
-
stack = {
|
|
187
|
-
...stack,
|
|
188
|
-
chartData: stack.chartData.filter((dataPoint)=>_isLegendHighlighted(dataPoint.legend)),
|
|
189
|
-
lineData: (_stack_lineData1 = stack.lineData) === null || _stack_lineData1 === void 0 ? void 0 : _stack_lineData1.filter((dataPoint)=>_isLegendHighlighted(dataPoint.legend))
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
const lineData = stack.lineData;
|
|
193
|
-
const isLinesPresent = lineData !== undefined && lineData.length > 0;
|
|
194
|
-
if (isLinesPresent) {
|
|
195
|
-
lineData.forEach((item)=>{
|
|
196
|
-
item.data = item.data || item.y;
|
|
197
|
-
item.shouldDrawBorderBottom = true;
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
_updatePosition(clientX, clientY);
|
|
201
|
-
var _stack_lineData_length;
|
|
202
|
-
setPopoverOpen(stack.chartData.length > 0 || ((_stack_lineData_length = (_stack_lineData = stack.lineData) === null || _stack_lineData === void 0 ? void 0 : _stack_lineData.length) !== null && _stack_lineData_length !== void 0 ? _stack_lineData_length : 0) > 0);
|
|
203
|
-
setYValueHover(isLinesPresent ? [
|
|
204
|
-
...lineData.sort((a, b)=>a.data < b.data ? 1 : -1),
|
|
205
|
-
...stack.chartData.slice().reverse()
|
|
206
|
-
] : stack.chartData.slice().reverse());
|
|
207
|
-
setHoverXValue(stack.xAxisPoint instanceof Date ? formatDateToLocaleString(stack.xAxisPoint, props.culture, props.useUTC) : stack.xAxisPoint);
|
|
208
|
-
setStackCalloutProps(stack);
|
|
209
|
-
setActiveXAxisDataPoint(stack.xAxisPoint);
|
|
210
|
-
setCallOutAccessibilityData(stack.stackCallOutAccessibilityData);
|
|
211
|
-
}
|
|
212
|
-
function _handleChartMouseLeave() {
|
|
213
|
-
_calloutAnchorPoint = null;
|
|
214
|
-
setPopoverOpen(false);
|
|
215
|
-
setActiveXAxisDataPoint('');
|
|
216
|
-
}
|
|
217
|
-
const _onClick = (data, mouseEvent)=>{
|
|
218
|
-
var _props_onBarClick;
|
|
219
|
-
(_props_onBarClick = props.onBarClick) === null || _props_onBarClick === void 0 ? void 0 : _props_onBarClick.call(props, mouseEvent, data);
|
|
220
|
-
if (props.href && isSafeUrl(props.href)) {
|
|
221
|
-
window.location.href = props.href;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
function _adjustProps() {
|
|
225
|
-
var _points_;
|
|
226
|
-
_points = props.data || [];
|
|
227
|
-
_barWidth = getBarWidth(props.barWidth, props.maxBarWidth);
|
|
228
|
-
const defaultColors = [
|
|
229
|
-
getColorFromToken(DataVizPalette.color6),
|
|
230
|
-
getColorFromToken(DataVizPalette.color1),
|
|
231
|
-
getColorFromToken(DataVizPalette.color5),
|
|
232
|
-
getColorFromToken(DataVizPalette.color7),
|
|
233
|
-
getColorFromToken(DataVizPalette.color10)
|
|
234
|
-
];
|
|
235
|
-
_colors = defaultColors;
|
|
236
|
-
const firstXValue = (_points_ = _points[0]) === null || _points_ === void 0 ? void 0 : _points_.xAxisPoint;
|
|
237
|
-
_xAxisType = isInvalidValue(firstXValue) ? XAxisTypes.StringAxis : getTypeOfAxis(firstXValue, true);
|
|
238
|
-
_lineObject = _getFormattedLineData(props.data);
|
|
239
|
-
_xAxisInnerPadding = getScalePadding(props.xAxisInnerPadding, props.xAxisPadding, _xAxisType === XAxisTypes.StringAxis ? 2 / 3 : 1 / 2);
|
|
240
|
-
_xAxisOuterPadding = getScalePadding(props.xAxisOuterPadding, props.xAxisPadding, 0);
|
|
241
|
-
_initYAxisParams();
|
|
242
|
-
}
|
|
243
|
-
function _createDataSetLayer() {
|
|
244
|
-
const dataset = _points.map((singlePointData)=>{
|
|
245
|
-
if (_yAxisType === YAxisType.StringAxis) {
|
|
246
|
-
return {
|
|
247
|
-
x: singlePointData.xAxisPoint,
|
|
248
|
-
y: 0
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
let total = 0;
|
|
252
|
-
singlePointData.chartData.forEach((point)=>{
|
|
253
|
-
total = total + point.data;
|
|
254
|
-
});
|
|
255
|
-
return {
|
|
256
|
-
x: singlePointData.xAxisPoint,
|
|
257
|
-
y: total
|
|
258
|
-
};
|
|
259
|
-
});
|
|
260
|
-
_xAxisLabels = _getOrderedXAxisLabels();
|
|
261
|
-
return dataset;
|
|
262
|
-
}
|
|
263
|
-
function _onLegendHover(legendTitle) {
|
|
264
|
-
setActiveLegend(legendTitle);
|
|
265
|
-
}
|
|
266
|
-
function _onLegendLeave() {
|
|
267
|
-
setActiveLegend(undefined);
|
|
268
|
-
}
|
|
269
|
-
function _onLegendSelectionChange(_selectedLegends, event, currentLegend) {
|
|
270
|
-
var _props_legendProps, _props_legendProps1;
|
|
271
|
-
if ((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.canSelectMultipleLegends) {
|
|
272
|
-
setSelectedLegends(_selectedLegends);
|
|
273
|
-
} else {
|
|
274
|
-
setSelectedLegends(_selectedLegends.slice(-1));
|
|
275
|
-
}
|
|
276
|
-
if ((_props_legendProps1 = props.legendProps) === null || _props_legendProps1 === void 0 ? void 0 : _props_legendProps1.onChange) {
|
|
277
|
-
props.legendProps.onChange(_selectedLegends, event, currentLegend);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
function _getMargins(margins) {
|
|
281
|
-
_margins = margins;
|
|
282
|
-
}
|
|
283
|
-
function _getGraphData(xScale, yScale, containerHeight, containerWidth, xElement) {
|
|
284
|
-
const { xBarScale, yBarScale } = _getScales(containerHeight, containerWidth);
|
|
285
|
-
return _bars = _createBar(xBarScale, _yAxisType === YAxisType.StringAxis ? yScale : yBarScale, containerHeight, xElement);
|
|
286
|
-
}
|
|
287
|
-
function _getAxisData(yAxisData) {
|
|
288
|
-
if (yAxisData && yAxisData.yAxisDomainValues.length) {
|
|
289
|
-
const { yAxisDomainValues: domainValue } = yAxisData;
|
|
290
|
-
_yMax = Math.max(domainValue[domainValue.length - 1], props.yMaxValue || Y_ORIGIN);
|
|
291
|
-
_yMin = Math.min(domainValue[0], props.yMinValue || Y_ORIGIN);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* This function checks if the given legend is highlighted or not.
|
|
296
|
-
* A legend can be highlighted in 2 ways:
|
|
297
|
-
* 1. selection: if the user clicks on it
|
|
298
|
-
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
299
|
-
*/ function _isLegendHighlighted(legendTitle) {
|
|
300
|
-
return _getHighlightedLegend().includes(legendTitle);
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* This function checks if none of the legends is selected or hovered.
|
|
304
|
-
*/ function _noLegendHighlighted() {
|
|
305
|
-
return _getHighlightedLegend().length === 0;
|
|
306
|
-
}
|
|
307
|
-
function _getAriaLabel(singleChartData, point, isLinePoint) {
|
|
308
|
-
var _point_callOutAccessibilityData;
|
|
309
|
-
if (!point) {
|
|
310
|
-
var _singleChartData_lineData, _singleChartData_stackCallOutAccessibilityData;
|
|
311
|
-
/** if shouldFocusWholeStack is true */ const xValue = singleChartData.xAxisCalloutData || (singleChartData.xAxisPoint instanceof Date ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC) : singleChartData.xAxisPoint);
|
|
312
|
-
const pointValues = singleChartData.chartData.map((pt)=>{
|
|
313
|
-
const legend = pt.legend;
|
|
314
|
-
const yValue = pt.yAxisCalloutData || pt.data;
|
|
315
|
-
return _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';
|
|
316
|
-
}).filter((str)=>str !== '').join(' ');
|
|
317
|
-
const lineValues = (_singleChartData_lineData = singleChartData.lineData) === null || _singleChartData_lineData === void 0 ? void 0 : _singleChartData_lineData.map((ln)=>{
|
|
318
|
-
const legend = ln.legend;
|
|
319
|
-
const yValue = ln.yAxisCalloutData || ln.data || ln.y;
|
|
320
|
-
return _noLegendHighlighted() || _isLegendHighlighted(legend) ? `${legend}, ${yValue}.` : '';
|
|
321
|
-
}).filter((str)=>str !== '').join(' ');
|
|
322
|
-
return ((_singleChartData_stackCallOutAccessibilityData = singleChartData.stackCallOutAccessibilityData) === null || _singleChartData_stackCallOutAccessibilityData === void 0 ? void 0 : _singleChartData_stackCallOutAccessibilityData.ariaLabel) || `${xValue}. ${pointValues}` + (lineValues ? ` ${lineValues}` : '');
|
|
323
|
-
}
|
|
324
|
-
/** if shouldFocusWholeStack is false */ const xValue = singleChartData.xAxisCalloutData || !isLinePoint && point.xAxisCalloutData || (singleChartData.xAxisPoint instanceof Date ? formatDateToLocaleString(singleChartData.xAxisPoint, props.culture, props.useUTC) : singleChartData.xAxisPoint);
|
|
325
|
-
const legend = point.legend;
|
|
326
|
-
const yValue = point.yAxisCalloutData || (isLinePoint ? point.data || point.y : point.data);
|
|
327
|
-
return !isLinePoint && ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
|
|
328
|
-
}
|
|
329
|
-
function _getCustomizedCallout() {
|
|
330
|
-
const _isHavingLines = props.data.some((item)=>item.lineData && item.lineData.length > 0);
|
|
331
|
-
return props.onRenderCalloutPerStack ? props.onRenderCalloutPerStack(stackCalloutProps) : props.onRenderCalloutPerDataPoint && !_isHavingLines ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout) : null;
|
|
332
|
-
}
|
|
333
|
-
function _toFocusWholeStack() {
|
|
334
|
-
const { isCalloutForStack = false } = props;
|
|
335
|
-
return isCalloutForStack;
|
|
336
|
-
}
|
|
337
|
-
function _getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues) {
|
|
338
|
-
let domainNRangeValue;
|
|
339
|
-
if (xAxisType === XAxisTypes.NumericAxis) {
|
|
340
|
-
domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth);
|
|
341
|
-
} else if (xAxisType === XAxisTypes.DateAxis) {
|
|
342
|
-
domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues, chartType, barWidth);
|
|
343
|
-
} else {
|
|
344
|
-
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
345
|
-
}
|
|
346
|
-
return domainNRangeValue;
|
|
347
|
-
}
|
|
348
|
-
function _getFormattedLineData(data) {
|
|
349
|
-
const linesData = [];
|
|
350
|
-
const formattedLineData = {};
|
|
351
|
-
data.forEach((item, index)=>{
|
|
352
|
-
if (item.lineData) {
|
|
353
|
-
item.lineData.forEach((line)=>{
|
|
354
|
-
linesData.push({
|
|
355
|
-
...line,
|
|
356
|
-
index,
|
|
357
|
-
xItem: item
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
linesData.forEach((item)=>{
|
|
363
|
-
if (formattedLineData[item.legend]) {
|
|
364
|
-
formattedLineData[item.legend].push(item);
|
|
365
|
-
} else {
|
|
366
|
-
formattedLineData[item.legend] = [
|
|
367
|
-
item
|
|
368
|
-
];
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
return formattedLineData;
|
|
372
|
-
}
|
|
373
|
-
function _getLineLegends(data) {
|
|
374
|
-
const lineObject = _lineObject;
|
|
375
|
-
const lineLegends = [];
|
|
376
|
-
Object.keys(lineObject).forEach((item)=>{
|
|
377
|
-
lineLegends.push({
|
|
378
|
-
title: item,
|
|
379
|
-
color: lineObject[item][0].color
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
return lineLegends;
|
|
383
|
-
}
|
|
384
|
-
function _createLines(xScale, yScalePrimary, containerHeight, containerWidth, yScaleSecondary) {
|
|
385
|
-
var _props_lineOptions;
|
|
386
|
-
const lineObject = _getFormattedLineData(props.data);
|
|
387
|
-
const lines = [];
|
|
388
|
-
const borderForLines = [];
|
|
389
|
-
const dots = [];
|
|
390
|
-
//const { theme } = props;
|
|
391
|
-
const lineBorderWidth = ((_props_lineOptions = props.lineOptions) === null || _props_lineOptions === void 0 ? void 0 : _props_lineOptions.lineBorderWidth) ? Number.parseFloat(props.lineOptions.lineBorderWidth.toString()) : 0;
|
|
392
|
-
const xScaleBandwidthTranslate = _xAxisType !== XAxisTypes.StringAxis ? 0 : xScale.bandwidth() / 2;
|
|
393
|
-
Object.keys(lineObject).forEach((item, index)=>{
|
|
394
|
-
const shouldHighlight = _isLegendHighlighted(item) || _noLegendHighlighted();
|
|
395
|
-
for(let i = 1; i < lineObject[item].length; i++){
|
|
396
|
-
var _lineObject_item__lineOptions, _lineObject_item__lineOptions1, _lineObject_item__lineOptions2;
|
|
397
|
-
const x1 = xScale(lineObject[item][i - 1].xItem.xAxisPoint);
|
|
398
|
-
const useSecondaryYScale = lineObject[item][i - 1].useSecondaryYScale && lineObject[item][i].useSecondaryYScale && yScaleSecondary;
|
|
399
|
-
const y1 = useSecondaryYScale ? yScaleSecondary(lineObject[item][i - 1].y) : yScalePrimary(lineObject[item][i - 1].y);
|
|
400
|
-
const x2 = xScale(lineObject[item][i].xItem.xAxisPoint);
|
|
401
|
-
const y2 = useSecondaryYScale ? yScaleSecondary(lineObject[item][i].y) : yScalePrimary(lineObject[item][i].y);
|
|
402
|
-
const yScaleBandwidthTranslate = !useSecondaryYScale && _yAxisType === YAxisType.StringAxis ? yScalePrimary.bandwidth() / 2 : 0;
|
|
403
|
-
if (lineBorderWidth > 0) {
|
|
404
|
-
borderForLines.push(/*#__PURE__*/ React.createElement("line", {
|
|
405
|
-
key: `${index}-${i}-BorderLine`,
|
|
406
|
-
x1: x1,
|
|
407
|
-
y1: y1,
|
|
408
|
-
x2: x2,
|
|
409
|
-
y2: y2,
|
|
410
|
-
opacity: shouldHighlight ? 1 : 0.1,
|
|
411
|
-
strokeWidth: 3 + lineBorderWidth * 2,
|
|
412
|
-
fill: "transparent",
|
|
413
|
-
strokeLinecap: "round",
|
|
414
|
-
stroke: tokens.colorNeutralBackground1,
|
|
415
|
-
transform: `translate(${xScaleBandwidthTranslate}, ${yScaleBandwidthTranslate})`
|
|
416
|
-
}));
|
|
417
|
-
}
|
|
418
|
-
var _lineObject_item__lineOptions_strokeWidth, _lineObject_item__lineOptions_strokeLinecap;
|
|
419
|
-
lines.push(/*#__PURE__*/ React.createElement("line", {
|
|
420
|
-
key: `${index}-${i}-line`,
|
|
421
|
-
x1: x1,
|
|
422
|
-
y1: y1,
|
|
423
|
-
x2: x2,
|
|
424
|
-
y2: y2,
|
|
425
|
-
opacity: shouldHighlight ? 1 : 0.1,
|
|
426
|
-
strokeWidth: (_lineObject_item__lineOptions_strokeWidth = (_lineObject_item__lineOptions = lineObject[item][0].lineOptions) === null || _lineObject_item__lineOptions === void 0 ? void 0 : _lineObject_item__lineOptions.strokeWidth) !== null && _lineObject_item__lineOptions_strokeWidth !== void 0 ? _lineObject_item__lineOptions_strokeWidth : 3,
|
|
427
|
-
strokeLinecap: (_lineObject_item__lineOptions_strokeLinecap = (_lineObject_item__lineOptions1 = lineObject[item][0].lineOptions) === null || _lineObject_item__lineOptions1 === void 0 ? void 0 : _lineObject_item__lineOptions1.strokeLinecap) !== null && _lineObject_item__lineOptions_strokeLinecap !== void 0 ? _lineObject_item__lineOptions_strokeLinecap : 'round',
|
|
428
|
-
strokeDasharray: (_lineObject_item__lineOptions2 = lineObject[item][0].lineOptions) === null || _lineObject_item__lineOptions2 === void 0 ? void 0 : _lineObject_item__lineOptions2.strokeDasharray,
|
|
429
|
-
stroke: lineObject[item][i].color,
|
|
430
|
-
transform: `translate(${xScaleBandwidthTranslate}, ${yScaleBandwidthTranslate})`,
|
|
431
|
-
onMouseOver: (event)=>_lineHover(lineObject[item][i - 1], event),
|
|
432
|
-
onMouseLeave: _handleMouseOut
|
|
433
|
-
}));
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
Object.keys(lineObject).forEach((item, index)=>{
|
|
437
|
-
lineObject[item].forEach((circlePoint, subIndex)=>{
|
|
438
|
-
const circleRef = {
|
|
439
|
-
refElement: null
|
|
440
|
-
};
|
|
441
|
-
const yScaleBandwidthTranslate = !circlePoint.useSecondaryYScale && _yAxisType === YAxisType.StringAxis ? yScalePrimary.bandwidth() / 2 : 0;
|
|
442
|
-
const shouldHighlight = _isLegendHighlighted(circlePoint.legend) || _noLegendHighlighted() ? true : false;
|
|
443
|
-
dots.push(/*#__PURE__*/ React.createElement("circle", {
|
|
444
|
-
key: `${index}-${subIndex}-dot`,
|
|
445
|
-
cx: xScale(circlePoint.xItem.xAxisPoint),
|
|
446
|
-
cy: circlePoint.useSecondaryYScale && yScaleSecondary ? yScaleSecondary(circlePoint.y) : yScalePrimary(circlePoint.y),
|
|
447
|
-
onMouseOver: (event)=>_lineHover(circlePoint, event),
|
|
448
|
-
onMouseLeave: _handleMouseOut,
|
|
449
|
-
r: _getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).radius,
|
|
450
|
-
stroke: circlePoint.color,
|
|
451
|
-
fill: tokens.colorNeutralBackground1,
|
|
452
|
-
strokeWidth: 3,
|
|
453
|
-
// Elements with visibility: hidden cannot receive focus, so use opacity: 0 instead to hide them.
|
|
454
|
-
// For more information, see https://fuzzbomb.github.io/accessibility-demos/visually-hidden-focus-test.html
|
|
455
|
-
opacity: _getCircleOpacityAndRadius(circlePoint.xItem.xAxisPoint, circlePoint.legend).opacity,
|
|
456
|
-
transform: `translate(${xScaleBandwidthTranslate}, ${yScaleBandwidthTranslate})`,
|
|
457
|
-
ref: (e)=>{
|
|
458
|
-
circleRef.refElement = e;
|
|
459
|
-
},
|
|
460
|
-
tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined,
|
|
461
|
-
onFocus: (event)=>_lineFocus(event, circlePoint, circleRef),
|
|
462
|
-
onBlur: _handleMouseOut,
|
|
463
|
-
role: "img",
|
|
464
|
-
"aria-label": _getAriaLabel(circlePoint.xItem, circlePoint, true)
|
|
465
|
-
}));
|
|
466
|
-
});
|
|
467
|
-
});
|
|
468
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, borderForLines, lines, dots);
|
|
469
|
-
}
|
|
470
|
-
function _getCircleOpacityAndRadius(xAxisPoint, legend) {
|
|
471
|
-
if (!_noLegendHighlighted()) {
|
|
472
|
-
if (xAxisPoint === activeXAxisDataPoint && _isLegendHighlighted(legend)) {
|
|
473
|
-
return {
|
|
474
|
-
opacity: 1,
|
|
475
|
-
radius: 8
|
|
476
|
-
};
|
|
477
|
-
} else if (_isLegendHighlighted(legend)) {
|
|
478
|
-
return {
|
|
479
|
-
opacity: 1,
|
|
480
|
-
radius: 0.3
|
|
481
|
-
};
|
|
482
|
-
} else {
|
|
483
|
-
return {
|
|
484
|
-
opacity: 0,
|
|
485
|
-
radius: 0
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
} else {
|
|
489
|
-
return {
|
|
490
|
-
opacity: activeXAxisDataPoint === xAxisPoint ? 1 : 0,
|
|
491
|
-
radius: 8
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
function _renderCallout(props) {
|
|
496
|
-
return props ? /*#__PURE__*/ React.createElement(ChartPopover, {
|
|
497
|
-
culture: props.culture,
|
|
498
|
-
XValue: props.xAxisCalloutData,
|
|
499
|
-
xCalloutValue: xCalloutValue,
|
|
500
|
-
yCalloutValue: yCalloutValue,
|
|
501
|
-
clickPosition: clickPosition,
|
|
502
|
-
isPopoverOpen: isPopoverOpen,
|
|
503
|
-
legend: props.legend,
|
|
504
|
-
YValue: props.yAxisCalloutData,
|
|
505
|
-
color: props.color
|
|
506
|
-
}) : null;
|
|
507
|
-
}
|
|
508
|
-
function _onRectHover(xAxisPoint, point, color, mouseEvent) {
|
|
509
|
-
mouseEvent.persist();
|
|
510
|
-
_onRectFocusHover(xAxisPoint, point, color, mouseEvent);
|
|
511
|
-
}
|
|
512
|
-
function _onRectFocusHover(xAxisPoint, point, color, mouseEvent) {
|
|
513
|
-
let clientX = 0;
|
|
514
|
-
let clientY = 0;
|
|
515
|
-
if ('clientX' in mouseEvent) {
|
|
516
|
-
clientX = mouseEvent.clientX;
|
|
517
|
-
clientY = mouseEvent.clientY;
|
|
518
|
-
} else {
|
|
519
|
-
// Handle case where mouseEvent is an SVGGElement
|
|
520
|
-
const boundingRect = mouseEvent.getBoundingClientRect();
|
|
521
|
-
clientX = boundingRect.left + boundingRect.width / 2;
|
|
522
|
-
clientY = boundingRect.top + boundingRect.height / 2;
|
|
523
|
-
}
|
|
524
|
-
if ((_calloutAnchorPoint === null || _calloutAnchorPoint === void 0 ? void 0 : _calloutAnchorPoint.chartDataPoint) !== point || (_calloutAnchorPoint === null || _calloutAnchorPoint === void 0 ? void 0 : _calloutAnchorPoint.xAxisDataPoint) !== xAxisPoint) {
|
|
525
|
-
_calloutAnchorPoint = {
|
|
526
|
-
chartDataPoint: point,
|
|
527
|
-
xAxisDataPoint: xAxisPoint instanceof Date ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC) : xAxisPoint.toString()
|
|
528
|
-
};
|
|
529
|
-
const xCalloutValue = point.xAxisCalloutData || (xAxisPoint instanceof Date ? formatDateToLocaleString(xAxisPoint, props.culture, props.useUTC) : xAxisPoint.toString());
|
|
530
|
-
_updatePosition(clientX, clientY);
|
|
531
|
-
setPopoverOpen(_noLegendHighlighted() || _isLegendHighlighted(point.legend));
|
|
532
|
-
setCalloutLegend(point.legend);
|
|
533
|
-
setDataForHoverCard(point.data);
|
|
534
|
-
setColor(color);
|
|
535
|
-
setXCalloutValue(xCalloutValue);
|
|
536
|
-
setYCalloutValue(point.yAxisCalloutData);
|
|
537
|
-
setDataPointCalloutProps(point);
|
|
538
|
-
setCallOutAccessibilityData(point.callOutAccessibilityData);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
function _lineHover(lineData, mouseEvent) {
|
|
542
|
-
mouseEvent.persist();
|
|
543
|
-
_lineHoverFocus(lineData, mouseEvent);
|
|
544
|
-
}
|
|
545
|
-
function _lineFocus(event, lineData, ref) {
|
|
546
|
-
if (ref.refElement) {
|
|
547
|
-
_lineHoverFocus(lineData, event);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
function _onStackHover(stack, mouseEvent) {
|
|
551
|
-
mouseEvent.persist();
|
|
552
|
-
_onStackHoverFocus(stack, mouseEvent);
|
|
553
|
-
}
|
|
554
|
-
function _onRectFocus(point, xAxisPoint, color, ref) {
|
|
555
|
-
if (ref.refElement) {
|
|
556
|
-
_onRectFocusHover(xAxisPoint, point, color, ref.refElement);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
function _onStackFocus(stack, groupRef) {
|
|
560
|
-
if (groupRef.refElement) {
|
|
561
|
-
_onStackHoverFocus(stack, groupRef.refElement);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
function _handleMouseOut() {
|
|
565
|
-
/**/ }
|
|
566
|
-
function _getBarGapAndScale(bars, yBarScale, defaultTotalHeight) {
|
|
567
|
-
const { barGapMax = 0 } = props;
|
|
568
|
-
let totalData = 0;
|
|
569
|
-
let totalHeight;
|
|
570
|
-
let sumOfPercent = 0;
|
|
571
|
-
let scalingRatio;
|
|
572
|
-
if (_yAxisType === YAxisType.StringAxis) {
|
|
573
|
-
totalHeight = defaultTotalHeight !== null && defaultTotalHeight !== void 0 ? defaultTotalHeight : bars.reduce((total, bar)=>total + yBarScale(bar.data), 0);
|
|
574
|
-
} else {
|
|
575
|
-
// When displaying gaps between the bars, the height of each bar is
|
|
576
|
-
// adjusted so that the total of all bars is not changed by the gaps
|
|
577
|
-
totalData = bars.reduce((iter, value)=>iter + Math.abs(value.data), 0);
|
|
578
|
-
totalHeight = defaultTotalHeight !== null && defaultTotalHeight !== void 0 ? defaultTotalHeight : Math.abs(yBarScale(totalData) - yBarScale(Y_ORIGIN));
|
|
579
|
-
bars.forEach((point)=>{
|
|
580
|
-
let value = Math.abs(point.data) / totalData * 100;
|
|
581
|
-
if (value < 1 && value !== 0) {
|
|
582
|
-
value = 1;
|
|
583
|
-
}
|
|
584
|
-
sumOfPercent += value;
|
|
585
|
-
});
|
|
586
|
-
scalingRatio = sumOfPercent !== 0 ? sumOfPercent / 100 : 1;
|
|
587
|
-
}
|
|
588
|
-
const gaps = barGapMax && bars.length - 1;
|
|
589
|
-
const gapHeight = gaps && Math.max(barGapMin, Math.min(barGapMax, totalHeight * barGapMultiplier / gaps));
|
|
590
|
-
const heightValueScale = _yAxisType === YAxisType.StringAxis ? 0 : (totalHeight - gapHeight * gaps) / (totalData * scalingRatio);
|
|
591
|
-
return {
|
|
592
|
-
gapHeight,
|
|
593
|
-
heightValueScale,
|
|
594
|
-
absStackTotal: totalData
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
function _getScales(containerHeight, containerWidth) {
|
|
598
|
-
const yDomain = [
|
|
599
|
-
Math.min(Y_ORIGIN, _yMin),
|
|
600
|
-
Math.max(Y_ORIGIN, _yMax)
|
|
601
|
-
];
|
|
602
|
-
const yBarScale = d3ScaleLinear().domain(yDomain).range([
|
|
603
|
-
0,
|
|
604
|
-
containerHeight - _margins.bottom - _margins.top
|
|
605
|
-
]);
|
|
606
|
-
if (_xAxisType === XAxisTypes.NumericAxis) {
|
|
607
|
-
const xMax = d3Max(_dataset, (point)=>point.x);
|
|
608
|
-
const xMin = d3Min(_dataset, (point)=>point.x);
|
|
609
|
-
const xBarScale = d3ScaleLinear().domain(_isRtl ? [
|
|
610
|
-
xMax,
|
|
611
|
-
xMin
|
|
612
|
-
] : [
|
|
613
|
-
xMin,
|
|
614
|
-
xMax
|
|
615
|
-
]).range([
|
|
616
|
-
_margins.left + _domainMargin,
|
|
617
|
-
containerWidth - _margins.right - _domainMargin
|
|
618
|
-
]);
|
|
619
|
-
if (!isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding)) {
|
|
620
|
-
xBarScale.nice();
|
|
621
|
-
}
|
|
622
|
-
return {
|
|
623
|
-
xBarScale,
|
|
624
|
-
yBarScale
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
if (_xAxisType === XAxisTypes.DateAxis) {
|
|
628
|
-
const sDate = d3Min(_dataset, (point)=>{
|
|
629
|
-
return point.x;
|
|
630
|
-
});
|
|
631
|
-
const lDate = d3Max(_dataset, (point)=>{
|
|
632
|
-
return point.x;
|
|
633
|
-
});
|
|
634
|
-
const xBarScale = props.useUTC ? d3ScaleUtc() : d3ScaleTime();
|
|
635
|
-
xBarScale.domain(_isRtl ? [
|
|
636
|
-
lDate,
|
|
637
|
-
sDate
|
|
638
|
-
] : [
|
|
639
|
-
sDate,
|
|
640
|
-
lDate
|
|
641
|
-
]).range([
|
|
642
|
-
_margins.left + _domainMargin,
|
|
643
|
-
containerWidth - _margins.right - _domainMargin
|
|
644
|
-
]);
|
|
645
|
-
return {
|
|
646
|
-
xBarScale,
|
|
647
|
-
yBarScale
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
const xBarScale = d3ScaleBand().domain(_xAxisLabels).range(_isRtl ? [
|
|
651
|
-
containerWidth - _margins.right - _domainMargin,
|
|
652
|
-
_margins.left + _domainMargin
|
|
653
|
-
] : [
|
|
654
|
-
_margins.left + _domainMargin,
|
|
655
|
-
containerWidth - _margins.right - _domainMargin
|
|
656
|
-
]).paddingInner(_xAxisInnerPadding).paddingOuter(_xAxisOuterPadding);
|
|
657
|
-
return {
|
|
658
|
-
xBarScale,
|
|
659
|
-
yBarScale
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
const _isChartEmpty = ()=>{
|
|
663
|
-
return !(props.data && props.data.length > 0 && props.data.some((item)=>item.chartData.length > 0 || item.lineData && item.lineData.length > 0));
|
|
664
|
-
};
|
|
665
|
-
function _updatePosition(newX, newY) {
|
|
666
|
-
const threshold = 1; // Set a threshold for movement
|
|
667
|
-
const { x, y } = clickPosition;
|
|
668
|
-
// Calculate the distance moved
|
|
669
|
-
const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
|
|
670
|
-
// Update the position only if the distance moved is greater than the threshold
|
|
671
|
-
if (distance > threshold) {
|
|
672
|
-
setClickPosition({
|
|
673
|
-
x: newX,
|
|
674
|
-
y: newY
|
|
675
|
-
});
|
|
676
|
-
setPopoverOpen(true);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
function _getDomainMargins(containerWidth) {
|
|
680
|
-
_domainMargin = MIN_DOMAIN_MARGIN;
|
|
681
|
-
const totalWidth = calcTotalWidth(containerWidth, _margins, MIN_DOMAIN_MARGIN);
|
|
682
|
-
if (_xAxisType === XAxisTypes.StringAxis) {
|
|
683
|
-
if (isScalePaddingDefined(props.xAxisOuterPadding, props.xAxisPadding)) {
|
|
684
|
-
// Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available
|
|
685
|
-
// to adjust the space before the first bar and after the last bar.
|
|
686
|
-
_domainMargin = 0;
|
|
687
|
-
} else if (props.barWidth !== 'auto') {
|
|
688
|
-
// Update the bar width so that when CartesianChart rerenders,
|
|
689
|
-
// the following calculations don't use the previous bar width.
|
|
690
|
-
_barWidth = getBarWidth(props.barWidth, props.maxBarWidth);
|
|
691
|
-
/** Total width required to render the bars. Directly proportional to bar width */ const reqWidth = calcRequiredWidth(_barWidth, _xAxisLabels.length, _xAxisInnerPadding);
|
|
692
|
-
if (totalWidth >= reqWidth) {
|
|
693
|
-
// Center align the chart by setting equal left and right margins for domain
|
|
694
|
-
_domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;
|
|
695
|
-
}
|
|
696
|
-
} else if (props.mode === 'plotly' && _xAxisLabels.length > 1) {
|
|
697
|
-
// Calculate the remaining width after rendering bars at their maximum allowable width
|
|
698
|
-
const bandwidth = calcBandwidth(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);
|
|
699
|
-
const barWidth = getBarWidth(props.barWidth, props.maxBarWidth, bandwidth);
|
|
700
|
-
let reqWidth = calcRequiredWidth(barWidth, _xAxisLabels.length, _xAxisInnerPadding);
|
|
701
|
-
const margin1 = (totalWidth - reqWidth) / 2;
|
|
702
|
-
let margin2 = Number.POSITIVE_INFINITY;
|
|
703
|
-
if (!props.hideTickOverlap) {
|
|
704
|
-
// Calculate the remaining width after accounting for the space required to render x-axis labels
|
|
705
|
-
const step = calculateLongestLabelWidth(_xAxisLabels) + 20;
|
|
706
|
-
reqWidth = (_xAxisLabels.length - _xAxisInnerPadding) * step;
|
|
707
|
-
margin2 = (totalWidth - reqWidth) / 2;
|
|
708
|
-
}
|
|
709
|
-
_domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));
|
|
710
|
-
}
|
|
711
|
-
} else {
|
|
712
|
-
var _props_data;
|
|
713
|
-
const data = ((_props_data = props.data) === null || _props_data === void 0 ? void 0 : _props_data.map((point)=>point.xAxisPoint)) || [];
|
|
714
|
-
_barWidth = getBarWidth(props.barWidth, props.maxBarWidth, calculateAppropriateBarWidth(data, totalWidth, _xAxisInnerPadding));
|
|
715
|
-
_domainMargin = MIN_DOMAIN_MARGIN + _barWidth / 2;
|
|
716
|
-
}
|
|
717
|
-
return {
|
|
718
|
-
..._margins,
|
|
719
|
-
left: _margins.left + _domainMargin,
|
|
720
|
-
right: _margins.right + _domainMargin
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
function _getChartTitle() {
|
|
724
|
-
const { chartTitle, data } = props;
|
|
725
|
-
const numLines = Object.keys(_lineObject).length;
|
|
726
|
-
return (chartTitle ? `${chartTitle}. ` : '') + `Vertical bar chart with ${(data === null || data === void 0 ? void 0 : data.length) || 0} stacked bars` + (numLines > 0 ? ` and ${numLines} lines` : '') + '. ';
|
|
727
|
-
}
|
|
728
|
-
const classes = useVerticalStackedBarChartStyles(props);
|
|
729
|
-
function _createBar(xBarScale, yBarScale, containerHeight, xElement) {
|
|
730
|
-
const { barCornerRadius = 0, barMinimumHeight = 0 } = props;
|
|
731
|
-
const shouldFocusWholeStack = _toFocusWholeStack();
|
|
732
|
-
if (_xAxisType === XAxisTypes.StringAxis) {
|
|
733
|
-
_barWidth = getBarWidth(props.barWidth, props.maxBarWidth, xBarScale.bandwidth());
|
|
734
|
-
}
|
|
735
|
-
const bars = _points.map((singleChartData, indexNumber)=>{
|
|
736
|
-
const xPoint = xBarScale(_xAxisType === XAxisTypes.NumericAxis ? singleChartData.xAxisPoint : _xAxisType === XAxisTypes.DateAxis ? singleChartData.xAxisPoint : singleChartData.xAxisPoint);
|
|
737
|
-
const xScaleBandwidthTranslate = _xAxisType !== XAxisTypes.StringAxis ? -_barWidth / 2 : (xBarScale.bandwidth() - _barWidth) / 2;
|
|
738
|
-
let barTotalValue = 0;
|
|
739
|
-
const barsToDisplay = singleChartData.chartData.filter((point)=>point.data !== 0 && point.data !== '' && !(_yAxisType === YAxisType.StringAxis && typeof yBarScale(point.data) === 'undefined'));
|
|
740
|
-
if (!barsToDisplay.length) {
|
|
741
|
-
return undefined;
|
|
742
|
-
}
|
|
743
|
-
const { gapHeight, heightValueScale, absStackTotal } = _getBarGapAndScale(barsToDisplay, yBarScale);
|
|
744
|
-
if (heightValueScale < 0) {
|
|
745
|
-
return undefined;
|
|
746
|
-
}
|
|
747
|
-
const yBaseline = containerHeight - _margins.bottom - (_yAxisType === YAxisType.StringAxis ? 0 : yBarScale(Y_ORIGIN));
|
|
748
|
-
let yPositiveStart = yBaseline;
|
|
749
|
-
let yNegativeStart = yBaseline;
|
|
750
|
-
let yPoint = 0;
|
|
751
|
-
let heightOfLastBar = 0;
|
|
752
|
-
const singleBar = barsToDisplay.map((point, index)=>{
|
|
753
|
-
const startColor = point.color ? point.color : _colors[index];
|
|
754
|
-
const ref = {};
|
|
755
|
-
const shouldHighlight = _isLegendHighlighted(point.legend) || _noLegendHighlighted() ? true : false;
|
|
756
|
-
const rectFocusProps = !shouldFocusWholeStack && shouldHighlight && {
|
|
757
|
-
'aria-label': _getAriaLabel(singleChartData, point),
|
|
758
|
-
onMouseOver: (event)=>_onRectHover(singleChartData.xAxisPoint, point, startColor, event),
|
|
759
|
-
onMouseMove: (event)=>_onRectHover(singleChartData.xAxisPoint, point, startColor, event),
|
|
760
|
-
onMouseLeave: _handleMouseOut,
|
|
761
|
-
onFocus: ()=>_onRectFocus(point, singleChartData.xAxisPoint, startColor, ref),
|
|
762
|
-
onBlur: _handleMouseOut,
|
|
763
|
-
onClick: (event)=>_onClick(point, event),
|
|
764
|
-
role: 'img',
|
|
765
|
-
tabIndex: !props.hideTooltip && shouldHighlight ? 0 : undefined
|
|
766
|
-
};
|
|
767
|
-
let barHeight;
|
|
768
|
-
const gapOffset = index ? gapHeight : 0;
|
|
769
|
-
if (_yAxisType === YAxisType.StringAxis) {
|
|
770
|
-
barHeight = Math.max(containerHeight - _margins.bottom - (yBarScale(point.data) + yBarScale.bandwidth() / 2) - gapOffset, barMinimumHeight, 1);
|
|
771
|
-
yPositiveStart -= barHeight + gapOffset;
|
|
772
|
-
yPoint = yPositiveStart;
|
|
773
|
-
} else {
|
|
774
|
-
barHeight = Math.abs(heightValueScale * point.data);
|
|
775
|
-
// FIXME: The current scaling logic may produce different min and gap heights for each bar stack.
|
|
776
|
-
const minHeight = Math.max(heightValueScale * absStackTotal / 100.0, barMinimumHeight);
|
|
777
|
-
if (barHeight < minHeight) {
|
|
778
|
-
barHeight = minHeight;
|
|
779
|
-
}
|
|
780
|
-
if (point.data >= Y_ORIGIN) {
|
|
781
|
-
yPositiveStart -= barHeight + gapOffset;
|
|
782
|
-
yPoint = yPositiveStart;
|
|
783
|
-
} else {
|
|
784
|
-
yPoint = yNegativeStart + gapOffset;
|
|
785
|
-
yNegativeStart = yPoint + barHeight;
|
|
786
|
-
}
|
|
787
|
-
barTotalValue += point.data;
|
|
788
|
-
heightOfLastBar = index === barsToDisplay.length - 1 ? barHeight : 0;
|
|
789
|
-
}
|
|
790
|
-
if (barCornerRadius && barHeight > barCornerRadius && index === barsToDisplay.length - 1) {
|
|
791
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, {
|
|
792
|
-
key: index + indexNumber + `${shouldFocusWholeStack}`
|
|
793
|
-
}, /*#__PURE__*/ React.createElement("path", {
|
|
794
|
-
className: classes.opacityChangeOnHover,
|
|
795
|
-
d: `
|
|
796
|
-
M ${xPoint} ${yPoint + barCornerRadius}
|
|
797
|
-
a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${-barCornerRadius}
|
|
798
|
-
h ${_barWidth - 2 * barCornerRadius}
|
|
799
|
-
a ${barCornerRadius} ${barCornerRadius} 0 0 1 ${barCornerRadius} ${barCornerRadius}
|
|
800
|
-
v ${barHeight - barCornerRadius}
|
|
801
|
-
h ${-_barWidth}
|
|
802
|
-
z
|
|
803
|
-
`,
|
|
804
|
-
fill: startColor,
|
|
805
|
-
opacity: shouldHighlight ? 1 : 0.1,
|
|
806
|
-
rx: props.roundCorners ? 3 : 0,
|
|
807
|
-
ref: (e)=>{
|
|
808
|
-
ref.refElement = e;
|
|
809
|
-
},
|
|
810
|
-
transform: `translate(${xScaleBandwidthTranslate}, 0)`,
|
|
811
|
-
cursor: props.href ? 'pointer' : 'default',
|
|
812
|
-
...rectFocusProps
|
|
813
|
-
}));
|
|
814
|
-
}
|
|
815
|
-
if (barHeight < 0) {
|
|
816
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, {
|
|
817
|
-
key: index + indexNumber
|
|
818
|
-
}, " ");
|
|
819
|
-
}
|
|
820
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, {
|
|
821
|
-
key: index + indexNumber
|
|
822
|
-
}, /*#__PURE__*/ React.createElement("rect", {
|
|
823
|
-
className: classes.opacityChangeOnHover,
|
|
824
|
-
x: xPoint,
|
|
825
|
-
y: yPoint,
|
|
826
|
-
width: _barWidth,
|
|
827
|
-
height: barHeight,
|
|
828
|
-
fill: startColor,
|
|
829
|
-
opacity: shouldHighlight ? 1 : 0.1,
|
|
830
|
-
cursor: props.href ? 'pointer' : 'default',
|
|
831
|
-
rx: props.roundCorners ? 3 : 0,
|
|
832
|
-
ref: (e)=>{
|
|
833
|
-
ref.refElement = e;
|
|
834
|
-
},
|
|
835
|
-
...rectFocusProps,
|
|
836
|
-
transform: `translate(${xScaleBandwidthTranslate}, 0)`
|
|
837
|
-
}));
|
|
838
|
-
});
|
|
839
|
-
const groupRef = {};
|
|
840
|
-
const someBarsActive = singleChartData.chartData.filter((dataPoint)=>_noLegendHighlighted() || _isLegendHighlighted(dataPoint.legend)).length > 0;
|
|
841
|
-
// FIXME: Making the entire stack focusable when stack callout is enabled adds unnecessary complexity
|
|
842
|
-
// and can reduce usability in certain scenarios. Instead, each individual element within the stack
|
|
843
|
-
// should be focusable on its own, with its own aria-label. This behavior is also seen in Highcharts.
|
|
844
|
-
const stackFocusProps = shouldFocusWholeStack && someBarsActive && {
|
|
845
|
-
'aria-label': _getAriaLabel(singleChartData),
|
|
846
|
-
onMouseOver: (event)=>_onStackHover(singleChartData, event),
|
|
847
|
-
onMouseMove: (event)=>_onStackHover(singleChartData, event),
|
|
848
|
-
onMouseLeave: _handleMouseOut,
|
|
849
|
-
onFocus: ()=>_onStackFocus(singleChartData, groupRef),
|
|
850
|
-
onBlur: _handleMouseOut,
|
|
851
|
-
onClick: (event)=>_onClick(singleChartData, event),
|
|
852
|
-
role: 'img',
|
|
853
|
-
tabIndex: !props.hideTooltip ? 0 : undefined
|
|
854
|
-
};
|
|
855
|
-
let showLabel = false;
|
|
856
|
-
let barLabel = 0;
|
|
857
|
-
let selectedBarTotalValue = 0;
|
|
858
|
-
let customBarLabel = undefined;
|
|
859
|
-
if (!props.hideLabels && _yAxisType !== YAxisType.StringAxis) {
|
|
860
|
-
// Collect all bars with barLabel that match the legend filter
|
|
861
|
-
const barLabelsToDisplay = barsToDisplay.filter((point)=>point.barLabel && (_noLegendHighlighted() || _isLegendHighlighted(point.legend)));
|
|
862
|
-
// For stacked bars, we want to show the total of the stack, not individual bar labels
|
|
863
|
-
// Only use customBarLabel if there's exactly one bar with a label in the stack
|
|
864
|
-
if (barLabelsToDisplay.length === 1) {
|
|
865
|
-
customBarLabel = barLabelsToDisplay[0].barLabel;
|
|
866
|
-
}
|
|
867
|
-
if (_noLegendHighlighted()) {
|
|
868
|
-
showLabel = true;
|
|
869
|
-
barLabel = customBarLabel !== null && customBarLabel !== void 0 ? customBarLabel : barTotalValue;
|
|
870
|
-
selectedBarTotalValue = barTotalValue;
|
|
871
|
-
} else {
|
|
872
|
-
barsToDisplay.forEach((point)=>{
|
|
873
|
-
if (_isLegendHighlighted(point.legend)) {
|
|
874
|
-
showLabel = true;
|
|
875
|
-
selectedBarTotalValue += point.data;
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
barLabel = customBarLabel !== null && customBarLabel !== void 0 ? customBarLabel : selectedBarTotalValue;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return /*#__PURE__*/ React.createElement("g", {
|
|
882
|
-
key: indexNumber + `${shouldFocusWholeStack}`
|
|
883
|
-
}, /*#__PURE__*/ React.createElement("g", {
|
|
884
|
-
id: `${indexNumber}-singleBar`,
|
|
885
|
-
ref: (e)=>{
|
|
886
|
-
groupRef.refElement = e;
|
|
887
|
-
},
|
|
888
|
-
...stackFocusProps
|
|
889
|
-
}, singleBar), !props.hideLabels && _barWidth >= 16 && showLabel && /*#__PURE__*/ React.createElement("text", {
|
|
890
|
-
x: xPoint + _barWidth / 2,
|
|
891
|
-
//if total bar value >=0, show label above top bar, otherwise below bottom bar
|
|
892
|
-
y: selectedBarTotalValue >= Y_ORIGIN ? yPoint - 6 : yPoint + heightOfLastBar + 12,
|
|
893
|
-
textAnchor: "middle",
|
|
894
|
-
className: classes.barLabel,
|
|
895
|
-
"aria-label": `Total: ${barLabel}`,
|
|
896
|
-
role: "img",
|
|
897
|
-
transform: `translate(${xScaleBandwidthTranslate}, 0)`,
|
|
898
|
-
style: {
|
|
899
|
-
direction: 'ltr',
|
|
900
|
-
unicodeBidi: 'isolate'
|
|
901
|
-
}
|
|
902
|
-
}, typeof barLabel === 'string' ? barLabel : typeof props.yAxisTickFormat === 'function' ? props.yAxisTickFormat(barLabel) : formatScientificLimitWidth(barLabel)));
|
|
903
|
-
});
|
|
904
|
-
return bars.filter((bar)=>!!bar);
|
|
905
|
-
}
|
|
906
|
-
function _getMinMaxOfYAxis(dataset, yAxisType, useSecondaryYScale) {
|
|
907
|
-
if (!useSecondaryYScale) {
|
|
908
|
-
return findVSBCNumericMinMaxOfY(dataset);
|
|
909
|
-
}
|
|
910
|
-
const values = [];
|
|
911
|
-
props.data.forEach((xPoint)=>{
|
|
912
|
-
var _xPoint_lineData;
|
|
913
|
-
(_xPoint_lineData = xPoint.lineData) === null || _xPoint_lineData === void 0 ? void 0 : _xPoint_lineData.forEach((point)=>{
|
|
914
|
-
// useSecondaryYScale is applicable only for lines in VSBC
|
|
915
|
-
if (point.useSecondaryYScale) {
|
|
916
|
-
values.push(point.y);
|
|
917
|
-
}
|
|
918
|
-
});
|
|
919
|
-
});
|
|
920
|
-
return {
|
|
921
|
-
startValue: d3Min(values),
|
|
922
|
-
endValue: d3Max(values)
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
function _initYAxisParams() {
|
|
926
|
-
if (_points[0].chartData.length > 0) {
|
|
927
|
-
_yAxisType = getTypeOfAxis(_points[0].chartData[0].data, false);
|
|
928
|
-
} else {
|
|
929
|
-
Object.keys(_lineObject).forEach((lineLegend)=>{
|
|
930
|
-
if (!_lineObject[lineLegend][0].useSecondaryYScale) {
|
|
931
|
-
_yAxisType = getTypeOfAxis(_lineObject[lineLegend][0].y, false);
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
_yAxisLabels = _getOrderedYAxisLabels();
|
|
936
|
-
}
|
|
937
|
-
function _getYDomainMargins(containerHeight) {
|
|
938
|
-
/**
|
|
939
|
-
* Specifies the extra top margin to apply above the highest y-axis tick label.
|
|
940
|
-
* Useful when stacked bars extend beyond the combined height of all y-axis labels (or categories).
|
|
941
|
-
*/ let yAxisTickMarginTop = 0;
|
|
942
|
-
/** Total height available to render the bars */ const totalHeight = containerHeight - _margins.bottom - _margins.top;
|
|
943
|
-
if (_yAxisType === YAxisType.StringAxis) {
|
|
944
|
-
/** Maximum height of the stacked bars, expressed in multiples of the height of a y-axis label (or category) */ let maxBarHeightInLabels = 0;
|
|
945
|
-
_points.forEach((xPoint)=>{
|
|
946
|
-
/** Height of the stacked bar, expressed in multiples of the height of a y-axis label (or category) */ let barHeightInLabels = 0;
|
|
947
|
-
xPoint.chartData.forEach((bar)=>{
|
|
948
|
-
barHeightInLabels += _yAxisLabels.indexOf(`${bar.data}`) + 1;
|
|
949
|
-
});
|
|
950
|
-
maxBarHeightInLabels = Math.max(maxBarHeightInLabels, barHeightInLabels);
|
|
951
|
-
});
|
|
952
|
-
/** Height of a y-axis label (or category) */ const yAxisLabelHeight = maxBarHeightInLabels === 0 ? 0 : totalHeight / maxBarHeightInLabels;
|
|
953
|
-
yAxisTickMarginTop += yAxisLabelHeight * (maxBarHeightInLabels - _yAxisLabels.length);
|
|
954
|
-
}
|
|
955
|
-
return {
|
|
956
|
-
..._margins,
|
|
957
|
-
top: _margins.top + yAxisTickMarginTop
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
function _getOrderedXAxisLabels() {
|
|
961
|
-
if (_xAxisType !== XAxisTypes.StringAxis) {
|
|
962
|
-
return [];
|
|
963
|
-
}
|
|
964
|
-
return sortAxisCategories(_mapCategoryToValues(), props.xAxisCategoryOrder);
|
|
965
|
-
}
|
|
966
|
-
function _getOrderedYAxisLabels() {
|
|
967
|
-
if (_yAxisType !== YAxisType.StringAxis) {
|
|
968
|
-
return [];
|
|
969
|
-
}
|
|
970
|
-
return sortAxisCategories(_mapCategoryToValues(true), props.yAxisCategoryOrder);
|
|
971
|
-
}
|
|
972
|
-
function _mapCategoryToValues(isYAxis = false) {
|
|
973
|
-
const categoryToValues = {};
|
|
974
|
-
_points.forEach((point)=>{
|
|
975
|
-
var _point_lineData;
|
|
976
|
-
point.chartData.forEach((bar)=>{
|
|
977
|
-
const category = isYAxis ? bar.data : point.xAxisPoint;
|
|
978
|
-
const value = isYAxis ? point.xAxisPoint : bar.data;
|
|
979
|
-
if (!categoryToValues[category]) {
|
|
980
|
-
categoryToValues[category] = [];
|
|
981
|
-
}
|
|
982
|
-
if (typeof value === 'number') {
|
|
983
|
-
categoryToValues[category].push(value);
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
|
-
(_point_lineData = point.lineData) === null || _point_lineData === void 0 ? void 0 : _point_lineData.forEach((linePoint)=>{
|
|
987
|
-
if (isYAxis && linePoint.useSecondaryYScale) {
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
const category = isYAxis ? linePoint.y : point.xAxisPoint;
|
|
991
|
-
const value = isYAxis ? point.xAxisPoint : linePoint.y;
|
|
992
|
-
if (!categoryToValues[category]) {
|
|
993
|
-
categoryToValues[category] = [];
|
|
994
|
-
}
|
|
995
|
-
if (typeof value === 'number') {
|
|
996
|
-
categoryToValues[category].push(value);
|
|
997
|
-
}
|
|
998
|
-
});
|
|
999
|
-
});
|
|
1000
|
-
return categoryToValues;
|
|
1001
|
-
}
|
|
1002
|
-
if (!_isChartEmpty()) {
|
|
1003
|
-
_adjustProps();
|
|
1004
|
-
const _isHavingLines = props.data.some((item)=>item.lineData && item.lineData.length > 0);
|
|
1005
|
-
const shouldFocusWholeStack = _toFocusWholeStack();
|
|
1006
|
-
_dataset = _createDataSetLayer();
|
|
1007
|
-
const legendBars = _getLegendData(_points, _createLegendsForLine(props.data));
|
|
1008
|
-
const calloutProps = {
|
|
1009
|
-
color,
|
|
1010
|
-
legend: calloutLegend,
|
|
1011
|
-
XValue: xCalloutValue,
|
|
1012
|
-
YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,
|
|
1013
|
-
YValueHover,
|
|
1014
|
-
hoverXValue,
|
|
1015
|
-
...props.calloutProps,
|
|
1016
|
-
...getAccessibleDataObject(callOutAccessibilityData),
|
|
1017
|
-
clickPosition,
|
|
1018
|
-
isPopoverOpen,
|
|
1019
|
-
isCalloutForStack: shouldFocusWholeStack,
|
|
1020
|
-
isCartesian: true,
|
|
1021
|
-
customCallout: {
|
|
1022
|
-
customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout() : undefined,
|
|
1023
|
-
customCalloutProps: props.calloutPropsPerDataPoint ? props.calloutPropsPerDataPoint(dataPointCalloutProps) : undefined
|
|
1024
|
-
}
|
|
1025
|
-
};
|
|
1026
|
-
const tickParams = {
|
|
1027
|
-
tickValues: props.tickValues,
|
|
1028
|
-
tickFormat: props.tickFormat
|
|
1029
|
-
};
|
|
1030
|
-
return /*#__PURE__*/ React.createElement(CartesianChart, {
|
|
1031
|
-
...props,
|
|
1032
|
-
chartTitle: _getChartTitle(),
|
|
1033
|
-
points: _dataset,
|
|
1034
|
-
chartType: ChartTypes.VerticalStackedBarChart,
|
|
1035
|
-
xAxisType: _xAxisType,
|
|
1036
|
-
getMinMaxOfYAxis: _getMinMaxOfYAxis,
|
|
1037
|
-
calloutProps: calloutProps,
|
|
1038
|
-
createYAxis: createNumericYAxis,
|
|
1039
|
-
tickParams: tickParams,
|
|
1040
|
-
legendBars: legendBars,
|
|
1041
|
-
datasetForXAxisDomain: _xAxisLabels,
|
|
1042
|
-
isCalloutForStack: shouldFocusWholeStack,
|
|
1043
|
-
getDomainNRangeValues: _getDomainNRangeValues,
|
|
1044
|
-
createStringYAxis: createStringYAxis,
|
|
1045
|
-
barwidth: _barWidth,
|
|
1046
|
-
getmargins: _getMargins,
|
|
1047
|
-
getGraphData: _getGraphData,
|
|
1048
|
-
getAxisData: _getAxisData,
|
|
1049
|
-
onChartMouseLeave: _handleChartMouseLeave,
|
|
1050
|
-
getDomainMargins: _getDomainMargins,
|
|
1051
|
-
..._xAxisType === XAxisTypes.StringAxis && {
|
|
1052
|
-
xAxisInnerPadding: _xAxisInnerPadding,
|
|
1053
|
-
xAxisOuterPadding: _xAxisOuterPadding
|
|
1054
|
-
},
|
|
1055
|
-
componentRef: cartesianChartRef,
|
|
1056
|
-
showRoundOffXTickValues: !isScalePaddingDefined(props.xAxisInnerPadding, props.xAxisPadding),
|
|
1057
|
-
yAxisType: _yAxisType,
|
|
1058
|
-
stringDatasetForYAxisDomain: [
|
|
1059
|
-
'',
|
|
1060
|
-
..._yAxisLabels
|
|
1061
|
-
],
|
|
1062
|
-
getYDomainMargins: _getYDomainMargins,
|
|
1063
|
-
/* eslint-disable react/jsx-no-bind */ children: (props)=>{
|
|
1064
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("g", _arrowNavigationAttributes, _bars), /*#__PURE__*/ React.createElement("g", null, _isHavingLines && _createLines(props.xScale, props.yScalePrimary, props.containerHeight, props.containerWidth, props.yScaleSecondary)));
|
|
1065
|
-
}
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
1069
|
-
id: _emptyChartId,
|
|
1070
|
-
role: 'alert',
|
|
1071
|
-
style: {
|
|
1072
|
-
opacity: '0'
|
|
1073
|
-
},
|
|
1074
|
-
"aria-label": 'Graph has no data to display'
|
|
1075
|
-
});
|
|
1076
|
-
});
|
|
1077
|
-
VerticalStackedBarChart.displayName = 'VerticalStackedBarChart';
|