@fluentui/react-charting 5.25.5 → 5.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +87 -1
- package/CHANGELOG.md +28 -2
- package/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,7 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../../utilities/colors", "../GaugeChart/index", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-shape", "./PlotlyColorAdapter", "d3-color", "@fluentui/react"], function (require, exports, tslib_1, d3_array_1, d3_scale_1, d3_format_1, colors_1, index_1, utilities_1, chart_utilities_1, d3_shape_1, PlotlyColorAdapter_1, d3_color_1, react_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.
|
|
4
|
+
exports.DEFAULT_POLAR_SUBPLOT = exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.transformPlotlyJsonToPolarChartProps = exports.transformPlotlyJsonToFunnelChartProps = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToGanttChartProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToLineChartProps = exports.transformPlotlyJsonToAreaChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports.transformPlotlyJsonToAnnotationChartProps = exports.normalizeObjectArrayForGVBC = exports.resolveXAxisPoint = exports._getGaugeAxisColor = exports.correctYearMonth = exports.SINGLE_REPEAT = exports.NON_PLOT_KEY_PREFIX = void 0;
|
|
5
5
|
exports.findArrayAttributes = findArrayAttributes;
|
|
6
6
|
exports.NON_PLOT_KEY_PREFIX = 'nonplot_';
|
|
7
7
|
exports.SINGLE_REPEAT = 'repeat(1, 1fr)';
|
|
@@ -44,12 +44,15 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
function getTitles(layout) {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
48
|
+
var titleObj = layout === null || layout === void 0 ? void 0 : layout.title;
|
|
49
|
+
var chartTitle = typeof titleObj === 'string' ? titleObj : (_a = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _a !== void 0 ? _a : '';
|
|
50
|
+
var titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
|
|
51
|
+
var titleXAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.xanchor : undefined;
|
|
52
|
+
var titleYAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.yanchor : undefined;
|
|
53
|
+
var titlePad = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.pad : undefined;
|
|
54
|
+
var titleStyles = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (titleFont ? { titleFont: titleFont } : {})), (titleXAnchor ? { titleXAnchor: titleXAnchor } : {})), (titleYAnchor ? { titleYAnchor: titleYAnchor } : {})), (titlePad ? { titlePad: titlePad } : {}));
|
|
55
|
+
var titles = tslib_1.__assign(tslib_1.__assign({ chartTitle: chartTitle }, (Object.keys(titleStyles).length > 0 ? { titleStyles: titleStyles } : {})), { xAxisTitle: typeof ((_b = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _b === void 0 ? void 0 : _b.title) === 'string' ? (_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title : (_f = (_e = (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.text) !== null && _f !== void 0 ? _f : '', yAxisTitle: typeof ((_g = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _g === void 0 ? void 0 : _g.title) === 'string' ? (_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title : (_l = (_k = (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title) === null || _k === void 0 ? void 0 : _k.text) !== null && _l !== void 0 ? _l : '', xAxisAnnotation: chartTitle });
|
|
53
56
|
return titles;
|
|
54
57
|
}
|
|
55
58
|
var getXAxisTickFormat = function (series, layout) {
|
|
@@ -1022,7 +1025,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1022
1025
|
var innerRadius = firstData.hole
|
|
1023
1026
|
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
|
|
1024
1027
|
: utilities_1.MIN_DONUT_RADIUS;
|
|
1025
|
-
var
|
|
1028
|
+
var _r = getTitles(input.layout), chartTitle = _r.chartTitle, titleStyles = _r.titleStyles;
|
|
1026
1029
|
// Build anticlockwise order by keeping the first item, reversing the rest
|
|
1027
1030
|
var legends = Object.keys(mapLegendToDataPoint);
|
|
1028
1031
|
var reorderedEntries = legends.length > 1
|
|
@@ -1033,36 +1036,26 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1033
1036
|
.reverse()
|
|
1034
1037
|
.map(function (key) { return [key, mapLegendToDataPoint[key]]; }), true)
|
|
1035
1038
|
: legends.map(function (key) { return [key, mapLegendToDataPoint[key]]; });
|
|
1036
|
-
return {
|
|
1037
|
-
data: {
|
|
1039
|
+
return tslib_1.__assign({ data: {
|
|
1038
1040
|
chartTitle: chartTitle,
|
|
1039
1041
|
chartData: reorderedEntries.map(function (_a) {
|
|
1040
1042
|
var v = _a[1];
|
|
1041
1043
|
return v;
|
|
1042
1044
|
}),
|
|
1043
|
-
},
|
|
1044
|
-
hideLegend: isMultiPlot || ((_p = input.layout) === null || _p === void 0 ? void 0 : _p.showlegend) === false,
|
|
1045
|
-
width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width,
|
|
1046
|
-
height: height,
|
|
1047
|
-
innerRadius: innerRadius,
|
|
1048
|
-
hideLabels: hideLabels,
|
|
1049
|
-
showLabelsInPercent: firstData.textinfo
|
|
1045
|
+
}, hideLegend: isMultiPlot || ((_p = input.layout) === null || _p === void 0 ? void 0 : _p.showlegend) === false, width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width, height: height, innerRadius: innerRadius, hideLabels: hideLabels, showLabelsInPercent: firstData.textinfo
|
|
1050
1046
|
? ['percent', 'label+percent', 'percent+label'].includes(firstData.textinfo)
|
|
1051
|
-
: true,
|
|
1052
|
-
roundCorners: true,
|
|
1053
|
-
order: 'sorted',
|
|
1054
|
-
};
|
|
1047
|
+
: true, roundCorners: true, order: 'sorted' }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1055
1048
|
};
|
|
1056
1049
|
exports.transformPlotlyJsonToDonutProps = transformPlotlyJsonToDonutProps;
|
|
1057
1050
|
var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot,
|
|
1058
1051
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1059
1052
|
colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
1060
|
-
var _a, _b, _c, _d, _e
|
|
1053
|
+
var _a, _b, _c, _d, _e;
|
|
1061
1054
|
var mapXToDataPoints = {};
|
|
1062
1055
|
var yMaxValue = 0;
|
|
1063
1056
|
var yMinValue = 0;
|
|
1064
1057
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
1065
|
-
var
|
|
1058
|
+
var _f = getLegendProps(input.data, input.layout, isMultiPlot), legends = _f.legends, hideLegend = _f.hideLegend;
|
|
1066
1059
|
var colorScale = undefined;
|
|
1067
1060
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1068
1061
|
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
@@ -1199,7 +1192,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1199
1192
|
});
|
|
1200
1193
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
1201
1194
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1202
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, height: (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundedTicks: true
|
|
1195
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, height: (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1203
1196
|
};
|
|
1204
1197
|
exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
|
|
1205
1198
|
var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot,
|
|
@@ -1302,15 +1295,15 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1302
1295
|
}
|
|
1303
1296
|
});
|
|
1304
1297
|
var annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
1305
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dataV2: gvbcDataV2, width: (_a = processedInput.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = processedInput.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barwidth: 'auto', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, roundedTicks: true,
|
|
1298
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dataV2: gvbcDataV2, width: (_a = processedInput.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = processedInput.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barwidth: 'auto', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }), getXMinMaxValues(processedInput.data[0], processedInput.layout)), getTitles(processedInput.layout)), getAxisCategoryOrderProps(processedInput.data, processedInput.layout)), getYMinMaxValues(processedInput.data[0], processedInput.layout)), getXAxisTickFormat(processedInput.data[0], processedInput.layout)), yAxisTickFormat), getBarProps(processedInput.data, processedInput.layout)), getAxisTickProps(processedInput.data, processedInput.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1306
1299
|
};
|
|
1307
1300
|
exports.transformPlotlyJsonToGVBCProps = transformPlotlyJsonToGVBCProps;
|
|
1308
1301
|
var transformPlotlyJsonToVBCProps = function (input, isMultiPlot,
|
|
1309
1302
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1310
1303
|
colorMap, colorwayType, isDarkTheme) {
|
|
1311
|
-
var _a, _b, _c
|
|
1304
|
+
var _a, _b, _c;
|
|
1312
1305
|
var vbcData = [];
|
|
1313
|
-
var
|
|
1306
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
1314
1307
|
var colorScale = undefined;
|
|
1315
1308
|
input.data.forEach(function (series, seriesIdx) {
|
|
1316
1309
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1370,7 +1363,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1370
1363
|
});
|
|
1371
1364
|
});
|
|
1372
1365
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1373
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true, roundedTicks: true,
|
|
1366
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }, getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1374
1367
|
};
|
|
1375
1368
|
exports.transformPlotlyJsonToVBCProps = transformPlotlyJsonToVBCProps;
|
|
1376
1369
|
var transformPlotlyJsonToAreaChartProps = function (input, isMultiPlot,
|
|
@@ -1429,9 +1422,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1429
1422
|
var mode = 'tonexty';
|
|
1430
1423
|
var _q = getLegendProps(input.data, input.layout, isMultiPlot), legends = _q.legends, hideLegend = _q.hideLegend;
|
|
1431
1424
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1432
|
-
var
|
|
1433
|
-
var resolveXValue = getAxisValueResolver(xAxisType);
|
|
1434
|
-
var shouldWrapLabels = xAxisType === 'category';
|
|
1425
|
+
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
1435
1426
|
var chartData = input.data
|
|
1436
1427
|
.map(function (series, index) {
|
|
1437
1428
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -1566,7 +1557,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1566
1557
|
scatterChartData: tslib_1.__spreadArray(tslib_1.__spreadArray([], chartData, true), lineShape, true),
|
|
1567
1558
|
};
|
|
1568
1559
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1569
|
-
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000,
|
|
1560
|
+
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000, showYAxisLables: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getAxisScaleTypeProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1570
1561
|
if (isAreaChart) {
|
|
1571
1562
|
return tslib_1.__assign({ data: chartProps, mode: mode }, commonProps);
|
|
1572
1563
|
}
|
|
@@ -1857,14 +1848,14 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1857
1848
|
var rangeValuesForColorScale = Array.isArray(colorscale)
|
|
1858
1849
|
? colorscale.map(function (arr) { return arr[1]; })
|
|
1859
1850
|
: defaultRange;
|
|
1860
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (_9 = input.layout) === null || _9 === void 0 ? void 0 : _9.width, height: (_11 = (_10 = input.layout) === null || _10 === void 0 ? void 0 : _10.height) !== null && _11 !== void 0 ? _11 : 350, hideTickOverlap: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true
|
|
1851
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (_9 = input.layout) === null || _9 === void 0 ? void 0 : _9.width, height: (_11 = (_10 = input.layout) === null || _10 === void 0 ? void 0 : _10.height) !== null && _11 !== void 0 ? _11 : 350, hideTickOverlap: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true }, getTitles(input.layout)), getAxisCategoryOrderProps([firstData], input.layout)), getAxisTickProps(input.data, input.layout));
|
|
1861
1852
|
};
|
|
1862
1853
|
exports.transformPlotlyJsonToHeatmapProps = transformPlotlyJsonToHeatmapProps;
|
|
1863
1854
|
var transformPlotlyJsonToSankeyProps = function (input, isMultiPlot,
|
|
1864
1855
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1865
1856
|
colorMap, colorwayType, isDarkTheme) {
|
|
1866
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1867
|
-
var
|
|
1857
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1858
|
+
var _r = input.data[0], link = _r.link, node = _r.node;
|
|
1868
1859
|
var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
|
|
1869
1860
|
.map(function (val, index) {
|
|
1870
1861
|
var _a, _b;
|
|
@@ -1901,17 +1892,11 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1901
1892
|
var styles = {
|
|
1902
1893
|
root: tslib_1.__assign({}, (((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.font) === null || _k === void 0 ? void 0 : _k.size) ? { fontSize: (_l = input.layout.font) === null || _l === void 0 ? void 0 : _l.size } : {})),
|
|
1903
1894
|
};
|
|
1904
|
-
var
|
|
1905
|
-
return {
|
|
1906
|
-
data: {
|
|
1895
|
+
var _s = getTitles(input.layout), chartTitle = _s.chartTitle, titleStyles = _s.titleStyles;
|
|
1896
|
+
return tslib_1.__assign({ data: {
|
|
1907
1897
|
chartTitle: chartTitle,
|
|
1908
1898
|
SankeyChartData: sankeyChartData,
|
|
1909
|
-
},
|
|
1910
|
-
width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width,
|
|
1911
|
-
height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 468,
|
|
1912
|
-
styles: styles,
|
|
1913
|
-
enableReflow: false,
|
|
1914
|
-
};
|
|
1899
|
+
}, width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 468, styles: styles, enableReflow: false, hideLegend: isMultiPlot || ((_q = input.layout) === null || _q === void 0 ? void 0 : _q.showlegend) === false }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1915
1900
|
};
|
|
1916
1901
|
exports.transformPlotlyJsonToSankeyProps = transformPlotlyJsonToSankeyProps;
|
|
1917
1902
|
var transformPlotlyJsonToGaugeProps = function (input, isMultiPlot,
|
|
@@ -1967,22 +1952,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
1967
1952
|
fill: sublabelColor,
|
|
1968
1953
|
},
|
|
1969
1954
|
};
|
|
1970
|
-
var
|
|
1971
|
-
return {
|
|
1972
|
-
segments: segments,
|
|
1973
|
-
chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0,
|
|
1974
|
-
chartTitle: chartTitle,
|
|
1975
|
-
sublabel: sublabel,
|
|
1955
|
+
var _32 = getTitles(input.layout), chartTitle = _32.chartTitle, titleStyles = _32.titleStyles;
|
|
1956
|
+
return tslib_1.__assign({ segments: segments, chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0, chartTitle: chartTitle, sublabel: sublabel,
|
|
1976
1957
|
// range values can be null
|
|
1977
|
-
minValue: typeof ((_17 = (_16 = (_15 = firstData.gauge) === null || _15 === void 0 ? void 0 : _15.axis) === null || _16 === void 0 ? void 0 : _16.range) === null || _17 === void 0 ? void 0 : _17[0]) === 'number' ? (_20 = (_19 = (_18 = firstData.gauge) === null || _18 === void 0 ? void 0 : _18.axis) === null || _19 === void 0 ? void 0 : _19.range) === null || _20 === void 0 ? void 0 : _20[0] : undefined,
|
|
1978
|
-
maxValue: typeof ((_23 = (_22 = (_21 = firstData.gauge) === null || _21 === void 0 ? void 0 : _21.axis) === null || _22 === void 0 ? void 0 : _22.range) === null || _23 === void 0 ? void 0 : _23[1]) === 'number' ? (_26 = (_25 = (_24 = firstData.gauge) === null || _24 === void 0 ? void 0 : _24.axis) === null || _25 === void 0 ? void 0 : _25.range) === null || _26 === void 0 ? void 0 : _26[1] : undefined,
|
|
1979
|
-
chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
|
|
1980
|
-
width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width,
|
|
1981
|
-
height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220,
|
|
1982
|
-
styles: styles,
|
|
1983
|
-
variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment,
|
|
1984
|
-
roundCorners: true,
|
|
1985
|
-
};
|
|
1958
|
+
minValue: typeof ((_17 = (_16 = (_15 = firstData.gauge) === null || _15 === void 0 ? void 0 : _15.axis) === null || _16 === void 0 ? void 0 : _16.range) === null || _17 === void 0 ? void 0 : _17[0]) === 'number' ? (_20 = (_19 = (_18 = firstData.gauge) === null || _18 === void 0 ? void 0 : _18.axis) === null || _19 === void 0 ? void 0 : _19.range) === null || _20 === void 0 ? void 0 : _20[0] : undefined, maxValue: typeof ((_23 = (_22 = (_21 = firstData.gauge) === null || _21 === void 0 ? void 0 : _21.axis) === null || _22 === void 0 ? void 0 : _22.range) === null || _23 === void 0 ? void 0 : _23[1]) === 'number' ? (_26 = (_25 = (_24 = firstData.gauge) === null || _24 === void 0 ? void 0 : _24.axis) === null || _25 === void 0 ? void 0 : _25.range) === null || _26 === void 0 ? void 0 : _26[1] : undefined, chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; }, width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width, height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220, styles: styles, variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment, roundCorners: true }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1986
1959
|
};
|
|
1987
1960
|
exports.transformPlotlyJsonToGaugeProps = transformPlotlyJsonToGaugeProps;
|
|
1988
1961
|
var cleanText = function (text) {
|
|
@@ -2097,13 +2070,8 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2097
2070
|
font: tslib_1.__assign(tslib_1.__assign({}, ((_t = templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.font) !== null && _t !== void 0 ? _t : {})), ((_u = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.font) !== null && _u !== void 0 ? _u : {})),
|
|
2098
2071
|
values: (_w = (_v = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.values) !== null && _v !== void 0 ? _v : templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.values) !== null && _w !== void 0 ? _w : [],
|
|
2099
2072
|
};
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
rows: rows,
|
|
2103
|
-
width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width,
|
|
2104
|
-
height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height,
|
|
2105
|
-
styles: styles,
|
|
2106
|
-
};
|
|
2073
|
+
var _1 = getTitles(input.layout), chartTitle = _1.chartTitle, titleStyles = _1.titleStyles;
|
|
2074
|
+
return tslib_1.__assign({ headers: normalizeHeaders((_y = (_x = tableData.header) === null || _x === void 0 ? void 0 : _x.values) !== null && _y !== void 0 ? _y : [], header), rows: rows, width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width, height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height, styles: styles, chartTitle: chartTitle }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
2107
2075
|
};
|
|
2108
2076
|
exports.transformPlotlyJsonToChartTableProps = transformPlotlyJsonToChartTableProps;
|
|
2109
2077
|
function getCategoriesAndValues(series) {
|
|
@@ -2221,144 +2189,62 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2221
2189
|
});
|
|
2222
2190
|
});
|
|
2223
2191
|
}
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
|
|
2227
|
-
height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
|
|
2228
|
-
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
2229
|
-
hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
|
|
2230
|
-
};
|
|
2192
|
+
var _e = getTitles(input.layout), chartTitle = _e.chartTitle, titleStyles = _e.titleStyles;
|
|
2193
|
+
return tslib_1.__assign({ data: funnelData, chartTitle: chartTitle, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height, orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical', hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
2231
2194
|
};
|
|
2232
2195
|
exports.transformPlotlyJsonToFunnelChartProps = transformPlotlyJsonToFunnelChartProps;
|
|
2233
|
-
var
|
|
2234
|
-
var _a, _b, _c
|
|
2235
|
-
var
|
|
2236
|
-
|
|
2237
|
-
var
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
var
|
|
2241
|
-
if (
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
projection.data[sindex] = series;
|
|
2277
|
-
return "continue";
|
|
2278
|
-
}
|
|
2279
|
-
// retrieve polar axis settings
|
|
2280
|
-
var dirMultiplier = ((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.polar) === null || _b === void 0 ? void 0 : _b.angularaxis) === null || _c === void 0 ? void 0 : _c.direction) === 'clockwise' ? -1 : 1;
|
|
2281
|
-
var startAngleInRad = (((_g = (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.polar) === null || _e === void 0 ? void 0 : _e.angularaxis) === null || _f === void 0 ? void 0 : _f.rotation) !== null && _g !== void 0 ? _g : 0) * Math.PI) / 180;
|
|
2282
|
-
// Compute tick positions if categorical
|
|
2283
|
-
var uniqueTheta = [];
|
|
2284
|
-
var categorical = false;
|
|
2285
|
-
if (!(0, chart_utilities_1.isNumberArray)(thetas)) {
|
|
2286
|
-
uniqueTheta = Array.from(new Set(thetas));
|
|
2287
|
-
categorical = true;
|
|
2288
|
-
}
|
|
2289
|
-
for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
|
|
2290
|
-
if ((0, chart_utilities_1.isInvalidValue)(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || (0, chart_utilities_1.isInvalidValue)(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
|
|
2291
|
-
continue;
|
|
2292
|
-
}
|
|
2293
|
-
// Map theta to angle in radians
|
|
2294
|
-
var thetaRad = void 0;
|
|
2295
|
-
if (categorical) {
|
|
2296
|
-
var idx = uniqueTheta.indexOf(thetas[ptindex]);
|
|
2297
|
-
var step = (2 * Math.PI) / uniqueTheta.length;
|
|
2298
|
-
thetaRad = startAngleInRad + dirMultiplier * idx * step;
|
|
2196
|
+
var transformPlotlyJsonToPolarChartProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
2197
|
+
var _a, _b, _c;
|
|
2198
|
+
var polarData = [];
|
|
2199
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
2200
|
+
var resolveRValue = getAxisValueResolver(getPolarAxis(input.data, 'r', input.layout)._type);
|
|
2201
|
+
input.data.forEach(function (series, index) {
|
|
2202
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2203
|
+
var legend = legends[index];
|
|
2204
|
+
if (series.type === 'scatterpolar') {
|
|
2205
|
+
var isAreaTrace = series.fill === 'toself' || series.fill === 'tonext';
|
|
2206
|
+
var isLineTrace = typeof series.mode === 'undefined' ? true : series.mode.includes('lines');
|
|
2207
|
+
var colors = isAreaTrace ? series.fillcolor : isLineTrace ? (_a = series.line) === null || _a === void 0 ? void 0 : _a.color : (_b = series.marker) === null || _b === void 0 ? void 0 : _b.color;
|
|
2208
|
+
var extractedColors_2 = (0, PlotlyColorAdapter_1.extractColor)((_e = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.template) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.colorway, colorwayType, colors, colorMap, isDarkTheme);
|
|
2209
|
+
var seriesColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, index, legend, colorMap, (_h = (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.colorway, isDarkTheme);
|
|
2210
|
+
var seriesOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index);
|
|
2211
|
+
var finalSeriesColor_1 = (0, d3_color_1.rgb)(seriesColor).copy({ opacity: seriesOpacity }).formatHex8();
|
|
2212
|
+
var lineOptions = getLineOptions(series.line);
|
|
2213
|
+
var thetaUnit_1 = series.thetaunit;
|
|
2214
|
+
var commonProps = {
|
|
2215
|
+
legend: legend,
|
|
2216
|
+
legendShape: getLegendShape(series),
|
|
2217
|
+
color: finalSeriesColor_1,
|
|
2218
|
+
data: ((_j = series.r) === null || _j === void 0 ? void 0 : _j.map(function (r, rIndex) {
|
|
2219
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2220
|
+
var theta = (_a = series.theta) === null || _a === void 0 ? void 0 : _a[rIndex];
|
|
2221
|
+
var markerSize = Array.isArray((_b = series.marker) === null || _b === void 0 ? void 0 : _b.size) ? series.marker.size[rIndex] : (_c = series.marker) === null || _c === void 0 ? void 0 : _c.size;
|
|
2222
|
+
var text = Array.isArray(series.text) ? series.text[rIndex] : series.text;
|
|
2223
|
+
var markerColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, rIndex, legend, colorMap, (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.template) === null || _e === void 0 ? void 0 : _e.layout) === null || _f === void 0 ? void 0 : _f.colorway, isDarkTheme);
|
|
2224
|
+
var markerOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, rIndex);
|
|
2225
|
+
if ((0, chart_utilities_1.isInvalidValue)(resolveRValue(r)) || (0, chart_utilities_1.isInvalidValue)(theta)) {
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2228
|
+
return tslib_1.__assign(tslib_1.__assign({ r: resolveRValue(r), theta: typeof theta === 'number'
|
|
2229
|
+
? thetaUnit_1 === 'radians'
|
|
2230
|
+
? (theta * 180) / Math.PI
|
|
2231
|
+
: thetaUnit_1 === 'gradians'
|
|
2232
|
+
? theta * 0.9
|
|
2233
|
+
: theta
|
|
2234
|
+
: theta, color: markerColor ? (0, d3_color_1.rgb)(markerColor).copy({ opacity: markerOpacity }).formatHex8() : finalSeriesColor_1 }, (typeof markerSize !== 'undefined' ? { markerSize: markerSize } : {})), (typeof text !== 'undefined' ? { text: text } : {}));
|
|
2235
|
+
}).filter(function (item) { return typeof item !== 'undefined'; })) || [],
|
|
2236
|
+
};
|
|
2237
|
+
if (isAreaTrace || isLineTrace) {
|
|
2238
|
+
polarData.push(tslib_1.__assign(tslib_1.__assign({ type: isAreaTrace ? 'areapolar' : 'linepolar' }, commonProps), { lineOptions: lineOptions }));
|
|
2299
2239
|
}
|
|
2300
2240
|
else {
|
|
2301
|
-
|
|
2241
|
+
polarData.push(tslib_1.__assign({ type: 'scatterpolar' }, commonProps));
|
|
2302
2242
|
}
|
|
2303
|
-
// Shift only the polar origin (not the cartesian)
|
|
2304
|
-
var rawRadius = rVals[ptindex];
|
|
2305
|
-
var polarRadius = rawRadius + radiusShift; // Only for projection
|
|
2306
|
-
// Calculate cartesian coordinates (with shifted polar origin)
|
|
2307
|
-
var x = polarRadius * Math.cos(thetaRad);
|
|
2308
|
-
var y = polarRadius * Math.sin(thetaRad);
|
|
2309
|
-
// Calculate the cartesian coordinates of the original polar origin (0,0)
|
|
2310
|
-
// This is the point that should be mapped to (0,0) in cartesian coordinates
|
|
2311
|
-
if (sindex === 0 && ptindex === 0) {
|
|
2312
|
-
// For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
|
|
2313
|
-
// But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
|
|
2314
|
-
originX = radiusShift;
|
|
2315
|
-
}
|
|
2316
|
-
series.x.push(x);
|
|
2317
|
-
series.y.push(y);
|
|
2318
|
-
allX.push(x);
|
|
2319
|
-
allY.push(y);
|
|
2320
|
-
}
|
|
2321
|
-
// Map text to each data point for downstream chart rendering
|
|
2322
|
-
if (series.x && series.y) {
|
|
2323
|
-
series.data = series.x.map(function (xVal, idx) { return (tslib_1.__assign({ x: xVal, y: series.y[idx] }, (series.text ? { text: series.text[idx] } : {}))); });
|
|
2324
2243
|
}
|
|
2325
|
-
|
|
2326
|
-
};
|
|
2327
|
-
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
2328
|
-
_loop_1(sindex);
|
|
2329
|
-
}
|
|
2330
|
-
// 7. Recenter all cartesian coordinates
|
|
2331
|
-
if (originX !== null) {
|
|
2332
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2333
|
-
var series = projection.data[sindex];
|
|
2334
|
-
if (series.x && series.y) {
|
|
2335
|
-
series.x = series.x.map(function (v) { return v - originX; });
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2338
|
-
// Also recenter allX for normalization
|
|
2339
|
-
for (var i = 0; i < allX.length; i++) {
|
|
2340
|
-
allX[i] = allX[i] - originX;
|
|
2341
|
-
}
|
|
2342
|
-
}
|
|
2343
|
-
// 8. Find the maximum absolute value among all x and y
|
|
2344
|
-
var maxAbs = Math.max.apply(Math, tslib_1.__spreadArray(tslib_1.__spreadArray([], allX.map(Math.abs), false), allY.map(Math.abs), false));
|
|
2345
|
-
maxAbs = maxAbs === 0 ? 1 : maxAbs;
|
|
2346
|
-
// 9. Rescale all points so that the largest |x| or |y| is 0.5
|
|
2347
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2348
|
-
var series = projection.data[sindex];
|
|
2349
|
-
if (series.x && series.y) {
|
|
2350
|
-
series.x = series.x.map(function (v) { return v / (2 * maxAbs); });
|
|
2351
|
-
series.y = series.y.map(function (v) { return v / (2 * maxAbs); });
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
// 10. Customize layout for perfect square with absolute positioning
|
|
2355
|
-
var size = ((_h = input.layout) === null || _h === void 0 ? void 0 : _h.width) || ((_j = input.layout) === null || _j === void 0 ? void 0 : _j.height) || 500;
|
|
2356
|
-
projection.layout = tslib_1.__assign(tslib_1.__assign({}, projection.layout), { width: size, height: size });
|
|
2357
|
-
// Attach originX as custom properties
|
|
2358
|
-
projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
|
|
2359
|
-
return projection;
|
|
2244
|
+
});
|
|
2245
|
+
return tslib_1.__assign({ data: polarData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 400, hideLegend: hideLegend }, getPolarAxisProps(input.data, input.layout));
|
|
2360
2246
|
};
|
|
2361
|
-
exports.
|
|
2247
|
+
exports.transformPlotlyJsonToPolarChartProps = transformPlotlyJsonToPolarChartProps;
|
|
2362
2248
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2363
2249
|
function isPlainObject(obj) {
|
|
2364
2250
|
if (window && window.process && window.process.versions) {
|
|
@@ -2672,6 +2558,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2672
2558
|
var domainXInfo = {
|
|
2673
2559
|
start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
|
|
2674
2560
|
end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1,
|
|
2561
|
+
cellName: "x".concat(domainX.length === 0 ? '' : domainX.length + 1),
|
|
2675
2562
|
};
|
|
2676
2563
|
domainX.push(domainXInfo);
|
|
2677
2564
|
}
|
|
@@ -2690,6 +2577,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2690
2577
|
var domainYInfo = {
|
|
2691
2578
|
start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
|
|
2692
2579
|
end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1,
|
|
2580
|
+
cellName: "x".concat(domainY.length === 0 ? '' : domainY.length + 1),
|
|
2693
2581
|
};
|
|
2694
2582
|
domainY.push(domainYInfo);
|
|
2695
2583
|
}
|
|
@@ -2703,16 +2591,36 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2703
2591
|
var domainXInfo = {
|
|
2704
2592
|
start: ((_b = series.domain) === null || _b === void 0 ? void 0 : _b.x) ? series.domain.x[0] : 0,
|
|
2705
2593
|
end: ((_c = series.domain) === null || _c === void 0 ? void 0 : _c.x) ? series.domain.x[1] : 1,
|
|
2594
|
+
cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainX.length - cartesianDomains + 1),
|
|
2706
2595
|
};
|
|
2707
2596
|
var domainYInfo = {
|
|
2708
2597
|
start: ((_d = series.domain) === null || _d === void 0 ? void 0 : _d.y) ? series.domain.y[0] : 0,
|
|
2709
2598
|
end: ((_e = series.domain) === null || _e === void 0 ? void 0 : _e.y) ? series.domain.y[1] : 1,
|
|
2599
|
+
cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainY.length - cartesianDomains + 1),
|
|
2710
2600
|
};
|
|
2711
2601
|
domainX.push(domainXInfo);
|
|
2712
2602
|
domainY.push(domainYInfo);
|
|
2713
2603
|
}
|
|
2714
2604
|
});
|
|
2715
2605
|
if (layout !== undefined && layout !== null && Object.keys(layout).length > 0) {
|
|
2606
|
+
Object.keys(layout !== null && layout !== void 0 ? layout : {}).forEach(function (key) {
|
|
2607
|
+
var _a, _b, _c, _d;
|
|
2608
|
+
if (key.startsWith('polar')) {
|
|
2609
|
+
var polarLayout = layout[key];
|
|
2610
|
+
var domainXInfo = {
|
|
2611
|
+
start: ((_a = polarLayout.domain) === null || _a === void 0 ? void 0 : _a.x) ? polarLayout.domain.x[0] : 0,
|
|
2612
|
+
end: ((_b = polarLayout.domain) === null || _b === void 0 ? void 0 : _b.x) ? polarLayout.domain.x[1] : 1,
|
|
2613
|
+
cellName: key,
|
|
2614
|
+
};
|
|
2615
|
+
var domainYInfo = {
|
|
2616
|
+
start: ((_c = polarLayout.domain) === null || _c === void 0 ? void 0 : _c.y) ? polarLayout.domain.y[0] : 0,
|
|
2617
|
+
end: ((_d = polarLayout.domain) === null || _d === void 0 ? void 0 : _d.y) ? polarLayout.domain.y[1] : 1,
|
|
2618
|
+
cellName: key,
|
|
2619
|
+
};
|
|
2620
|
+
domainX.push(domainXInfo);
|
|
2621
|
+
domainY.push(domainYInfo);
|
|
2622
|
+
}
|
|
2623
|
+
});
|
|
2716
2624
|
(_a = layout.annotations) === null || _a === void 0 ? void 0 : _a.forEach(function (annotation) {
|
|
2717
2625
|
var xMatches = domainX.flatMap(function (interval, idx) {
|
|
2718
2626
|
return (annotation === null || annotation === void 0 ? void 0 : annotation.x) >= interval.start && (annotation === null || annotation === void 0 ? void 0 : annotation.x) <= interval.end ? [idx] : [];
|
|
@@ -2748,9 +2656,6 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2748
2656
|
.sort();
|
|
2749
2657
|
templateColumns = "repeat(".concat(sortedXStart_1.length, ", 1fr)");
|
|
2750
2658
|
domainX.forEach(function (interval, index) {
|
|
2751
|
-
var cellName = index >= cartesianDomains
|
|
2752
|
-
? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2753
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2754
2659
|
var columnIndex = sortedXStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2755
2660
|
var columnNumber = columnIndex + 1; // Column numbers are 1-based
|
|
2756
2661
|
var annotationProps = annotations[index];
|
|
@@ -2762,7 +2667,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2762
2667
|
xDomain: interval,
|
|
2763
2668
|
yDomain: { start: 0, end: 1 }, // Default yDomain for x-axis
|
|
2764
2669
|
};
|
|
2765
|
-
gridLayout[cellName] = row;
|
|
2670
|
+
gridLayout[interval.cellName] = row;
|
|
2766
2671
|
});
|
|
2767
2672
|
}
|
|
2768
2673
|
if (domainY.length > 0) {
|
|
@@ -2779,14 +2684,11 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2779
2684
|
var numberOfRows_1 = sortedYStart_1.length;
|
|
2780
2685
|
templateRows = "repeat(".concat(numberOfRows_1, ", 1fr)");
|
|
2781
2686
|
domainY.forEach(function (interval, index) {
|
|
2782
|
-
var cellName = index >= cartesianDomains
|
|
2783
|
-
? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2784
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2785
2687
|
var rowIndex = sortedYStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2786
2688
|
var rowNumber = numberOfRows_1 - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
|
|
2787
2689
|
var annotationProps = annotations[index];
|
|
2788
2690
|
var yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
|
|
2789
|
-
var cell = gridLayout[cellName];
|
|
2691
|
+
var cell = gridLayout[interval.cellName];
|
|
2790
2692
|
if (cell !== undefined) {
|
|
2791
2693
|
cell.row = rowNumber;
|
|
2792
2694
|
cell.yAnnotation = yAnnotation;
|
|
@@ -2938,19 +2840,20 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2938
2840
|
return;
|
|
2939
2841
|
}
|
|
2940
2842
|
var axType = getAxisType(data, ax);
|
|
2843
|
+
if (axId === 'x' && axType === 'category') {
|
|
2844
|
+
props.xAxis = {
|
|
2845
|
+
tickLayout: 'auto',
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2941
2848
|
if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
|
|
2942
2849
|
var tickValues = axType === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
2943
2850
|
if (axId === 'x') {
|
|
2944
2851
|
props.tickValues = tickValues;
|
|
2945
|
-
props.xAxis = {
|
|
2946
|
-
tickText: ax.ticktext,
|
|
2947
|
-
};
|
|
2852
|
+
props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickText: ax.ticktext });
|
|
2948
2853
|
}
|
|
2949
2854
|
else if (axId === 'y') {
|
|
2950
2855
|
props.yAxisTickValues = tickValues;
|
|
2951
|
-
props.yAxis = {
|
|
2952
|
-
tickText: ax.ticktext,
|
|
2953
|
-
};
|
|
2856
|
+
props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickText: ax.ticktext });
|
|
2954
2857
|
}
|
|
2955
2858
|
return;
|
|
2956
2859
|
}
|
|
@@ -2958,16 +2861,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
2958
2861
|
var dtick = plotlyDtick(ax.dtick, axType);
|
|
2959
2862
|
var tick0 = plotlyTick0(ax.tick0, axType, dtick);
|
|
2960
2863
|
if (axId === 'x') {
|
|
2961
|
-
props.xAxis = {
|
|
2962
|
-
tickStep: dtick,
|
|
2963
|
-
tick0: tick0,
|
|
2964
|
-
};
|
|
2864
|
+
props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickStep: dtick, tick0: tick0 });
|
|
2965
2865
|
}
|
|
2966
2866
|
else if (axId === 'y') {
|
|
2967
|
-
props.yAxis = {
|
|
2968
|
-
tickStep: dtick,
|
|
2969
|
-
tick0: tick0,
|
|
2970
|
-
};
|
|
2867
|
+
props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickStep: dtick, tick0: tick0 });
|
|
2971
2868
|
}
|
|
2972
2869
|
return;
|
|
2973
2870
|
}
|
|
@@ -3120,5 +3017,93 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
3120
3017
|
}
|
|
3121
3018
|
};
|
|
3122
3019
|
};
|
|
3020
|
+
var POLAR_AXIS_BY_DATA_KEY = {
|
|
3021
|
+
r: 'radialAxis',
|
|
3022
|
+
theta: 'angularAxis',
|
|
3023
|
+
};
|
|
3024
|
+
exports.DEFAULT_POLAR_SUBPLOT = 'polar';
|
|
3025
|
+
var getPolarLayout = function (trace, layout) {
|
|
3026
|
+
var subplotId = ((trace === null || trace === void 0 ? void 0 : trace.subplot) || exports.DEFAULT_POLAR_SUBPLOT);
|
|
3027
|
+
return layout === null || layout === void 0 ? void 0 : layout[subplotId];
|
|
3028
|
+
};
|
|
3029
|
+
var getValidAxisValues = function (data, dataKey) {
|
|
3030
|
+
var values = [];
|
|
3031
|
+
data.forEach(function (series) {
|
|
3032
|
+
if ((0, chart_utilities_1.isArrayOrTypedArray)(series[dataKey])) {
|
|
3033
|
+
series[dataKey].forEach(function (val) {
|
|
3034
|
+
if (!(0, chart_utilities_1.isInvalidValue)(val)) {
|
|
3035
|
+
values.push(val);
|
|
3036
|
+
}
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
});
|
|
3040
|
+
return values;
|
|
3041
|
+
};
|
|
3042
|
+
var getPolarAxisType = function (data, dataKey, declaredType) {
|
|
3043
|
+
if (['linear', 'log', 'date', 'category'].includes(declaredType !== null && declaredType !== void 0 ? declaredType : '')) {
|
|
3044
|
+
return declaredType;
|
|
3045
|
+
}
|
|
3046
|
+
var values = getValidAxisValues(data, dataKey);
|
|
3047
|
+
if ((0, chart_utilities_1.isNumberArray)(values) && !(0, chart_utilities_1.isYearArray)(values)) {
|
|
3048
|
+
return 'linear';
|
|
3049
|
+
}
|
|
3050
|
+
if ((0, chart_utilities_1.isDateArray)(values)) {
|
|
3051
|
+
return 'date';
|
|
3052
|
+
}
|
|
3053
|
+
return 'category';
|
|
3054
|
+
};
|
|
3055
|
+
var getPolarAxis = function (data, dataKey, layout) {
|
|
3056
|
+
var polarLayout = getPolarLayout(data[0], layout);
|
|
3057
|
+
var ax = polarLayout === null || polarLayout === void 0 ? void 0 : polarLayout[POLAR_AXIS_BY_DATA_KEY[dataKey].toLowerCase()];
|
|
3058
|
+
return tslib_1.__assign(tslib_1.__assign({}, ax), { _dataKey: dataKey, _type: getPolarAxisType(data, dataKey, ax === null || ax === void 0 ? void 0 : ax.type) });
|
|
3059
|
+
};
|
|
3060
|
+
var getPolarAxisTickProps = function (data, ax) {
|
|
3061
|
+
var props = {};
|
|
3062
|
+
if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
|
|
3063
|
+
var tickValues = ax._type === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
3064
|
+
props.tickValues = tickValues;
|
|
3065
|
+
props.tickText = ax.ticktext;
|
|
3066
|
+
return props;
|
|
3067
|
+
}
|
|
3068
|
+
if ((!ax.tickmode || ax.tickmode === 'linear') && ax.dtick) {
|
|
3069
|
+
var dtick = plotlyDtick(ax.dtick, ax._type);
|
|
3070
|
+
var tick0 = plotlyTick0(ax.tick0, ax._type, dtick);
|
|
3071
|
+
props.tickStep = dtick;
|
|
3072
|
+
props.tick0 = tick0;
|
|
3073
|
+
return props;
|
|
3074
|
+
}
|
|
3075
|
+
if ((!ax.tickmode || ax.tickmode === 'auto') && typeof ax.nticks === 'number' && ax.nticks >= 0) {
|
|
3076
|
+
props.tickCount = ax.nticks;
|
|
3077
|
+
}
|
|
3078
|
+
return props;
|
|
3079
|
+
};
|
|
3080
|
+
var getPolarAxisCategoryOrder = function (data, ax) {
|
|
3081
|
+
if (ax._type !== 'category') {
|
|
3082
|
+
return 'data';
|
|
3083
|
+
}
|
|
3084
|
+
var isValidArray = (0, chart_utilities_1.isArrayOrTypedArray)(ax.categoryarray) && ax.categoryarray.length > 0;
|
|
3085
|
+
if (isValidArray && (!ax.categoryorder || ax.categoryorder === 'array')) {
|
|
3086
|
+
return ax.categoryarray;
|
|
3087
|
+
}
|
|
3088
|
+
if (!ax.categoryorder || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
|
|
3089
|
+
var values = getValidAxisValues(data, ax._dataKey);
|
|
3090
|
+
var categoriesInTraceOrder = Array.from(new Set(values));
|
|
3091
|
+
return ax.autorange === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
|
|
3092
|
+
}
|
|
3093
|
+
return ax.categoryorder;
|
|
3094
|
+
};
|
|
3095
|
+
var getPolarAxisProps = function (data, layout) {
|
|
3096
|
+
var props = {};
|
|
3097
|
+
Object.keys(POLAR_AXIS_BY_DATA_KEY).forEach(function (dataKey) {
|
|
3098
|
+
var propName = POLAR_AXIS_BY_DATA_KEY[dataKey];
|
|
3099
|
+
var ax = getPolarAxis(data, dataKey, layout);
|
|
3100
|
+
props[propName] = tslib_1.__assign(tslib_1.__assign({ scaleType: ax._type === 'log' ? 'log' : 'default', categoryOrder: getPolarAxisCategoryOrder(data, ax), tickFormat: ax.tickformat }, getPolarAxisTickProps(data, ax)), ((0, chart_utilities_1.isArrayOrTypedArray)(ax.range) ? { rangeStart: ax.range[0], rangeEnd: ax.range[1] } : {}));
|
|
3101
|
+
if (propName === 'angularAxis') {
|
|
3102
|
+
props[propName].unit = ax.thetaunit;
|
|
3103
|
+
props.direction = ax.direction;
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
return props;
|
|
3107
|
+
};
|
|
3123
3108
|
});
|
|
3124
3109
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|