@fluentui/react-charting 5.25.5 → 5.25.6
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 +60 -1
- package/CHANGELOG.md +17 -2
- package/bundle-size/PolarChart.fixture.js +7 -0
- package/dist/react-charting.d.ts +388 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +85 -1
- package/lib/PolarChart.d.ts +1 -0
- package/lib/PolarChart.js +2 -0
- package/lib/PolarChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib/components/AreaChart/AreaChart.base.js +2 -31
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +12 -4
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.styles.js +3 -0
- package/lib/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +82 -42
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js +31 -27
- package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +24 -28
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +202 -217
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib/components/DonutChart/DonutChart.base.js +16 -4
- package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.styles.js +3 -1
- package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.base.js +14 -8
- package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.styles.js +3 -0
- package/lib/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.base.js +2 -2
- package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.styles.js +16 -22
- package/lib/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +2 -18
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib/components/LineChart/LineChart.base.js +1 -25
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib/components/PolarChart/PolarChart.base.js +426 -0
- package/lib/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib/components/PolarChart/PolarChart.js +9 -0
- package/lib/components/PolarChart/PolarChart.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib/components/PolarChart/PolarChart.styles.js +39 -0
- package/lib/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib/components/PolarChart/PolarChart.types.js +2 -0
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib/components/PolarChart/PolarChart.utils.js +180 -0
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib/components/PolarChart/index.d.ts +2 -0
- package/lib/components/PolarChart/index.js +3 -0
- package/lib/components/PolarChart/index.js.map +1 -0
- package/lib/components/SankeyChart/SankeyChart.base.js +9 -2
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +1 -28
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +1 -73
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -26
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.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/IDataPoint.d.ts +88 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/ChartTitle.d.ts +55 -0
- package/lib/utilities/ChartTitle.js +45 -0
- package/lib/utilities/ChartTitle.js.map +1 -0
- package/lib/utilities/Common.styles.d.ts +51 -0
- package/lib/utilities/Common.styles.js +70 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/image-export-utils.js +4 -4
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.d.ts +1 -0
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.d.ts +28 -6
- package/lib/utilities/utilities.js +210 -104
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/PolarChart.d.ts +1 -0
- package/lib-amd/PolarChart.js +6 -0
- package/lib-amd/PolarChart.js.map +1 -0
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +1 -29
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +12 -5
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.styles.js +3 -1
- package/lib-amd/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib-amd/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +81 -41
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js +30 -26
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +22 -28
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -219
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-amd/components/DonutChart/DonutChart.base.js +15 -3
- package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -0
- package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib-amd/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.base.js +14 -9
- package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js +3 -1
- package/lib-amd/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib-amd/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib-amd/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js +16 -23
- package/lib-amd/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-amd/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib-amd/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +0 -16
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-amd/components/LineChart/LineChart.base.js +0 -24
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib-amd/components/PolarChart/PolarChart.base.js +421 -0
- package/lib-amd/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib-amd/components/PolarChart/PolarChart.js +11 -0
- package/lib-amd/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.js +43 -0
- package/lib-amd/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib-amd/components/PolarChart/PolarChart.types.js +5 -0
- package/lib-amd/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.js +183 -0
- package/lib-amd/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-amd/components/PolarChart/index.d.ts +2 -0
- package/lib-amd/components/PolarChart/index.js +7 -0
- package/lib-amd/components/PolarChart/index.js.map +1 -0
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +9 -3
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js +3 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib-amd/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +0 -27
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +1 -72
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -25
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.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/IDataPoint.d.ts +88 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/ChartTitle.d.ts +55 -0
- package/lib-amd/utilities/ChartTitle.js +46 -0
- package/lib-amd/utilities/ChartTitle.js.map +1 -0
- package/lib-amd/utilities/Common.styles.d.ts +51 -0
- package/lib-amd/utilities/Common.styles.js +74 -2
- package/lib-amd/utilities/Common.styles.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +3 -3
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/index.d.ts +1 -0
- package/lib-amd/utilities/index.js +2 -1
- package/lib-amd/utilities/index.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +28 -6
- package/lib-amd/utilities/utilities.js +217 -107
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/PolarChart.d.ts +1 -0
- package/lib-commonjs/PolarChart.js +5 -0
- package/lib-commonjs/PolarChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +0 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +0 -29
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +12 -4
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.styles.js +3 -0
- package/lib-commonjs/components/ChartTable/ChartTable.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.d.ts +11 -0
- package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +11 -6
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +17 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +5 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +81 -41
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +30 -26
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +16 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +23 -27
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +3 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +204 -219
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +1 -0
- package/lib-commonjs/components/DonutChart/DonutChart.base.js +15 -3
- package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -0
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.d.ts +13 -0
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +14 -8
- package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js +3 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.d.ts +13 -0
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js +16 -22
- package/lib-commonjs/components/GaugeChart/GaugeChart.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.d.ts +9 -0
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +0 -16
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +0 -24
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.base.d.ts +3 -0
- package/lib-commonjs/components/PolarChart/PolarChart.base.js +429 -0
- package/lib-commonjs/components/PolarChart/PolarChart.base.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.d.ts +7 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js +12 -0
- package/lib-commonjs/components/PolarChart/PolarChart.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.d.ts +2 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.js +43 -0
- package/lib-commonjs/components/PolarChart/PolarChart.styles.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.d.ts +185 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js +3 -0
- package/lib-commonjs/components/PolarChart/PolarChart.types.js.map +1 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.d.ts +43 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js +188 -0
- package/lib-commonjs/components/PolarChart/PolarChart.utils.js.map +1 -0
- package/lib-commonjs/components/PolarChart/index.d.ts +2 -0
- package/lib-commonjs/components/PolarChart/index.js +6 -0
- package/lib-commonjs/components/PolarChart/index.js.map +1 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +9 -2
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +3 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.d.ts +18 -0
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +0 -27
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +0 -72
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +0 -25
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.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/IDataPoint.d.ts +88 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.d.ts +55 -0
- package/lib-commonjs/utilities/ChartTitle.js +49 -0
- package/lib-commonjs/utilities/ChartTitle.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.d.ts +51 -0
- package/lib-commonjs/utilities/Common.styles.js +74 -2
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +3 -3
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/index.d.ts +1 -0
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +28 -6
- package/lib-commonjs/utilities/utilities.js +217 -107
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -12
- package/project.json +0 -1
- package/src/components/ChartTable/ChartTable.types.ts +13 -0
- package/src/components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts +5 -0
- package/src/components/CommonComponents/CartesianChart.types.ts +17 -1
- package/src/components/DonutChart/DonutChart.types.ts +16 -0
- package/src/components/FunnelChart/FunnelChart.types.ts +16 -0
- package/src/components/GaugeChart/GaugeChart.types.ts +11 -0
- package/src/components/PolarChart/PolarChart.types.ts +232 -0
- package/src/components/SankeyChart/SankeyChart.types.ts +22 -0
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import { CurveFactory } from 'd3-shape';
|
|
8
8
|
import { FocusZoneDirection } from '@fluentui/react-focus';
|
|
9
|
+
import type { Font } from '@fluentui/chart-utilities';
|
|
9
10
|
import { ICalloutContentStyleProps } from '@fluentui/react/lib/Callout';
|
|
10
11
|
import { ICalloutContentStyles } from '@fluentui/react/lib/Callout';
|
|
11
12
|
import { ICalloutProps } from '@fluentui/react/lib/Callout';
|
|
13
|
+
import { ICalloutProps as ICalloutProps_2 } from '@fluentui/react';
|
|
12
14
|
import { IFocusZoneProps } from '@fluentui/react-focus';
|
|
13
15
|
import { IHoverCardStyleProps } from '@fluentui/react/lib/HoverCard';
|
|
14
16
|
import { IHoverCardStyles } from '@fluentui/react/lib/HoverCard';
|
|
@@ -447,10 +449,14 @@ export interface ICartesianChartProps {
|
|
|
447
449
|
tickPadding?: number;
|
|
448
450
|
tickValues?: number[] | Date[] | string[];
|
|
449
451
|
timeFormatLocale?: TimeLocaleDefinition;
|
|
452
|
+
// Warning: (ae-forgotten-export) The symbol "ITitleStyles" needs to be exported by the entry point index.d.ts
|
|
453
|
+
titleStyles?: ITitleStyles;
|
|
450
454
|
useUTC?: boolean;
|
|
451
455
|
width?: number;
|
|
452
456
|
wrapXAxisLables?: boolean;
|
|
453
|
-
xAxis?: AxisProps
|
|
457
|
+
xAxis?: AxisProps & {
|
|
458
|
+
tickLayout?: 'default' | 'auto';
|
|
459
|
+
};
|
|
454
460
|
xAxisAnnotation?: string;
|
|
455
461
|
xAxisCategoryOrder?: AxisCategoryOrder;
|
|
456
462
|
xAxisTickCount?: number;
|
|
@@ -588,6 +594,7 @@ export interface IChartProps {
|
|
|
588
594
|
|
|
589
595
|
// @public
|
|
590
596
|
export interface IChartTableProps {
|
|
597
|
+
chartTitle?: string;
|
|
591
598
|
className?: string;
|
|
592
599
|
componentRef?: IRefObject<IChart>;
|
|
593
600
|
headers: {
|
|
@@ -601,6 +608,7 @@ export interface IChartTableProps {
|
|
|
601
608
|
}[][];
|
|
602
609
|
styles?: IStyleFunctionOrObject<IChartTableStyleProps, IChartTableStyles>;
|
|
603
610
|
theme?: ITheme;
|
|
611
|
+
titleStyles?: ITitleStyles;
|
|
604
612
|
width?: string | number;
|
|
605
613
|
}
|
|
606
614
|
|
|
@@ -619,10 +627,14 @@ export interface IChartTableStyles {
|
|
|
619
627
|
// (undocumented)
|
|
620
628
|
chart?: IStyle;
|
|
621
629
|
// (undocumented)
|
|
630
|
+
chartTitle?: IStyle;
|
|
631
|
+
// (undocumented)
|
|
622
632
|
headerCell?: IStyle;
|
|
623
633
|
// (undocumented)
|
|
624
634
|
root?: IStyle;
|
|
625
635
|
// (undocumented)
|
|
636
|
+
svgTooltip?: IStyle;
|
|
637
|
+
// (undocumented)
|
|
626
638
|
table?: IStyle;
|
|
627
639
|
}
|
|
628
640
|
|
|
@@ -741,6 +753,7 @@ export interface IDonutChartProps extends ICartesianChartProps {
|
|
|
741
753
|
roundCorners?: boolean;
|
|
742
754
|
showLabelsInPercent?: boolean;
|
|
743
755
|
styles?: IStyleFunctionOrObject<IDonutChartStyleProps, IDonutChartStyles>;
|
|
756
|
+
titleStyles?: ITitleStyles;
|
|
744
757
|
valueInsideDonut?: string | number;
|
|
745
758
|
}
|
|
746
759
|
|
|
@@ -752,9 +765,11 @@ export interface IDonutChartStyleProps extends ICartesianChartStyleProps {
|
|
|
752
765
|
export interface IDonutChartStyles {
|
|
753
766
|
axisAnnotation?: IStyle;
|
|
754
767
|
chart?: IStyle;
|
|
768
|
+
chartTitle?: IStyle;
|
|
755
769
|
chartWrapper?: IStyle;
|
|
756
770
|
legendContainer: IStyle;
|
|
757
771
|
root?: IStyle;
|
|
772
|
+
svgTooltip?: IStyle;
|
|
758
773
|
}
|
|
759
774
|
|
|
760
775
|
// @public (undocumented)
|
|
@@ -790,6 +805,7 @@ export interface IFunnelChartProps {
|
|
|
790
805
|
orientation?: 'horizontal' | 'vertical';
|
|
791
806
|
styles?: IStyleFunctionOrObject<IFunnelChartStyleProps, IFunnelChartStyles>;
|
|
792
807
|
theme?: ITheme;
|
|
808
|
+
titleStyles?: ITitleStyles;
|
|
793
809
|
width?: number;
|
|
794
810
|
}
|
|
795
811
|
|
|
@@ -804,10 +820,12 @@ export interface IFunnelChartStyleProps {
|
|
|
804
820
|
// @public
|
|
805
821
|
export interface IFunnelChartStyles {
|
|
806
822
|
chart?: IStyle;
|
|
823
|
+
chartTitle?: IStyle;
|
|
807
824
|
root?: IStyle;
|
|
808
825
|
subComponentStyles: {
|
|
809
826
|
calloutStyles: IStyleFunctionOrObject<ICalloutContentStyleProps, ICalloutContentStyles>;
|
|
810
827
|
};
|
|
828
|
+
svgTooltip?: IStyle;
|
|
811
829
|
text?: IStyle;
|
|
812
830
|
}
|
|
813
831
|
|
|
@@ -872,6 +890,7 @@ export interface IGaugeChartProps {
|
|
|
872
890
|
styles?: IStyleFunctionOrObject<IGaugeChartStyleProps, IGaugeChartStyles>;
|
|
873
891
|
sublabel?: string;
|
|
874
892
|
theme?: ITheme;
|
|
893
|
+
titleStyles?: ITitleStyles;
|
|
875
894
|
variant?: GaugeChartVariant;
|
|
876
895
|
width?: number;
|
|
877
896
|
}
|
|
@@ -921,6 +940,7 @@ export interface IGaugeChartStyles {
|
|
|
921
940
|
segment?: IStyle;
|
|
922
941
|
shapeStyles?: IStyle;
|
|
923
942
|
sublabel?: IStyle;
|
|
943
|
+
svgTooltip?: IStyle;
|
|
924
944
|
}
|
|
925
945
|
|
|
926
946
|
// @public (undocumented)
|
|
@@ -1529,6 +1549,52 @@ export interface IPieChartStyles {
|
|
|
1529
1549
|
root?: IStyle;
|
|
1530
1550
|
}
|
|
1531
1551
|
|
|
1552
|
+
// @public
|
|
1553
|
+
export interface IPolarChartProps {
|
|
1554
|
+
angularAxis?: PolarAxisProps & {
|
|
1555
|
+
unit?: 'radians' | 'degrees';
|
|
1556
|
+
};
|
|
1557
|
+
calloutProps?: Partial<ICalloutProps_2>;
|
|
1558
|
+
chartTitle?: string;
|
|
1559
|
+
componentRef?: React_2.Ref<IChart>;
|
|
1560
|
+
culture?: string;
|
|
1561
|
+
// Warning: (ae-forgotten-export) The symbol "IAreaPolarSeries" needs to be exported by the entry point index.d.ts
|
|
1562
|
+
// Warning: (ae-forgotten-export) The symbol "ILinePolarSeries" needs to be exported by the entry point index.d.ts
|
|
1563
|
+
// Warning: (ae-forgotten-export) The symbol "IScatterPolarSeries" needs to be exported by the entry point index.d.ts
|
|
1564
|
+
data: (IAreaPolarSeries | ILinePolarSeries | IScatterPolarSeries)[];
|
|
1565
|
+
dateLocalizeOptions?: Intl.DateTimeFormatOptions;
|
|
1566
|
+
direction?: 'clockwise' | 'counterclockwise';
|
|
1567
|
+
height?: number;
|
|
1568
|
+
hideLegend?: boolean;
|
|
1569
|
+
hideTooltip?: boolean;
|
|
1570
|
+
hole?: number;
|
|
1571
|
+
// (undocumented)
|
|
1572
|
+
legendProps?: Partial<ILegendsProps>;
|
|
1573
|
+
margins?: IMargins;
|
|
1574
|
+
radialAxis?: PolarAxisProps;
|
|
1575
|
+
shape?: 'circle' | 'polygon';
|
|
1576
|
+
styles?: IStyleFunctionOrObject_2<IPolarChartStyleProps, IPolarChartStyles>;
|
|
1577
|
+
theme?: ITheme_2;
|
|
1578
|
+
useUTC?: boolean;
|
|
1579
|
+
width?: number;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
// @public
|
|
1583
|
+
export interface IPolarChartStyleProps {
|
|
1584
|
+
theme: ITheme_2;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
// @public
|
|
1588
|
+
export interface IPolarChartStyles {
|
|
1589
|
+
chart?: IStyle_2;
|
|
1590
|
+
chartWrapper?: IStyle_2;
|
|
1591
|
+
gridLineInner?: IStyle_2;
|
|
1592
|
+
gridLineOuter?: IStyle_2;
|
|
1593
|
+
legendContainer?: IStyle_2;
|
|
1594
|
+
root?: IStyle_2;
|
|
1595
|
+
tickLabel?: IStyle_2;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1532
1598
|
// @public (undocumented)
|
|
1533
1599
|
export interface IRefArrayData {
|
|
1534
1600
|
// (undocumented)
|
|
@@ -1588,12 +1654,14 @@ export interface ISankeyChartProps {
|
|
|
1588
1654
|
enableReflow?: boolean;
|
|
1589
1655
|
formatNumberOptions?: Intl.NumberFormatOptions;
|
|
1590
1656
|
height?: number;
|
|
1657
|
+
hideLegend?: boolean;
|
|
1591
1658
|
parentRef?: HTMLElement | null;
|
|
1592
1659
|
pathColor?: string;
|
|
1593
1660
|
shouldResize?: number;
|
|
1594
1661
|
strings?: ISankeyChartStrings;
|
|
1595
1662
|
styles?: IStyleFunctionOrObject<ISankeyChartStyleProps, ISankeyChartStyles>;
|
|
1596
1663
|
theme?: ITheme;
|
|
1664
|
+
titleStyles?: ITitleStyles;
|
|
1597
1665
|
width?: number;
|
|
1598
1666
|
}
|
|
1599
1667
|
|
|
@@ -1622,11 +1690,13 @@ export interface ISankeyChartStyleProps {
|
|
|
1622
1690
|
export interface ISankeyChartStyles {
|
|
1623
1691
|
calloutContentRoot?: IStyle;
|
|
1624
1692
|
chart?: IStyle;
|
|
1693
|
+
chartTitle?: IStyle;
|
|
1625
1694
|
chartWrapper?: IStyle;
|
|
1626
1695
|
links?: IStyle;
|
|
1627
1696
|
nodes?: IStyle;
|
|
1628
1697
|
nodeTextContainer?: IStyle;
|
|
1629
1698
|
root?: IStyle;
|
|
1699
|
+
svgTooltip?: IStyle;
|
|
1630
1700
|
toolTip?: IStyle;
|
|
1631
1701
|
}
|
|
1632
1702
|
|
|
@@ -2028,6 +2098,20 @@ export enum NodesComposition {
|
|
|
2028
2098
|
// @public
|
|
2029
2099
|
export const PieChart: React_2.FunctionComponent<IPieChartProps>;
|
|
2030
2100
|
|
|
2101
|
+
// @public
|
|
2102
|
+
export type PolarAxisProps = AxisProps & {
|
|
2103
|
+
tickValues?: number[] | Date[] | string[];
|
|
2104
|
+
tickFormat?: string;
|
|
2105
|
+
tickCount?: number;
|
|
2106
|
+
categoryOrder?: AxisCategoryOrder;
|
|
2107
|
+
scaleType?: AxisScaleType;
|
|
2108
|
+
rangeStart?: number | Date;
|
|
2109
|
+
rangeEnd?: number | Date;
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
// @public
|
|
2113
|
+
export const PolarChart: React_2.FunctionComponent<IPolarChartProps>;
|
|
2114
|
+
|
|
2031
2115
|
// @public
|
|
2032
2116
|
export const ResponsiveContainer: React_2.FC<IResponsiveContainerProps>;
|
|
2033
2117
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/PolarChart/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolarChart.js","sourceRoot":"../src/","sources":["PolarChart.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/PolarChart/index';\n"]}
|
|
@@ -152,7 +152,7 @@ export var AnnotationOnlyChart = function (props) {
|
|
|
152
152
|
React.createElement("foreignObject", { x: 0, y: 0, width: resolvedWidth, height: svgHeight },
|
|
153
153
|
React.createElement("div", { ref: contentRef, className: rootClassName, "data-chart-annotation-only": "true", "aria-label": ariaLabel },
|
|
154
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))))));
|
|
155
|
+
React.createElement("div", { className: contentClassName, role: "presentation" }, hasAnnotations ? (React.createElement(ChartAnnotationLayer, { annotations: resolvedAnnotations, context: context, theme: theme, hideDefaultStyles: true })) : null))))));
|
|
156
156
|
};
|
|
157
157
|
AnnotationOnlyChart.displayName = 'AnnotationOnlyChart';
|
|
158
158
|
//# sourceMappingURL=AnnotationOnlyChart.js.map
|
|
@@ -1 +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,MAA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AE,aAAa,gCAA6B,MAAM,gBAAa,SAAS;oBACpG,UAAU,IAAI,CACb,8BAAM,SAAS,EAAE,cAAc,iBAAc,MAAM,IAChD,UAAU,CACN,CACR;oBACD,6BAAK,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAC,cAAc,IAClD,cAAc,CAAC,CAAC,CAAC,CAChB,oBAAC,oBAAoB,IAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAI,CAC3F,CAAC,CAAC,CAAC,IAAI,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"]}
|
|
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,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,EAAE,SAAS,EAAE,aAAa,gCAA6B,MAAM,gBAAa,SAAS;oBACpG,UAAU,IAAI,CACb,8BAAM,SAAS,EAAE,cAAc,iBAAc,MAAM,IAChD,UAAU,CACN,CACR;oBACD,6BAAK,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAC,cAAc,IAClD,cAAc,CAAC,CAAC,CAAC,CAChB,oBAAC,oBAAoB,IACnB,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,IAAI,GACvB,CACH,CAAC,CAAC,CAAC,IAAI,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\n annotations={resolvedAnnotations}\n context={context}\n theme={theme}\n hideDefaultStyles={true}\n />\n ) : null}\n </div>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n};\n\nAnnotationOnlyChart.displayName = 'AnnotationOnlyChart';\n"]}
|
|
@@ -54,7 +54,6 @@ export declare class AreaChartBase extends React.Component<IAreaChartProps, IAre
|
|
|
54
54
|
private _rectId;
|
|
55
55
|
private _xAxisRectScale;
|
|
56
56
|
private _isMultiStackChart;
|
|
57
|
-
private _tooltipId;
|
|
58
57
|
private _highlightedCircleId;
|
|
59
58
|
private _enableComputationOptimization;
|
|
60
59
|
private _firstRenderOptimization;
|
|
@@ -2,17 +2,15 @@ import { __assign, __extends } from "tslib";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { max as d3Max, bisector } from 'd3-array';
|
|
4
4
|
import { pointer } from 'd3-selection';
|
|
5
|
-
import { select as d3Select } from 'd3-selection';
|
|
6
5
|
import { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';
|
|
7
|
-
import {
|
|
6
|
+
import { getId, getRTL, initializeComponentRef, memoizeFunction } from '@fluentui/react/lib/Utilities';
|
|
8
7
|
import { CartesianChart, } from '../../index';
|
|
9
8
|
import { warnDeprecations } from '@fluentui/react/lib/Utilities';
|
|
10
9
|
import { formatDateToLocaleString } from '@fluentui/chart-utilities';
|
|
11
|
-
import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis,
|
|
10
|
+
import { calloutData, getXAxisType, ChartTypes, XAxisTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfNumericForAreaLineScatterCharts, domainRangeOfDateForAreaLineScatterVerticalBarCharts, createStringYAxis, getSecureProps, areArraysEqual, getCurveFactory, findCalloutPoints, } from '../../utilities/index';
|
|
12
11
|
import { Legends } from '../Legends/index';
|
|
13
12
|
import { DirectionalHint } from '@fluentui/react/lib/Callout';
|
|
14
13
|
import { exportChartsAsImage } from '../../utilities/image-export-utils';
|
|
15
|
-
var getClassNames = classNamesFunction();
|
|
16
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
15
|
var bisect = bisector(function (d) { return d.x; }).left;
|
|
18
16
|
var COMPONENT_NAME = 'AREA CHART';
|
|
@@ -536,32 +534,6 @@ var AreaChartBase = /** @class */ (function (_super) {
|
|
|
536
534
|
}
|
|
537
535
|
});
|
|
538
536
|
graph.push(React.createElement("line", __assign({ id: _this._verticalLineId, key: _this._verticalLineId, x1: _this.state.lineXValue, y1: 0, x2: _this.state.lineXValue, y2: containerHeight, strokeWidth: 1, strokeDasharray: 5.5, stroke: lineColor, opacity: 0.5, visibility: _this.state.displayOfLine }, getSecureProps(pointLineOptions))));
|
|
539
|
-
var classNames = getClassNames(_this.props.styles, {
|
|
540
|
-
theme: _this.props.theme,
|
|
541
|
-
});
|
|
542
|
-
// Removing un wanted tooltip div from DOM, when prop not provided.
|
|
543
|
-
if (!_this.props.showXAxisLablesTooltip) {
|
|
544
|
-
try {
|
|
545
|
-
document.getElementById(_this._tooltipId) && document.getElementById(_this._tooltipId).remove();
|
|
546
|
-
// eslint-disable-next-line no-empty
|
|
547
|
-
}
|
|
548
|
-
catch (e) { }
|
|
549
|
-
}
|
|
550
|
-
// Used to display tooltip at x axis labels.
|
|
551
|
-
if (!_this.props.wrapXAxisLables && _this.props.showXAxisLablesTooltip) {
|
|
552
|
-
var xAxisElement = d3Select(xElement).call(xScale);
|
|
553
|
-
try {
|
|
554
|
-
document.getElementById(_this._tooltipId) && document.getElementById(_this._tooltipId).remove();
|
|
555
|
-
// eslint-disable-next-line no-empty
|
|
556
|
-
}
|
|
557
|
-
catch (e) { }
|
|
558
|
-
var tooltipProps = {
|
|
559
|
-
tooltipCls: classNames.tooltip,
|
|
560
|
-
id: _this._tooltipId,
|
|
561
|
-
axis: xAxisElement,
|
|
562
|
-
};
|
|
563
|
-
xAxisElement && tooltipOfAxislabels(tooltipProps);
|
|
564
|
-
}
|
|
565
537
|
return graph;
|
|
566
538
|
};
|
|
567
539
|
_this._getOnClickHandler = function (points, index, pointIndex) {
|
|
@@ -718,7 +690,6 @@ var AreaChartBase = /** @class */ (function (_super) {
|
|
|
718
690
|
_this._verticalLineId = getId('verticalLine_');
|
|
719
691
|
_this._circleId = getId('circle');
|
|
720
692
|
_this._rectId = getId('rectangle');
|
|
721
|
-
_this._tooltipId = getId('AreaChartTooltipID');
|
|
722
693
|
_this._enableComputationOptimization = true;
|
|
723
694
|
_this._firstRenderOptimization = true;
|
|
724
695
|
_this._emptyChartId = getId('_AreaChart_empty');
|