@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
|
@@ -16,13 +16,11 @@ var getClassNames = (0, Utilities_1.classNamesFunction)();
|
|
|
16
16
|
var ChartHoverCard = React.lazy(function () {
|
|
17
17
|
return Promise.resolve().then(function () { return require('../../utilities/ChartHoverCard/ChartHoverCard'); }).then(function (module) { return ({ default: module.ChartHoverCard }); });
|
|
18
18
|
});
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
index_1.ChartTypes.ScatterChart,
|
|
25
|
-
];
|
|
19
|
+
var HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;
|
|
20
|
+
var VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;
|
|
21
|
+
var AXIS_TITLE_PADDING = 8;
|
|
22
|
+
var DEFAULT_MARGIN_WITH_TICKS = 40;
|
|
23
|
+
var DEFAULT_MARGIN_NO_TICKS = 20;
|
|
26
24
|
/**
|
|
27
25
|
* Cartesian chart used for
|
|
28
26
|
* 1.draw X and Y axis of the chart
|
|
@@ -32,7 +30,6 @@ var chartTypesWithStringYAxis = [
|
|
|
32
30
|
var CartesianChartBase = /** @class */ (function (_super) {
|
|
33
31
|
tslib_1.__extends(CartesianChartBase, _super);
|
|
34
32
|
function CartesianChartBase(props) {
|
|
35
|
-
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;
|
|
36
33
|
var _this = _super.call(this, props) || this;
|
|
37
34
|
_this.minLegendContainerHeight = 32;
|
|
38
35
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
@@ -44,6 +41,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
44
41
|
* Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
|
|
45
42
|
*/
|
|
46
43
|
_this._removalValueForTextTuncate = 0;
|
|
44
|
+
_this._yAxisTickText = [];
|
|
47
45
|
_this.isIntegralDataset = true;
|
|
48
46
|
_this.calculateMaxYAxisLabelLength = function (className) {
|
|
49
47
|
var formatTickLabel = function (str) {
|
|
@@ -52,7 +50,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
52
50
|
}
|
|
53
51
|
return str;
|
|
54
52
|
};
|
|
55
|
-
return (0, index_1.calculateLongestLabelWidth)(_this.
|
|
53
|
+
return (0, index_1.calculateLongestLabelWidth)(_this._yAxisTickText.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
|
|
56
54
|
};
|
|
57
55
|
// TO DO: Write a common functional component for Multi value callout and divide sub count method
|
|
58
56
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -188,6 +186,55 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
188
186
|
_this._removalValueForTextTuncate = rotatedHeight + _this.margins.bottom;
|
|
189
187
|
}
|
|
190
188
|
};
|
|
189
|
+
_this._calcMargins = function () {
|
|
190
|
+
var margins = _this._getDefaultMargins();
|
|
191
|
+
margins = _this._applyTitleMargins(margins);
|
|
192
|
+
margins = _this._applyAnnotationMargins(margins);
|
|
193
|
+
if (_this._isRtl) {
|
|
194
|
+
margins = _this._swapRtlMargins(margins);
|
|
195
|
+
}
|
|
196
|
+
return tslib_1.__assign(tslib_1.__assign({}, margins), _this.props.margins);
|
|
197
|
+
};
|
|
198
|
+
_this._getDefaultMargins = function () {
|
|
199
|
+
return {
|
|
200
|
+
top: DEFAULT_MARGIN_NO_TICKS,
|
|
201
|
+
// Smaller than the default because it is based on the line height rather than
|
|
202
|
+
// the length of the tick labels.
|
|
203
|
+
bottom: DEFAULT_MARGIN_WITH_TICKS - 5,
|
|
204
|
+
// For the actual margin, add the tick size, tick padding, and some extra space to
|
|
205
|
+
// the width of the longest yaxis tick label (startFromX).
|
|
206
|
+
left: Math.max(DEFAULT_MARGIN_WITH_TICKS, _this.state.startFromX + 20),
|
|
207
|
+
right: _this.props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
_this._applyTitleMargins = function (margins) {
|
|
211
|
+
var updated = tslib_1.__assign({}, margins);
|
|
212
|
+
if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
|
|
213
|
+
updated.bottom += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
214
|
+
}
|
|
215
|
+
if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
|
|
216
|
+
updated.left += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
217
|
+
}
|
|
218
|
+
if (_this.props.secondaryYAxistitle !== undefined && _this.props.secondaryYAxistitle !== '') {
|
|
219
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
220
|
+
}
|
|
221
|
+
return updated;
|
|
222
|
+
};
|
|
223
|
+
_this._applyAnnotationMargins = function (margins) {
|
|
224
|
+
var updated = tslib_1.__assign({}, margins);
|
|
225
|
+
if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
|
|
226
|
+
updated.top += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
|
|
227
|
+
}
|
|
228
|
+
if (_this.props.yAxisAnnotation !== undefined &&
|
|
229
|
+
_this.props.yAxisAnnotation !== '' &&
|
|
230
|
+
(_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
|
|
231
|
+
updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
|
|
232
|
+
}
|
|
233
|
+
return updated;
|
|
234
|
+
};
|
|
235
|
+
_this._swapRtlMargins = function (margins) {
|
|
236
|
+
return tslib_1.__assign(tslib_1.__assign({}, margins), { left: margins.right, right: margins.left });
|
|
237
|
+
};
|
|
191
238
|
_this.state = {
|
|
192
239
|
containerHeight: 0,
|
|
193
240
|
containerWidth: 0,
|
|
@@ -196,67 +243,13 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
196
243
|
startFromX: 0,
|
|
197
244
|
};
|
|
198
245
|
_this.idForGraph = (0, Utilities_1.getId)('chart_');
|
|
199
|
-
_this.titleMargin = 8;
|
|
200
246
|
_this.idForDefaultTabbableElement = (0, Utilities_1.getId)('defaultTabbableElement_');
|
|
201
247
|
_this._tooltipId = (0, Utilities_1.getId)('tooltip_');
|
|
202
|
-
/**
|
|
203
|
-
* In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.
|
|
204
|
-
* So that, in RTL, left margins becomes right margins and viceversa.
|
|
205
|
-
* As graph needs to be drawn perfecty, these values consider as default values.
|
|
206
|
-
* Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.
|
|
207
|
-
*/
|
|
208
|
-
_this.margins = {
|
|
209
|
-
top: (_b = (_a = _this.props.margins) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 20,
|
|
210
|
-
bottom: (_d = (_c = _this.props.margins) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 35,
|
|
211
|
-
right: _this._isRtl
|
|
212
|
-
? (_f = (_e = _this.props.margins) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 40
|
|
213
|
-
: ((_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)
|
|
214
|
-
? 40
|
|
215
|
-
: 20,
|
|
216
|
-
left: _this._isRtl
|
|
217
|
-
? ((_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)
|
|
218
|
-
? 40
|
|
219
|
-
: 20
|
|
220
|
-
: (_p = (_o = _this.props.margins) === null || _o === void 0 ? void 0 : _o.left) !== null && _p !== void 0 ? _p : 40,
|
|
221
|
-
};
|
|
222
|
-
var TITLE_MARGIN_HORIZONTAL = 24;
|
|
223
|
-
var TITLE_MARGIN_VERTICAL = 20;
|
|
224
|
-
if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
|
|
225
|
-
_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;
|
|
226
|
-
}
|
|
227
|
-
if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
|
|
228
|
-
_this.margins.left = _this._isRtl
|
|
229
|
-
? ((_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)
|
|
230
|
-
? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
|
|
231
|
-
: _this.margins.right + TITLE_MARGIN_HORIZONTAL
|
|
232
|
-
: (_w = (_v = _this.props.margins) === null || _v === void 0 ? void 0 : _v.left) !== null && _w !== void 0 ? _w : _this.margins.left + TITLE_MARGIN_HORIZONTAL;
|
|
233
|
-
_this.margins.right = _this._isRtl
|
|
234
|
-
? (_y = (_x = _this.props.margins) === null || _x === void 0 ? void 0 : _x.left) !== null && _y !== void 0 ? _y : _this.margins.left + TITLE_MARGIN_HORIZONTAL
|
|
235
|
-
: ((_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)
|
|
236
|
-
? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
|
|
237
|
-
: _this.margins.right + TITLE_MARGIN_HORIZONTAL;
|
|
238
|
-
}
|
|
239
|
-
if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
|
|
240
|
-
_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;
|
|
241
|
-
}
|
|
242
|
-
if (_this.props.yAxisAnnotation !== undefined &&
|
|
243
|
-
_this.props.yAxisAnnotation !== '' &&
|
|
244
|
-
(_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
|
|
245
|
-
if (_this._isRtl) {
|
|
246
|
-
_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;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
_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;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
248
|
return _this;
|
|
253
249
|
}
|
|
254
250
|
CartesianChartBase.prototype.componentDidMount = function () {
|
|
255
251
|
this._fitParentContainer();
|
|
256
|
-
if (
|
|
257
|
-
this.props.showYAxisLables &&
|
|
258
|
-
this.yAxisElement &&
|
|
259
|
-
this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
252
|
+
if (this.props.showYAxisLables) {
|
|
260
253
|
var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
|
|
261
254
|
if (this.state.startFromX !== maxYAxisLabelLength) {
|
|
262
255
|
this.setState({
|
|
@@ -280,10 +273,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
280
273
|
if (prevProps.height !== this.props.height || prevProps.width !== this.props.width) {
|
|
281
274
|
this._fitParentContainer();
|
|
282
275
|
}
|
|
283
|
-
if (
|
|
284
|
-
this.props.showYAxisLables &&
|
|
285
|
-
this.yAxisElement &&
|
|
286
|
-
this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
276
|
+
if (this.props.showYAxisLables) {
|
|
287
277
|
var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
|
|
288
278
|
if (this.state.startFromX !== maxYAxisLabelLength) {
|
|
289
279
|
this.setState({
|
|
@@ -311,18 +301,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
311
301
|
if (this.props.parentRef) {
|
|
312
302
|
this._fitParentContainer();
|
|
313
303
|
}
|
|
314
|
-
|
|
315
|
-
// Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
|
|
316
|
-
if (chartTypesWithStringYAxis.includes(this.props.chartType)) {
|
|
317
|
-
if (!this._isRtl) {
|
|
318
|
-
margin.left += this.state.startFromX;
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
margin.right += this.state.startFromX;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
304
|
+
this.margins = this._calcMargins();
|
|
324
305
|
// Callback for margins to the chart
|
|
325
|
-
this.props.getmargins && this.props.getmargins(
|
|
306
|
+
this.props.getmargins && this.props.getmargins(this.margins);
|
|
326
307
|
this._classNames = getClassNames(this.props.styles, {
|
|
327
308
|
theme: this.props.theme,
|
|
328
309
|
width: this.state._width,
|
|
@@ -341,9 +322,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
341
322
|
if ((this.props.enableFirstRenderOptimization && this.chartContainer) ||
|
|
342
323
|
!this.props.enableFirstRenderOptimization) {
|
|
343
324
|
this._isFirstRender = false;
|
|
344
|
-
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,
|
|
345
|
-
// This is only used for Horizontal Bar Chart with Axis for y as string axis
|
|
346
|
-
this.state.startFromX),
|
|
325
|
+
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),
|
|
347
326
|
// FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
|
|
348
327
|
// Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
|
|
349
328
|
// However, if transformation props are enabled, the updated _removalValueForTextTuncate
|
|
@@ -387,9 +366,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
387
366
|
* 2. To draw the graph.
|
|
388
367
|
* For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
|
|
389
368
|
*/
|
|
390
|
-
var axisData = { yAxisDomainValues: [] };
|
|
369
|
+
var axisData = { yAxisDomainValues: [], yAxisTickText: [] };
|
|
391
370
|
if (this.props.yAxisType && this.props.yAxisType === index_1.YAxisType.StringAxis) {
|
|
392
|
-
yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, this.props.barwidth, this.props.chartType);
|
|
371
|
+
yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, axisData, this.props.barwidth, this.props.chartType);
|
|
393
372
|
}
|
|
394
373
|
else {
|
|
395
374
|
// TODO: Since the scale domain values are now computed independently for both the primary and
|
|
@@ -415,40 +394,39 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
415
394
|
}
|
|
416
395
|
yScalePrimary = this.props.createYAxis(YAxisParams, this._isRtl, axisData, this.isIntegralDataset, false, this.props.supportNegativeData, this.props.roundedTicks, this.props.yScaleType);
|
|
417
396
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
catch (e) { }
|
|
397
|
+
this._yAxisTickText = axisData.yAxisTickText;
|
|
398
|
+
this.props.getAxisData && this.props.getAxisData(axisData);
|
|
399
|
+
// Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
|
|
400
|
+
// of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
|
|
401
|
+
// in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
|
|
402
|
+
if (!this.props.showYAxisLablesTooltip) {
|
|
403
|
+
try {
|
|
404
|
+
document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
|
|
405
|
+
//eslint-disable-next-line no-empty
|
|
428
406
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var ytooltipProps = {
|
|
444
|
-
tooltipCls: this._classNames.tooltip,
|
|
445
|
-
id: this._tooltipId,
|
|
446
|
-
axis: yAxisElement,
|
|
447
|
-
};
|
|
448
|
-
yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
|
|
407
|
+
catch (e) { }
|
|
408
|
+
}
|
|
409
|
+
// Used to display tooltip at y axis labels.
|
|
410
|
+
if (this.props.showYAxisLablesTooltip) {
|
|
411
|
+
// To create y axis tick values by if specified truncating the rest of the text
|
|
412
|
+
// and showing elipsis or showing the whole string,
|
|
413
|
+
yScalePrimary &&
|
|
414
|
+
// Note: This function should be invoked within the showYAxisLablesTooltip check,
|
|
415
|
+
// as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
|
|
416
|
+
(0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
|
|
417
|
+
var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
|
|
418
|
+
try {
|
|
419
|
+
document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
|
|
420
|
+
//eslint-disable-next-line no-empty
|
|
449
421
|
}
|
|
422
|
+
catch (e) { }
|
|
423
|
+
var ytooltipProps = {
|
|
424
|
+
tooltipCls: this._classNames.tooltip,
|
|
425
|
+
id: this._tooltipId,
|
|
426
|
+
axis: yAxisElement,
|
|
427
|
+
};
|
|
428
|
+
yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
|
|
450
429
|
}
|
|
451
|
-
this.props.getAxisData && this.props.getAxisData(axisData);
|
|
452
430
|
// Callback function for chart, returns axis
|
|
453
431
|
this._getData(xScale, yScalePrimary, yScaleSecondary);
|
|
454
432
|
children = this.props.children(tslib_1.__assign(tslib_1.__assign({}, this.state), { xScale: xScale, yScalePrimary: yScalePrimary, yScaleSecondary: yScaleSecondary }));
|
|
@@ -460,11 +438,10 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
460
438
|
width: this.state.containerWidth,
|
|
461
439
|
height: this.state.containerHeight,
|
|
462
440
|
};
|
|
463
|
-
var
|
|
464
|
-
var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right - startFromX);
|
|
441
|
+
var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right);
|
|
465
442
|
var plotHeight = Math.max(0, svgDimensions.height - this.margins.top - this.margins.bottom - this._removalValueForTextTuncate);
|
|
466
443
|
var plotRect = {
|
|
467
|
-
x: this.
|
|
444
|
+
x: this.margins.left,
|
|
468
445
|
y: this.margins.top,
|
|
469
446
|
width: plotWidth,
|
|
470
447
|
height: plotHeight,
|
|
@@ -491,12 +468,19 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
491
468
|
else {
|
|
492
469
|
focusDirection = react_focus_1.FocusZoneDirection.horizontal;
|
|
493
470
|
}
|
|
494
|
-
var
|
|
495
|
-
var
|
|
471
|
+
var xAxisTitleMaxWidth = svgDimensions.width - this.margins.left - this.margins.right - AXIS_TITLE_PADDING * 2;
|
|
472
|
+
var yAxisTitleMaxHeight = svgDimensions.height -
|
|
496
473
|
this.margins.bottom -
|
|
497
474
|
this.margins.top -
|
|
498
475
|
this._removalValueForTextTuncate -
|
|
499
|
-
|
|
476
|
+
AXIS_TITLE_PADDING * 2;
|
|
477
|
+
var yAxisTitleCenterY = this.margins.top + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;
|
|
478
|
+
var yAxisTitleCenterX = this._isRtl
|
|
479
|
+
? svgDimensions.width - AXIS_TITLE_PADDING
|
|
480
|
+
: HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;
|
|
481
|
+
var secondaryYAxisTitleCenterX = this._isRtl
|
|
482
|
+
? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING
|
|
483
|
+
: svgDimensions.width - AXIS_TITLE_PADDING;
|
|
500
484
|
var commonSvgToolTipProps = {
|
|
501
485
|
wrapContent: index_1.wrapContent,
|
|
502
486
|
theme: this.props.theme,
|
|
@@ -522,7 +506,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
522
506
|
* But this is a hacky solution and not a proper fix and also elementRef is deprecated.
|
|
523
507
|
* 2. Using the default tabbable element to fix the issue.
|
|
524
508
|
*/
|
|
525
|
-
return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
|
|
509
|
+
return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
|
|
510
|
+
_this.chartContainer = rootElem;
|
|
511
|
+
}, onMouseLeave: this._onChartLeave },
|
|
526
512
|
!this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
|
|
527
513
|
React.createElement(react_focus_1.FocusZone, tslib_1.__assign({ direction: focusDirection, className: this._classNames.chartWrapper, defaultTabbableElement: "#".concat(this.idForDefaultTabbableElement) }, svgFocusZoneProps),
|
|
528
514
|
this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
|
|
@@ -533,69 +519,57 @@ var CartesianChartBase = /** @class */ (function (_super) {
|
|
|
533
519
|
// To add wrap of x axis lables feature, need to remove word height from svg height.
|
|
534
520
|
transform: "translate(0, ".concat(svgDimensions.height - this.margins.bottom - this._removalValueForTextTuncate, ")"), className: this._classNames.xAxis }),
|
|
535
521
|
this.props.xAxisTitle !== undefined && this.props.xAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisTitle, textProps: {
|
|
536
|
-
x: this.margins.left +
|
|
537
|
-
y: svgDimensions.height -
|
|
522
|
+
x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
523
|
+
y: svgDimensions.height - AXIS_TITLE_PADDING,
|
|
538
524
|
className: this._classNames.axisTitle,
|
|
539
525
|
textAnchor: 'middle',
|
|
540
526
|
'aria-hidden': true,
|
|
541
|
-
}, maxWidth:
|
|
527
|
+
}, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
|
|
542
528
|
this.props.xAxisAnnotation !== undefined && this.props.xAxisAnnotation !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisAnnotation, textProps: {
|
|
543
|
-
x: this.margins.left +
|
|
544
|
-
y:
|
|
529
|
+
x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
|
|
530
|
+
y: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,
|
|
545
531
|
className: this._classNames.axisAnnotation,
|
|
546
532
|
textAnchor: 'middle',
|
|
547
533
|
'aria-hidden': true,
|
|
548
|
-
}, maxWidth:
|
|
534
|
+
}, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
|
|
549
535
|
React.createElement("g", { ref: function (e) {
|
|
550
536
|
_this.yAxisElement = e;
|
|
551
|
-
}, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
|
|
552
|
-
? svgDimensions.width - this.margins.right - this.state.startFromX
|
|
553
|
-
: this.margins.left + this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
|
|
537
|
+
}, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? svgDimensions.width - this.margins.right : this.margins.left, ", 0)"), className: this._classNames.yAxis }),
|
|
554
538
|
this.props.secondaryYScaleOptions && (React.createElement("g", null,
|
|
555
539
|
React.createElement("g", { ref: function (e) {
|
|
556
540
|
_this.yAxisElementSecondary = e;
|
|
557
|
-
}, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
|
|
558
|
-
? this.margins.left + this.state.startFromX
|
|
559
|
-
: svgDimensions.width - this.margins.right - this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
|
|
541
|
+
}, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? this.margins.left : svgDimensions.width - this.margins.right, ", 0)"), className: this._classNames.yAxis }),
|
|
560
542
|
this.props.secondaryYAxistitle !== undefined && this.props.secondaryYAxistitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.secondaryYAxistitle, textProps: {
|
|
561
|
-
x:
|
|
562
|
-
y:
|
|
563
|
-
? this.state.startFromX - this.titleMargin
|
|
564
|
-
: svgDimensions.width - this.margins.right,
|
|
543
|
+
x: secondaryYAxisTitleCenterX,
|
|
544
|
+
y: yAxisTitleCenterY,
|
|
565
545
|
textAnchor: 'middle',
|
|
566
|
-
transform: "
|
|
567
|
-
? this.margins.right / 2 - this.titleMargin
|
|
568
|
-
: this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
|
|
546
|
+
transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
569
547
|
className: this._classNames.axisTitle,
|
|
570
548
|
'aria-hidden': true,
|
|
571
|
-
}, maxWidth:
|
|
549
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))))),
|
|
572
550
|
children,
|
|
573
551
|
this.props.yAxisTitle !== undefined && this.props.yAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisTitle, textProps: {
|
|
574
|
-
x:
|
|
575
|
-
y:
|
|
576
|
-
? svgDimensions.width - this.margins.right / 2 + this.titleMargin
|
|
577
|
-
: this.margins.left / 2 - this.titleMargin,
|
|
552
|
+
x: yAxisTitleCenterX,
|
|
553
|
+
y: yAxisTitleCenterY,
|
|
578
554
|
textAnchor: 'middle',
|
|
579
|
-
transform: "
|
|
555
|
+
transform: "rotate(-90, ".concat(yAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
580
556
|
className: this._classNames.axisTitle,
|
|
581
557
|
'aria-hidden': true,
|
|
582
|
-
}, maxWidth:
|
|
558
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))),
|
|
583
559
|
this.props.yAxisAnnotation !== undefined &&
|
|
584
560
|
this.props.yAxisAnnotation !== '' &&
|
|
585
561
|
(this.props.secondaryYAxistitle === undefined || this.props.secondaryYAxistitle === '') && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisAnnotation, textProps: {
|
|
586
|
-
x:
|
|
587
|
-
y:
|
|
588
|
-
? this.state.startFromX - this.titleMargin
|
|
589
|
-
: svgDimensions.width - this.margins.right,
|
|
562
|
+
x: secondaryYAxisTitleCenterX,
|
|
563
|
+
y: yAxisTitleCenterY,
|
|
590
564
|
textAnchor: 'middle',
|
|
591
|
-
transform: "
|
|
592
|
-
? this.margins.right / 2 - this.titleMargin
|
|
593
|
-
: this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
|
|
565
|
+
transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
|
|
594
566
|
className: this._classNames.axisAnnotation,
|
|
595
567
|
'aria-hidden': true,
|
|
596
|
-
}, maxWidth:
|
|
568
|
+
}, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps)))),
|
|
597
569
|
hasAnnotations && annotationContext && (React.createElement(ChartAnnotationLayer_1.ChartAnnotationLayer, { annotations: annotations, context: annotationContext, theme: this.props.theme, className: this._classNames.annotationLayer }))),
|
|
598
|
-
!this.props.hideLegend && (React.createElement("div", { ref: function (e) {
|
|
570
|
+
!this.props.hideLegend && (React.createElement("div", { ref: function (e) {
|
|
571
|
+
_this.legendContainer = e;
|
|
572
|
+
}, className: this._classNames.legendContainer }, this.props.legendBars)),
|
|
599
573
|
callout && React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Loading...") }, callout)));
|
|
600
574
|
};
|
|
601
575
|
/**
|