@fluentui/react-charts 9.3.5 → 9.3.7
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 +42 -2
- package/dist/index.d.ts +239 -55
- package/lib/AnnotationOnlyChart.js +1 -0
- package/lib/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +194 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/index.js +2 -0
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +31 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +23 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.js +3 -16
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +11 -6
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +2 -10
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +59 -39
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +5 -5
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +617 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/index.js +2 -0
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +173 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +126 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +159 -132
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +1 -2
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/index.js +2 -0
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +32 -14
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +2 -6
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +1 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +83 -40
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -8
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +692 -94
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +23 -8
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +3 -12
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +4 -2
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +2 -10
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +6 -19
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +3 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +2 -10
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +11 -6
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +4 -17
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +25 -12
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +4 -4
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -23
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +97 -37
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +10 -11
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +11 -20
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +15 -10
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +3 -9
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -10
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +24 -24
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -8
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.js +11 -7
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +3 -15
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +13 -8
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +8 -18
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +11 -6
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/ChartAnnotation.js +1 -0
- package/lib/types/ChartAnnotation.js.map +1 -0
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/Common.styles.js +1 -2
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +1 -2
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/getWindow.js +0 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js +34 -0
- package/lib/utilities/hooks.js.map +1 -0
- package/lib/utilities/image-export-utils.js +221 -73
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +39 -37
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/AnnotationOnlyChart.js +6 -0
- package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +205 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +6 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js +7 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +56 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +33 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js +2 -15
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +14 -15
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +3 -10
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +74 -102
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +4 -4
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +628 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js +7 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +265 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +161 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +159 -131
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.js +2 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +35 -22
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -14
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +82 -39
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +678 -60
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +25 -16
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +2 -11
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +2 -10
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +5 -18
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +3 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -10
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +14 -15
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +3 -16
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +47 -34
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -21
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +144 -86
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +9 -10
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +11 -20
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +18 -19
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +3 -9
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +16 -19
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +22 -22
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +16 -17
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -15
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +16 -17
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +7 -17
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +14 -15
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.js +6 -0
- package/lib-commonjs/types/ChartAnnotation.js.map +1 -0
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/types/index.js +1 -0
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +1 -2
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +1 -2
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/getWindow.js +0 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/hooks.js +45 -0
- package/lib-commonjs/utilities/hooks.js.map +1 -0
- package/lib-commonjs/utilities/image-export-utils.js +222 -74
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +37 -33
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +11 -11
|
@@ -16,10 +16,15 @@ const _d3selection = require("d3-selection");
|
|
|
16
16
|
const _index = require("../../utilities/index");
|
|
17
17
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
18
18
|
const _SVGTooltipText = require("../../utilities/SVGTooltipText");
|
|
19
|
+
const _ChartAnnotationLayer = require("./Annotations/ChartAnnotationLayer");
|
|
19
20
|
const _ChartPopover = require("./ChartPopover");
|
|
20
21
|
const _reacttabster = require("@fluentui/react-tabster");
|
|
22
|
+
const HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;
|
|
23
|
+
const VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;
|
|
24
|
+
const AXIS_TITLE_PADDING = 8;
|
|
25
|
+
const DEFAULT_MARGIN_WITH_TICKS = 40;
|
|
26
|
+
const DEFAULT_MARGIN_NO_TICKS = 20;
|
|
21
27
|
const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true, ...props }, forwardedRef)=>{
|
|
22
|
-
var _props_margins, _props_margins1, _props_margins2, _props_margins3, _props_margins4, _props_margins5;
|
|
23
28
|
const chartContainer = _react.useRef(null);
|
|
24
29
|
let legendContainer;
|
|
25
30
|
const minLegendContainerHeight = 40;
|
|
@@ -31,7 +36,6 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
31
36
|
let _reqID;
|
|
32
37
|
const _useRtl = (0, _index.useRtl)();
|
|
33
38
|
let _tickValues;
|
|
34
|
-
const titleMargin = 8;
|
|
35
39
|
const _isFirstRender = _react.useRef(true);
|
|
36
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
41
|
let _xScale;
|
|
@@ -47,61 +51,12 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
47
51
|
* These value need to be removed from actual svg height/graph height.
|
|
48
52
|
* Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
|
|
49
53
|
*/ let _removalValueForTextTuncate = 0;
|
|
54
|
+
const _yAxisTickText = _react.useRef([]);
|
|
50
55
|
const [containerWidth, setContainerWidth] = _react.useState(0);
|
|
51
56
|
const [containerHeight, setContainerHeight] = _react.useState(0);
|
|
52
57
|
const [startFromX, setStartFromX] = _react.useState(0);
|
|
53
58
|
const prevWidthRef = _react.useRef(undefined);
|
|
54
59
|
const prevHeightRef = _react.useRef(undefined);
|
|
55
|
-
const chartTypesWithStringYAxis = [
|
|
56
|
-
_index.ChartTypes.HorizontalBarChartWithAxis,
|
|
57
|
-
_index.ChartTypes.HeatMapChart,
|
|
58
|
-
_index.ChartTypes.VerticalStackedBarChart,
|
|
59
|
-
_index.ChartTypes.GanttChart,
|
|
60
|
-
_index.ChartTypes.ScatterChart
|
|
61
|
-
];
|
|
62
|
-
var _props_margins_top, _props_margins_bottom, _props_margins_left, _props_margins_right, _props_margins_right1, _props_margins_left1;
|
|
63
|
-
/**
|
|
64
|
-
* In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.
|
|
65
|
-
* So that, in RTL, left margins becomes right margins and viceversa.
|
|
66
|
-
* As graph needs to be drawn perfecty, these values consider as default values.
|
|
67
|
-
* Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.
|
|
68
|
-
*/ // eslint-disable-next-line prefer-const
|
|
69
|
-
margins = {
|
|
70
|
-
top: (_props_margins_top = (_props_margins = props.margins) === null || _props_margins === void 0 ? void 0 : _props_margins.top) !== null && _props_margins_top !== void 0 ? _props_margins_top : 20,
|
|
71
|
-
bottom: (_props_margins_bottom = (_props_margins1 = props.margins) === null || _props_margins1 === void 0 ? void 0 : _props_margins1.bottom) !== null && _props_margins_bottom !== void 0 ? _props_margins_bottom : 35,
|
|
72
|
-
right: _useRtl ? (_props_margins_left = (_props_margins2 = props.margins) === null || _props_margins2 === void 0 ? void 0 : _props_margins2.left) !== null && _props_margins_left !== void 0 ? _props_margins_left : 40 : ((_props_margins_right = (_props_margins3 = props.margins) === null || _props_margins3 === void 0 ? void 0 : _props_margins3.right) !== null && _props_margins_right !== void 0 ? _props_margins_right : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20,
|
|
73
|
-
left: _useRtl ? ((_props_margins_right1 = (_props_margins4 = props.margins) === null || _props_margins4 === void 0 ? void 0 : _props_margins4.right) !== null && _props_margins_right1 !== void 0 ? _props_margins_right1 : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20 : (_props_margins_left1 = (_props_margins5 = props.margins) === null || _props_margins5 === void 0 ? void 0 : _props_margins5.left) !== null && _props_margins_left1 !== void 0 ? _props_margins_left1 : 40
|
|
74
|
-
};
|
|
75
|
-
const TITLE_MARGIN_HORIZONTAL = 24;
|
|
76
|
-
const TITLE_MARGIN_VERTICAL = 20;
|
|
77
|
-
if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {
|
|
78
|
-
var _props_margins6;
|
|
79
|
-
var _props_margins_bottom1;
|
|
80
|
-
margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN_VERTICAL;
|
|
81
|
-
}
|
|
82
|
-
if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {
|
|
83
|
-
var _props_margins7, _props_margins8, _props_margins9, _props_margins10;
|
|
84
|
-
var _props_margins_right2, _props_margins_left2;
|
|
85
|
-
margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN_HORIZONTAL;
|
|
86
|
-
var _props_margins_left3, _props_margins_right3;
|
|
87
|
-
margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN_HORIZONTAL : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
88
|
-
}
|
|
89
|
-
if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {
|
|
90
|
-
var _props_margins11;
|
|
91
|
-
var _props_margins_top1;
|
|
92
|
-
margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN_VERTICAL;
|
|
93
|
-
}
|
|
94
|
-
if (props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')) {
|
|
95
|
-
if (_useRtl) {
|
|
96
|
-
var _props_margins12;
|
|
97
|
-
var _props_margins_right4;
|
|
98
|
-
margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
99
|
-
} else {
|
|
100
|
-
var _props_margins13;
|
|
101
|
-
var _props_margins_right5;
|
|
102
|
-
margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
60
|
const classes = (0, _useCartesianChartStylesstyles.useCartesianChartStyles)(props);
|
|
106
61
|
const focusAttributes = (0, _reacttabster.useFocusableGroup)();
|
|
107
62
|
const arrowAttributes = (0, _reacttabster.useArrowNavigationGroup)({
|
|
@@ -110,7 +65,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
110
65
|
// ComponentdidMount and Componentwillunmount logic
|
|
111
66
|
_react.useEffect(()=>{
|
|
112
67
|
_fitParentContainer();
|
|
113
|
-
if (
|
|
68
|
+
if (props.showYAxisLables) {
|
|
114
69
|
const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis);
|
|
115
70
|
if (startFromX !== maxYAxisLabelLength) {
|
|
116
71
|
setStartFromX(maxYAxisLabelLength);
|
|
@@ -135,7 +90,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
135
90
|
// Update refs with current values
|
|
136
91
|
prevWidthRef.current = props.width;
|
|
137
92
|
prevHeightRef.current = props.height;
|
|
138
|
-
if (
|
|
93
|
+
if (props.showYAxisLables) {
|
|
139
94
|
const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis);
|
|
140
95
|
if (startFromX !== maxYAxisLabelLength) {
|
|
141
96
|
setStartFromX(maxYAxisLabelLength);
|
|
@@ -173,32 +128,26 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
173
128
|
}
|
|
174
129
|
return str;
|
|
175
130
|
};
|
|
176
|
-
return (0, _index.calculateLongestLabelWidth)(
|
|
131
|
+
return (0, _index.calculateLongestLabelWidth)(_yAxisTickText.current.map((label)=>formatTickLabel(label)), `.${className} text`);
|
|
177
132
|
}
|
|
178
133
|
const { calloutProps, points, chartType, svgProps, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter } = props;
|
|
179
134
|
if (props.parentRef) {
|
|
180
135
|
_fitParentContainer();
|
|
181
136
|
}
|
|
182
|
-
|
|
183
|
-
...margins
|
|
184
|
-
};
|
|
185
|
-
// Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
|
|
186
|
-
if (chartTypesWithStringYAxis.includes(props.chartType)) {
|
|
187
|
-
if (!_useRtl) {
|
|
188
|
-
margin.left += startFromX;
|
|
189
|
-
} else {
|
|
190
|
-
margin.right += startFromX;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
137
|
+
margins = _calcMargins();
|
|
193
138
|
// Callback for margins to the chart
|
|
194
|
-
props.getmargins && props.getmargins(
|
|
139
|
+
props.getmargins && props.getmargins(margins);
|
|
195
140
|
let callout = null;
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
142
|
+
let yScalePrimary;
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
144
|
+
let yScaleSecondary;
|
|
196
145
|
let children = null;
|
|
197
146
|
if (props.enableFirstRenderOptimization && chartContainer.current || !props.enableFirstRenderOptimization) {
|
|
198
147
|
_isFirstRender.current = false;
|
|
199
148
|
var _props_showRoundOffXTickValues;
|
|
200
149
|
const XAxisParams = {
|
|
201
|
-
domainNRangeValues: props.getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues
|
|
150
|
+
domainNRangeValues: props.getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues),
|
|
202
151
|
// FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
|
|
203
152
|
// Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
|
|
204
153
|
// However, if transformation props are enabled, the updated _removalValueForTextTuncate
|
|
@@ -218,6 +167,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
218
167
|
containerWidth: containerWidth,
|
|
219
168
|
hideTickOverlap: props.rotateXAxisLables ? false : hideTickOverlap,
|
|
220
169
|
calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,
|
|
170
|
+
xMinValue: props.xMinValue,
|
|
171
|
+
xMaxValue: props.xMaxValue,
|
|
221
172
|
...props.xAxis
|
|
222
173
|
};
|
|
223
174
|
/**
|
|
@@ -268,15 +219,12 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
268
219
|
* 1. To create x and y axis
|
|
269
220
|
* 2. To draw the graph.
|
|
270
221
|
* For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
let yScaleSecondary;
|
|
275
|
-
const axisData = {
|
|
276
|
-
yAxisDomainValues: []
|
|
222
|
+
*/ const axisData = {
|
|
223
|
+
yAxisDomainValues: [],
|
|
224
|
+
yAxisTickText: []
|
|
277
225
|
};
|
|
278
226
|
if (props.yAxisType && props.yAxisType === _index.YAxisType.StringAxis) {
|
|
279
|
-
yScalePrimary = props.createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, props.barwidth, props.chartType);
|
|
227
|
+
yScalePrimary = props.createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, axisData, props.barwidth, props.chartType);
|
|
280
228
|
} else {
|
|
281
229
|
// TODO: Since the scale domain values are now computed independently for both the primary and
|
|
282
230
|
// secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately
|
|
@@ -303,42 +251,41 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
303
251
|
}
|
|
304
252
|
yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks, props.yScaleType, _useRtl);
|
|
305
253
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
254
|
+
_yAxisTickText.current = axisData.yAxisTickText;
|
|
255
|
+
props.getAxisData && props.getAxisData(axisData);
|
|
256
|
+
// Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
|
|
257
|
+
// of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
|
|
258
|
+
// in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)
|
|
259
|
+
if (!props.showYAxisLablesTooltip) {
|
|
260
|
+
try {
|
|
261
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
262
|
+
//eslint-disable-next-line no-empty
|
|
263
|
+
} catch (e) {}
|
|
264
|
+
}
|
|
265
|
+
// Used to display tooltip at y axis labels.
|
|
266
|
+
if (props.showYAxisLablesTooltip) {
|
|
267
|
+
// To create y axis tick values by if specified truncating the rest of the text
|
|
268
|
+
// and showing elipsis or showing the whole string,
|
|
269
|
+
yScalePrimary && // Note: This function should be invoked within the showYAxisLablesTooltip check,
|
|
270
|
+
// as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
|
|
271
|
+
(0, _index.createYAxisLabels)(yAxisElement.current, yScalePrimary, props.noOfCharsToTruncate || 4, props.showYAxisLablesTooltip || false, _useRtl);
|
|
272
|
+
const _yAxisElement = (0, _d3selection.select)(yAxisElement.current).call(yScalePrimary);
|
|
273
|
+
try {
|
|
274
|
+
document.getElementById(_tooltipId) && document.getElementById(_tooltipId).remove();
|
|
275
|
+
//eslint-disable-next-line no-empty
|
|
276
|
+
} catch (e) {}
|
|
277
|
+
const ytooltipProps = {
|
|
278
|
+
tooltipCls: classes.tooltip,
|
|
279
|
+
id: _tooltipId,
|
|
280
|
+
axis: _yAxisElement
|
|
281
|
+
};
|
|
282
|
+
_yAxisElement && (0, _index.tooltipOfAxislabels)(ytooltipProps);
|
|
335
283
|
}
|
|
336
284
|
// Call back to the chart.
|
|
337
285
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
338
286
|
const _getData = (xScale, yScalePrimary, yScaleSecondary)=>{
|
|
339
287
|
props.getGraphData && props.getGraphData(xScale, yScalePrimary, containerHeight - _removalValueForTextTuncate, containerWidth, xAxisElement.current, yAxisElement.current, yScaleSecondary);
|
|
340
288
|
};
|
|
341
|
-
props.getAxisData && props.getAxisData(axisData);
|
|
342
289
|
// Callback function for chart, returns axis
|
|
343
290
|
_getData(xScale, yScalePrimary, yScaleSecondary);
|
|
344
291
|
children = props.children({
|
|
@@ -356,8 +303,30 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
356
303
|
width: containerWidth,
|
|
357
304
|
height: containerHeight
|
|
358
305
|
};
|
|
359
|
-
const
|
|
360
|
-
const
|
|
306
|
+
const plotWidth = Math.max(0, svgDimensions.width - margins.left - margins.right);
|
|
307
|
+
const plotHeight = Math.max(0, svgDimensions.height - margins.top - margins.bottom - _removalValueForTextTuncate);
|
|
308
|
+
const plotRect = {
|
|
309
|
+
x: margins.left,
|
|
310
|
+
y: margins.top,
|
|
311
|
+
width: plotWidth,
|
|
312
|
+
height: plotHeight
|
|
313
|
+
};
|
|
314
|
+
var _props_annotations;
|
|
315
|
+
const annotations = (_props_annotations = props.annotations) !== null && _props_annotations !== void 0 ? _props_annotations : [];
|
|
316
|
+
const hasAnnotations = annotations.length > 0;
|
|
317
|
+
const annotationContext = hasAnnotations ? {
|
|
318
|
+
plotRect,
|
|
319
|
+
svgRect: svgDimensions,
|
|
320
|
+
isRtl: _useRtl,
|
|
321
|
+
xScale: _xScale,
|
|
322
|
+
yScalePrimary,
|
|
323
|
+
yScaleSecondary
|
|
324
|
+
} : undefined;
|
|
325
|
+
const xAxisTitleMaxWidth = svgDimensions.width - margins.left - margins.right - AXIS_TITLE_PADDING * 2;
|
|
326
|
+
const yAxisTitleMaxHeight = svgDimensions.height - margins.bottom - margins.top - _removalValueForTextTuncate - AXIS_TITLE_PADDING * 2;
|
|
327
|
+
const yAxisTitleCenterY = margins.top + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;
|
|
328
|
+
const yAxisTitleCenterX = _useRtl ? svgDimensions.width - AXIS_TITLE_PADDING : HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;
|
|
329
|
+
const secondaryYAxisTitleCenterX = _useRtl ? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING : svgDimensions.width - AXIS_TITLE_PADDING;
|
|
361
330
|
const commonSvgToolTipProps = {
|
|
362
331
|
wrapContent: _index.wrapContent,
|
|
363
332
|
showBackground: true,
|
|
@@ -477,6 +446,64 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
477
446
|
_removalValueForTextTuncate = rotatedHeight + margins.bottom;
|
|
478
447
|
}
|
|
479
448
|
}
|
|
449
|
+
function _calcMargins() {
|
|
450
|
+
let _margins = _getDefaultMargins();
|
|
451
|
+
_margins = _applyTitleMargins(_margins);
|
|
452
|
+
_margins = _applyAnnotationMargins(_margins);
|
|
453
|
+
if (_useRtl) {
|
|
454
|
+
_margins = _swapRtlMargins(_margins);
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
..._margins,
|
|
458
|
+
...props.margins
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
function _getDefaultMargins() {
|
|
462
|
+
return {
|
|
463
|
+
top: DEFAULT_MARGIN_NO_TICKS,
|
|
464
|
+
// Smaller than the default because it is based on the line height rather than
|
|
465
|
+
// the length of the tick labels.
|
|
466
|
+
bottom: DEFAULT_MARGIN_WITH_TICKS - 5,
|
|
467
|
+
// For the actual margin, add the tick size, tick padding, and some extra space to
|
|
468
|
+
// the width of the longest yaxis tick label (startFromX).
|
|
469
|
+
left: Math.max(DEFAULT_MARGIN_WITH_TICKS, startFromX + 20),
|
|
470
|
+
right: props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
function _applyTitleMargins(_margins) {
|
|
474
|
+
const updated = {
|
|
475
|
+
..._margins
|
|
476
|
+
};
|
|
477
|
+
if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {
|
|
478
|
+
updated.bottom += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
479
|
+
}
|
|
480
|
+
if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {
|
|
481
|
+
updated.left += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
482
|
+
}
|
|
483
|
+
if (props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '') {
|
|
484
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
485
|
+
}
|
|
486
|
+
return updated;
|
|
487
|
+
}
|
|
488
|
+
function _applyAnnotationMargins(_margins) {
|
|
489
|
+
const updated = {
|
|
490
|
+
..._margins
|
|
491
|
+
};
|
|
492
|
+
if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {
|
|
493
|
+
updated.top += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
494
|
+
}
|
|
495
|
+
if (props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')) {
|
|
496
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
497
|
+
}
|
|
498
|
+
return updated;
|
|
499
|
+
}
|
|
500
|
+
function _swapRtlMargins(_margins) {
|
|
501
|
+
return {
|
|
502
|
+
..._margins,
|
|
503
|
+
left: _margins.right,
|
|
504
|
+
right: _margins.left
|
|
505
|
+
};
|
|
506
|
+
}
|
|
480
507
|
/**
|
|
481
508
|
* We have use the {@link defaultTabbableElement } to fix
|
|
482
509
|
* the Focus not landing on chart while tabbing, instead goes to legend.
|
|
@@ -528,75 +555,76 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef(({ hideTickOverlap = true
|
|
|
528
555
|
...commonSvgToolTipProps,
|
|
529
556
|
content: props.xAxisTitle,
|
|
530
557
|
textProps: {
|
|
531
|
-
x: margins.left +
|
|
532
|
-
y: svgDimensions.height -
|
|
558
|
+
x: margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
559
|
+
y: svgDimensions.height - AXIS_TITLE_PADDING,
|
|
533
560
|
className: classes.axisTitle,
|
|
534
561
|
textAnchor: 'middle'
|
|
535
562
|
},
|
|
536
|
-
maxWidth:
|
|
563
|
+
maxWidth: xAxisTitleMaxWidth
|
|
537
564
|
}), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
538
565
|
...commonSvgToolTipProps,
|
|
539
566
|
content: props.xAxisAnnotation,
|
|
540
567
|
textProps: {
|
|
541
|
-
x: margins.left +
|
|
542
|
-
y:
|
|
568
|
+
x: margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
569
|
+
y: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,
|
|
543
570
|
className: classes.axisAnnotation,
|
|
544
571
|
textAnchor: 'middle',
|
|
545
572
|
'aria-hidden': true
|
|
546
573
|
},
|
|
547
|
-
maxWidth:
|
|
574
|
+
maxWidth: xAxisTitleMaxWidth
|
|
548
575
|
}), /*#__PURE__*/ _react.createElement("g", {
|
|
549
576
|
ref: (e)=>{
|
|
550
577
|
yAxisElement.current = e;
|
|
551
578
|
},
|
|
552
579
|
id: `yAxisGElement${idForGraph}`,
|
|
553
|
-
transform: `translate(${_useRtl ? svgDimensions.width - margins.right
|
|
580
|
+
transform: `translate(${_useRtl ? svgDimensions.width - margins.right : margins.left}, 0)`,
|
|
554
581
|
className: classes.yAxis
|
|
555
582
|
}), props.secondaryYScaleOptions && /*#__PURE__*/ _react.createElement("g", null, /*#__PURE__*/ _react.createElement("g", {
|
|
556
583
|
ref: (e)=>{
|
|
557
584
|
yAxisElementSecondary.current = e;
|
|
558
585
|
},
|
|
559
586
|
id: `yAxisGElementSecondary${idForGraph}`,
|
|
560
|
-
transform: `translate(${_useRtl ? margins.left
|
|
587
|
+
transform: `translate(${_useRtl ? margins.left : svgDimensions.width - margins.right}, 0)`,
|
|
561
588
|
className: classes.yAxis
|
|
562
589
|
}), props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
563
590
|
...commonSvgToolTipProps,
|
|
564
591
|
content: props.secondaryYAxistitle,
|
|
565
592
|
textProps: {
|
|
566
|
-
x:
|
|
567
|
-
y:
|
|
593
|
+
x: secondaryYAxisTitleCenterX,
|
|
594
|
+
y: yAxisTitleCenterY,
|
|
568
595
|
textAnchor: 'middle',
|
|
569
|
-
transform: `
|
|
570
|
-
${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
|
|
596
|
+
transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,
|
|
571
597
|
className: classes.axisTitle
|
|
572
598
|
},
|
|
573
|
-
maxWidth:
|
|
599
|
+
maxWidth: yAxisTitleMaxHeight
|
|
574
600
|
})), children, props.yAxisTitle !== undefined && props.yAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
575
601
|
...commonSvgToolTipProps,
|
|
576
602
|
content: props.yAxisTitle,
|
|
577
603
|
textProps: {
|
|
578
|
-
x:
|
|
579
|
-
y:
|
|
604
|
+
x: yAxisTitleCenterX,
|
|
605
|
+
y: yAxisTitleCenterY,
|
|
580
606
|
textAnchor: 'middle',
|
|
581
|
-
transform: `
|
|
582
|
-
${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
|
|
607
|
+
transform: `rotate(-90, ${yAxisTitleCenterX}, ${yAxisTitleCenterY})`,
|
|
583
608
|
className: classes.axisTitle
|
|
584
609
|
},
|
|
585
|
-
maxWidth:
|
|
610
|
+
maxWidth: yAxisTitleMaxHeight
|
|
586
611
|
}), props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
|
|
587
612
|
...commonSvgToolTipProps,
|
|
588
613
|
content: props.yAxisAnnotation,
|
|
589
614
|
textProps: {
|
|
590
|
-
x:
|
|
591
|
-
y:
|
|
615
|
+
x: secondaryYAxisTitleCenterX,
|
|
616
|
+
y: yAxisTitleCenterY,
|
|
592
617
|
textAnchor: 'middle',
|
|
593
|
-
transform: `
|
|
594
|
-
${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
|
|
618
|
+
transform: `rotate(-90, ${secondaryYAxisTitleCenterX}, ${yAxisTitleCenterY})`,
|
|
595
619
|
className: classes.axisAnnotation,
|
|
596
620
|
'aria-hidden': true
|
|
597
621
|
},
|
|
598
|
-
maxWidth:
|
|
599
|
-
}))
|
|
622
|
+
maxWidth: yAxisTitleMaxHeight
|
|
623
|
+
})), hasAnnotations && annotationContext && /*#__PURE__*/ _react.createElement(_ChartAnnotationLayer.ChartAnnotationLayer, {
|
|
624
|
+
annotations: annotations,
|
|
625
|
+
context: annotationContext,
|
|
626
|
+
className: classes.annotationLayer
|
|
627
|
+
})), !props.hideLegend && /*#__PURE__*/ _react.createElement("div", {
|
|
600
628
|
ref: (e)=>{
|
|
601
629
|
legendContainer = e;
|
|
602
630
|
},
|