@fluentui/react-charting 5.25.1 → 5.25.3
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 +123 -1
- package/CHANGELOG.md +34 -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 +18 -14
- 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 +176 -63
- 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 +11 -6
- 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 +41 -31
- 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 +22 -10
- 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 +176 -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 +18 -14
- 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 +178 -64
- 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 +10 -6
- 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 +39 -29
- 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 +20 -8
- 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 +175 -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 +18 -14
- 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 +178 -64
- 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 +10 -5
- 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 +39 -29
- 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 +20 -8
- 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 +175 -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
|
@@ -22,6 +22,7 @@ import { IStyleFunctionOrObject as IStyleFunctionOrObject_2 } from '@fluentui/re
|
|
|
22
22
|
import { ITheme } from '@fluentui/react/lib/Styling';
|
|
23
23
|
import { ITheme as ITheme_2 } from '@fluentui/react';
|
|
24
24
|
import type { JSXElement } from '@fluentui/utilities';
|
|
25
|
+
import type { Margin } from '@fluentui/chart-utilities';
|
|
25
26
|
import * as React_2 from 'react';
|
|
26
27
|
import { SankeyLink } from 'd3-sankey';
|
|
27
28
|
import { SankeyNode } from 'd3-sankey';
|
|
@@ -29,6 +30,9 @@ import { ScaleBand } from 'd3-scale';
|
|
|
29
30
|
import { ScaleLinear } from 'd3-scale';
|
|
30
31
|
import { TimeLocaleDefinition } from 'd3-time-format';
|
|
31
32
|
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
export const AnnotationOnlyChart: React_2.FC<IAnnotationOnlyChartProps>;
|
|
35
|
+
|
|
32
36
|
// @public
|
|
33
37
|
export const AreaChart: React_2.FunctionComponent<IAreaChartProps>;
|
|
34
38
|
|
|
@@ -114,6 +118,7 @@ export interface ChartAnnotationStyleProps {
|
|
|
114
118
|
fontWeight?: React_2.CSSProperties['fontWeight'];
|
|
115
119
|
opacity?: number;
|
|
116
120
|
padding?: string;
|
|
121
|
+
rotation?: number;
|
|
117
122
|
textColor?: string;
|
|
118
123
|
}
|
|
119
124
|
|
|
@@ -289,6 +294,21 @@ export interface IAccessibilityProps {
|
|
|
289
294
|
ariaLabelledBy?: string;
|
|
290
295
|
}
|
|
291
296
|
|
|
297
|
+
// @public
|
|
298
|
+
export interface IAnnotationOnlyChartProps {
|
|
299
|
+
annotations: ChartAnnotation[];
|
|
300
|
+
chartTitle?: string;
|
|
301
|
+
componentRef?: React_2.RefObject<IChart>;
|
|
302
|
+
description?: string;
|
|
303
|
+
fontColor?: string;
|
|
304
|
+
fontFamily?: string;
|
|
305
|
+
height?: number;
|
|
306
|
+
margin?: Partial<Margin>;
|
|
307
|
+
paperBackgroundColor?: string;
|
|
308
|
+
plotBackgroundColor?: string;
|
|
309
|
+
width?: number;
|
|
310
|
+
}
|
|
311
|
+
|
|
292
312
|
// @public
|
|
293
313
|
export interface IAreaChartProps extends ICartesianChartProps {
|
|
294
314
|
culture?: string;
|
|
@@ -416,6 +436,8 @@ export interface ICartesianChartProps {
|
|
|
416
436
|
};
|
|
417
437
|
secondaryYScaleType?: AxisScaleType;
|
|
418
438
|
showXAxisLablesTooltip?: boolean;
|
|
439
|
+
showYAxisLables?: boolean;
|
|
440
|
+
showYAxisLablesTooltip?: boolean;
|
|
419
441
|
strokeWidth?: number;
|
|
420
442
|
styles?: IStyleFunctionOrObject<ICartesianChartStyleProps, ICartesianChartStyles>;
|
|
421
443
|
supportNegativeData?: boolean;
|
|
@@ -814,8 +836,6 @@ export interface IGanttChartProps extends ICartesianChartProps {
|
|
|
814
836
|
maxBarHeight?: number;
|
|
815
837
|
onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;
|
|
816
838
|
roundCorners?: boolean;
|
|
817
|
-
showYAxisLables?: boolean;
|
|
818
|
-
showYAxisLablesTooltip?: boolean;
|
|
819
839
|
styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;
|
|
820
840
|
yAxisPadding?: number;
|
|
821
841
|
}
|
|
@@ -1008,8 +1028,6 @@ export interface IHeatMapChartProps extends Pick<ICartesianChartProps, Exclude<k
|
|
|
1008
1028
|
domainValuesForColorScale: number[];
|
|
1009
1029
|
legendProps?: Partial<ILegendsProps>;
|
|
1010
1030
|
rangeValuesForColorScale: string[];
|
|
1011
|
-
showYAxisLables?: boolean;
|
|
1012
|
-
showYAxisLablesTooltip?: boolean;
|
|
1013
1031
|
sortOrder?: 'none' | 'alphabetical';
|
|
1014
1032
|
styles?: IStyleFunctionOrObject<IHeatMapChartStyleProps, IHeatMapChartStyles>;
|
|
1015
1033
|
xAxisDateFormatString?: string;
|
|
@@ -1109,8 +1127,6 @@ export interface IHorizontalBarChartWithAxisProps extends ICartesianChartProps {
|
|
|
1109
1127
|
enableGradient?: boolean;
|
|
1110
1128
|
onRenderCalloutPerDataPoint?: IRenderFunction<IHorizontalBarChartWithAxisDataPoint>;
|
|
1111
1129
|
roundCorners?: boolean;
|
|
1112
|
-
showYAxisLables?: boolean;
|
|
1113
|
-
showYAxisLablesTooltip?: boolean;
|
|
1114
1130
|
styles?: IStyleFunctionOrObject<IHorizontalBarChartWithAxisStyleProps, IHorizontalBarChartWithAxisStyles>;
|
|
1115
1131
|
useSingleColor?: boolean;
|
|
1116
1132
|
yAxisPadding?: number;
|
|
@@ -1377,7 +1393,7 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
|
|
|
1377
1393
|
// Warning: (ae-forgotten-export) The symbol "ChartTypes" needs to be exported by the entry point index.d.ts
|
|
1378
1394
|
chartType: ChartTypes;
|
|
1379
1395
|
children(props: IChildProps): React_2.ReactNode;
|
|
1380
|
-
createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, barWidth: number | undefined, chartType?: ChartTypes) => ScaleBand<string>;
|
|
1396
|
+
createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, axisData: IAxisData, barWidth: number | undefined, chartType?: ChartTypes) => ScaleBand<string>;
|
|
1381
1397
|
// Warning: (ae-forgotten-export) The symbol "IYAxisParams" needs to be exported by the entry point index.d.ts
|
|
1382
1398
|
// Warning: (ae-forgotten-export) The symbol "IAxisData" needs to be exported by the entry point index.d.ts
|
|
1383
1399
|
createYAxis: (yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, isIntegralDataset: boolean, useSecondaryYScale?: boolean, supportNegativeData?: boolean, roundedTicks?: boolean, scaleType?: AxisScaleType) => ScaleLinear<number, number, never>;
|
|
@@ -1390,7 +1406,7 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
|
|
|
1390
1406
|
getAxisData?: any;
|
|
1391
1407
|
getDomainMargins?: (containerWidth: number) => IMargins;
|
|
1392
1408
|
// Warning: (ae-forgotten-export) The symbol "IDomainNRange" needs to be exported by the entry point index.d.ts
|
|
1393
|
-
getDomainNRangeValues: (points: ILineChartPoints[] | IVerticalBarChartDataPoint[] | IVerticalStackedBarDataPoint[] | IHorizontalBarChartWithAxisDataPoint[] | IGroupedVerticalBarChartData[] | IHeatMapChartDataPoint[] | IGanttChartDataPoint[], margins: IMargins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | string[] | undefined
|
|
1409
|
+
getDomainNRangeValues: (points: ILineChartPoints[] | IVerticalBarChartDataPoint[] | IVerticalStackedBarDataPoint[] | IHorizontalBarChartWithAxisDataPoint[] | IGroupedVerticalBarChartData[] | IHeatMapChartDataPoint[] | IGanttChartDataPoint[], margins: IMargins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | string[] | undefined) => IDomainNRange;
|
|
1394
1410
|
getGraphData?: any;
|
|
1395
1411
|
getmargins?: (margins: IMargins) => void;
|
|
1396
1412
|
getMinMaxOfYAxis: (points: ILineChartPoints[] | IHorizontalBarChartWithAxisDataPoint[] | IVerticalBarChartDataPoint[] | IDataPoint[] | IScatterChartPoints[] | IGanttChartDataPoint[], yAxisType: YAxisType | undefined, useSecondaryYScale?: boolean) => {
|
|
@@ -1633,7 +1649,6 @@ export interface IScatterChartProps extends ICartesianChartProps {
|
|
|
1633
1649
|
data: IChartProps;
|
|
1634
1650
|
getCalloutDescriptionMessage?: (calloutDataProps: ICustomizedCalloutData) => string | undefined;
|
|
1635
1651
|
onRenderCalloutPerDataPoint?: IRenderFunction<ICustomizedCalloutData>;
|
|
1636
|
-
showYAxisLablesTooltip?: boolean;
|
|
1637
1652
|
styles?: IScatterChartStyles;
|
|
1638
1653
|
}
|
|
1639
1654
|
|
|
@@ -1895,8 +1910,6 @@ export interface IVerticalStackedBarChartProps extends ICartesianChartProps {
|
|
|
1895
1910
|
onRenderCalloutPerDataPoint?: IRenderFunction<IVSChartDataPoint>;
|
|
1896
1911
|
onRenderCalloutPerStack?: IRenderFunction<IVerticalStackedChartProps>;
|
|
1897
1912
|
roundCorners?: boolean;
|
|
1898
|
-
showYAxisLables?: boolean;
|
|
1899
|
-
showYAxisLablesTooltip?: boolean;
|
|
1900
1913
|
styles?: IStyleFunctionOrObject<IVerticalStackedBarChartStyleProps, IVerticalStackedBarChartStyles>;
|
|
1901
1914
|
xAxisInnerPadding?: number;
|
|
1902
1915
|
xAxisOuterPadding?: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/AnnotationOnlyChart/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationOnlyChart.js","sourceRoot":"../src/","sources":["AnnotationOnlyChart.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC","sourcesContent":["export * from './components/AnnotationOnlyChart/index';\n"]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getRTL, useTheme } from '@fluentui/react';
|
|
3
|
+
import { mergeStyles } from '@fluentui/react/lib/Styling';
|
|
4
|
+
import { ChartAnnotationLayer } from '../CommonComponents/Annotations/ChartAnnotationLayer';
|
|
5
|
+
import { exportChartsAsImage } from '../../utilities/image-export-utils';
|
|
6
|
+
var DEFAULT_HEIGHT = 650;
|
|
7
|
+
var FALLBACK_WIDTH = 400;
|
|
8
|
+
var buildPadding = function (margin) {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
if (!margin) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
var top = (_a = margin.t) !== null && _a !== void 0 ? _a : 0;
|
|
14
|
+
var right = (_b = margin.r) !== null && _b !== void 0 ? _b : 0;
|
|
15
|
+
var bottom = (_c = margin.b) !== null && _c !== void 0 ? _c : 0;
|
|
16
|
+
var left = (_d = margin.l) !== null && _d !== void 0 ? _d : 0;
|
|
17
|
+
if (top === 0 && right === 0 && bottom === 0 && left === 0) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return "".concat(top, "px ").concat(right, "px ").concat(bottom, "px ").concat(left, "px");
|
|
21
|
+
};
|
|
22
|
+
export var AnnotationOnlyChart = function (props) {
|
|
23
|
+
var annotations = props.annotations, chartTitle = props.chartTitle, description = props.description, width = props.width, height = props.height, paperBackgroundColor = props.paperBackgroundColor, plotBackgroundColor = props.plotBackgroundColor, fontColor = props.fontColor, fontFamily = props.fontFamily, margin = props.margin, componentRef = props.componentRef;
|
|
24
|
+
var theme = useTheme();
|
|
25
|
+
var containerRef = React.useRef(null);
|
|
26
|
+
var contentRef = React.useRef(null);
|
|
27
|
+
var _a = React.useState(width !== null && width !== void 0 ? width : 0), measuredWidth = _a[0], setMeasuredWidth = _a[1];
|
|
28
|
+
var _b = React.useState(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT), contentHeight = _b[0], setContentHeight = _b[1];
|
|
29
|
+
React.useEffect(function () {
|
|
30
|
+
if (typeof width === 'number' && width > 0) {
|
|
31
|
+
setMeasuredWidth(width);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
var node = containerRef.current;
|
|
35
|
+
if (!node || typeof ResizeObserver === 'undefined') {
|
|
36
|
+
var rect_1 = node === null || node === void 0 ? void 0 : node.getBoundingClientRect();
|
|
37
|
+
if (rect_1 && rect_1.width > 0) {
|
|
38
|
+
setMeasuredWidth(rect_1.width);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
setMeasuredWidth(function (prev) { return (prev > 0 ? prev : FALLBACK_WIDTH); });
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var observer = new ResizeObserver(function (entries) {
|
|
46
|
+
var entry = entries[0];
|
|
47
|
+
if (!entry) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
var newWidth = entry.contentRect.width;
|
|
51
|
+
if (newWidth > 0 && Math.abs(newWidth - measuredWidth) > 0.5) {
|
|
52
|
+
setMeasuredWidth(newWidth);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var rect = node.getBoundingClientRect();
|
|
56
|
+
if (rect.width > 0) {
|
|
57
|
+
setMeasuredWidth(rect.width);
|
|
58
|
+
}
|
|
59
|
+
observer.observe(node);
|
|
60
|
+
return function () { return observer.disconnect(); };
|
|
61
|
+
}, [width, measuredWidth]);
|
|
62
|
+
var resolvedWidth = Math.max(measuredWidth || FALLBACK_WIDTH, 1);
|
|
63
|
+
var resolvedHeight = Math.max(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT, 1);
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
var node = contentRef.current;
|
|
66
|
+
if (!node) {
|
|
67
|
+
setContentHeight(function (prev) { return (prev > 0 ? prev : resolvedHeight); });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
71
|
+
var rect_2 = node.getBoundingClientRect();
|
|
72
|
+
setContentHeight(function (prev) { return (rect_2.height > 0 ? rect_2.height : prev > 0 ? prev : resolvedHeight); });
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
var observer = new ResizeObserver(function (entries) {
|
|
76
|
+
var entry = entries[0];
|
|
77
|
+
if (!entry) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
var newHeight = entry.contentRect.height;
|
|
81
|
+
if (newHeight > 0) {
|
|
82
|
+
setContentHeight(function (prev) { return (Math.abs(prev - newHeight) > 0.5 ? newHeight : prev); });
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
var rect = node.getBoundingClientRect();
|
|
86
|
+
setContentHeight(function (prev) { return (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight); });
|
|
87
|
+
observer.observe(node);
|
|
88
|
+
return function () { return observer.disconnect(); };
|
|
89
|
+
}, [
|
|
90
|
+
resolvedHeight,
|
|
91
|
+
resolvedWidth,
|
|
92
|
+
annotations,
|
|
93
|
+
chartTitle,
|
|
94
|
+
description,
|
|
95
|
+
margin,
|
|
96
|
+
plotBackgroundColor,
|
|
97
|
+
paperBackgroundColor,
|
|
98
|
+
fontColor,
|
|
99
|
+
fontFamily,
|
|
100
|
+
theme,
|
|
101
|
+
]);
|
|
102
|
+
var svgHeight = Math.max(Math.ceil(contentHeight || 0), resolvedHeight);
|
|
103
|
+
var context = {
|
|
104
|
+
plotRect: { x: 0, y: 0, width: resolvedWidth, height: resolvedHeight },
|
|
105
|
+
svgRect: { width: resolvedWidth, height: resolvedHeight },
|
|
106
|
+
isRtl: theme === null || theme === void 0 ? void 0 : theme.rtl,
|
|
107
|
+
};
|
|
108
|
+
var padding = buildPadding(margin);
|
|
109
|
+
var rootClassName = React.useMemo(function () {
|
|
110
|
+
return mergeStyles({
|
|
111
|
+
position: 'relative',
|
|
112
|
+
width: width ? "".concat(width, "px") : '100%',
|
|
113
|
+
minHeight: resolvedHeight,
|
|
114
|
+
backgroundColor: paperBackgroundColor !== null && paperBackgroundColor !== void 0 ? paperBackgroundColor : theme.semanticColors.bodyBackground,
|
|
115
|
+
color: fontColor !== null && fontColor !== void 0 ? fontColor : theme.semanticColors.bodyText,
|
|
116
|
+
fontFamily: fontFamily !== null && fontFamily !== void 0 ? fontFamily : theme.fonts.medium.fontFamily,
|
|
117
|
+
padding: padding,
|
|
118
|
+
display: 'flex',
|
|
119
|
+
flexDirection: 'column',
|
|
120
|
+
rowGap: '8px',
|
|
121
|
+
});
|
|
122
|
+
}, [fontColor, fontFamily, paperBackgroundColor, padding, resolvedHeight, theme, width]);
|
|
123
|
+
var contentClassName = React.useMemo(function () {
|
|
124
|
+
var _a;
|
|
125
|
+
return mergeStyles({
|
|
126
|
+
position: 'relative',
|
|
127
|
+
flexGrow: 1,
|
|
128
|
+
backgroundColor: plotBackgroundColor !== null && plotBackgroundColor !== void 0 ? plotBackgroundColor : 'transparent',
|
|
129
|
+
borderRadius: (_a = theme.effects.roundedCorner2) !== null && _a !== void 0 ? _a : 4,
|
|
130
|
+
boxSizing: 'border-box',
|
|
131
|
+
});
|
|
132
|
+
}, [plotBackgroundColor, theme.effects.roundedCorner2]);
|
|
133
|
+
var titleClassName = React.useMemo(function () {
|
|
134
|
+
return mergeStyles({
|
|
135
|
+
textAlign: 'center',
|
|
136
|
+
});
|
|
137
|
+
}, []);
|
|
138
|
+
var resolvedAnnotations = annotations !== null && annotations !== void 0 ? annotations : [];
|
|
139
|
+
var hasAnnotations = resolvedAnnotations.length > 0;
|
|
140
|
+
var ariaLabel = hasAnnotations ? description !== null && description !== void 0 ? description : chartTitle : undefined;
|
|
141
|
+
React.useImperativeHandle(componentRef, function () {
|
|
142
|
+
var chartHandle = {
|
|
143
|
+
chartContainer: containerRef.current,
|
|
144
|
+
toImage: function (opts) {
|
|
145
|
+
return exportChartsAsImage([{ container: containerRef.current }], undefined, getRTL(), opts);
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
return chartHandle;
|
|
149
|
+
}, []);
|
|
150
|
+
return (React.createElement("div", { ref: containerRef, "data-chart-annotation-container": "true" },
|
|
151
|
+
React.createElement("svg", { width: resolvedWidth, height: svgHeight, viewBox: "0 0 ".concat(resolvedWidth, " ").concat(svgHeight), style: { width: width ? "".concat(width, "px") : '100%', height: "".concat(svgHeight, "px"), display: 'block' }, role: ariaLabel ? 'img' : undefined, "aria-label": ariaLabel },
|
|
152
|
+
React.createElement("foreignObject", { x: 0, y: 0, width: resolvedWidth, height: svgHeight },
|
|
153
|
+
React.createElement("div", { ref: contentRef, className: rootClassName, "data-chart-annotation-only": "true", "aria-label": ariaLabel },
|
|
154
|
+
chartTitle && (React.createElement("span", { className: titleClassName, "aria-hidden": "true" }, chartTitle)),
|
|
155
|
+
React.createElement("div", { className: contentClassName, role: "presentation" }, hasAnnotations ? (React.createElement(ChartAnnotationLayer, { annotations: resolvedAnnotations, context: context, theme: theme })) : null))))));
|
|
156
|
+
};
|
|
157
|
+
AnnotationOnlyChart.displayName = 'AnnotationOnlyChart';
|
|
158
|
+
//# sourceMappingURL=AnnotationOnlyChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationOnlyChart.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/AnnotationOnlyChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAKzE,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,IAAM,YAAY,GAAG,UAAC,MAA2C;;IAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAM,GAAG,GAAG,MAAA,MAAM,CAAC,CAAC,mCAAI,CAAC,CAAC;IAC1B,IAAM,KAAK,GAAG,MAAA,MAAM,CAAC,CAAC,mCAAI,CAAC,CAAC;IAC5B,IAAM,MAAM,GAAG,MAAA,MAAM,CAAC,CAAC,mCAAI,CAAC,CAAC;IAC7B,IAAM,IAAI,GAAG,MAAA,MAAM,CAAC,CAAC,mCAAI,CAAC,CAAC;IAE3B,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,UAAG,GAAG,gBAAM,KAAK,gBAAM,MAAM,gBAAM,IAAI,OAAI,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,mBAAmB,GAAwC,UAAA,KAAK;IAE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I,CACJ,CACF,CACQ,CACZ,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC","sourcesContent":["import * as React from 'react';\nimport { getRTL, useTheme } from '@fluentui/react';\nimport { mergeStyles } from '@fluentui/react/lib/Styling';\nimport { ChartAnnotationLayer } from '../CommonComponents/Annotations/ChartAnnotationLayer';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport type { IAnnotationOnlyChartProps } from './AnnotationOnlyChart.types';\nimport type { IChart, IImageExportOptions } from '../../types/index';\nimport type { IChartAnnotationContext } from '../CommonComponents/Annotations/ChartAnnotationLayer.types';\n\nconst DEFAULT_HEIGHT = 650;\nconst FALLBACK_WIDTH = 400;\n\nconst buildPadding = (margin: IAnnotationOnlyChartProps['margin']): string | undefined => {\n if (!margin) {\n return undefined;\n }\n\n const top = margin.t ?? 0;\n const right = margin.r ?? 0;\n const bottom = margin.b ?? 0;\n const left = margin.l ?? 0;\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return undefined;\n }\n\n return `${top}px ${right}px ${bottom}px ${left}px`;\n};\n\nexport const AnnotationOnlyChart: React.FC<IAnnotationOnlyChartProps> = props => {\n const {\n annotations,\n chartTitle,\n description,\n width,\n height,\n paperBackgroundColor,\n plotBackgroundColor,\n fontColor,\n fontFamily,\n margin,\n componentRef,\n } = props;\n\n const theme = useTheme();\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const contentRef = React.useRef<HTMLDivElement | null>(null);\n const [measuredWidth, setMeasuredWidth] = React.useState<number>(width ?? 0);\n const [contentHeight, setContentHeight] = React.useState<number>(height ?? DEFAULT_HEIGHT);\n\n React.useEffect(() => {\n if (typeof width === 'number' && width > 0) {\n setMeasuredWidth(width);\n return;\n }\n\n const node = containerRef.current;\n if (!node || typeof ResizeObserver === 'undefined') {\n const rect = node?.getBoundingClientRect();\n if (rect && rect.width > 0) {\n setMeasuredWidth(rect.width);\n } else {\n setMeasuredWidth(prev => (prev > 0 ? prev : FALLBACK_WIDTH));\n }\n return;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n const newWidth = entry.contentRect.width;\n if (newWidth > 0 && Math.abs(newWidth - measuredWidth) > 0.5) {\n setMeasuredWidth(newWidth);\n }\n });\n\n const rect = node.getBoundingClientRect();\n if (rect.width > 0) {\n setMeasuredWidth(rect.width);\n }\n\n observer.observe(node);\n return () => observer.disconnect();\n }, [width, measuredWidth]);\n\n const resolvedWidth = Math.max(measuredWidth || FALLBACK_WIDTH, 1);\n const resolvedHeight = Math.max(height ?? DEFAULT_HEIGHT, 1);\n\n React.useEffect(() => {\n const node = contentRef.current;\n if (!node) {\n setContentHeight(prev => (prev > 0 ? prev : resolvedHeight));\n return;\n }\n\n if (typeof ResizeObserver === 'undefined') {\n const rect = node.getBoundingClientRect();\n setContentHeight(prev => (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight));\n return;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n if (!entry) {\n return;\n }\n\n const newHeight = entry.contentRect.height;\n if (newHeight > 0) {\n setContentHeight(prev => (Math.abs(prev - newHeight) > 0.5 ? newHeight : prev));\n }\n });\n\n const rect = node.getBoundingClientRect();\n setContentHeight(prev => (rect.height > 0 ? rect.height : prev > 0 ? prev : resolvedHeight));\n\n observer.observe(node);\n return () => observer.disconnect();\n }, [\n resolvedHeight,\n resolvedWidth,\n annotations,\n chartTitle,\n description,\n margin,\n plotBackgroundColor,\n paperBackgroundColor,\n fontColor,\n fontFamily,\n theme,\n ]);\n\n const svgHeight = Math.max(Math.ceil(contentHeight || 0), resolvedHeight);\n\n const context: IChartAnnotationContext = {\n plotRect: { x: 0, y: 0, width: resolvedWidth, height: resolvedHeight },\n svgRect: { width: resolvedWidth, height: resolvedHeight },\n isRtl: theme?.rtl,\n };\n\n const padding = buildPadding(margin);\n\n const rootClassName = React.useMemo(\n () =>\n mergeStyles({\n position: 'relative',\n width: width ? `${width}px` : '100%',\n minHeight: resolvedHeight,\n backgroundColor: paperBackgroundColor ?? theme.semanticColors.bodyBackground,\n color: fontColor ?? theme.semanticColors.bodyText,\n fontFamily: fontFamily ?? theme.fonts.medium.fontFamily,\n padding,\n display: 'flex',\n flexDirection: 'column',\n rowGap: '8px',\n }),\n [fontColor, fontFamily, paperBackgroundColor, padding, resolvedHeight, theme, width],\n );\n\n const contentClassName = React.useMemo(\n () =>\n mergeStyles({\n position: 'relative',\n flexGrow: 1,\n backgroundColor: plotBackgroundColor ?? 'transparent',\n borderRadius: theme.effects.roundedCorner2 ?? 4,\n boxSizing: 'border-box',\n }),\n [plotBackgroundColor, theme.effects.roundedCorner2],\n );\n\n const titleClassName = React.useMemo(\n () =>\n mergeStyles({\n textAlign: 'center',\n }),\n [],\n );\n\n const resolvedAnnotations = annotations ?? [];\n const hasAnnotations = resolvedAnnotations.length > 0;\n const ariaLabel = hasAnnotations ? description ?? chartTitle : undefined;\n\n React.useImperativeHandle(\n componentRef,\n () => {\n const chartHandle: IChart = {\n chartContainer: containerRef.current,\n toImage: (opts?: IImageExportOptions) => {\n return exportChartsAsImage([{ container: containerRef.current }], undefined, getRTL(), opts);\n },\n };\n\n return chartHandle;\n },\n [],\n );\n\n return (\n <div ref={containerRef} data-chart-annotation-container=\"true\">\n <svg\n width={resolvedWidth}\n height={svgHeight}\n viewBox={`0 0 ${resolvedWidth} ${svgHeight}`}\n style={{ width: width ? `${width}px` : '100%', height: `${svgHeight}px`, display: 'block' }}\n role={ariaLabel ? 'img' : undefined}\n aria-label={ariaLabel}\n >\n <foreignObject x={0} y={0} width={resolvedWidth} height={svgHeight}>\n <div ref={contentRef} className={rootClassName} data-chart-annotation-only=\"true\" aria-label={ariaLabel}>\n {chartTitle && (\n <span className={titleClassName} aria-hidden=\"true\">\n {chartTitle}\n </span>\n )}\n <div className={contentClassName} role=\"presentation\">\n {hasAnnotations ? (\n <ChartAnnotationLayer annotations={resolvedAnnotations} context={context} theme={theme} />\n ) : null}\n </div>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n};\n\nAnnotationOnlyChart.displayName = 'AnnotationOnlyChart';\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { IChartAnnotation } from '../../types/IChartAnnotation';
|
|
3
|
+
import type { IChart } from '../../types/index';
|
|
4
|
+
import type { Margin } from '@fluentui/chart-utilities';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the annotation-only chart renderer.
|
|
7
|
+
*/
|
|
8
|
+
export interface IAnnotationOnlyChartProps {
|
|
9
|
+
/**
|
|
10
|
+
* Collection of annotations to render.
|
|
11
|
+
*/
|
|
12
|
+
annotations: IChartAnnotation[];
|
|
13
|
+
/** Optional layout title extracted from the Plotly schema. */
|
|
14
|
+
chartTitle?: string;
|
|
15
|
+
/** Optional descriptive text for accessibility. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Desired width in pixels (if absent the chart will grow to fit the container). */
|
|
18
|
+
width?: number;
|
|
19
|
+
/** Desired height in pixels. */
|
|
20
|
+
height?: number;
|
|
21
|
+
/** Paper/background colour specified in the Plotly layout. */
|
|
22
|
+
paperBackgroundColor?: string;
|
|
23
|
+
/** Plot area background colour specified in the Plotly layout. */
|
|
24
|
+
plotBackgroundColor?: string;
|
|
25
|
+
/** Global layout font colour. */
|
|
26
|
+
fontColor?: string;
|
|
27
|
+
/** Global layout font family. */
|
|
28
|
+
fontFamily?: string;
|
|
29
|
+
/** Layout margin converted to padding for the outer wrapper. */
|
|
30
|
+
margin?: Partial<Margin>;
|
|
31
|
+
/** Component ref propagated by the DeclarativeChart surface. */
|
|
32
|
+
componentRef?: React.RefObject<IChart>;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationOnlyChart.types.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/AnnotationOnlyChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IChartAnnotation } from '../../types/IChartAnnotation';\nimport type { IChart } from '../../types/index';\nimport type { Margin } from '@fluentui/chart-utilities';\n\n/**\n * Props for the annotation-only chart renderer.\n */\nexport interface IAnnotationOnlyChartProps {\n /**\n * Collection of annotations to render.\n */\n annotations: IChartAnnotation[];\n /** Optional layout title extracted from the Plotly schema. */\n chartTitle?: string;\n /** Optional descriptive text for accessibility. */\n description?: string;\n /** Desired width in pixels (if absent the chart will grow to fit the container). */\n width?: number;\n /** Desired height in pixels. */\n height?: number;\n /** Paper/background colour specified in the Plotly layout. */\n paperBackgroundColor?: string;\n /** Plot area background colour specified in the Plotly layout. */\n plotBackgroundColor?: string;\n /** Global layout font colour. */\n fontColor?: string;\n /** Global layout font family. */\n fontFamily?: string;\n /** Layout margin converted to padding for the outer wrapper. */\n margin?: Partial<Margin>;\n /** Component ref propagated by the DeclarativeChart surface. */\n componentRef?: React.RefObject<IChart>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/AnnotationOnlyChart/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './AnnotationOnlyChart';\nexport * from './AnnotationOnlyChart.types';\n"]}
|
|
@@ -11,7 +11,7 @@ import { formatDateToLocaleString } from '@fluentui/chart-utilities';
|
|
|
11
11
|
import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, tooltipOfAxislabels, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfNumericForAreaLineScatterCharts, domainRangeOfDateForAreaLineScatterVerticalBarCharts, createStringYAxis, getSecureProps, areArraysEqual, getCurveFactory, findCalloutPoints, } from '../../utilities/index';
|
|
12
12
|
import { Legends } from '../Legends/index';
|
|
13
13
|
import { DirectionalHint } from '@fluentui/react/lib/Callout';
|
|
14
|
-
import {
|
|
14
|
+
import { exportChartsAsImage } from '../../utilities/image-export-utils';
|
|
15
15
|
var getClassNames = classNamesFunction();
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
17
|
var bisect = bisector(function (d) { return d.x; }).left;
|
|
@@ -31,7 +31,7 @@ var AreaChartBase = /** @class */ (function (_super) {
|
|
|
31
31
|
_this._hasMissingXValues = false;
|
|
32
32
|
_this.toImage = function (opts) {
|
|
33
33
|
var _a, _b;
|
|
34
|
-
return
|
|
34
|
+
return exportChartsAsImage([{ container: (_a = _this._cartesianChartRef.current) === null || _a === void 0 ? void 0 : _a.chartContainer }], _this.props.hideLegend ? undefined : (_b = _this._legendsRef.current) === null || _b === void 0 ? void 0 : _b.toSVG, getRTL(), opts);
|
|
35
35
|
};
|
|
36
36
|
_this._getMinMaxOfYAxis = function (points, yAxisType, useSecondaryYScale) {
|
|
37
37
|
return findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale);
|