@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.types.js","sourceRoot":"../src/","sources":["components/CommonComponents/CartesianChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IRefObject, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { ILegendsProps } from '../Legends/index';\nimport {\n AxisCategoryOrder,\n AxisProps,\n AxisScaleType,\n IAccessibilityProps,\n IChart,\n IChartAnnotation,\n IDataPoint,\n IGanttChartDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n ILineChartPoints,\n IMargins,\n IScatterChartPoints,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n} from '../../types/index';\nimport { IChartHoverCardProps } from '../../utilities/index';\nimport { TimeLocaleDefinition } from 'd3-time-format';\nimport { ChartTypes, IAxisData, IDomainNRange, IYAxisParams, XAxisTypes, YAxisType } from '../../utilities/utilities';\nimport { ScaleBand, ScaleLinear } from 'd3-scale';\nimport type { JSXElement } from '@fluentui/utilities';\n\n/**\n * Cartesian Chart style properties\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Color of the chart.\n */\n color?: string;\n\n /**\n * Link to redirect if click action for graph\n */\n href?: string;\n\n /**\n * prop to check if the chart is selected or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check if the Page is in Rtl\n */\n isRtl?: boolean;\n\n /**\n * color of the line\n */\n lineColor?: string;\n\n /**\n * boolean flag which determines if shape is drawn in callout\n */\n toDrawShape?: boolean;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n */\n enableReflow?: boolean;\n}\n\n/**\n * Cartesian Chart styles\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the element containing the x-axis.\n */\n xAxis?: IStyle;\n\n /**\n * Style for the element containing the y-axis.\n */\n yAxis?: IStyle;\n\n /**\n * Style for legend container\n */\n legendContainer?: IStyle;\n\n /**\n * line hover box css\n */\n hover?: IStyle;\n\n /**\n * styles for callout root-content\n */\n calloutContentRoot?: IStyle;\n\n /**\n * styles for callout x-content\n */\n calloutContentX?: IStyle;\n\n /**\n * styles for callout y-content\n */\n calloutContentY?: IStyle;\n\n /**\n * styles for description message\n */\n descriptionMessage?: IStyle;\n\n /**\n * styles for callout Date time container\n */\n calloutDateTimeContainer?: IStyle;\n\n /**\n * styles for callout info container\n */\n calloutInfoContainer?: IStyle;\n\n /**\n * styles for callout block container\n */\n calloutBlockContainer?: IStyle;\n\n /**\n * styles for callout legend text\n */\n calloutlegendText?: IStyle;\n\n /**\n * styles for tooltip\n */\n tooltip?: IStyle;\n\n /**\n * styles for axis title\n */\n axisTitle?: IStyle;\n\n /**\n * styles for axis annotation\n */\n axisAnnotation?: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle?: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover?: IStyle;\n\n /**\n * styles for the shape object in the callout\n */\n shapeStyles?: IStyle;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: IStyle;\n\n /**\n * Styles for the element wrapping the svg and overlays for annotation\n */\n plotContainer?: IStyle;\n\n /**\n * Styles for the svg tooltip\n */\n svgTooltip?: IStyle;\n\n /**\n * Styles applied to the annotation layer root element\n */\n annotationLayer?: IStyle;\n\n /**\n * Styles for the chart svg element\n */\n chart?: IStyle;\n}\n\n/**\n * Cartesian Chart properties\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartProps {\n /**\n * Below height used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n height?: number;\n\n /**\n * Below width used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n width?: number;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Margins for the chart\n * @default `{ top: 20, bottom: 35, left: 40, right: 20 }`\n * To avoid edge cuttings to the chart, we recommend you use default values or greater then default values\n */\n margins?: IMargins;\n\n /** decides wether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show tooltips in chart\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * this prop takes values that you want the chart to render on x-axis\n * This is a optional parameter if not specified D3 will decide which values appear on the x-axis for you\n * Please look at https://github.com/d3/d3-scale for more information on how D3 decides what data to appear on the axis of chart\n */\n tickValues?: number[] | Date[] | string[];\n\n /**\n * the format for the data on x-axis. For date object this can be specified to your requirement. Eg: '%m/%d', '%d'\n * Please look at https://github.com/d3/d3-time-format for all the formats supported for date axis\n * Only applicable for date axis. For y-axis format use yAxisTickFormat prop.\n */\n tickFormat?: string;\n\n /**\n * Width of line stroke\n */\n strokeWidth?: number;\n\n /**\n * x Axis labels tick padding. This defines the gap between tick labels and tick lines.\n * @default 10\n */\n xAxisTickPadding?: number;\n\n /**\n * the format in for the data on y-axis. For data object this can be specified to your requirement.\n * Eg: d3.format(\".0%\")(0.123),d3.format(\"+20\")(42);\n * Please look at https://github.com/d3/d3-format for all the formats supported\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxisTickFormat?: any;\n\n /**\n * Secondary y-scale options\n * By default this is not defined, meaning there will be no secondary y-scale.\n */\n secondaryYScaleOptions?: {\n /** Minimum value (0 by default) */\n yMinValue?: number;\n /** Maximum value (100 by default) */\n yMaxValue?: number;\n };\n\n /**\n * minimum data value point in y-axis\n */\n yMinValue?: number;\n\n /**\n * maximum data value point in y-axis\n */\n yMaxValue?: number;\n\n /**\n * minimum data value point in x-axis (for numeric x-axis)\n */\n xMinValue?: number;\n\n /**\n * maximum data value point in x-axis\n */\n xMaxValue?: number;\n\n /**\n * Number of ticks on the y-axis.\n * Tick count should be factor of difference between (yMinValue, yMaxValue)?\n * @default 4\n */\n yAxisTickCount?: number;\n\n /**\n * defines the number of ticks on the x-axis. Tries to match the nearest interval satisfying the count.\n * Does not work for string axis.\n * @default 6\n */\n xAxisTickCount?: number;\n\n /**\n * define the size of the tick lines on the x-axis\n * @default 10\n */\n xAxistickSize?: number;\n\n /**\n * Text annotations rendered on top of the chart area\n */\n annotations?: IChartAnnotation[];\n\n /**\n * defines the space between the tick line and the data label\n * @default 10\n */\n tickPadding?: number;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * Label to apply to the whole chart.\n * @deprecated - Use your chart label for the chart.\n */\n chartLabel?: string;\n\n /**\n * overflow props for the legends\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n *@default false\n *Used for to elipse x axis labes and show tooltip on x axis labels\n */\n showXAxisLablesTooltip?: boolean;\n\n /**\n * @default 4\n * Used for X axis labels\n * While Giving showXAxisLablesTooltip prop, need to define after how many chars, we need to truncate the word.\n */\n noOfCharsToTruncate?: number;\n\n /**\n * @default false\n * Used to wrap x axis labels values (whole value)\n */\n wrapXAxisLables?: boolean;\n\n /**\n * @default false\n * Used to rotate x axis labels by 45 degrees\n */\n rotateXAxisLables?: boolean;\n\n /**\n * The prop used to define the date time localization options\n */\n dateLocalizeOptions?: Intl.DateTimeFormatOptions;\n\n /**\n * The prop used to define a custom locale for the date time format.\n */\n timeFormatLocale?: TimeLocaleDefinition;\n\n /**\n * The prop used to define a custom datetime formatter for date axis.\n */\n customDateTimeFormatter?: (dateTime: Date) => string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ICartesianChartStyleProps, ICartesianChartStyles>;\n\n /**\n * Callout customization props\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * props for the svg; use this to include aria-* or other attributes on the tag\n */\n svgProps?: React.SVGProps<SVGSVGElement>;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n * @default True for LineChart but False for other charts\n */\n enableReflow?: boolean;\n\n /**\n * Prop to set the x axis title\n * @default undefined\n * Minimum bottom margin required for x axis title is 55px\n */\n\n xAxisTitle?: string;\n\n /**\n * Prop to set the y axis title\n * @default undefined\n * Minimum left margin required for y axis title is 60px and for RTL is 40px\n * Minimum right margin required for y axis title is 40px and for RTL is 60px\n */\n yAxisTitle?: string;\n\n /**\n * Prop to set the secondary y axis title\n * @default undefined\n * If RTL is enabled, minimum left and right margins required for secondary y axis title is 60px\n */\n secondaryYAxistitle?: string;\n\n /**\n * Whether to use UTC time for axis scale, ticks, and the time display in callouts.\n * When set to `true`, time is displayed equally, regardless of the user's timezone settings.\n * @default true\n */\n useUTC?: boolean;\n\n /**\n * @default false\n * Used for enabling negative values in Y axis.\n */\n supportNegativeData?: boolean;\n\n /**\n * @default false\n * The prop used to decide rounded ticks on y axis\n */\n roundedTicks?: boolean;\n\n /**\n * Optional callback to access the IChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IChart>;\n\n /**\n * Determines whether overlapping x-axis tick labels should be hidden.\n * @default false\n */\n hideTickOverlap?: boolean;\n\n /**\n * Prop to set the x axis annotation. Used to display additional information on the x-axis.\n * This is shown on the top of the chart.\n * @default undefined\n */\n xAxisAnnotation?: string;\n\n /**\n * Prop to set the y axis annotation. Used to display additional information on the y-axis.\n * This is shown on the right side of the chart. Not shown if secondary y-axis is enabled.\n * @default undefined\n */\n yAxisAnnotation?: string;\n\n /**\n * Specifies the ordering logic for categories (or string tick labels) on the x-axis.\n * @default 'default'\n */\n xAxisCategoryOrder?: AxisCategoryOrder;\n\n /**\n * Specifies the ordering logic for categories (or string tick labels) on the y-axis.\n * @default 'default'\n */\n yAxisCategoryOrder?: AxisCategoryOrder;\n\n /**\n * Defines the scale type for the x-axis.\n * @default 'default'\n */\n xScaleType?: AxisScaleType;\n\n /**\n * Defines the scale type for the primary y-axis.\n * @default 'default'\n */\n yScaleType?: AxisScaleType;\n\n /**\n * Defines the scale type for the secondary y-axis.\n * @default 'default'\n */\n secondaryYScaleType?: AxisScaleType;\n\n /**\n * Explicit set of tick values for the y-axis.\n * If provided, these values override automatic tick generation.\n */\n yAxisTickValues?: number[] | Date[] | string[];\n\n /**\n * Configuration for the x-axis.\n * Use this to control `tickStep`, `tick0`, etc.\n */\n xAxis?: AxisProps;\n\n /**\n * Configuration for the y-axis.\n * Use this to control `tickStep`, `tick0`, etc.\n */\n yAxis?: AxisProps;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n}\n\nexport interface IYValueHover {\n legend?: string;\n y?: number | string;\n color?: string;\n data?: string | number;\n shouldDrawBorderBottom?: boolean;\n yAxisCalloutData?: string | { [id: string]: number };\n index?: number;\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IChildProps {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScaleSecondary?: any;\n containerHeight?: number;\n containerWidth?: number;\n}\n\n// Only used for Cartesian chart base\nexport interface IModifiedCartesianChartProps extends ICartesianChartProps {\n /**\n * Define the chart title\n */\n chartTitle?: string;\n\n /**\n * Only used for Area chart\n * Value used to draw y axis of that chart.\n */\n maxOfYVal?: number;\n\n /**\n * Data of the chart\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any;\n\n /**\n * Define type of the chart\n */\n chartType: ChartTypes;\n\n /** X axis type */\n xAxisType: XAxisTypes;\n\n /** Y axis type */\n yAxisType?: YAxisType;\n\n /**\n * Legends of the chart.\n */\n\n legendBars: JSXElement | null;\n\n /**\n * Callout props\n */\n calloutProps: Partial<ICalloutProps> & {\n isCalloutVisible: boolean;\n id: string;\n YValueHover?: IYValueHover[];\n hoverXValue?: string | number | null;\n legend?: string;\n color?: string;\n YValue?: string | number;\n XValue?: string;\n descriptionMessage?: string;\n };\n\n /**\n * Callback method used for to get margins to the chart.\n */\n getmargins?: (margins: IMargins) => void;\n\n /**\n * This is a call back method to the chart from cartesian chart.\n * params are xScale, yScale, containerHeight, containerWidth. These values were used to draw the graph.\n * It also contians an optional param xAxisElement - defines as x axis scale element.\n * This param used to enable feature word wrap of Xaxis.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getGraphData?: any;\n\n /**\n * Used for bar chart graphs.\n * To define width of the bar\n */\n barwidth?: number;\n\n /**\n * Used for tick styles of the x axis of the chart\n * Tick params are applicable for date axis only.\n */\n tickParams?: {\n tickValues?: number[] | Date[] | string[];\n tickFormat?: string;\n };\n\n /**\n * it's padding between bar's or lines in the graph\n */\n xAxisPadding?: number;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n * Children elements specific to derived chart types.\n */\n children(props: IChildProps): React.ReactNode;\n\n /**\n * To enable callout for individualbar or complete stack. Using for only Vertical stacked bar chart.\n * @default false\n * @type \\{boolean \\}\n */\n isCalloutForStack?: boolean;\n\n /** dataset values to find out domain of the String axis\n * Present using for only vertical stacked bar chart and grouped vertical bar chart\n */\n datasetForXAxisDomain?: string[];\n\n /** Own callout design */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n customizedCallout?: any;\n\n /**\n * if the data points for the y-axis is of type string, then we need to give this\n * prop to construct the y-axis\n */\n stringDatasetForYAxisDomain?: string[];\n\n /**\n * Focus zone direction to the chart\n * @default FocusZoneDirection.horizontal\n */\n focusZoneDirection?: FocusZoneDirection;\n\n /**\n * props to send into the chart hover card\n */\n chartHoverProps?: IChartHoverCardProps;\n\n /**\n * props to send to the focuszone\n */\n svgFocusZoneProps?: IFocusZoneProps;\n\n /**\n * Annotations to render on top of the chart area.\n */\n annotations?: IChartAnnotation[];\n\n /**\n * The prop used to define the culture to localize the numbers and date\n */\n culture?: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getAxisData?: any;\n\n /**\n * Callback method used when mouse leaves the chart boundary.\n */\n onChartMouseLeave?: () => void;\n\n /** Callback method to get extra margins for domain */\n getDomainMargins?: (containerWidth: number) => IMargins;\n\n /** Callback method to get extra margins for Y-axis domain */\n getYDomainMargins?: (containerHeight: number) => IMargins;\n\n /** Padding between each bar/line-point */\n xAxisInnerPadding?: number;\n\n /** Padding before first bar/line-point and after last bar/line-point */\n xAxisOuterPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * Used to control the first render cycle Performance optimization code.\n */\n enableFirstRenderOptimization?: boolean;\n\n /**\n * Get the min and max values of the y-axis\n */\n getMinMaxOfYAxis: (\n points:\n | ILineChartPoints[]\n | IHorizontalBarChartWithAxisDataPoint[]\n | IVerticalBarChartDataPoint[]\n | IDataPoint[]\n | IScatterChartPoints[]\n | IGanttChartDataPoint[],\n yAxisType: YAxisType | undefined,\n useSecondaryYScale?: boolean,\n ) => { startValue: number; endValue: number };\n\n /**\n * Create the y-axis\n */\n createYAxis: (\n yAxisParams: IYAxisParams,\n isRtl: boolean,\n axisData: IAxisData,\n isIntegralDataset: boolean,\n useSecondaryYScale?: boolean,\n supportNegativeData?: boolean,\n roundedTicks?: boolean,\n scaleType?: AxisScaleType,\n ) => ScaleLinear<number, number, never>;\n\n /**\n * Get the domain and range values\n */\n getDomainNRangeValues: (\n points:\n | ILineChartPoints[]\n | IVerticalBarChartDataPoint[]\n | IVerticalStackedBarDataPoint[]\n | IHorizontalBarChartWithAxisDataPoint[]\n | IGroupedVerticalBarChartData[]\n | IHeatMapChartDataPoint[]\n | IGanttChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | string[] | undefined,\n ) => IDomainNRange;\n\n /**\n * Create the string y-axis\n */\n createStringYAxis: (\n yAxisParams: IYAxisParams,\n dataPoints: string[],\n isRtl: boolean,\n axisData: IAxisData,\n barWidth: number | undefined,\n chartType?: ChartTypes,\n ) => ScaleBand<string>;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n ref?: IRefObject<IChart>;\n\n /**\n * Controls whether the numeric x-axis domain should be extended to start and end at nice rounded values.\n * @default true\n */\n showRoundOffXTickValues?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CartesianChart.types.js","sourceRoot":"../src/","sources":["components/CommonComponents/CartesianChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IRefObject, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { ILegendsProps } from '../Legends/index';\nimport { ITitleStyles } from '../../utilities/Common.styles';\nimport {\n AxisCategoryOrder,\n AxisProps,\n AxisScaleType,\n IAccessibilityProps,\n IChart,\n IChartAnnotation,\n IDataPoint,\n IGanttChartDataPoint,\n IGroupedVerticalBarChartData,\n IHeatMapChartDataPoint,\n IHorizontalBarChartWithAxisDataPoint,\n ILineChartPoints,\n IMargins,\n IScatterChartPoints,\n IVerticalBarChartDataPoint,\n IVerticalStackedBarDataPoint,\n} from '../../types/index';\nimport { IChartHoverCardProps } from '../../utilities/index';\nimport { TimeLocaleDefinition } from 'd3-time-format';\nimport { ChartTypes, IAxisData, IDomainNRange, IYAxisParams, XAxisTypes, YAxisType } from '../../utilities/utilities';\nimport { ScaleBand, ScaleLinear } from 'd3-scale';\nimport type { JSXElement } from '@fluentui/utilities';\n\n/**\n * Cartesian Chart style properties\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of the chart.\n */\n height?: number;\n\n /**\n * Color of the chart.\n */\n color?: string;\n\n /**\n * Link to redirect if click action for graph\n */\n href?: string;\n\n /**\n * prop to check if the chart is selected or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check if the Page is in Rtl\n */\n isRtl?: boolean;\n\n /**\n * color of the line\n */\n lineColor?: string;\n\n /**\n * boolean flag which determines if shape is drawn in callout\n */\n toDrawShape?: boolean;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n */\n enableReflow?: boolean;\n}\n\n/**\n * Cartesian Chart styles\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartStyles {\n /**\n * Style for the root element.\n */\n root?: IStyle;\n\n /**\n * Style for the element containing the x-axis.\n */\n xAxis?: IStyle;\n\n /**\n * Style for the element containing the y-axis.\n */\n yAxis?: IStyle;\n\n /**\n * Style for legend container\n */\n legendContainer?: IStyle;\n\n /**\n * line hover box css\n */\n hover?: IStyle;\n\n /**\n * styles for callout root-content\n */\n calloutContentRoot?: IStyle;\n\n /**\n * styles for callout x-content\n */\n calloutContentX?: IStyle;\n\n /**\n * styles for callout y-content\n */\n calloutContentY?: IStyle;\n\n /**\n * styles for description message\n */\n descriptionMessage?: IStyle;\n\n /**\n * styles for callout Date time container\n */\n calloutDateTimeContainer?: IStyle;\n\n /**\n * styles for callout info container\n */\n calloutInfoContainer?: IStyle;\n\n /**\n * styles for callout block container\n */\n calloutBlockContainer?: IStyle;\n\n /**\n * styles for callout legend text\n */\n calloutlegendText?: IStyle;\n\n /**\n * styles for tooltip\n */\n tooltip?: IStyle;\n\n /**\n * styles for axis title\n */\n axisTitle?: IStyle;\n\n /**\n * styles for axis annotation\n */\n axisAnnotation?: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle?: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover?: IStyle;\n\n /**\n * styles for the shape object in the callout\n */\n shapeStyles?: IStyle;\n\n /**\n * Styles for the chart wrapper div\n */\n chartWrapper?: IStyle;\n\n /**\n * Styles for the element wrapping the svg and overlays for annotation\n */\n plotContainer?: IStyle;\n\n /**\n * Styles for the svg tooltip\n */\n svgTooltip?: IStyle;\n\n /**\n * Styles applied to the annotation layer root element\n */\n annotationLayer?: IStyle;\n\n /**\n * Styles for the chart svg element\n */\n chart?: IStyle;\n}\n\n/**\n * Cartesian Chart properties\n * {@docCategory CartesianChart}\n */\nexport interface ICartesianChartProps {\n /**\n * Title styles configuration for the chart title\n */\n titleStyles?: ITitleStyles;\n\n /**\n * Below height used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n height?: number;\n\n /**\n * Below width used for resizing of the chart\n * Wrap chart in your container and send the updated height and width to these props.\n * These values decide wheather chart re render or not. Please check examples for reference\n */\n width?: number;\n\n /**\n * this prop takes its parent as a HTML element to define the width and height of the chart\n */\n parentRef?: HTMLElement | null;\n\n /**\n * Additional CSS class(es) to apply to the Chart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Margins for the chart\n * @default `{ top: 20, bottom: 35, left: 40, right: 20 }`\n * To avoid edge cuttings to the chart, we recommend you use default values or greater then default values\n */\n margins?: IMargins;\n\n /** decides wether to show/hide legends\n * @defaultvalue false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show tooltips in chart\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * this prop takes values that you want the chart to render on x-axis\n * This is a optional parameter if not specified D3 will decide which values appear on the x-axis for you\n * Please look at https://github.com/d3/d3-scale for more information on how D3 decides what data to appear on the axis of chart\n */\n tickValues?: number[] | Date[] | string[];\n\n /**\n * the format for the data on x-axis. For date object this can be specified to your requirement. Eg: '%m/%d', '%d'\n * Please look at https://github.com/d3/d3-time-format for all the formats supported for date axis\n * Only applicable for date axis. For y-axis format use yAxisTickFormat prop.\n */\n tickFormat?: string;\n\n /**\n * Width of line stroke\n */\n strokeWidth?: number;\n\n /**\n * x Axis labels tick padding. This defines the gap between tick labels and tick lines.\n * @default 10\n */\n xAxisTickPadding?: number;\n\n /**\n * the format in for the data on y-axis. For data object this can be specified to your requirement.\n * Eg: d3.format(\".0%\")(0.123),d3.format(\"+20\")(42);\n * Please look at https://github.com/d3/d3-format for all the formats supported\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yAxisTickFormat?: any;\n\n /**\n * Secondary y-scale options\n * By default this is not defined, meaning there will be no secondary y-scale.\n */\n secondaryYScaleOptions?: {\n /** Minimum value (0 by default) */\n yMinValue?: number;\n /** Maximum value (100 by default) */\n yMaxValue?: number;\n };\n\n /**\n * minimum data value point in y-axis\n */\n yMinValue?: number;\n\n /**\n * maximum data value point in y-axis\n */\n yMaxValue?: number;\n\n /**\n * minimum data value point in x-axis (for numeric x-axis)\n */\n xMinValue?: number;\n\n /**\n * maximum data value point in x-axis\n */\n xMaxValue?: number;\n\n /**\n * Number of ticks on the y-axis.\n * Tick count should be factor of difference between (yMinValue, yMaxValue)?\n * @default 4\n */\n yAxisTickCount?: number;\n\n /**\n * defines the number of ticks on the x-axis. Tries to match the nearest interval satisfying the count.\n * Does not work for string axis.\n * @default 6\n */\n xAxisTickCount?: number;\n\n /**\n * define the size of the tick lines on the x-axis\n * @default 10\n */\n xAxistickSize?: number;\n\n /**\n * Text annotations rendered on top of the chart area\n */\n annotations?: IChartAnnotation[];\n\n /**\n * defines the space between the tick line and the data label\n * @default 10\n */\n tickPadding?: number;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * Label to apply to the whole chart.\n * @deprecated - Use your chart label for the chart.\n */\n chartLabel?: string;\n\n /**\n * overflow props for the legends\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n legendsOverflowText?: any;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /*\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n *@default false\n *Used for to elipse x axis labes and show tooltip on x axis labels\n */\n showXAxisLablesTooltip?: boolean;\n\n /**\n * @default 4\n * Used for X axis labels\n * While Giving showXAxisLablesTooltip prop, need to define after how many chars, we need to truncate the word.\n */\n noOfCharsToTruncate?: number;\n\n /**\n * @default false\n * Used to wrap x axis labels values (whole value)\n */\n wrapXAxisLables?: boolean;\n\n /**\n * @default false\n * Used to rotate x axis labels by 45 degrees\n */\n rotateXAxisLables?: boolean;\n\n /**\n * The prop used to define the date time localization options\n */\n dateLocalizeOptions?: Intl.DateTimeFormatOptions;\n\n /**\n * The prop used to define a custom locale for the date time format.\n */\n timeFormatLocale?: TimeLocaleDefinition;\n\n /**\n * The prop used to define a custom datetime formatter for date axis.\n */\n customDateTimeFormatter?: (dateTime: Date) => string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ICartesianChartStyleProps, ICartesianChartStyles>;\n\n /**\n * Callout customization props\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * props for the svg; use this to include aria-* or other attributes on the tag\n */\n svgProps?: React.SVGProps<SVGSVGElement>;\n\n /**\n * Prop to disable shrinking of the chart beyond a certain limit and enable scrolling when the chart overflows\n * @default True for LineChart but False for other charts\n */\n enableReflow?: boolean;\n\n /**\n * Prop to set the x axis title\n * @default undefined\n * Minimum bottom margin required for x axis title is 55px\n */\n\n xAxisTitle?: string;\n\n /**\n * Prop to set the y axis title\n * @default undefined\n * Minimum left margin required for y axis title is 60px and for RTL is 40px\n * Minimum right margin required for y axis title is 40px and for RTL is 60px\n */\n yAxisTitle?: string;\n\n /**\n * Prop to set the secondary y axis title\n * @default undefined\n * If RTL is enabled, minimum left and right margins required for secondary y axis title is 60px\n */\n secondaryYAxistitle?: string;\n\n /**\n * Whether to use UTC time for axis scale, ticks, and the time display in callouts.\n * When set to `true`, time is displayed equally, regardless of the user's timezone settings.\n * @default true\n */\n useUTC?: boolean;\n\n /**\n * @default false\n * Used for enabling negative values in Y axis.\n */\n supportNegativeData?: boolean;\n\n /**\n * @default false\n * The prop used to decide rounded ticks on y axis\n */\n roundedTicks?: boolean;\n\n /**\n * Optional callback to access the IChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IChart>;\n\n /**\n * Determines whether overlapping x-axis tick labels should be hidden.\n * @default false\n */\n hideTickOverlap?: boolean;\n\n /**\n * Prop to set the x axis annotation. Used to display additional information on the x-axis.\n * This is shown on the top of the chart.\n * @default undefined\n */\n xAxisAnnotation?: string;\n\n /**\n * Prop to set the y axis annotation. Used to display additional information on the y-axis.\n * This is shown on the right side of the chart. Not shown if secondary y-axis is enabled.\n * @default undefined\n */\n yAxisAnnotation?: string;\n\n /**\n * Specifies the ordering logic for categories (or string tick labels) on the x-axis.\n * @default 'default'\n */\n xAxisCategoryOrder?: AxisCategoryOrder;\n\n /**\n * Specifies the ordering logic for categories (or string tick labels) on the y-axis.\n * @default 'default'\n */\n yAxisCategoryOrder?: AxisCategoryOrder;\n\n /**\n * Defines the scale type for the x-axis.\n * @default 'default'\n */\n xScaleType?: AxisScaleType;\n\n /**\n * Defines the scale type for the primary y-axis.\n * @default 'default'\n */\n yScaleType?: AxisScaleType;\n\n /**\n * Defines the scale type for the secondary y-axis.\n * @default 'default'\n */\n secondaryYScaleType?: AxisScaleType;\n\n /**\n * Explicit set of tick values for the y-axis.\n * If provided, these values override automatic tick generation.\n */\n yAxisTickValues?: number[] | Date[] | string[];\n\n /**\n * Configuration for the x-axis.\n * Use this to control `tickStep`, `tick0`, etc.\n */\n xAxis?: AxisProps & {\n /**\n * Controls how x-axis tick labels are laid out.\n *\n * - `'auto'`: Tick labels are automatically wrapped, truncated, and staggered\n * across alternating levels based on the available space to prevent overlap.\n *\n * @default 'default'\n */\n tickLayout?: 'default' | 'auto';\n };\n\n /**\n * Configuration for the y-axis.\n * Use this to control `tickStep`, `tick0`, etc.\n */\n yAxis?: AxisProps;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n}\n\nexport interface IYValueHover {\n legend?: string;\n y?: number | string;\n color?: string;\n data?: string | number;\n shouldDrawBorderBottom?: boolean;\n yAxisCalloutData?: string | { [id: string]: number };\n index?: number;\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IChildProps {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary?: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScaleSecondary?: any;\n containerHeight?: number;\n containerWidth?: number;\n}\n\n// Only used for Cartesian chart base\nexport interface IModifiedCartesianChartProps extends ICartesianChartProps {\n /**\n * Define the chart title\n */\n chartTitle?: string;\n\n /**\n * Only used for Area chart\n * Value used to draw y axis of that chart.\n */\n maxOfYVal?: number;\n\n /**\n * Data of the chart\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n points: any;\n\n /**\n * Define type of the chart\n */\n chartType: ChartTypes;\n\n /** X axis type */\n xAxisType: XAxisTypes;\n\n /** Y axis type */\n yAxisType?: YAxisType;\n\n /**\n * Legends of the chart.\n */\n\n legendBars: JSXElement | null;\n\n /**\n * Callout props\n */\n calloutProps: Partial<ICalloutProps> & {\n isCalloutVisible: boolean;\n id: string;\n YValueHover?: IYValueHover[];\n hoverXValue?: string | number | null;\n legend?: string;\n color?: string;\n YValue?: string | number;\n XValue?: string;\n descriptionMessage?: string;\n };\n\n /**\n * Callback method used for to get margins to the chart.\n */\n getmargins?: (margins: IMargins) => void;\n\n /**\n * This is a call back method to the chart from cartesian chart.\n * params are xScale, yScale, containerHeight, containerWidth. These values were used to draw the graph.\n * It also contians an optional param xAxisElement - defines as x axis scale element.\n * This param used to enable feature word wrap of Xaxis.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getGraphData?: any;\n\n /**\n * Used for bar chart graphs.\n * To define width of the bar\n */\n barwidth?: number;\n\n /**\n * Used for tick styles of the x axis of the chart\n * Tick params are applicable for date axis only.\n */\n tickParams?: {\n tickValues?: number[] | Date[] | string[];\n tickFormat?: string;\n };\n\n /**\n * it's padding between bar's or lines in the graph\n */\n xAxisPadding?: number;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n * Children elements specific to derived chart types.\n */\n children(props: IChildProps): React.ReactNode;\n\n /**\n * To enable callout for individualbar or complete stack. Using for only Vertical stacked bar chart.\n * @default false\n * @type \\{boolean \\}\n */\n isCalloutForStack?: boolean;\n\n /** dataset values to find out domain of the String axis\n * Present using for only vertical stacked bar chart and grouped vertical bar chart\n */\n datasetForXAxisDomain?: string[];\n\n /** Own callout design */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n customizedCallout?: any;\n\n /**\n * if the data points for the y-axis is of type string, then we need to give this\n * prop to construct the y-axis\n */\n stringDatasetForYAxisDomain?: string[];\n\n /**\n * Focus zone direction to the chart\n * @default FocusZoneDirection.horizontal\n */\n focusZoneDirection?: FocusZoneDirection;\n\n /**\n * props to send into the chart hover card\n */\n chartHoverProps?: IChartHoverCardProps;\n\n /**\n * props to send to the focuszone\n */\n svgFocusZoneProps?: IFocusZoneProps;\n\n /**\n * Annotations to render on top of the chart area.\n */\n annotations?: IChartAnnotation[];\n\n /**\n * The prop used to define the culture to localize the numbers and date\n */\n culture?: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getAxisData?: any;\n\n /**\n * Callback method used when mouse leaves the chart boundary.\n */\n onChartMouseLeave?: () => void;\n\n /** Callback method to get extra margins for domain */\n getDomainMargins?: (containerWidth: number) => IMargins;\n\n /** Callback method to get extra margins for Y-axis domain */\n getYDomainMargins?: (containerHeight: number) => IMargins;\n\n /** Padding between each bar/line-point */\n xAxisInnerPadding?: number;\n\n /** Padding before first bar/line-point and after last bar/line-point */\n xAxisOuterPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * Used to control the first render cycle Performance optimization code.\n */\n enableFirstRenderOptimization?: boolean;\n\n /**\n * Get the min and max values of the y-axis\n */\n getMinMaxOfYAxis: (\n points:\n | ILineChartPoints[]\n | IHorizontalBarChartWithAxisDataPoint[]\n | IVerticalBarChartDataPoint[]\n | IDataPoint[]\n | IScatterChartPoints[]\n | IGanttChartDataPoint[],\n yAxisType: YAxisType | undefined,\n useSecondaryYScale?: boolean,\n ) => { startValue: number; endValue: number };\n\n /**\n * Create the y-axis\n */\n createYAxis: (\n yAxisParams: IYAxisParams,\n isRtl: boolean,\n axisData: IAxisData,\n isIntegralDataset: boolean,\n useSecondaryYScale?: boolean,\n supportNegativeData?: boolean,\n roundedTicks?: boolean,\n scaleType?: AxisScaleType,\n ) => ScaleLinear<number, number, never>;\n\n /**\n * Get the domain and range values\n */\n getDomainNRangeValues: (\n points:\n | ILineChartPoints[]\n | IVerticalBarChartDataPoint[]\n | IVerticalStackedBarDataPoint[]\n | IHorizontalBarChartWithAxisDataPoint[]\n | IGroupedVerticalBarChartData[]\n | IHeatMapChartDataPoint[]\n | IGanttChartDataPoint[],\n margins: IMargins,\n width: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | string[] | undefined,\n ) => IDomainNRange;\n\n /**\n * Create the string y-axis\n */\n createStringYAxis: (\n yAxisParams: IYAxisParams,\n dataPoints: string[],\n isRtl: boolean,\n axisData: IAxisData,\n barWidth: number | undefined,\n chartType?: ChartTypes,\n ) => ScaleBand<string>;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n ref?: IRefObject<IChart>;\n\n /**\n * Controls whether the numeric x-axis domain should be extended to start and end at nice rounded values.\n * @default true\n */\n showRoundOffXTickValues?: boolean;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/react/lib/Utilities", "../AnnotationOnlyChart/AnnotationOnlyChart", "../DonutChart/index", "../VerticalStackedBarChart/index", "@fluentui/chart-utilities", "@fluentui/chart-utilities", "./PlotlySchemaAdapter", "../LineChart/index", "../HorizontalBarChartWithAxis/index", "../AreaChart/index", "../HeatMapChart/index", "../SankeyChart/SankeyChart", "../GaugeChart/index", "../GroupedVerticalBarChart/index", "../VerticalBarChart/index", "../ResponsiveContainer/withResponsiveContainer", "../ScatterChart/index", "../ChartTable/index", "../FunnelChart/FunnelChart", "../GanttChart/index", "../Legends/index", "../../utilities/image-export-utils", "../../utilities/utilities"], function (require, exports, tslib_1, React, react_1, Utilities_1, AnnotationOnlyChart_1, index_1, index_2, chart_utilities_1, chart_utilities_2, PlotlySchemaAdapter_1, index_3, index_4, index_5, index_6, SankeyChart_1, index_7, index_8, index_9, withResponsiveContainer_1, index_10, index_11, FunnelChart_1, index_12, index_13, image_export_utils_1, utilities_1) {
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/react/lib/Utilities", "../AnnotationOnlyChart/AnnotationOnlyChart", "../DonutChart/index", "../VerticalStackedBarChart/index", "@fluentui/chart-utilities", "@fluentui/chart-utilities", "./PlotlySchemaAdapter", "../LineChart/index", "../HorizontalBarChartWithAxis/index", "../AreaChart/index", "../HeatMapChart/index", "../SankeyChart/SankeyChart", "../GaugeChart/index", "../GroupedVerticalBarChart/index", "../VerticalBarChart/index", "../ResponsiveContainer/withResponsiveContainer", "../ScatterChart/index", "../ChartTable/index", "../FunnelChart/FunnelChart", "../GanttChart/index", "../Legends/index", "../../utilities/image-export-utils", "../../utilities/utilities", "../../utilities/Common.styles", "../PolarChart/index"], function (require, exports, tslib_1, React, react_1, Utilities_1, AnnotationOnlyChart_1, index_1, index_2, chart_utilities_1, chart_utilities_2, PlotlySchemaAdapter_1, index_3, index_4, index_5, index_6, SankeyChart_1, index_7, index_8, index_9, withResponsiveContainer_1, index_10, index_11, FunnelChart_1, index_12, index_13, image_export_utils_1, utilities_1, Common_styles_1, index_14) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.DeclarativeChart = void 0;
|
|
@@ -17,6 +17,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
17
17
|
// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart
|
|
18
18
|
//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);
|
|
19
19
|
var ResponsiveGanttChart = (0, withResponsiveContainer_1.withResponsiveContainer)(index_12.GanttChart);
|
|
20
|
+
var ResponsivePolarChart = (0, withResponsiveContainer_1.withResponsiveContainer)(index_14.PolarChart);
|
|
20
21
|
// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.
|
|
21
22
|
var DEFAULT_XAXIS = 'x';
|
|
22
23
|
var useColorMapping = function () {
|
|
@@ -114,6 +115,10 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
114
115
|
transformer: PlotlySchemaAdapter_1.transformPlotlyJsonToGanttChartProps,
|
|
115
116
|
renderer: ResponsiveGanttChart,
|
|
116
117
|
},
|
|
118
|
+
scatterpolar: {
|
|
119
|
+
transformer: PlotlySchemaAdapter_1.transformPlotlyJsonToPolarChartProps,
|
|
120
|
+
renderer: ResponsivePolarChart,
|
|
121
|
+
},
|
|
117
122
|
fallback: {
|
|
118
123
|
transformer: PlotlySchemaAdapter_1.transformPlotlyJsonToVSBCProps,
|
|
119
124
|
renderer: ResponsiveVerticalStackedBarChart,
|
|
@@ -124,8 +129,8 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
124
129
|
* {@docCategory DeclarativeChart}
|
|
125
130
|
*/
|
|
126
131
|
exports.DeclarativeChart = React.forwardRef(function (_a, forwardedRef) {
|
|
127
|
-
var _b;
|
|
128
|
-
var
|
|
132
|
+
var _b, _c, _d;
|
|
133
|
+
var _e = _a.colorwayType, colorwayType = _e === void 0 ? 'default' : _e, onSchemaChange = _a.onSchemaChange, props = tslib_1.__rest(_a, ["colorwayType", "onSchemaChange"]);
|
|
129
134
|
var plotlySchema = (0, chart_utilities_2.sanitizeJson)(props.chartSchema).plotlySchema;
|
|
130
135
|
var chart = (0, chart_utilities_2.mapFluentChart)(plotlySchema);
|
|
131
136
|
if (!chart.isValid) {
|
|
@@ -154,7 +159,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
154
159
|
if (!(0, chart_utilities_2.isArrayOrTypedArray)(selectedLegends)) {
|
|
155
160
|
selectedLegends = [];
|
|
156
161
|
}
|
|
157
|
-
var
|
|
162
|
+
var _f = React.useState(selectedLegends), activeLegends = _f[0], setActiveLegends = _f[1];
|
|
158
163
|
var onActiveLegendsChange = React.useCallback(function (keys) {
|
|
159
164
|
setActiveLegends(keys);
|
|
160
165
|
if (onSchemaChange) {
|
|
@@ -207,26 +212,6 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
207
212
|
React.useImperativeHandle(props.componentRef, function () { return ({
|
|
208
213
|
exportAsImage: exportAsImage,
|
|
209
214
|
}); }, [exportAsImage]);
|
|
210
|
-
if (chart.type === 'scatterpolar') {
|
|
211
|
-
var cartesianProjection = (0, PlotlySchemaAdapter_1.projectPolarToCartesian)(plotlyInputWithValidData);
|
|
212
|
-
plotlyInputWithValidData.data = cartesianProjection.data;
|
|
213
|
-
plotlyInputWithValidData.layout = cartesianProjection.layout;
|
|
214
|
-
validTracesFilteredIndex.forEach(function (trace, index) {
|
|
215
|
-
var _a, _b;
|
|
216
|
-
if (trace.type === 'scatterpolar') {
|
|
217
|
-
var mode = (_b = (_a = plotlyInputWithValidData.data[index]) === null || _a === void 0 ? void 0 : _a.mode) !== null && _b !== void 0 ? _b : '';
|
|
218
|
-
if (mode.includes('line')) {
|
|
219
|
-
validTracesFilteredIndex[index].type = 'line';
|
|
220
|
-
}
|
|
221
|
-
else if (mode.includes('markers') || mode === 'text') {
|
|
222
|
-
validTracesFilteredIndex[index].type = 'scatter';
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
validTracesFilteredIndex[index].type = 'line';
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
215
|
var groupedTraces = {};
|
|
231
216
|
var nonCartesianTraceCount = 0;
|
|
232
217
|
// For annotation-only charts, create a single group entry
|
|
@@ -235,14 +220,17 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
235
220
|
}
|
|
236
221
|
else {
|
|
237
222
|
plotlyInputWithValidData.data.forEach(function (trace, index) {
|
|
238
|
-
var _a;
|
|
223
|
+
var _a, _b;
|
|
239
224
|
var traceKey = '';
|
|
240
225
|
if ((0, PlotlySchemaAdapter_1.isNonPlotType)(chart.validTracesInfo[index].type)) {
|
|
241
226
|
traceKey = "".concat(PlotlySchemaAdapter_1.NON_PLOT_KEY_PREFIX).concat(nonCartesianTraceCount + 1);
|
|
242
227
|
nonCartesianTraceCount++;
|
|
243
228
|
}
|
|
244
229
|
else {
|
|
245
|
-
traceKey =
|
|
230
|
+
traceKey =
|
|
231
|
+
chart.validTracesInfo[index].type === 'scatterpolar'
|
|
232
|
+
? (_a = trace.subplot) !== null && _a !== void 0 ? _a : PlotlySchemaAdapter_1.DEFAULT_POLAR_SUBPLOT
|
|
233
|
+
: (_b = trace.xaxis) !== null && _b !== void 0 ? _b : DEFAULT_XAXIS;
|
|
246
234
|
}
|
|
247
235
|
if (!groupedTraces[traceKey]) {
|
|
248
236
|
groupedTraces[traceKey] = [];
|
|
@@ -275,8 +263,14 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
275
263
|
isMultiPlot.current = false;
|
|
276
264
|
}
|
|
277
265
|
var allupLegendsProps = (0, PlotlySchemaAdapter_1.getAllupLegendsProps)(plotlyInputWithValidData, colorMap, colorwayType, chart.validTracesInfo, isDarkTheme);
|
|
266
|
+
var titleObj = (_c = plotlyInputWithValidData.layout) === null || _c === void 0 ? void 0 : _c.title;
|
|
267
|
+
var chartTitle = typeof titleObj === 'string' ? titleObj : (_d = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _d !== void 0 ? _d : '';
|
|
268
|
+
var titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
|
|
269
|
+
var _g = theme.fonts.medium, fontFamily = _g.fontFamily, fontSize = _g.fontSize, fontWeight = _g.fontWeight;
|
|
270
|
+
var titleStyle = tslib_1.__assign({ fontFamily: fontFamily, fontSize: fontSize, fontWeight: fontWeight, color: theme.semanticColors.bodyText, textAlign: 'center', marginBottom: '8px' }, (0, Common_styles_1.getChartTitleInlineStyles)(titleFont));
|
|
278
271
|
// map through the grouped traces and render the appropriate chart
|
|
279
272
|
return (React.createElement(React.Fragment, null,
|
|
273
|
+
isMultiPlot.current && chartTitle && React.createElement("div", { style: titleStyle }, chartTitle),
|
|
280
274
|
React.createElement("div", { style: {
|
|
281
275
|
display: 'grid',
|
|
282
276
|
gridTemplateRows: gridProperties.templateRows,
|
|
@@ -303,8 +297,8 @@ define(["require", "exports", "tslib", "react", "@fluentui/react", "@fluentui/re
|
|
|
303
297
|
var cellProperties_1 = gridProperties.layout[xAxisKey];
|
|
304
298
|
var resolvedCommonProps = (chartType === 'annotation'
|
|
305
299
|
? {}
|
|
306
|
-
: tslib_1.__assign(
|
|
307
|
-
return renderChart(renderer, transformer, [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme], tslib_1.__assign(tslib_1.__assign({}, resolvedCommonProps),
|
|
300
|
+
: tslib_1.__assign({}, interactiveCommonProps));
|
|
301
|
+
return renderChart(renderer, transformer, [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme], tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, resolvedCommonProps), ((cellProperties_1 === null || cellProperties_1 === void 0 ? void 0 : cellProperties_1.xAnnotation) && { xAxisAnnotation: cellProperties_1.xAnnotation })), ((cellProperties_1 === null || cellProperties_1 === void 0 ? void 0 : cellProperties_1.yAnnotation) && { yAxisAnnotation: cellProperties_1.yAnnotation })), { componentRef: function (ref) {
|
|
308
302
|
var _a, _b;
|
|
309
303
|
chartRefs.current[chartIdx] = {
|
|
310
304
|
compRef: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclarativeChart.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/DeclarativeChart.tsx"],"names":[],"mappings":";;;;IAwDA,IAAM,oBAAoB,GAAG,IAAA,iDAAuB,EAAC,kBAAU,CAAC,CAAC;IACjE,IAAM,iCAAiC,GAAG,IAAA,iDAAuB,EAAC,+BAAuB,CAAC,CAAC;IAC3F,IAAM,mBAAmB,GAAG,IAAA,iDAAuB,EAAC,iBAAS,CAAC,CAAC;IAC/D,IAAM,oCAAoC,GAAG,IAAA,iDAAuB,EAAC,kCAA0B,CAAC,CAAC;IACjG,IAAM,mBAAmB,GAAG,IAAA,iDAAuB,EAAC,iBAAS,CAAC,CAAC;IAC/D,IAAM,sBAAsB,GAAG,IAAA,iDAAuB,EAAC,oBAAY,CAAC,CAAC;IACrE,IAAM,qBAAqB,GAAG,IAAA,iDAAuB,EAAC,yBAAW,CAAC,CAAC;IACnE,IAAM,oBAAoB,GAAG,IAAA,iDAAuB,EAAC,kBAAU,CAAC,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C,GAAG;oCAC5B,OAAO,EAAE,GAAG;oCACZ,GAAG,EAAE,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,GAAG,mCAAI,CAAC;oCAC7B,GAAG,EAAE,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,MAAM,mCAAI,CAAC;iCACjC,CAAC;4BACJ,CAAC,KAEH,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,GAAG,mCAAI,CAAC,EACxB,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,MAAM,mCAAI,CAAC,CAC5B,CAAC;oBACJ,CAAC;oBACD,OAAO,yCAAK,CAAC;gBACf,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,kCAA2B,MAAA,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,IAAI,CAAE,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC,CAAC,CACE;YACL,WAAW,CAAC,OAAO,IAAI,aAAa,CAAC,iBAAiB,CAAC,CACvD,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport { useTheme } from '@fluentui/react';\nimport { getRTL, IRefObject } from '@fluentui/react/lib/Utilities';\nimport { AnnotationOnlyChart } from '../AnnotationOnlyChart/AnnotationOnlyChart';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { decodeBase64Fields } from '@fluentui/chart-utilities';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport { isArrayOrTypedArray, isMonthArray, mapFluentChart, sanitizeJson } from '@fluentui/chart-utilities';\n\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n projectPolarToCartesian,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n transformPlotlyJsonToAnnotationChartProps,\n} from './PlotlySchemaAdapter';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { ChartTable } from '../ChartTable/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\nimport { ILegendContainer, ILegendsProps, Legends } from '../Legends/index';\nimport type { JSXElement } from '@fluentui/utilities';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { resolveCSSVariables } from '../../utilities/utilities';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IDeclarativeChart>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: IImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n annotation: {\n transformer: typeof transformPlotlyJsonToAnnotationChartProps;\n renderer: typeof AnnotationOnlyChart;\n } & PreTransformHooks;\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n annotation: {\n transformer: transformPlotlyJsonToAnnotationChartProps,\n renderer: AnnotationOnlyChart,\n },\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>(({ colorwayType = 'default', onSchemaChange, ...props }, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const theme = useTheme();\n const isDarkTheme = theme?.isInverted ?? false;\n const chartRefs = React.useRef<{ compRef: IChart | null; row: number; col: number }[]>([]);\n const isMultiPlot = React.useRef(false);\n const legendsRef = React.useRef<ILegendContainer>(null);\n const containerRef = React.useRef<HTMLDivElement>(null);\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = React.useCallback(\n (keys: string[]) => {\n setActiveLegends(keys);\n if (onSchemaChange) {\n onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n },\n [onSchemaChange, plotlyInput],\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const interactiveCommonProps = {\n legendProps: multiSelectLegendProps,\n calloutProps: { layerProps: { eventBubblingEnabled: true } },\n };\n\n function createLegends(legendProps: ILegendsProps): JSXElement {\n return (\n <Legends {...legendProps} selectedLegends={activeLegends} onChange={onActiveLegendsChange} ref={legendsRef} />\n );\n }\n\n const exportAsImage = React.useCallback(\n async (opts?: IImageExportOptions) => {\n if (!containerRef.current) {\n throw new Error('Container reference is null');\n }\n\n const imgExpOpts = {\n background: resolveCSSVariables(containerRef.current, theme.semanticColors.bodyBackground),\n scale: 5,\n ...opts,\n };\n\n if (!isMultiPlot.current) {\n if (!chartRefs.current[0]?.compRef?.toImage) {\n throw new Error('Chart cannot be exported as image');\n }\n\n return chartRefs.current[0].compRef.toImage(imgExpOpts);\n }\n\n return exportChartsAsImage(\n chartRefs.current.map(item => ({\n container: item.compRef?.chartContainer,\n row: item.row,\n col: item.col,\n })),\n legendsRef.current?.toSVG,\n getRTL(),\n imgExpOpts,\n );\n },\n [theme],\n );\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n if (chart.type === 'scatterpolar') {\n const cartesianProjection = projectPolarToCartesian(plotlyInputWithValidData);\n plotlyInputWithValidData.data = cartesianProjection.data;\n plotlyInputWithValidData.layout = cartesianProjection.layout;\n validTracesFilteredIndex.forEach((trace, index) => {\n if (trace.type === 'scatterpolar') {\n const mode = (plotlyInputWithValidData.data[index] as PlotData)?.mode ?? '';\n if (mode.includes('line')) {\n validTracesFilteredIndex[index].type = 'line';\n } else if (mode.includes('markers') || mode === 'text') {\n validTracesFilteredIndex[index].type = 'scatter';\n } else {\n validTracesFilteredIndex[index].type = 'line';\n }\n }\n });\n }\n\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n\n // For annotation-only charts, create a single group entry\n if (chart.type === 'annotation') {\n groupedTraces[DEFAULT_XAXIS] = [];\n } else {\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey = (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n }\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n if (chart.type === 'donut') {\n // If there are multiple data traces for donut/pie, picking the last one similar to plotly\n const keys = Object.keys(groupedTraces);\n keys.forEach((key, index) => {\n if (index < keys.length - 1) {\n delete groupedTraces[key];\n }\n });\n } else {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n }\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n ref={containerRef}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index], chartIdx) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n chart.type === 'fallback' || chart.type === 'groupedverticalbar'\n ? chart.type\n : filteredTracesInfo[0]?.type ?? chart.type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n const resolvedCommonProps = (\n chartType === 'annotation'\n ? {}\n : {\n ...interactiveCommonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n }\n ) as Partial<ReturnType<typeof transformer>>;\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme],\n {\n ...resolvedCommonProps,\n xAxisAnnotation: cellProperties?.xAnnotation,\n yAxisAnnotation: cellProperties?.yAnnotation,\n componentRef: (ref: IChart | null) => {\n chartRefs.current[chartIdx] = {\n compRef: ref,\n row: cellProperties?.row ?? 1,\n col: cellProperties?.column ?? 1,\n };\n },\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\n"]}
|
|
1
|
+
{"version":3,"file":"DeclarativeChart.js","sourceRoot":"../src/","sources":["components/DeclarativeChart/DeclarativeChart.tsx"],"names":[],"mappings":";;;;IA2DA,IAAM,oBAAoB,GAAG,IAAA,iDAAuB,EAAC,kBAAU,CAAC,CAAC;IACjE,IAAM,iCAAiC,GAAG,IAAA,iDAAuB,EAAC,+BAAuB,CAAC,CAAC;IAC3F,IAAM,mBAAmB,GAAG,IAAA,iDAAuB,EAAC,iBAAS,CAAC,CAAC;IAC/D,IAAM,oCAAoC,GAAG,IAAA,iDAAuB,EAAC,kCAA0B,CAAC,CAAC;IACjG,IAAM,mBAAmB,GAAG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E,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,0EAEvE,mBAAmB,GACnB,CAAC,CAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,WAAW,KAAI,EAAE,eAAe,EAAE,gBAAc,CAAC,WAAW,EAAE,CAAC,GAChF,CAAC,CAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,WAAW,KAAI,EAAE,eAAe,EAAE,gBAAc,CAAC,WAAW,EAAE,CAAC,KACnF,YAAY,EAAE,UAAC,GAAkB;;gCAC/B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;oCAC5B,OAAO,EAAE,GAAG;oCACZ,GAAG,EAAE,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,GAAG,mCAAI,CAAC;oCAC7B,GAAG,EAAE,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,MAAM,mCAAI,CAAC;iCACjC,CAAC;4BACJ,CAAC,KAEH,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,GAAG,mCAAI,CAAC,EACxB,MAAA,gBAAc,aAAd,gBAAc,uBAAd,gBAAc,CAAE,MAAM,mCAAI,CAAC,CAC5B,CAAC;oBACJ,CAAC;oBACD,OAAO,yCAAK,CAAC;gBACf,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,kCAA2B,MAAA,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,IAAI,CAAE,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC,CAAC,CACE;YACL,WAAW,CAAC,OAAO,IAAI,aAAa,CAAC,iBAAiB,CAAC,CACvD,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport * as React from 'react';\nimport { useTheme } from '@fluentui/react';\nimport { getRTL, IRefObject } from '@fluentui/react/lib/Utilities';\nimport { AnnotationOnlyChart } from '../AnnotationOnlyChart/AnnotationOnlyChart';\nimport { DonutChart } from '../DonutChart/index';\nimport { VerticalStackedBarChart } from '../VerticalStackedBarChart/index';\nimport { decodeBase64Fields } from '@fluentui/chart-utilities';\nimport type { Data, PlotData, PlotlySchema, OutputChartType, TraceInfo } from '@fluentui/chart-utilities';\nimport { isArrayOrTypedArray, isMonthArray, mapFluentChart, sanitizeJson } from '@fluentui/chart-utilities';\n\nimport type { GridProperties } from './PlotlySchemaAdapter';\nimport {\n correctYearMonth,\n getGridProperties,\n isNonPlotType,\n transformPlotlyJsonToDonutProps,\n transformPlotlyJsonToVSBCProps,\n transformPlotlyJsonToAreaChartProps,\n transformPlotlyJsonToLineChartProps,\n transformPlotlyJsonToHorizontalBarWithAxisProps,\n transformPlotlyJsonToHeatmapProps,\n transformPlotlyJsonToSankeyProps,\n transformPlotlyJsonToGaugeProps,\n transformPlotlyJsonToGVBCProps,\n transformPlotlyJsonToVBCProps,\n transformPlotlyJsonToChartTableProps,\n transformPlotlyJsonToScatterChartProps,\n getAllupLegendsProps,\n NON_PLOT_KEY_PREFIX,\n SINGLE_REPEAT,\n transformPlotlyJsonToFunnelChartProps,\n transformPlotlyJsonToGanttChartProps,\n transformPlotlyJsonToAnnotationChartProps,\n transformPlotlyJsonToPolarChartProps,\n DEFAULT_POLAR_SUBPLOT,\n} from './PlotlySchemaAdapter';\nimport type { ColorwayType } from './PlotlyColorAdapter';\nimport { LineChart } from '../LineChart/index';\nimport { HorizontalBarChartWithAxis } from '../HorizontalBarChartWithAxis/index';\nimport { AreaChart } from '../AreaChart/index';\nimport { HeatMapChart } from '../HeatMapChart/index';\nimport { SankeyChart } from '../SankeyChart/SankeyChart';\nimport { GaugeChart } from '../GaugeChart/index';\nimport { GroupedVerticalBarChart } from '../GroupedVerticalBarChart/index';\nimport { VerticalBarChart } from '../VerticalBarChart/index';\nimport { IChart, IImageExportOptions } from '../../types/index';\nimport { withResponsiveContainer } from '../ResponsiveContainer/withResponsiveContainer';\nimport { ScatterChart } from '../ScatterChart/index';\nimport { ChartTable } from '../ChartTable/index';\nimport { FunnelChart } from '../FunnelChart/FunnelChart';\nimport { GanttChart } from '../GanttChart/index';\nimport { ILegendContainer, ILegendsProps, Legends } from '../Legends/index';\nimport type { JSXElement } from '@fluentui/utilities';\nimport { exportChartsAsImage } from '../../utilities/image-export-utils';\nimport { resolveCSSVariables } from '../../utilities/utilities';\nimport { getChartTitleInlineStyles } from '../../utilities/Common.styles';\nimport { PolarChart } from '../PolarChart/index';\n\nconst ResponsiveDonutChart = withResponsiveContainer(DonutChart);\nconst ResponsiveVerticalStackedBarChart = withResponsiveContainer(VerticalStackedBarChart);\nconst ResponsiveLineChart = withResponsiveContainer(LineChart);\nconst ResponsiveHorizontalBarChartWithAxis = withResponsiveContainer(HorizontalBarChartWithAxis);\nconst ResponsiveAreaChart = withResponsiveContainer(AreaChart);\nconst ResponsiveHeatMapChart = withResponsiveContainer(HeatMapChart);\nconst ResponsiveSankeyChart = withResponsiveContainer(SankeyChart);\nconst ResponsiveGaugeChart = withResponsiveContainer(GaugeChart);\nconst ResponsiveGroupedVerticalBarChart = withResponsiveContainer(GroupedVerticalBarChart);\nconst ResponsiveVerticalBarChart = withResponsiveContainer(VerticalBarChart);\nconst ResponsiveScatterChart = withResponsiveContainer(ScatterChart);\nconst ResponsiveChartTable = withResponsiveContainer(ChartTable);\n// Removing responsive wrapper for FunnelChart as responsive container is not working with FunnelChart\n//const ResponsiveFunnelChart = withResponsiveContainer(FunnelChart);\nconst ResponsiveGanttChart = withResponsiveContainer(GanttChart);\nconst ResponsivePolarChart = withResponsiveContainer(PolarChart);\n\n// Default x-axis key for grouping traces. Also applicable for PieData and SankeyData where x-axis is not defined.\nconst DEFAULT_XAXIS = 'x';\n\n/**\n * DeclarativeChart schema.\n * {@docCategory DeclarativeChart}\n */\nexport interface Schema {\n /**\n * Plotly schema represented as JSON object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n plotlySchema: any;\n}\n\n/**\n * DeclarativeChart props.\n * {@docCategory DeclarativeChart}\n */\nexport interface DeclarativeChartProps extends React.RefAttributes<HTMLDivElement> {\n /**\n * The schema representing the chart data, layout and configuration\n */\n chartSchema: Schema;\n\n /**\n * Callback when an event occurs\n */\n onSchemaChange?: (eventData: Schema) => void;\n\n /**\n * Optional callback to access the IDeclarativeChart interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IDeclarativeChart>;\n\n /**\n * Optional prop to specify the colorway type of the chart.\n * - 'default': Use Fluent UI color palette aligning with plotly colorway.\n * - 'builtin': Use Fluent UI colorway.\n * - 'others': Reserved for future colorways.\n * @default 'default'\n */\n colorwayType?: ColorwayType;\n}\n\n/**\n * {@docCategory DeclarativeChart}\n */\nexport interface IDeclarativeChart {\n exportAsImage: (opts?: IImageExportOptions) => Promise<string>;\n}\n\nconst useColorMapping = () => {\n const colorMap = React.useRef(new Map<string, string>());\n return colorMap;\n};\n\nfunction renderChart<TProps>(\n Renderer: React.ComponentType<TProps>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformer: (...args: any[]) => TProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transformerArgs: any[],\n commonProps: Partial<TProps>,\n cellRow: number,\n cellColumn: number,\n): JSXElement {\n const chartProps = transformer(...transformerArgs);\n return (\n <div\n key={`${cellRow}_${cellColumn}`}\n style={{\n gridRowStart: cellRow,\n gridRowEnd: cellRow + 1,\n gridColumnStart: cellColumn,\n gridColumnEnd: cellColumn + 1,\n }}\n >\n <Renderer {...chartProps} {...commonProps} />\n </div>\n );\n}\n\ntype PreTransformHooks = {\n preTransformCondition?: (plotlySchema: PlotlySchema) => boolean;\n preTransformOperation?: (plotlySchema: PlotlySchema) => PlotlySchema;\n};\n\nconst LineAreaPreTransformOp = (plotlyInput: PlotlySchema) => {\n const xValues = (plotlyInput.data[0] as PlotData).x;\n const isXMonth = isMonthArray(xValues);\n let renderData = plotlyInput.data;\n if (isXMonth) {\n renderData = plotlyInput.data.map((dataPoint: PlotData) => ({\n ...dataPoint,\n x: correctYearMonth(dataPoint.x),\n }));\n }\n return { data: renderData, layout: plotlyInput.layout };\n};\n\ntype ChartTypeMap = {\n annotation: {\n transformer: typeof transformPlotlyJsonToAnnotationChartProps;\n renderer: typeof AnnotationOnlyChart;\n } & PreTransformHooks;\n donut: {\n transformer: typeof transformPlotlyJsonToDonutProps;\n renderer: typeof ResponsiveDonutChart;\n } & PreTransformHooks;\n sankey: {\n transformer: typeof transformPlotlyJsonToSankeyProps;\n renderer: typeof ResponsiveSankeyChart;\n } & PreTransformHooks;\n table: {\n transformer: typeof transformPlotlyJsonToChartTableProps;\n renderer: typeof ResponsiveChartTable;\n } & PreTransformHooks;\n horizontalbar: {\n transformer: typeof transformPlotlyJsonToHorizontalBarWithAxisProps;\n renderer: typeof ResponsiveHorizontalBarChartWithAxis;\n } & PreTransformHooks;\n groupedverticalbar: {\n transformer: typeof transformPlotlyJsonToGVBCProps;\n renderer: typeof ResponsiveGroupedVerticalBarChart;\n } & PreTransformHooks;\n verticalstackedbar: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n heatmap: {\n transformer: typeof transformPlotlyJsonToHeatmapProps;\n renderer: typeof ResponsiveHeatMapChart;\n } & PreTransformHooks;\n gauge: {\n transformer: typeof transformPlotlyJsonToGaugeProps;\n renderer: typeof ResponsiveGaugeChart;\n } & PreTransformHooks;\n verticalbar: {\n transformer: typeof transformPlotlyJsonToVBCProps;\n renderer: typeof ResponsiveVerticalBarChart;\n } & PreTransformHooks;\n area: {\n transformer: typeof transformPlotlyJsonToAreaChartProps;\n renderer: typeof ResponsiveAreaChart;\n } & PreTransformHooks;\n line: {\n transformer: typeof transformPlotlyJsonToLineChartProps;\n renderer: typeof ResponsiveLineChart;\n } & PreTransformHooks;\n scatter: {\n transformer: typeof transformPlotlyJsonToScatterChartProps;\n renderer: typeof ResponsiveScatterChart;\n } & PreTransformHooks;\n funnel: {\n transformer: typeof transformPlotlyJsonToFunnelChartProps;\n renderer: typeof FunnelChart;\n } & PreTransformHooks;\n gantt: {\n transformer: typeof transformPlotlyJsonToGanttChartProps;\n renderer: typeof ResponsiveGanttChart;\n } & PreTransformHooks;\n scatterpolar: {\n transformer: typeof transformPlotlyJsonToPolarChartProps;\n renderer: typeof ResponsivePolarChart;\n } & PreTransformHooks;\n fallback: {\n transformer: typeof transformPlotlyJsonToVSBCProps;\n renderer: typeof ResponsiveVerticalStackedBarChart;\n } & PreTransformHooks;\n};\n\nconst chartMap: ChartTypeMap = {\n annotation: {\n transformer: transformPlotlyJsonToAnnotationChartProps,\n renderer: AnnotationOnlyChart,\n },\n // PieData category charts\n donut: {\n transformer: transformPlotlyJsonToDonutProps,\n renderer: ResponsiveDonutChart,\n },\n // SankeyData category charts\n sankey: {\n transformer: transformPlotlyJsonToSankeyProps,\n renderer: ResponsiveSankeyChart,\n },\n // TableData category charts\n table: {\n transformer: transformPlotlyJsonToChartTableProps,\n renderer: ResponsiveChartTable,\n },\n // PlotData category charts\n horizontalbar: {\n transformer: transformPlotlyJsonToHorizontalBarWithAxisProps,\n renderer: ResponsiveHorizontalBarChartWithAxis,\n },\n groupedverticalbar: {\n transformer: transformPlotlyJsonToGVBCProps,\n renderer: ResponsiveGroupedVerticalBarChart,\n },\n verticalstackedbar: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n heatmap: {\n transformer: transformPlotlyJsonToHeatmapProps,\n renderer: ResponsiveHeatMapChart,\n },\n gauge: {\n transformer: transformPlotlyJsonToGaugeProps,\n renderer: ResponsiveGaugeChart,\n },\n verticalbar: {\n transformer: transformPlotlyJsonToVBCProps,\n renderer: ResponsiveVerticalBarChart,\n },\n area: {\n transformer: transformPlotlyJsonToAreaChartProps,\n renderer: ResponsiveAreaChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n line: {\n transformer: transformPlotlyJsonToLineChartProps,\n renderer: ResponsiveLineChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n scatter: {\n transformer: transformPlotlyJsonToScatterChartProps,\n renderer: ResponsiveScatterChart,\n preTransformOperation: LineAreaPreTransformOp,\n },\n funnel: {\n transformer: transformPlotlyJsonToFunnelChartProps,\n renderer: FunnelChart,\n },\n gantt: {\n transformer: transformPlotlyJsonToGanttChartProps,\n renderer: ResponsiveGanttChart,\n },\n scatterpolar: {\n transformer: transformPlotlyJsonToPolarChartProps,\n renderer: ResponsivePolarChart,\n },\n fallback: {\n transformer: transformPlotlyJsonToVSBCProps,\n renderer: ResponsiveVerticalStackedBarChart,\n },\n};\n\n/**\n * DeclarativeChart component.\n * {@docCategory DeclarativeChart}\n */\nexport const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> = React.forwardRef<\n HTMLDivElement,\n DeclarativeChartProps\n>(({ colorwayType = 'default', onSchemaChange, ...props }, forwardedRef) => {\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n const chart: OutputChartType = mapFluentChart(plotlySchema);\n if (!chart.isValid) {\n throw new Error(`Invalid chart schema: ${chart.errorMessage}`);\n }\n let plotlyInput = plotlySchema as PlotlySchema;\n try {\n plotlyInput = decodeBase64Fields(plotlyInput);\n } catch (error) {\n throw new Error(`Failed to decode plotly schema: ${error}`);\n }\n const plotlyInputWithValidData: PlotlySchema = {\n ...plotlyInput,\n data: chart.validTracesInfo!.map(trace => plotlyInput.data[trace.index]),\n };\n\n const validTracesFilteredIndex: TraceInfo[] = chart.validTracesInfo!.map((trace, index) => ({\n index,\n type: trace.type,\n }));\n\n let { selectedLegends } = plotlySchema;\n const colorMap = useColorMapping();\n const theme = useTheme();\n const isDarkTheme = theme?.isInverted ?? false;\n const chartRefs = React.useRef<{ compRef: IChart | null; row: number; col: number }[]>([]);\n const isMultiPlot = React.useRef(false);\n const legendsRef = React.useRef<ILegendContainer>(null);\n const containerRef = React.useRef<HTMLDivElement>(null);\n\n if (!isArrayOrTypedArray(selectedLegends)) {\n selectedLegends = [];\n }\n\n const [activeLegends, setActiveLegends] = React.useState<string[]>(selectedLegends);\n const onActiveLegendsChange = React.useCallback(\n (keys: string[]) => {\n setActiveLegends(keys);\n if (onSchemaChange) {\n onSchemaChange({ plotlySchema: { plotlyInput, selectedLegends: keys } });\n }\n },\n [onSchemaChange, plotlyInput],\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { plotlySchema } = sanitizeJson(props.chartSchema);\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { selectedLegends } = plotlySchema;\n setActiveLegends(selectedLegends ?? []);\n }, [props.chartSchema]);\n\n const multiSelectLegendProps = {\n canSelectMultipleLegends: true,\n onChange: onActiveLegendsChange,\n selectedLegends: activeLegends,\n };\n\n const interactiveCommonProps = {\n legendProps: multiSelectLegendProps,\n calloutProps: { layerProps: { eventBubblingEnabled: true } },\n };\n\n function createLegends(legendProps: ILegendsProps): JSXElement {\n return (\n <Legends {...legendProps} selectedLegends={activeLegends} onChange={onActiveLegendsChange} ref={legendsRef} />\n );\n }\n\n const exportAsImage = React.useCallback(\n async (opts?: IImageExportOptions) => {\n if (!containerRef.current) {\n throw new Error('Container reference is null');\n }\n\n const imgExpOpts = {\n background: resolveCSSVariables(containerRef.current, theme.semanticColors.bodyBackground),\n scale: 5,\n ...opts,\n };\n\n if (!isMultiPlot.current) {\n if (!chartRefs.current[0]?.compRef?.toImage) {\n throw new Error('Chart cannot be exported as image');\n }\n\n return chartRefs.current[0].compRef.toImage(imgExpOpts);\n }\n\n return exportChartsAsImage(\n chartRefs.current.map(item => ({\n container: item.compRef?.chartContainer,\n row: item.row,\n col: item.col,\n })),\n legendsRef.current?.toSVG,\n getRTL(),\n imgExpOpts,\n );\n },\n [theme],\n );\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n exportAsImage,\n }),\n [exportAsImage],\n );\n\n const groupedTraces: Record<string, number[]> = {};\n let nonCartesianTraceCount = 0;\n\n // For annotation-only charts, create a single group entry\n if (chart.type === 'annotation') {\n groupedTraces[DEFAULT_XAXIS] = [];\n } else {\n plotlyInputWithValidData.data.forEach((trace: Data, index: number) => {\n let traceKey = '';\n if (isNonPlotType(chart.validTracesInfo![index].type)) {\n traceKey = `${NON_PLOT_KEY_PREFIX}${nonCartesianTraceCount + 1}`;\n nonCartesianTraceCount++;\n } else {\n traceKey =\n chart.validTracesInfo![index].type === 'scatterpolar'\n ? (trace as { subplot?: string }).subplot ?? DEFAULT_POLAR_SUBPLOT\n : (trace as PlotData).xaxis ?? DEFAULT_XAXIS;\n }\n if (!groupedTraces[traceKey]) {\n groupedTraces[traceKey] = [];\n }\n groupedTraces[traceKey].push(index);\n });\n }\n\n isMultiPlot.current = Object.keys(groupedTraces).length > 1;\n const gridProperties: GridProperties = getGridProperties(\n plotlyInputWithValidData,\n isMultiPlot.current,\n chart.validTracesInfo!,\n );\n\n // Render only one plot if the grid properties cannot determine positioning of multiple plots.\n if (\n isMultiPlot.current &&\n gridProperties.templateRows === SINGLE_REPEAT &&\n gridProperties.templateColumns === SINGLE_REPEAT\n ) {\n if (chart.type === 'donut') {\n // If there are multiple data traces for donut/pie, picking the last one similar to plotly\n const keys = Object.keys(groupedTraces);\n keys.forEach((key, index) => {\n if (index < keys.length - 1) {\n delete groupedTraces[key];\n }\n });\n } else {\n Object.keys(groupedTraces).forEach((key, index) => {\n if (index > 0) {\n delete groupedTraces[key];\n }\n });\n }\n isMultiPlot.current = false;\n }\n\n const allupLegendsProps = getAllupLegendsProps(\n plotlyInputWithValidData,\n colorMap,\n colorwayType,\n chart.validTracesInfo!,\n isDarkTheme,\n );\n\n type ChartType = keyof ChartTypeMap;\n\n const titleObj = plotlyInputWithValidData.layout?.title;\n const chartTitle = typeof titleObj === 'string' ? titleObj : titleObj?.text ?? '';\n const titleFont = typeof titleObj === 'object' ? titleObj?.font : undefined;\n\n const { fontFamily, fontSize, fontWeight } = theme.fonts.medium;\n const titleStyle: React.CSSProperties = {\n fontFamily,\n fontSize,\n fontWeight,\n color: theme.semanticColors.bodyText,\n textAlign: 'center',\n marginBottom: '8px',\n ...getChartTitleInlineStyles(titleFont),\n };\n\n // map through the grouped traces and render the appropriate chart\n return (\n <>\n {isMultiPlot.current && chartTitle && <div style={titleStyle}>{chartTitle}</div>}\n <div\n style={{\n display: 'grid',\n gridTemplateRows: gridProperties.templateRows,\n gridTemplateColumns: gridProperties.templateColumns,\n }}\n ref={containerRef}\n >\n {Object.entries(groupedTraces).map(([xAxisKey, index], chartIdx) => {\n const plotlyInputForGroup: PlotlySchema = {\n ...plotlyInputWithValidData,\n data: index.map(idx => plotlyInputWithValidData.data[idx]),\n };\n\n const filteredTracesInfo = validTracesFilteredIndex.filter(trace => index.includes(trace.index));\n let chartType =\n chart.type === 'fallback' || chart.type === 'groupedverticalbar'\n ? chart.type\n : filteredTracesInfo[0]?.type ?? chart.type;\n\n if (\n validTracesFilteredIndex.some(trace => trace.type === 'line') &&\n validTracesFilteredIndex.some(trace => trace.type === 'scatter')\n ) {\n chartType = 'line';\n }\n\n const chartEntry = chartMap[chartType as ChartType];\n if (chartEntry) {\n const { transformer, renderer, preTransformCondition, preTransformOperation } = chartEntry;\n if (preTransformCondition === undefined || preTransformCondition(plotlyInputForGroup)) {\n const transformedInput = preTransformOperation\n ? preTransformOperation(plotlyInputForGroup)\n : plotlyInputForGroup;\n const cellProperties = gridProperties.layout[xAxisKey];\n\n const resolvedCommonProps = (\n chartType === 'annotation'\n ? {}\n : {\n ...interactiveCommonProps,\n }\n ) as Partial<ReturnType<typeof transformer>>;\n\n return renderChart<ReturnType<typeof transformer>>(\n renderer,\n transformer,\n [transformedInput, isMultiPlot.current, colorMap, colorwayType, isDarkTheme],\n {\n ...resolvedCommonProps,\n ...(cellProperties?.xAnnotation && { xAxisAnnotation: cellProperties.xAnnotation }),\n ...(cellProperties?.yAnnotation && { yAxisAnnotation: cellProperties.yAnnotation }),\n componentRef: (ref: IChart | null) => {\n chartRefs.current[chartIdx] = {\n compRef: ref,\n row: cellProperties?.row ?? 1,\n col: cellProperties?.column ?? 1,\n };\n },\n },\n cellProperties?.row ?? 1,\n cellProperties?.column ?? 1,\n );\n }\n return <></>;\n } else {\n throw new Error(`Unsupported chart type :${plotlyInputForGroup.data[0]?.type}`);\n }\n })}\n </div>\n {isMultiPlot.current && createLegends(allupLegendsProps)}\n </>\n );\n});\nDeclarativeChart.displayName = 'DeclarativeChart';\n"]}
|
|
@@ -16,6 +16,7 @@ import type { ColorwayType } from './PlotlyColorAdapter';
|
|
|
16
16
|
import { IFunnelChartProps } from '../FunnelChart/FunnelChart.types';
|
|
17
17
|
import { ILegendsProps } from '../Legends/index';
|
|
18
18
|
import { IGanttChartProps } from '../GanttChart/GanttChart.types';
|
|
19
|
+
import { IPolarChartProps } from '../PolarChart/index';
|
|
19
20
|
export declare const NON_PLOT_KEY_PREFIX = "nonplot_";
|
|
20
21
|
export declare const SINGLE_REPEAT = "repeat(1, 1fr)";
|
|
21
22
|
type DomainInterval = {
|
|
@@ -64,7 +65,7 @@ export declare const transformPlotlyJsonToSankeyProps: (input: PlotlySchema, isM
|
|
|
64
65
|
export declare const transformPlotlyJsonToGaugeProps: (input: PlotlySchema, isMultiPlot: boolean, colorMap: React.MutableRefObject<Map<string, string>>, colorwayType: ColorwayType, isDarkTheme?: boolean) => IGaugeChartProps;
|
|
65
66
|
export declare const transformPlotlyJsonToChartTableProps: (input: PlotlySchema, isMultiPlot: boolean, colorMap: React.MutableRefObject<Map<string, string>>, colorwayType: ColorwayType, isDarkTheme?: boolean) => IChartTableProps;
|
|
66
67
|
export declare const transformPlotlyJsonToFunnelChartProps: (input: PlotlySchema, isMultiPlot: boolean, colorMap: React.MutableRefObject<Map<string, string>>, colorwayType: ColorwayType, isDarkTheme?: boolean) => IFunnelChartProps;
|
|
67
|
-
export declare const
|
|
68
|
+
export declare const transformPlotlyJsonToPolarChartProps: (input: PlotlySchema, isMultiPlot: boolean, colorMap: React.RefObject<Map<string, string>>, colorwayType: ColorwayType, isDarkTheme?: boolean) => IPolarChartProps;
|
|
68
69
|
/**
|
|
69
70
|
* Interate iteratively through the trace object and find all the array attributes.
|
|
70
71
|
* 1 trace record = 1 series of data
|
|
@@ -76,4 +77,5 @@ export declare const getNumberAtIndexOrDefault: (data: PlotData["z"] | undefined
|
|
|
76
77
|
export declare const getValidXYRanges: (series: Partial<PlotData>, resolveX?: (v: Datum) => Datum, resolveY?: (v: Datum) => Datum) => [number, number][];
|
|
77
78
|
export declare const isNonPlotType: (chartType: string) => boolean;
|
|
78
79
|
export declare const getGridProperties: (schema: PlotlySchema | undefined, isMultiPlot: boolean, validTracesInfo: TraceInfo[]) => GridProperties;
|
|
80
|
+
export declare const DEFAULT_POLAR_SUBPLOT = "polar";
|
|
79
81
|
export {};
|