@fluentui/react-charting 5.25.0 → 5.25.2
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.json +87 -1
- package/CHANGELOG.md +28 -2
- package/dist/react-charting.d.ts +48 -45
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +24 -11
- package/lib/AnnotationOnlyChart.d.ts +1 -0
- package/lib/AnnotationOnlyChart.js +2 -0
- package/lib/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +158 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +2 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/index.d.ts +2 -0
- package/lib/components/AnnotationOnlyChart/index.js +3 -0
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib/components/AreaChart/AreaChart.base.js +2 -2
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +5 -3
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +199 -42
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/index.d.ts +2 -0
- package/lib/components/CommonComponents/Annotations/index.js +3 -0
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +6 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +131 -157
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +11 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +85 -51
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +169 -48
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.js +5 -3
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +15 -18
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.base.js +6 -6
- package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.d.ts +0 -11
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.js +5 -3
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +3 -3
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +3 -3
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +4 -4
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/Legends/Legends.base.d.ts +1 -1
- package/lib/components/Legends/Legends.base.js +6 -2
- package/lib/components/Legends/Legends.base.js.map +1 -1
- package/lib/components/Legends/Legends.types.d.ts +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +3 -3
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +5 -3
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +4 -4
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.d.ts +0 -4
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +6 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +15 -7
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/IChartAnnotation.d.ts +2 -0
- package/lib/types/IChartAnnotation.js.map +1 -1
- package/lib/utilities/image-export-utils.d.ts +7 -2
- package/lib/utilities/image-export-utils.js +174 -86
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.d.ts +5 -4
- package/lib/utilities/utilities.js +18 -17
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/AnnotationOnlyChart.d.ts +1 -0
- package/lib-amd/AnnotationOnlyChart.js +6 -0
- package/lib-amd/AnnotationOnlyChart.js.map +1 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +159 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +5 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib-amd/components/AnnotationOnlyChart/index.d.ts +2 -0
- package/lib-amd/components/AnnotationOnlyChart/index.js +7 -0
- package/lib-amd/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +4 -2
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +198 -41
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/index.d.ts +2 -0
- package/lib-amd/components/CommonComponents/Annotations/index.js +7 -0
- package/lib-amd/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +6 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +131 -157
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +11 -2
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +80 -50
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
- package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +171 -49
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.js +4 -2
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +13 -16
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/GanttChart/GanttChart.base.js +5 -5
- package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib-amd/components/GanttChart/GanttChart.types.d.ts +0 -11
- package/lib-amd/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +4 -2
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +2 -2
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +2 -2
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
- package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-amd/components/Legends/Legends.base.d.ts +1 -1
- package/lib-amd/components/Legends/Legends.base.js +6 -2
- package/lib-amd/components/Legends/Legends.base.js.map +1 -1
- package/lib-amd/components/Legends/Legends.types.d.ts +1 -1
- package/lib-amd/components/Legends/Legends.types.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +2 -2
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -2
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +3 -3
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +0 -4
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +14 -6
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-amd/index.d.ts +2 -0
- package/lib-amd/index.js +3 -2
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IChartAnnotation.d.ts +2 -0
- package/lib-amd/types/IChartAnnotation.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.d.ts +7 -2
- package/lib-amd/utilities/image-export-utils.js +173 -85
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +5 -4
- package/lib-amd/utilities/utilities.js +18 -17
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/AnnotationOnlyChart.d.ts +1 -0
- package/lib-commonjs/AnnotationOnlyChart.js +5 -0
- package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +162 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +3 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.d.ts +2 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js +6 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +4 -2
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +198 -41
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.d.ts +2 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js +6 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +6 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +131 -157
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +11 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +83 -49
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +171 -49
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +4 -2
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +13 -16
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.base.js +5 -5
- package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.d.ts +0 -11
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +4 -2
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +2 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +2 -2
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.base.d.ts +1 -1
- package/lib-commonjs/components/Legends/Legends.base.js +6 -2
- package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.d.ts +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +2 -2
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -2
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +3 -3
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +0 -4
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +14 -6
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -0
- package/lib-commonjs/index.js +3 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IChartAnnotation.d.ts +2 -0
- package/lib-commonjs/types/IChartAnnotation.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.d.ts +7 -2
- package/lib-commonjs/utilities/image-export-utils.js +173 -85
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +5 -4
- package/lib-commonjs/utilities/utilities.js +18 -17
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +5 -5
- package/src/components/AnnotationOnlyChart/AnnotationOnlyChart.types.ts +34 -0
- package/src/components/CommonComponents/CartesianChart.types.ts +12 -1
- package/src/components/GanttChart/GanttChart.types.ts +0 -13
- package/src/components/HeatMapChart/HeatMapChart.types.ts +0 -11
- package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +0 -11
- package/src/components/Legends/Legends.types.ts +1 -1
- package/src/components/ScatterChart/ScatterChart.types.ts +0 -5
- package/src/components/VerticalStackedBarChart/VerticalStackedBarChart.types.ts +0 -11
|
@@ -6,13 +6,11 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
6
6
|
var ChartHoverCard = React.lazy(function () {
|
|
7
7
|
return new Promise(function (resolve_1, reject_1) { require(['../../utilities/ChartHoverCard/ChartHoverCard'], resolve_1, reject_1); }).then(function (module) { return ({ default: module.ChartHoverCard }); });
|
|
8
8
|
});
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
index_1.ChartTypes.ScatterChart,
|
|
15
|
-
];
|
|
9
|
+
var HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;
|
|
10
|
+
var VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;
|
|
11
|
+
var AXIS_TITLE_PADDING = 8;
|
|
12
|
+
var DEFAULT_MARGIN_WITH_TICKS = 40;
|
|
13
|
+
var DEFAULT_MARGIN_NO_TICKS = 20;
|
|
16
14
|
/**
|
|
17
15
|
* Cartesian chart used for
|
|
18
16
|
* 1.draw X and Y axis of the chart
|
|
@@ -22,7 +20,6 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
22
20
|
var CartesianChartBase = /** @class */ (function (_super) {
|
|
23
21
|
tslib_1.__extends(CartesianChartBase, _super);
|
|
24
22
|
function CartesianChartBase(props) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
26
23
|
var _this = _super.call(this, props) || this;
|
|
27
24
|
_this.minLegendContainerHeight = 32;
|
|
28
25
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
@@ -34,6 +31,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
34
31
|
* Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
|
|
35
32
|
*/
|
|
36
33
|
_this._removalValueForTextTuncate = 0;
|
|
34
|
+
_this._yAxisTickText = [];
|
|
37
35
|
_this.isIntegralDataset = true;
|
|
38
36
|
_this.calculateMaxYAxisLabelLength = function (className) {
|
|
39
37
|
var formatTickLabel = function (str) {
|
|
@@ -42,7 +40,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
42
40
|
}
|
|
43
41
|
return str;
|
|
44
42
|
};
|
|
45
|
-
return (0, index_1.calculateLongestLabelWidth)(_this.
|
|
43
|
+
return (0, index_1.calculateLongestLabelWidth)(_this._yAxisTickText.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
|
|
46
44
|
};
|
|
47
45
|
// TO DO: Write a common functional component for Multi value callout and divide sub count method
|
|
48
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -178,6 +176,55 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
178
176
|
_this._removalValueForTextTuncate = rotatedHeight + _this.margins.bottom;
|
|
179
177
|
}
|
|
180
178
|
};
|
|
179
|
+
_this._calcMargins = function () {
|
|
180
|
+
var margins = _this._getDefaultMargins();
|
|
181
|
+
margins = _this._applyTitleMargins(margins);
|
|
182
|
+
margins = _this._applyAnnotationMargins(margins);
|
|
183
|
+
if (_this._isRtl) {
|
|
184
|
+
margins = _this._swapRtlMargins(margins);
|
|
185
|
+
}
|
|
186
|
+
return tslib_1.__assign(tslib_1.__assign({}, margins), _this.props.margins);
|
|
187
|
+
};
|
|
188
|
+
_this._getDefaultMargins = function () {
|
|
189
|
+
return {
|
|
190
|
+
top: DEFAULT_MARGIN_NO_TICKS,
|
|
191
|
+
// Smaller than the default because it is based on the line height rather than
|
|
192
|
+
// the length of the tick labels.
|
|
193
|
+
bottom: DEFAULT_MARGIN_WITH_TICKS - 5,
|
|
194
|
+
// For the actual margin, add the tick size, tick padding, and some extra space to
|
|
195
|
+
// the width of the longest yaxis tick label (startFromX).
|
|
196
|
+
left: Math.max(DEFAULT_MARGIN_WITH_TICKS, _this.state.startFromX + 20),
|
|
197
|
+
right: _this.props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
_this._applyTitleMargins = function (margins) {
|
|
201
|
+
var updated = tslib_1.__assign({}, margins);
|
|
202
|
+
if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
|
|
203
|
+
updated.bottom += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
204
|
+
}
|
|
205
|
+
if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
|
|
206
|
+
updated.left += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
207
|
+
}
|
|
208
|
+
if (_this.props.secondaryYAxistitle !== undefined && _this.props.secondaryYAxistitle !== '') {
|
|
209
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
210
|
+
}
|
|
211
|
+
return updated;
|
|
212
|
+
};
|
|
213
|
+
_this._applyAnnotationMargins = function (margins) {
|
|
214
|
+
var updated = tslib_1.__assign({}, margins);
|
|
215
|
+
if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
|
|
216
|
+
updated.top += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
217
|
+
}
|
|
218
|
+
if (_this.props.yAxisAnnotation !== undefined &&
|
|
219
|
+
_this.props.yAxisAnnotation !== '' &&
|
|
220
|
+
(_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
|
|
221
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
222
|
+
}
|
|
223
|
+
return updated;
|
|
224
|
+
};
|
|
225
|
+
_this._swapRtlMargins = function (margins) {
|
|
226
|
+
return tslib_1.__assign(tslib_1.__assign({}, margins), { left: margins.right, right: margins.left });
|
|
227
|
+
};
|
|
181
228
|
_this.state = {
|
|
182
229
|
containerHeight: 0,
|
|
183
230
|
containerWidth: 0,
|
|
@@ -186,67 +233,13 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
186
233
|
startFromX: 0,
|
|
187
234
|
};
|
|
188
235
|
_this.idForGraph = (0, Utilities_1.getId)('chart_');
|
|
189
|
-
_this.titleMargin = 8;
|
|
190
236
|
_this.idForDefaultTabbableElement = (0, Utilities_1.getId)('defaultTabbableElement_');
|
|
191
237
|
_this._tooltipId = (0, Utilities_1.getId)('tooltip_');
|
|
192
|
-
/**
|
|
193
|
-
* In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.
|
|
194
|
-
* So that, in RTL, left margins becomes right margins and viceversa.
|
|
195
|
-
* As graph needs to be drawn perfecty, these values consider as default values.
|
|
196
|
-
* Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.
|
|
197
|
-
*/
|
|
198
|
-
_this.margins = {
|
|
199
|
-
top: (_b = (_a = _this.props.margins) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 20,
|
|
200
|
-
bottom: (_d = (_c = _this.props.margins) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 35,
|
|
201
|
-
right: _this._isRtl
|
|
202
|
-
? (_f = (_e = _this.props.margins) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 40
|
|
203
|
-
: ((_h = (_g = _this.props.margins) === null || _g === void 0 ? void 0 : _g.right) !== null && _h !== void 0 ? _h : (_j = _this.props) === null || _j === void 0 ? void 0 : _j.secondaryYScaleOptions)
|
|
204
|
-
? 40
|
|
205
|
-
: 20,
|
|
206
|
-
left: _this._isRtl
|
|
207
|
-
? ((_l = (_k = _this.props.margins) === null || _k === void 0 ? void 0 : _k.right) !== null && _l !== void 0 ? _l : (_m = _this.props) === null || _m === void 0 ? void 0 : _m.secondaryYScaleOptions)
|
|
208
|
-
? 40
|
|
209
|
-
: 20
|
|
210
|
-
: (_p = (_o = _this.props.margins) === null || _o === void 0 ? void 0 : _o.left) !== null && _p !== void 0 ? _p : 40,
|
|
211
|
-
};
|
|
212
|
-
var TITLE_MARGIN_HORIZONTAL = 24;
|
|
213
|
-
var TITLE_MARGIN_VERTICAL = 20;
|
|
214
|
-
if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
|
|
215
|
-
_this.margins.bottom = (_r = (_q = _this.props.margins) === null || _q === void 0 ? void 0 : _q.bottom) !== null && _r !== void 0 ? _r : _this.margins.bottom + TITLE_MARGIN_VERTICAL;
|
|
216
|
-
}
|
|
217
|
-
if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
|
|
218
|
-
_this.margins.left = _this._isRtl
|
|
219
|
-
? ((_t = (_s = _this.props.margins) === null || _s === void 0 ? void 0 : _s.right) !== null && _t !== void 0 ? _t : (_u = _this.props) === null || _u === void 0 ? void 0 : _u.secondaryYAxistitle)
|
|
220
|
-
? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
|
|
221
|
-
: _this.margins.right + TITLE_MARGIN_HORIZONTAL
|
|
222
|
-
: (_w = (_v = _this.props.margins) === null || _v === void 0 ? void 0 : _v.left) !== null && _w !== void 0 ? _w : _this.margins.left + TITLE_MARGIN_HORIZONTAL;
|
|
223
|
-
_this.margins.right = _this._isRtl
|
|
224
|
-
? (_y = (_x = _this.props.margins) === null || _x === void 0 ? void 0 : _x.left) !== null && _y !== void 0 ? _y : _this.margins.left + TITLE_MARGIN_HORIZONTAL
|
|
225
|
-
: ((_0 = (_z = _this.props.margins) === null || _z === void 0 ? void 0 : _z.right) !== null && _0 !== void 0 ? _0 : (_1 = _this.props) === null || _1 === void 0 ? void 0 : _1.secondaryYAxistitle)
|
|
226
|
-
? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
|
|
227
|
-
: _this.margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
228
|
-
}
|
|
229
|
-
if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
|
|
230
|
-
_this.margins.top = (_3 = (_2 = _this.props.margins) === null || _2 === void 0 ? void 0 : _2.top) !== null && _3 !== void 0 ? _3 : _this.margins.top + TITLE_MARGIN_VERTICAL;
|
|
231
|
-
}
|
|
232
|
-
if (_this.props.yAxisAnnotation !== undefined &&
|
|
233
|
-
_this.props.yAxisAnnotation !== '' &&
|
|
234
|
-
(_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
|
|
235
|
-
if (_this._isRtl) {
|
|
236
|
-
_this.margins.left = (_5 = (_4 = _this.props.margins) === null || _4 === void 0 ? void 0 : _4.right) !== null && _5 !== void 0 ? _5 : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
_this.margins.right = (_7 = (_6 = _this.props.margins) === null || _6 === void 0 ? void 0 : _6.right) !== null && _7 !== void 0 ? _7 : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
238
|
return _this;
|
|
243
239
|
}
|
|
244
240
|
CartesianChartBase.prototype.componentDidMount = function () {
|
|
245
241
|
this._fitParentContainer();
|
|
246
|
-
if (
|
|
247
|
-
this.props.showYAxisLables &&
|
|
248
|
-
this.yAxisElement &&
|
|
249
|
-
this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
242
|
+
if (this.props.showYAxisLables) {
|
|
250
243
|
var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
|
|
251
244
|
if (this.state.startFromX !== maxYAxisLabelLength) {
|
|
252
245
|
this.setState({
|
|
@@ -270,10 +263,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
270
263
|
if (prevProps.height !== this.props.height || prevProps.width !== this.props.width) {
|
|
271
264
|
this._fitParentContainer();
|
|
272
265
|
}
|
|
273
|
-
if (
|
|
274
|
-
this.props.showYAxisLables &&
|
|
275
|
-
this.yAxisElement &&
|
|
276
|
-
this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
266
|
+
if (this.props.showYAxisLables) {
|
|
277
267
|
var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
|
|
278
268
|
if (this.state.startFromX !== maxYAxisLabelLength) {
|
|
279
269
|
this.setState({
|
|
@@ -301,18 +291,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
301
291
|
if (this.props.parentRef) {
|
|
302
292
|
this._fitParentContainer();
|
|
303
293
|
}
|
|
304
|
-
|
|
305
|
-
// Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
|
|
306
|
-
if (chartTypesWithStringYAxis.includes(this.props.chartType)) {
|
|
307
|
-
if (!this._isRtl) {
|
|
308
|
-
margin.left += this.state.startFromX;
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
margin.right += this.state.startFromX;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
294
|
+
this.margins = this._calcMargins();
|
|
314
295
|
// Callback for margins to the chart
|
|
315
|
-
this.props.getmargins && this.props.getmargins(
|
|
296
|
+
this.props.getmargins && this.props.getmargins(this.margins);
|
|
316
297
|
this._classNames = getClassNames(this.props.styles, {
|
|
317
298
|
theme: this.props.theme,
|
|
318
299
|
width: this.state._width,
|
|
@@ -331,9 +312,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
331
312
|
if ((this.props.enableFirstRenderOptimization && this.chartContainer) ||
|
|
332
313
|
!this.props.enableFirstRenderOptimization) {
|
|
333
314
|
this._isFirstRender = false;
|
|
334
|
-
var XAxisParams = tslib_1.__assign({ domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues,
|
|
335
|
-
// This is only used for Horizontal Bar Chart with Axis for y as string axis
|
|
336
|
-
this.state.startFromX),
|
|
315
|
+
var XAxisParams = tslib_1.__assign({ domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues),
|
|
337
316
|
// FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
|
|
338
317
|
// Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
|
|
339
318
|
// However, if transformation props are enabled, the updated _removalValueForTextTuncate
|
|
@@ -377,9 +356,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
377
356
|
* 2. To draw the graph.
|
|
378
357
|
* For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
|
|
379
358
|
*/
|
|
380
|
-
var axisData = { yAxisDomainValues: [] };
|
|
359
|
+
var axisData = { yAxisDomainValues: [], yAxisTickText: [] };
|
|
381
360
|
if (this.props.yAxisType && this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
382
|
-
yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, this.props.barwidth, this.props.chartType);
|
|
361
|
+
yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, axisData, this.props.barwidth, this.props.chartType);
|
|
383
362
|
}
|
|
384
363
|
else {
|
|
385
364
|
// TODO: Since the scale domain values are now computed independently for both the primary and
|
|
@@ -405,40 +384,39 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
405
384
|
}
|
|
406
385
|
yScalePrimary = this.props.createYAxis(YAxisParams, this._isRtl, axisData, this.isIntegralDataset, false, this.props.supportNegativeData, this.props.roundedTicks, this.props.yScaleType);
|
|
407
386
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
catch (e) { }
|
|
387
|
+
this._yAxisTickText = axisData.yAxisTickText;
|
|
388
|
+
this.props.getAxisData && this.props.getAxisData(axisData);
|
|
389
|
+
// Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
|
|
390
|
+
// of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
|
|
391
|
+
// in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
|
|
392
|
+
if (!this.props.showYAxisLablesTooltip) {
|
|
393
|
+
try {
|
|
394
|
+
document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
|
|
395
|
+
//eslint-disable-next-line no-empty
|
|
418
396
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
var ytooltipProps = {
|
|
434
|
-
tooltipCls: this._classNames.tooltip,
|
|
435
|
-
id: this._tooltipId,
|
|
436
|
-
axis: yAxisElement,
|
|
437
|
-
};
|
|
438
|
-
yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
|
|
397
|
+
catch (e) { }
|
|
398
|
+
}
|
|
399
|
+
// Used to display tooltip at y axis labels.
|
|
400
|
+
if (this.props.showYAxisLablesTooltip) {
|
|
401
|
+
// To create y axis tick values by if specified truncating the rest of the text
|
|
402
|
+
// and showing elipsis or showing the whole string,
|
|
403
|
+
yScalePrimary &&
|
|
404
|
+
// Note: This function should be invoked within the showYAxisLablesTooltip check,
|
|
405
|
+
// as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
|
|
406
|
+
(0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
|
|
407
|
+
var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
|
|
408
|
+
try {
|
|
409
|
+
document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
|
|
410
|
+
//eslint-disable-next-line no-empty
|
|
439
411
|
}
|
|
412
|
+
catch (e) { }
|
|
413
|
+
var ytooltipProps = {
|
|
414
|
+
tooltipCls: this._classNames.tooltip,
|
|
415
|
+
id: this._tooltipId,
|
|
416
|
+
axis: yAxisElement,
|
|
417
|
+
};
|
|
418
|
+
yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
|
|
440
419
|
}
|
|
441
|
-
this.props.getAxisData && this.props.getAxisData(axisData);
|
|
442
420
|
// Callback function for chart, returns axis
|
|
443
421
|
this._getData(xScale, yScalePrimary, yScaleSecondary);
|
|
444
422
|
children = this.props.children(tslib_1.__assign(tslib_1.__assign({}, this.state), { xScale: xScale, yScalePrimary: yScalePrimary, yScaleSecondary: yScaleSecondary }));
|
|
@@ -450,11 +428,10 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
450
428
|
width: this.state.containerWidth,
|
|
451
429
|
height: this.state.containerHeight,
|
|
452
430
|
};
|
|
453
|
-
var
|
|
454
|
-
var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right - startFromX);
|
|
431
|
+
var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right);
|
|
455
432
|
var plotHeight = Math.max(0, svgDimensions.height - this.margins.top - this.margins.bottom - this._removalValueForTextTuncate);
|
|
456
433
|
var plotRect = {
|
|
457
|
-
x: this.
|
|
434
|
+
x: this.margins.left,
|
|
458
435
|
y: this.margins.top,
|
|
459
436
|
width: plotWidth,
|
|
460
437
|
height: plotHeight,
|
|
@@ -481,12 +458,19 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
481
458
|
else {
|
|
482
459
|
focusDirection = react_focus_1.FocusZoneDirection.horizontal;
|
|
483
460
|
}
|
|
484
|
-
var
|
|
485
|
-
var
|
|
461
|
+
var xAxisTitleMaxWidth = svgDimensions.width - this.margins.left - this.margins.right - AXIS_TITLE_PADDING * 2;
|
|
462
|
+
var yAxisTitleMaxHeight = svgDimensions.height -
|
|
486
463
|
this.margins.bottom -
|
|
487
464
|
this.margins.top -
|
|
488
465
|
this._removalValueForTextTuncate -
|
|
489
|
-
|
|
466
|
+
AXIS_TITLE_PADDING * 2;
|
|
467
|
+
var yAxisTitleCenterY = this.margins.top + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;
|
|
468
|
+
var yAxisTitleCenterX = this._isRtl
|
|
469
|
+
? svgDimensions.width - AXIS_TITLE_PADDING
|
|
470
|
+
: HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;
|
|
471
|
+
var secondaryYAxisTitleCenterX = this._isRtl
|
|
472
|
+
? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING
|
|
473
|
+
: svgDimensions.width - AXIS_TITLE_PADDING;
|
|
490
474
|
var commonSvgToolTipProps = {
|
|
491
475
|
wrapContent: index_1.wrapContent,
|
|
492
476
|
theme: this.props.theme,
|
|
@@ -512,7 +496,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
512
496
|
* But this is a hacky solution and not a proper fix and also elementRef is deprecated.
|
|
513
497
|
* 2. Using the default tabbable element to fix the issue.
|
|
514
498
|
*/
|
|
515
|
-
return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
|
|
499
|
+
return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
|
|
500
|
+
_this.chartContainer = rootElem;
|
|
501
|
+
}, onMouseLeave: this._onChartLeave },
|
|
516
502
|
!this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
|
|
517
503
|
React.createElement(react_focus_1.FocusZone, tslib_1.__assign({ direction: focusDirection, className: this._classNames.chartWrapper, defaultTabbableElement: "#".concat(this.idForDefaultTabbableElement) }, svgFocusZoneProps),
|
|
518
504
|
this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
|
|
@@ -523,69 +509,57 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
|
|
|
523
509
|
// To add wrap of x axis lables feature, need to remove word height from svg height.
|
|
524
510
|
transform: "translate(0, ".concat(svgDimensions.height - this.margins.bottom - this._removalValueForTextTuncate, ")"), className: this._classNames.xAxis }),
|
|
525
511
|
this.props.xAxisTitle !== undefined && this.props.xAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisTitle, textProps: {
|
|
526
|
-
x: this.margins.left +
|
|
527
|
-
y: svgDimensions.height -
|
|
512
|
+
x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
513
|
+
y: svgDimensions.height - AXIS_TITLE_PADDING,
|
|
528
514
|
className: this._classNames.axisTitle,
|
|
529
515
|
textAnchor: 'middle',
|
|
530
516
|
'aria-hidden': true,
|
|
531
|
-
}, maxWidth:
|
|
517
|
+
}, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
|
|
532
518
|
this.props.xAxisAnnotation !== undefined && this.props.xAxisAnnotation !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisAnnotation, textProps: {
|
|
533
|
-
x: this.margins.left +
|
|
534
|
-
y:
|
|
519
|
+
x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
520
|
+
y: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,
|
|
535
521
|
className: this._classNames.axisAnnotation,
|
|
536
522
|
textAnchor: 'middle',
|
|
537
523
|
'aria-hidden': true,
|
|
538
|
-
}, maxWidth:
|
|
524
|
+
}, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
|
|
539
525
|
React.createElement("g", { ref: function (e) {
|
|
540
526
|
_this.yAxisElement = e;
|
|
541
|
-
}, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
|
|
542
|
-
? svgDimensions.width - this.margins.right - this.state.startFromX
|
|
543
|
-
: this.margins.left + this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
|
|
527
|
+
}, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? svgDimensions.width - this.margins.right : this.margins.left, ", 0)"), className: this._classNames.yAxis }),
|
|
544
528
|
this.props.secondaryYScaleOptions && (React.createElement("g", null,
|
|
545
529
|
React.createElement("g", { ref: function (e) {
|
|
546
530
|
_this.yAxisElementSecondary = e;
|
|
547
|
-
}, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
|
|
548
|
-
? this.margins.left + this.state.startFromX
|
|
549
|
-
: svgDimensions.width - this.margins.right - this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
|
|
531
|
+
}, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? this.margins.left : svgDimensions.width - this.margins.right, ", 0)"), className: this._classNames.yAxis }),
|
|
550
532
|
this.props.secondaryYAxistitle !== undefined && this.props.secondaryYAxistitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.secondaryYAxistitle, textProps: {
|
|
551
|
-
x:
|
|
552
|
-
y:
|
|
553
|
-
? this.state.startFromX - this.titleMargin
|
|
554
|
-
: svgDimensions.width - this.margins.right,
|
|
533
|
+
x: secondaryYAxisTitleCenterX,
|
|
534
|
+
y: yAxisTitleCenterY,
|
|
555
535
|
textAnchor: 'middle',
|
|
556
|
-
transform: "
|
|
557
|
-
? this.margins.right / 2 - this.titleMargin
|
|
558
|
-
: this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
|
|
536
|
+
transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
559
537
|
className: this._classNames.axisTitle,
|
|
560
538
|
'aria-hidden': true,
|
|
561
|
-
}, maxWidth:
|
|
539
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))))),
|
|
562
540
|
children,
|
|
563
541
|
this.props.yAxisTitle !== undefined && this.props.yAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisTitle, textProps: {
|
|
564
|
-
x:
|
|
565
|
-
y:
|
|
566
|
-
? svgDimensions.width - this.margins.right / 2 + this.titleMargin
|
|
567
|
-
: this.margins.left / 2 - this.titleMargin,
|
|
542
|
+
x: yAxisTitleCenterX,
|
|
543
|
+
y: yAxisTitleCenterY,
|
|
568
544
|
textAnchor: 'middle',
|
|
569
|
-
transform: "
|
|
545
|
+
transform: "rotate(-90, ".concat(yAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
570
546
|
className: this._classNames.axisTitle,
|
|
571
547
|
'aria-hidden': true,
|
|
572
|
-
}, maxWidth:
|
|
548
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))),
|
|
573
549
|
this.props.yAxisAnnotation !== undefined &&
|
|
574
550
|
this.props.yAxisAnnotation !== '' &&
|
|
575
551
|
(this.props.secondaryYAxistitle === undefined || this.props.secondaryYAxistitle === '') && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisAnnotation, textProps: {
|
|
576
|
-
x:
|
|
577
|
-
y:
|
|
578
|
-
? this.state.startFromX - this.titleMargin
|
|
579
|
-
: svgDimensions.width - this.margins.right,
|
|
552
|
+
x: secondaryYAxisTitleCenterX,
|
|
553
|
+
y: yAxisTitleCenterY,
|
|
580
554
|
textAnchor: 'middle',
|
|
581
|
-
transform: "
|
|
582
|
-
? this.margins.right / 2 - this.titleMargin
|
|
583
|
-
: this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
|
|
555
|
+
transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
584
556
|
className: this._classNames.axisAnnotation,
|
|
585
557
|
'aria-hidden': true,
|
|
586
|
-
}, maxWidth:
|
|
558
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps)))),
|
|
587
559
|
hasAnnotations && annotationContext && (React.createElement(ChartAnnotationLayer_1.ChartAnnotationLayer, { annotations: annotations, context: annotationContext, theme: this.props.theme, className: this._classNames.annotationLayer }))),
|
|
588
|
-
!this.props.hideLegend && (React.createElement("div", { ref: function (e) {
|
|
560
|
+
!this.props.hideLegend && (React.createElement("div", { ref: function (e) {
|
|
561
|
+
_this.legendContainer = e;
|
|
562
|
+
}, className: this._classNames.legendContainer }, this.props.legendBars)),
|
|
589
563
|
callout && React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Loading...") }, callout)));
|
|
590
564
|
};
|
|
591
565
|
/**
|