@fluentui/react-charting 5.25.1 → 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 +72 -1
- package/CHANGELOG.md +19 -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 +157 -45
- 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 +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 +159 -46
- 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 +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 +159 -46
- 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 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AC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;gBACjF,gBAAgB,EAAE,SAAS;gBAC3B,KAAK,OAAA;gBACL,aAAa,EAAE,KAAK,CAAC,gBAAiB;gBACtC,aAAa,EAAE,KAAK,CAAC,gBAAiB;gBACtC,qBAAqB,wCAAO,KAAK,KAAE,KAAK,OAAA,GAAE;gBAC1C,wBAAwB,EAAE,KAAK,CAAC,wBAAyB;aAC1D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,yCAAW,GAAnB;QACE,IAAI;IACN,CAAC;IASO,4CAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAqCO,2CAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjG,CAAC;IA3gBa,gCAAY,GAAmC;QAC3D,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE,KAAK;KACtB,AALyB,CAKxB;IAugBJ,0BAAC;CAAA,AA7gBD,CAAyC,KAAK,CAAC,SAAS,GA6gBvD;AA7gBY,kDAAmB","sourcesContent":["import * as React from 'react';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ILegend, Legends } from '../Legends/index';\nimport { IAccessibilityProps, IChartDataPoint, IChartProps } from './index';\nimport { IRefArrayData, IStackedBarChartProps, IStackedBarChartStyleProps, IStackedBarChartStyles } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ChartHoverCard, getAccessibleDataObject, getNextGradient } from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IStackedBarChartStyleProps, IStackedBarChartStyles>();\nexport interface IStackedBarChartState {\n isCalloutVisible: boolean;\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class StackedBarChartBase extends React.Component<IStackedBarChartProps, IStackedBarChartState> {\n public static defaultProps: Partial<IStackedBarChartProps> = {\n barHeight: 12,\n hideNumberDisplay: false,\n hideLegend: false,\n ignoreFixStyle: false,\n };\n private _classNames: IProcessedStyleSet<IStackedBarChartStyles>;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string;\n private barChartSvgRef: React.RefObject<SVGSVGElement>;\n private _isRTL = getRTL();\n\n public constructor(props: IStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._onLeave = this._onLeave.bind(this);\n this._refCallback = this._refCallback.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_SBC_empty');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSXElement {\n if (!this._isChartEmpty()) {\n this._adjustProps();\n const { data, benchmarkData, targetData, hideNumberDisplay, ignoreFixStyle, culture } = this.props;\n const { palette } = this.props.theme!;\n const barHeight = ignoreFixStyle || data!.chartData!.length > 2 ? this.props.barHeight : 12;\n\n if (benchmarkData) {\n // benchmark color is used to render color for benchmark triangle and benchmark legend\n benchmarkData.color = benchmarkData.color || palette.neutralTertiary;\n }\n\n if (targetData) {\n // target color is used to render color for target triangle and target legend\n targetData.color = targetData.color || palette.neutralSecondary;\n }\n\n const bars = this._createBarsAndLegends(data!, barHeight!, palette, benchmarkData, targetData);\n\n const showRatio = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 2;\n const showNumber = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 1;\n const total = data!.chartData!.reduce(\n (acc: number, value: IChartDataPoint) => acc + (value.data ? value.data : 0),\n 0,\n );\n\n let benchmarkRatio = 0;\n if (benchmarkData && total) {\n benchmarkRatio = (benchmarkData.data! / total) * 100;\n }\n let targetRatio = 0;\n if (targetData && total) {\n targetRatio = (targetData.data! / total) * 100;\n }\n\n const showLegend = this.props.hideLegend === false && (ignoreFixStyle || data!.chartData!.length > 2);\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n benchmarkColor: benchmarkData ? benchmarkData.color : '',\n benchmarkRatio,\n targetColor: targetData ? targetData.color : '',\n targetRatio,\n showTriangle: !!(benchmarkData || targetData),\n });\n const getChartData = () =>\n formatToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture) as React.ReactNode;\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!this.props.hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + formatToLocaleString(total, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n {(benchmarkData || targetData) && (\n <div className={this._classNames.benchmarkContainer}>\n {benchmarkData && <div className={this._classNames.benchmark} role=\"text\" />}\n {targetData && <div className={this._classNames.target} role=\"text\" />}\n </div>\n )}\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n <g>{bars[0]}</g>\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard}\n color={this.state.color}\n culture={culture}\n />\n )}\n </>\n </Callout>\n </svg>\n </div>\n </FocusZone>\n {showLegend && <div className={this._classNames.legendContainer}>{bars[1]}</div>}\n </div>\n );\n }\n\n return (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _adjustProps(): void {\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n width: this.props.width!,\n barHeight: this.props.barHeight!,\n className: this.props.className!,\n });\n }\n\n /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n benchmarkData?: IChartDataPoint,\n targetData?: IChartDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ): [JSXElement[], JSXElement] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const legendDataItems: ILegend[] = [];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.data ? point.data : 0;\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color: startColor,\n action:\n total > 0\n ? () => {\n this._onClick(point.legend!);\n }\n : undefined,\n hoverAction:\n total > 0\n ? () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n }\n : undefined,\n onMouseOutAction:\n total > 0\n ? () => {\n this._onLeave();\n }\n : undefined,\n };\n\n if (!point.placeHolder) {\n legendDataItems.push(legend);\n }\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n const hoverCardYColor = point.placeHolder ? this.props.theme!.semanticColors.bodyText : startColor;\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href: this.props.href!,\n });\n\n const gradientId = getId('SBC_Gradient') + `_${index}`;\n\n return (\n <g\n key={index}\n className={this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, legend.title);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, hoverCardYColor, point)}\n onBlur={this._onBarLeave}\n aria-label={this._getAriaLabel(point)}\n role=\"img\"\n onMouseOver={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseLeave={this._onBarLeave}\n pointerEvents=\"all\"\n onClick={this.props.href ? this._redirectToUrl.bind(this, this.props.href!) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={getId('_SBC_bar')}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n\n // add benchmark legends\n this._addLegend(legendDataItems, benchmarkData);\n this._addLegend(legendDataItems, targetData);\n const legends = (\n <Legends\n legends={legendDataItems}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n return [\n total === 0\n ? [\n this._generateEmptyBar(\n barHeight,\n this.props.barBackgroundColor ? this.props.barBackgroundColor : palette.neutralLight,\n ),\n ]\n : bars,\n legends,\n ];\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this._refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend ? point.legend : point.placeHolder ? 'Remaining' : '',\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _addLegend(legendDataItems: ILegend[], data?: IChartDataPoint): void {\n if (data) {\n const legend: ILegend = {\n title: data.legend!,\n color: data.color!,\n shape: 'triangle',\n };\n legendDataItems.push(legend);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _generateEmptyBar(barHeight: number, color: string): JSXElement {\n return (\n <g key={0} className={this._classNames.opacityChangeOnHover}>\n <rect key={0} id={getId('_SBC_empty_bar_')} x={'0%'} y={0} width={'100%'} height={barHeight} fill={color} />\n </g>\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend ? point.legend : point.placeHolder ? 'Remaining' : '',\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : point.placeHolder ? 'Remaining, ' : '') + `${yValue}.`\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.chartData && this.props.data.chartData.length > 0);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StackedBarChart.base.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAE/B,2DAAkF;AAClF,0CAAoD;AAGpD,uDAAuE;AACvE,qDAAsE;AACtE,+CAAiG;AACjG,6EAA4E;AAC5E,6DAAiE;AAGjE,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAsD,CAAC;AAi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GAAE;gBAC1C,wBAAwB,EAAE,KAAK,CAAC,wBAAyB;aAC1D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,yCAAW,GAAnB;QACE,IAAI;IACN,CAAC;IASO,4CAAc,GAAtB,UAAuB,IAAwB;QAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAqCO,2CAAa,GAArB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjG,CAAC;IA3gBa,gCAAY,GAAmC;QAC3D,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,KAAK;QACjB,cAAc,EAAE,KAAK;KACtB,AALyB,CAKxB;IAugBJ,0BAAC;CAAA,AA7gBD,CAAyC,KAAK,CAAC,SAAS,GA6gBvD;AA7gBY,kDAAmB","sourcesContent":["import * as React from 'react';\nimport { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling';\nimport { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities';\nimport { ILegend, Legends } from '../Legends/index';\nimport { IAccessibilityProps, IChartDataPoint, IChartProps } from './index';\nimport { IRefArrayData, IStackedBarChartProps, IStackedBarChartStyleProps, IStackedBarChartStyles } from '../../index';\nimport { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ChartHoverCard, getAccessibleDataObject, getNextGradient } from '../../utilities/index';\nimport { FocusableTooltipText } from '../../utilities/FocusableTooltipText';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport type { JSXElement } from '@fluentui/utilities';\n\nconst getClassNames = classNamesFunction<IStackedBarChartStyleProps, IStackedBarChartStyles>();\nexport interface IStackedBarChartState {\n isCalloutVisible: boolean;\n selectedLegend: string;\n activeLegend: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected: any;\n dataForHoverCard: number;\n color: string;\n xCalloutValue?: string;\n yCalloutValue?: string;\n dataPointCalloutProps?: IChartDataPoint;\n callOutAccessibilityData?: IAccessibilityProps;\n calloutLegend: string;\n barSpacingInPercent: number;\n}\n\nexport class StackedBarChartBase extends React.Component<IStackedBarChartProps, IStackedBarChartState> {\n public static defaultProps: Partial<IStackedBarChartProps> = {\n barHeight: 12,\n hideNumberDisplay: false,\n hideLegend: false,\n ignoreFixStyle: false,\n };\n private _classNames: IProcessedStyleSet<IStackedBarChartStyles>;\n private _calloutId: string;\n private _refArray: IRefArrayData[];\n private _calloutAnchorPoint: IChartDataPoint | null;\n private _emptyChartId: string;\n private barChartSvgRef: React.RefObject<SVGSVGElement | null>;\n private _isRTL = getRTL();\n\n public constructor(props: IStackedBarChartProps) {\n super(props);\n this.state = {\n isCalloutVisible: false,\n selectedLegend: '',\n activeLegend: '',\n refSelected: null,\n dataForHoverCard: 0,\n color: '',\n xCalloutValue: '',\n yCalloutValue: '',\n calloutLegend: '',\n barSpacingInPercent: 0,\n };\n this._refArray = [];\n this._onLeave = this._onLeave.bind(this);\n this._refCallback = this._refCallback.bind(this);\n this._onBarLeave = this._onBarLeave.bind(this);\n this._calloutId = getId('callout');\n this._emptyChartId = getId('_SBC_empty');\n this.barChartSvgRef = React.createRef<SVGSVGElement>();\n }\n\n public componentDidMount(): void {\n const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0;\n const MARGIN_WIDTH_IN_PX = 3;\n if (svgWidth) {\n const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100;\n this.setState({ barSpacingInPercent: currentBarSpacing });\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public render(): JSXElement {\n if (!this._isChartEmpty()) {\n this._adjustProps();\n const { data, benchmarkData, targetData, hideNumberDisplay, ignoreFixStyle, culture } = this.props;\n const { palette } = this.props.theme!;\n const barHeight = ignoreFixStyle || data!.chartData!.length > 2 ? this.props.barHeight : 12;\n\n if (benchmarkData) {\n // benchmark color is used to render color for benchmark triangle and benchmark legend\n benchmarkData.color = benchmarkData.color || palette.neutralTertiary;\n }\n\n if (targetData) {\n // target color is used to render color for target triangle and target legend\n targetData.color = targetData.color || palette.neutralSecondary;\n }\n\n const bars = this._createBarsAndLegends(data!, barHeight!, palette, benchmarkData, targetData);\n\n const showRatio = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 2;\n const showNumber = hideNumberDisplay === false && !ignoreFixStyle && data!.chartData!.length === 1;\n const total = data!.chartData!.reduce(\n (acc: number, value: IChartDataPoint) => acc + (value.data ? value.data : 0),\n 0,\n );\n\n let benchmarkRatio = 0;\n if (benchmarkData && total) {\n benchmarkRatio = (benchmarkData.data! / total) * 100;\n }\n let targetRatio = 0;\n if (targetData && total) {\n targetRatio = (targetData.data! / total) * 100;\n }\n\n const showLegend = this.props.hideLegend === false && (ignoreFixStyle || data!.chartData!.length > 2);\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n benchmarkColor: benchmarkData ? benchmarkData.color : '',\n benchmarkRatio,\n targetColor: targetData ? targetData.color : '',\n targetRatio,\n showTriangle: !!(benchmarkData || targetData),\n });\n const getChartData = () =>\n formatToLocaleString(data!.chartData![0].data ? data!.chartData![0].data : 0, culture) as React.ReactNode;\n\n return (\n <div className={this._classNames.root} onMouseLeave={this._handleChartMouseLeave}>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div className={this._classNames.chartTitle}>\n {data!.chartTitle && (\n <FocusableTooltipText\n className={this._classNames.chartTitleLeft}\n content={data!.chartTitle}\n accessibilityData={data!.chartTitleAccessibilityData}\n />\n )}\n {showRatio && (\n <div {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}>\n <span className={this._classNames.ratioNumerator}>{getChartData()}</span>\n {!this.props.hideDenominator && (\n <span className={this._classNames.ratioDenominator}>\n {' / ' + formatToLocaleString(total, culture)}\n </span>\n )}\n </div>\n )}\n {showNumber && (\n <div\n className={this._classNames.ratioNumerator}\n {...getAccessibleDataObject(data!.chartDataAccessibilityData, 'text', false)}\n >\n {getChartData()}\n </div>\n )}\n </div>\n {(benchmarkData || targetData) && (\n <div className={this._classNames.benchmarkContainer}>\n {benchmarkData && <div className={this._classNames.benchmark} role=\"text\" />}\n {targetData && <div className={this._classNames.target} role=\"text\" />}\n </div>\n )}\n </FocusZone>\n <FocusZone direction={FocusZoneDirection.horizontal}>\n <div>\n <svg ref={this.barChartSvgRef} className={this._classNames.chart} aria-label={data?.chartTitle}>\n <g>{bars[0]}</g>\n <Callout\n gapSpace={15}\n isBeakVisible={false}\n target={this.state.refSelected}\n setInitialFocus={true}\n hidden={!(!this.props.hideTooltip && this.state.isCalloutVisible)}\n directionalHint={DirectionalHint.topAutoEdge}\n id={this._calloutId}\n onDismiss={this._closeCallout}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n preventDismissOnLostFocus={true}\n /** Keep the callout updated with details of focused/hovered bar */\n shouldUpdateWhenHidden={true}\n {...this.props.calloutProps}\n {...getAccessibleDataObject(this.state.callOutAccessibilityData, 'text', false)}\n >\n <>\n {this.props.onRenderCalloutPerDataPoint ? (\n this.props.onRenderCalloutPerDataPoint(this.state.dataPointCalloutProps)\n ) : (\n <ChartHoverCard\n Legend={this.state.xCalloutValue ? this.state.xCalloutValue : this.state.calloutLegend}\n YValue={this.state.yCalloutValue ? this.state.yCalloutValue : this.state.dataForHoverCard}\n color={this.state.color}\n culture={culture}\n />\n )}\n </>\n </Callout>\n </svg>\n </div>\n </FocusZone>\n {showLegend && <div className={this._classNames.legendContainer}>{bars[1]}</div>}\n </div>\n );\n }\n\n return (\n <div\n id={this._emptyChartId}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n\n private _adjustProps(): void {\n this._classNames = getClassNames(this.props.styles!, {\n legendColor: this.state.color,\n theme: this.props.theme!,\n width: this.props.width!,\n barHeight: this.props.barHeight!,\n className: this.props.className!,\n });\n }\n\n /**\n * The Create bar functions returns an array of <rect> elements, which form the bars\n * For each bar an x value, and a width needs to be specified\n * The computations are done based on percentages\n * Extra margin is also provided, in the x value to provide some spacing\n */\n\n private _createBarsAndLegends(\n data: IChartProps,\n barHeight: number,\n palette: IPalette,\n benchmarkData?: IChartDataPoint,\n targetData?: IChartDataPoint,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ): [JSXElement[], JSXElement] {\n const noOfBars =\n data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) ||\n 1;\n const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1);\n\n const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black];\n const legendDataItems: ILegend[] = [];\n // calculating starting point of each bar and it's range\n const startingPoint: number[] = [];\n const total = data.chartData!.reduce(\n (acc: number, point: IChartDataPoint) => acc + (point.data ? point.data : 0),\n 0,\n );\n let prevPosition = 0;\n let value = 0;\n\n let sumOfPercent = 0;\n\n data.chartData!.map((point: IChartDataPoint, index: number) => {\n const pointData = point.data ? point.data : 0;\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1;\n } else if (value > 99 && value !== 100) {\n value = 99;\n }\n sumOfPercent += value;\n\n return sumOfPercent;\n });\n\n /**\n * The %age of the space occupied by the margin needs to subtracted\n * while computing the scaling ratio, since the margins are not being\n * scaled down, only the data is being scaled down from a higher percentage to lower percentage\n * Eg: 95% of the space is taken by the bars, 5% by the margins\n * Now if the sumOfPercent is 120% -> This needs to be scaled down to 95%, not 100%\n * since that's only space available to the bars\n */\n const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1;\n\n const bars = data.chartData!.map((point: IChartDataPoint, index: number) => {\n let startColor: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)];\n let endColor: string = startColor;\n if (this.props.enableGradient) {\n startColor = point.gradient?.[0] || getNextGradient(index, 0, this.props.theme?.isInverted)[0];\n endColor = point.gradient?.[1] || getNextGradient(index, 0, this.props.theme?.isInverted)[1];\n }\n\n const pointData = point.data ? point.data : 0;\n // mapping data to the format Legends component needs\n const legend: ILegend = {\n title: point.legend!,\n color: startColor,\n action:\n total > 0\n ? () => {\n this._onClick(point.legend!);\n }\n : undefined,\n hoverAction:\n total > 0\n ? () => {\n this._handleChartMouseLeave();\n this._onHover(point.legend!);\n }\n : undefined,\n onMouseOutAction:\n total > 0\n ? () => {\n this._onLeave();\n }\n : undefined,\n };\n\n if (!point.placeHolder) {\n legendDataItems.push(legend);\n }\n if (index > 0) {\n prevPosition += value;\n }\n value = (pointData / total) * 100;\n if (value < 1 && value !== 0) {\n value = 1 / scalingRatio;\n } else if (value > 99 && value !== 100) {\n value = 99 / scalingRatio;\n } else {\n value = value / scalingRatio;\n }\n\n startingPoint.push(prevPosition);\n const styles = this.props.styles;\n const shouldHighlight = this._legendHighlighted(point.legend!) || this._noLegendHighlighted() ? true : false;\n const hoverCardYColor = point.placeHolder ? this.props.theme!.semanticColors.bodyText : startColor;\n this._classNames = getClassNames(styles!, {\n theme: this.props.theme!,\n shouldHighlight,\n href: this.props.href!,\n });\n\n const gradientId = getId('SBC_Gradient') + `_${index}`;\n\n return (\n <g\n key={index}\n className={this._classNames.opacityChangeOnHover}\n ref={(e: SVGGElement) => {\n this._refCallback(e, legend.title);\n }}\n data-is-focusable={!this.props.hideTooltip && shouldHighlight}\n onFocus={this._onBarFocus.bind(this, pointData, hoverCardYColor, point)}\n onBlur={this._onBarLeave}\n aria-label={this._getAriaLabel(point)}\n role=\"img\"\n onMouseOver={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseMove={this._onBarHover.bind(this, pointData, hoverCardYColor, point)}\n onMouseLeave={this._onBarLeave}\n pointerEvents=\"all\"\n onClick={this.props.href ? this._redirectToUrl.bind(this, this.props.href!) : point.onClick}\n >\n {this.props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n key={index}\n id={getId('_SBC_bar')}\n x={`${\n this._isRTL\n ? 100 - startingPoint[index] - value - this.state.barSpacingInPercent * index\n : startingPoint[index] + this.state.barSpacingInPercent * index\n }%`}\n y={0}\n width={value + '%'}\n height={barHeight}\n rx={this.props.roundCorners ? 3 : 0}\n fill={this.props.enableGradient ? `url(#${gradientId})` : startColor}\n />\n </g>\n );\n });\n\n // add benchmark legends\n this._addLegend(legendDataItems, benchmarkData);\n this._addLegend(legendDataItems, targetData);\n const legends = (\n <Legends\n legends={legendDataItems}\n enabledWrapLines={this.props.enabledLegendsWrapLines}\n overflowProps={this.props.legendsOverflowProps}\n focusZonePropsInHoverCard={this.props.focusZonePropsForLegendsInHoverCard}\n overflowText={this.props.legendsOverflowText}\n {...this.props.legendProps}\n />\n );\n return [\n total === 0\n ? [\n this._generateEmptyBar(\n barHeight,\n this.props.barBackgroundColor ? this.props.barBackgroundColor : palette.neutralLight,\n ),\n ]\n : bars,\n legends,\n ];\n }\n\n private _onBarFocus(pointData: number, color: string, point: IChartDataPoint): void {\n this._refArray.forEach((obj: IRefArrayData) => {\n if (obj.index === point.legend!) {\n this.setState({\n refSelected: obj.refElement,\n /** Show the callout if highlighted bar is focused and Hide it if unhighlighted bar is focused */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend ? point.legend : point.placeHolder ? 'Remaining' : '',\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n });\n }\n\n private _addLegend(legendDataItems: ILegend[], data?: IChartDataPoint): void {\n if (data) {\n const legend: ILegend = {\n title: data.legend!,\n color: data.color!,\n shape: 'triangle',\n };\n legendDataItems.push(legend);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n private _generateEmptyBar(barHeight: number, color: string): JSXElement {\n return (\n <g key={0} className={this._classNames.opacityChangeOnHover}>\n <rect key={0} id={getId('_SBC_empty_bar_')} x={'0%'} y={0} width={'100%'} height={barHeight} fill={color} />\n </g>\n );\n }\n\n private _refCallback(element: SVGGElement, legendTitle: string): void {\n this._refArray.push({ index: legendTitle, refElement: element });\n }\n\n private _onClick(legendTitle: string): void {\n if (this.state.selectedLegend === legendTitle) {\n this.setState({\n selectedLegend: '',\n });\n } else {\n this.setState({\n selectedLegend: legendTitle,\n });\n }\n }\n\n private _onHover(legendTitle: string): void {\n this.setState({\n activeLegend: legendTitle,\n });\n }\n\n private _onLeave(): void {\n this.setState({\n activeLegend: '',\n });\n }\n\n private _onBarHover(\n pointData: number,\n color: string,\n point: IChartDataPoint,\n mouseEvent: React.MouseEvent<SVGPathElement>,\n ): void {\n mouseEvent.persist();\n if (this._calloutAnchorPoint !== point) {\n this._calloutAnchorPoint = point;\n this.setState({\n refSelected: mouseEvent,\n /** Show the callout if highlighted bar is hovered and Hide it if unhighlighted bar is hovered */\n isCalloutVisible: this.state.selectedLegend === '' || this.state.selectedLegend === point.legend!,\n calloutLegend: point.legend ? point.legend : point.placeHolder ? 'Remaining' : '',\n dataForHoverCard: pointData,\n color,\n xCalloutValue: point.xAxisCalloutData!,\n yCalloutValue: point.yAxisCalloutData!,\n dataPointCalloutProps: { ...point, color },\n callOutAccessibilityData: point.callOutAccessibilityData!,\n });\n }\n }\n\n private _onBarLeave(): void {\n /**/\n }\n\n private _handleChartMouseLeave = () => {\n this._calloutAnchorPoint = null;\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n private _redirectToUrl(href: string | undefined): void {\n href ? (window.location.href = href) : '';\n }\n\n private _closeCallout = () => {\n this.setState({\n isCalloutVisible: false,\n });\n };\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n private _legendHighlighted = (legendTitle: string) => {\n return (\n this.state.selectedLegend === legendTitle ||\n (this.state.selectedLegend === '' && this.state.activeLegend === legendTitle)\n );\n };\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n private _noLegendHighlighted = () => {\n return this.state.selectedLegend === '' && this.state.activeLegend === '';\n };\n\n private _getAriaLabel = (point: IChartDataPoint): string => {\n const legend = point.xAxisCalloutData || point.legend;\n const yValue = point.yAxisCalloutData || point.data || 0;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n (legend ? `${legend}, ` : point.placeHolder ? 'Remaining, ' : '') + `${yValue}.`\n );\n };\n\n private _isChartEmpty(): boolean {\n return !(this.props.data && this.props.data.chartData && this.props.data.chartData.length > 0);\n }\n}\n"]}
|
|
@@ -29,9 +29,9 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
29
29
|
_this._isRtl = (0, Utilities_1.getRTL)();
|
|
30
30
|
_this.toImage = function (opts) {
|
|
31
31
|
var _a, _b;
|
|
32
|
-
return (0, image_export_utils_1.
|
|
32
|
+
return (0, image_export_utils_1.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, _this._isRtl, opts);
|
|
33
33
|
};
|
|
34
|
-
_this._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues
|
|
34
|
+
_this._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues) {
|
|
35
35
|
var domainNRangeValue;
|
|
36
36
|
if (xAxisType === index_2.XAxisTypes.NumericAxis) {
|
|
37
37
|
domainNRangeValue = (0, index_2.domainRageOfVerticalNumeric)(points, margins, width, isRTL, barWidth);
|
|
@@ -95,7 +95,9 @@ var VerticalBarChartBase = /** @class */ (function (_super) {
|
|
|
95
95
|
var circleRef = { refElement: null };
|
|
96
96
|
return (React.createElement("circle", { key: index, id: (0, Utilities_1.getId)('_VBC_point_'), cx: isStringAxis ? xBarScale(item.x) + 0.5 * xBarScale.bandwidth() : xScale(item.x), cy: item.useSecondaryYScale && yScaleSecondary ? yScaleSecondary(item.y) : yScalePrimary(item.y), onMouseOver: _this._legendHighlighted(lineLegendText)
|
|
97
97
|
? _this._lineHover.bind(_this, item.point)
|
|
98
|
-
: _this._onBarHover.bind(_this, item.point, colorScale(item.y)), onMouseOut: _this._onBarLeave, r: _this._getCircleVisibilityAndRadius(item.x, lineLegendText).radius, stroke: lineLegendColor, fill: _this.props.theme.semanticColors.bodyBackground, strokeWidth: 3, visibility: _this._getCircleVisibilityAndRadius(item.x, lineLegendText).visibility, onClick: (_a = item.point.lineData) === null || _a === void 0 ? void 0 : _a.onClick, "data-is-focusable": _this._legendHighlighted(lineLegendText), ref: function (e) {
|
|
98
|
+
: _this._onBarHover.bind(_this, item.point, colorScale(item.y)), onMouseOut: _this._onBarLeave, r: _this._getCircleVisibilityAndRadius(item.x, lineLegendText).radius, stroke: lineLegendColor, fill: _this.props.theme.semanticColors.bodyBackground, strokeWidth: 3, visibility: _this._getCircleVisibilityAndRadius(item.x, lineLegendText).visibility, onClick: (_a = item.point.lineData) === null || _a === void 0 ? void 0 : _a.onClick, "data-is-focusable": _this._legendHighlighted(lineLegendText), ref: function (e) {
|
|
99
|
+
circleRef.refElement = e;
|
|
100
|
+
}, onFocus: _this._lineFocus.bind(_this, item.point, circleRef), onBlur: _this._handleChartMouseLeave }));
|
|
99
101
|
});
|
|
100
102
|
return (React.createElement(React.Fragment, null,
|
|
101
103
|
line,
|