@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
|
@@ -51,12 +51,15 @@ var dashOptions = {
|
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
53
|
function getTitles(layout) {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
55
|
+
var titleObj = layout === null || layout === void 0 ? void 0 : layout.title;
|
|
56
|
+
var chartTitle = typeof titleObj === 'string' ? titleObj : (_a = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _a !== void 0 ? _a : '';
|
|
57
|
+
var titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
|
|
58
|
+
var titleXAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.xanchor : undefined;
|
|
59
|
+
var titleYAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.yanchor : undefined;
|
|
60
|
+
var titlePad = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.pad : undefined;
|
|
61
|
+
var titleStyles = __assign(__assign(__assign(__assign({}, (titleFont ? { titleFont: titleFont } : {})), (titleXAnchor ? { titleXAnchor: titleXAnchor } : {})), (titleYAnchor ? { titleYAnchor: titleYAnchor } : {})), (titlePad ? { titlePad: titlePad } : {}));
|
|
62
|
+
var titles = __assign(__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 });
|
|
60
63
|
return titles;
|
|
61
64
|
}
|
|
62
65
|
var getXAxisTickFormat = function (series, layout) {
|
|
@@ -1024,7 +1027,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1024
1027
|
var innerRadius = firstData.hole
|
|
1025
1028
|
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
|
|
1026
1029
|
: MIN_DONUT_RADIUS;
|
|
1027
|
-
var
|
|
1030
|
+
var _r = getTitles(input.layout), chartTitle = _r.chartTitle, titleStyles = _r.titleStyles;
|
|
1028
1031
|
// Build anticlockwise order by keeping the first item, reversing the rest
|
|
1029
1032
|
var legends = Object.keys(mapLegendToDataPoint);
|
|
1030
1033
|
var reorderedEntries = legends.length > 1
|
|
@@ -1035,35 +1038,25 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1035
1038
|
.reverse()
|
|
1036
1039
|
.map(function (key) { return [key, mapLegendToDataPoint[key]]; }), true)
|
|
1037
1040
|
: legends.map(function (key) { return [key, mapLegendToDataPoint[key]]; });
|
|
1038
|
-
return {
|
|
1039
|
-
data: {
|
|
1041
|
+
return __assign({ data: {
|
|
1040
1042
|
chartTitle: chartTitle,
|
|
1041
1043
|
chartData: reorderedEntries.map(function (_a) {
|
|
1042
1044
|
var v = _a[1];
|
|
1043
1045
|
return v;
|
|
1044
1046
|
}),
|
|
1045
|
-
},
|
|
1046
|
-
hideLegend: isMultiPlot || ((_p = input.layout) === null || _p === void 0 ? void 0 : _p.showlegend) === false,
|
|
1047
|
-
width: (_q = input.layout) === null || _q === void 0 ? void 0 : _q.width,
|
|
1048
|
-
height: height,
|
|
1049
|
-
innerRadius: innerRadius,
|
|
1050
|
-
hideLabels: hideLabels,
|
|
1051
|
-
showLabelsInPercent: firstData.textinfo
|
|
1047
|
+
}, 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
|
|
1052
1048
|
? ['percent', 'label+percent', 'percent+label'].includes(firstData.textinfo)
|
|
1053
|
-
: true,
|
|
1054
|
-
roundCorners: true,
|
|
1055
|
-
order: 'sorted',
|
|
1056
|
-
};
|
|
1049
|
+
: true, roundCorners: true, order: 'sorted' }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1057
1050
|
};
|
|
1058
1051
|
export var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot,
|
|
1059
1052
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1060
1053
|
colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
1061
|
-
var _a, _b, _c, _d, _e
|
|
1054
|
+
var _a, _b, _c, _d, _e;
|
|
1062
1055
|
var mapXToDataPoints = {};
|
|
1063
1056
|
var yMaxValue = 0;
|
|
1064
1057
|
var yMinValue = 0;
|
|
1065
1058
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
1066
|
-
var
|
|
1059
|
+
var _f = getLegendProps(input.data, input.layout, isMultiPlot), legends = _f.legends, hideLegend = _f.hideLegend;
|
|
1067
1060
|
var colorScale = undefined;
|
|
1068
1061
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1069
1062
|
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
@@ -1200,7 +1193,7 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1200
1193
|
});
|
|
1201
1194
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
1202
1195
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1203
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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
|
|
1196
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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 } : {}));
|
|
1204
1197
|
};
|
|
1205
1198
|
export var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot,
|
|
1206
1199
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1302,14 +1295,14 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1302
1295
|
}
|
|
1303
1296
|
});
|
|
1304
1297
|
var annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
1305
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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 __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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
|
export var transformPlotlyJsonToVBCProps = function (input, isMultiPlot,
|
|
1308
1301
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1309
1302
|
colorMap, colorwayType, isDarkTheme) {
|
|
1310
|
-
var _a, _b, _c
|
|
1303
|
+
var _a, _b, _c;
|
|
1311
1304
|
var vbcData = [];
|
|
1312
|
-
var
|
|
1305
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
1313
1306
|
var colorScale = undefined;
|
|
1314
1307
|
input.data.forEach(function (series, seriesIdx) {
|
|
1315
1308
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1369,7 +1362,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1369
1362
|
});
|
|
1370
1363
|
});
|
|
1371
1364
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1372
|
-
return __assign(__assign(__assign(__assign(__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,
|
|
1365
|
+
return __assign(__assign(__assign(__assign(__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 } : {}));
|
|
1373
1366
|
};
|
|
1374
1367
|
export var transformPlotlyJsonToAreaChartProps = function (input, isMultiPlot,
|
|
1375
1368
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1424,9 +1417,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1424
1417
|
var mode = 'tonexty';
|
|
1425
1418
|
var _q = getLegendProps(input.data, input.layout, isMultiPlot), legends = _q.legends, hideLegend = _q.hideLegend;
|
|
1426
1419
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1427
|
-
var
|
|
1428
|
-
var resolveXValue = getAxisValueResolver(xAxisType);
|
|
1429
|
-
var shouldWrapLabels = xAxisType === 'category';
|
|
1420
|
+
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
1430
1421
|
var chartData = input.data
|
|
1431
1422
|
.map(function (series, index) {
|
|
1432
1423
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -1561,7 +1552,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1561
1552
|
scatterChartData: __spreadArray(__spreadArray([], chartData, true), lineShape, true),
|
|
1562
1553
|
};
|
|
1563
1554
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1564
|
-
var commonProps = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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,
|
|
1555
|
+
var commonProps = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__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 } : {}));
|
|
1565
1556
|
if (isAreaChart) {
|
|
1566
1557
|
return __assign({ data: chartProps, mode: mode }, commonProps);
|
|
1567
1558
|
}
|
|
@@ -1850,13 +1841,13 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1850
1841
|
var rangeValuesForColorScale = Array.isArray(colorscale)
|
|
1851
1842
|
? colorscale.map(function (arr) { return arr[1]; })
|
|
1852
1843
|
: defaultRange;
|
|
1853
|
-
return __assign(__assign(__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
|
|
1844
|
+
return __assign(__assign(__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));
|
|
1854
1845
|
};
|
|
1855
1846
|
export var transformPlotlyJsonToSankeyProps = function (input, isMultiPlot,
|
|
1856
1847
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1857
1848
|
colorMap, colorwayType, isDarkTheme) {
|
|
1858
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1859
|
-
var
|
|
1849
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1850
|
+
var _r = input.data[0], link = _r.link, node = _r.node;
|
|
1860
1851
|
var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
|
|
1861
1852
|
.map(function (val, index) {
|
|
1862
1853
|
var _a, _b;
|
|
@@ -1893,17 +1884,11 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1893
1884
|
var styles = {
|
|
1894
1885
|
root: __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 } : {})),
|
|
1895
1886
|
};
|
|
1896
|
-
var
|
|
1897
|
-
return {
|
|
1898
|
-
data: {
|
|
1887
|
+
var _s = getTitles(input.layout), chartTitle = _s.chartTitle, titleStyles = _s.titleStyles;
|
|
1888
|
+
return __assign({ data: {
|
|
1899
1889
|
chartTitle: chartTitle,
|
|
1900
1890
|
SankeyChartData: sankeyChartData,
|
|
1901
|
-
},
|
|
1902
|
-
width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width,
|
|
1903
|
-
height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 468,
|
|
1904
|
-
styles: styles,
|
|
1905
|
-
enableReflow: false,
|
|
1906
|
-
};
|
|
1891
|
+
}, 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 } : {}));
|
|
1907
1892
|
};
|
|
1908
1893
|
export var transformPlotlyJsonToGaugeProps = function (input, isMultiPlot,
|
|
1909
1894
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1958,22 +1943,10 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1958
1943
|
fill: sublabelColor,
|
|
1959
1944
|
},
|
|
1960
1945
|
};
|
|
1961
|
-
var
|
|
1962
|
-
return {
|
|
1963
|
-
segments: segments,
|
|
1964
|
-
chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0,
|
|
1965
|
-
chartTitle: chartTitle,
|
|
1966
|
-
sublabel: sublabel,
|
|
1946
|
+
var _32 = getTitles(input.layout), chartTitle = _32.chartTitle, titleStyles = _32.titleStyles;
|
|
1947
|
+
return __assign({ segments: segments, chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0, chartTitle: chartTitle, sublabel: sublabel,
|
|
1967
1948
|
// range values can be null
|
|
1968
|
-
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,
|
|
1969
|
-
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,
|
|
1970
|
-
chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
|
|
1971
|
-
width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width,
|
|
1972
|
-
height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220,
|
|
1973
|
-
styles: styles,
|
|
1974
|
-
variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment,
|
|
1975
|
-
roundCorners: true,
|
|
1976
|
-
};
|
|
1949
|
+
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) ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment, roundCorners: true }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1977
1950
|
};
|
|
1978
1951
|
var cleanText = function (text) {
|
|
1979
1952
|
return text
|
|
@@ -2087,13 +2060,8 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
2087
2060
|
font: __assign(__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 : {})),
|
|
2088
2061
|
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 : [],
|
|
2089
2062
|
};
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
rows: rows,
|
|
2093
|
-
width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width,
|
|
2094
|
-
height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height,
|
|
2095
|
-
styles: styles,
|
|
2096
|
-
};
|
|
2063
|
+
var _1 = getTitles(input.layout), chartTitle = _1.chartTitle, titleStyles = _1.titleStyles;
|
|
2064
|
+
return __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 } : {}));
|
|
2097
2065
|
};
|
|
2098
2066
|
function getCategoriesAndValues(series) {
|
|
2099
2067
|
var _a, _b, _c, _d;
|
|
@@ -2210,141 +2178,59 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
2210
2178
|
});
|
|
2211
2179
|
});
|
|
2212
2180
|
}
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
|
|
2216
|
-
height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
|
|
2217
|
-
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
2218
|
-
hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
|
|
2219
|
-
};
|
|
2181
|
+
var _e = getTitles(input.layout), chartTitle = _e.chartTitle, titleStyles = _e.titleStyles;
|
|
2182
|
+
return __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 } : {}));
|
|
2220
2183
|
};
|
|
2221
|
-
export var
|
|
2222
|
-
var _a, _b, _c
|
|
2223
|
-
var
|
|
2224
|
-
|
|
2225
|
-
var
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
var
|
|
2229
|
-
if (
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
projection.data[sindex] = series;
|
|
2265
|
-
return "continue";
|
|
2266
|
-
}
|
|
2267
|
-
// retrieve polar axis settings
|
|
2268
|
-
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;
|
|
2269
|
-
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;
|
|
2270
|
-
// Compute tick positions if categorical
|
|
2271
|
-
var uniqueTheta = [];
|
|
2272
|
-
var categorical = false;
|
|
2273
|
-
if (!isNumberArray(thetas)) {
|
|
2274
|
-
uniqueTheta = Array.from(new Set(thetas));
|
|
2275
|
-
categorical = true;
|
|
2276
|
-
}
|
|
2277
|
-
for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
|
|
2278
|
-
if (isInvalidValue(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || isInvalidValue(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
|
|
2279
|
-
continue;
|
|
2280
|
-
}
|
|
2281
|
-
// Map theta to angle in radians
|
|
2282
|
-
var thetaRad = void 0;
|
|
2283
|
-
if (categorical) {
|
|
2284
|
-
var idx = uniqueTheta.indexOf(thetas[ptindex]);
|
|
2285
|
-
var step = (2 * Math.PI) / uniqueTheta.length;
|
|
2286
|
-
thetaRad = startAngleInRad + dirMultiplier * idx * step;
|
|
2184
|
+
export var transformPlotlyJsonToPolarChartProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
2185
|
+
var _a, _b, _c;
|
|
2186
|
+
var polarData = [];
|
|
2187
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
2188
|
+
var resolveRValue = getAxisValueResolver(getPolarAxis(input.data, 'r', input.layout)._type);
|
|
2189
|
+
input.data.forEach(function (series, index) {
|
|
2190
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2191
|
+
var legend = legends[index];
|
|
2192
|
+
if (series.type === 'scatterpolar') {
|
|
2193
|
+
var isAreaTrace = series.fill === 'toself' || series.fill === 'tonext';
|
|
2194
|
+
var isLineTrace = typeof series.mode === 'undefined' ? true : series.mode.includes('lines');
|
|
2195
|
+
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;
|
|
2196
|
+
var extractedColors_2 = 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);
|
|
2197
|
+
var seriesColor = 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);
|
|
2198
|
+
var seriesOpacity = getOpacity(series, index);
|
|
2199
|
+
var finalSeriesColor_1 = rgb(seriesColor).copy({ opacity: seriesOpacity }).formatHex8();
|
|
2200
|
+
var lineOptions = getLineOptions(series.line);
|
|
2201
|
+
var thetaUnit_1 = series.thetaunit;
|
|
2202
|
+
var commonProps = {
|
|
2203
|
+
legend: legend,
|
|
2204
|
+
legendShape: getLegendShape(series),
|
|
2205
|
+
color: finalSeriesColor_1,
|
|
2206
|
+
data: ((_j = series.r) === null || _j === void 0 ? void 0 : _j.map(function (r, rIndex) {
|
|
2207
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2208
|
+
var theta = (_a = series.theta) === null || _a === void 0 ? void 0 : _a[rIndex];
|
|
2209
|
+
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;
|
|
2210
|
+
var text = Array.isArray(series.text) ? series.text[rIndex] : series.text;
|
|
2211
|
+
var markerColor = 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);
|
|
2212
|
+
var markerOpacity = getOpacity(series, rIndex);
|
|
2213
|
+
if (isInvalidValue(resolveRValue(r)) || isInvalidValue(theta)) {
|
|
2214
|
+
return;
|
|
2215
|
+
}
|
|
2216
|
+
return __assign(__assign({ r: resolveRValue(r), theta: typeof theta === 'number'
|
|
2217
|
+
? thetaUnit_1 === 'radians'
|
|
2218
|
+
? (theta * 180) / Math.PI
|
|
2219
|
+
: thetaUnit_1 === 'gradians'
|
|
2220
|
+
? theta * 0.9
|
|
2221
|
+
: theta
|
|
2222
|
+
: theta, color: markerColor ? rgb(markerColor).copy({ opacity: markerOpacity }).formatHex8() : finalSeriesColor_1 }, (typeof markerSize !== 'undefined' ? { markerSize: markerSize } : {})), (typeof text !== 'undefined' ? { text: text } : {}));
|
|
2223
|
+
}).filter(function (item) { return typeof item !== 'undefined'; })) || [],
|
|
2224
|
+
};
|
|
2225
|
+
if (isAreaTrace || isLineTrace) {
|
|
2226
|
+
polarData.push(__assign(__assign({ type: isAreaTrace ? 'areapolar' : 'linepolar' }, commonProps), { lineOptions: lineOptions }));
|
|
2287
2227
|
}
|
|
2288
2228
|
else {
|
|
2289
|
-
|
|
2229
|
+
polarData.push(__assign({ type: 'scatterpolar' }, commonProps));
|
|
2290
2230
|
}
|
|
2291
|
-
// Shift only the polar origin (not the cartesian)
|
|
2292
|
-
var rawRadius = rVals[ptindex];
|
|
2293
|
-
var polarRadius = rawRadius + radiusShift; // Only for projection
|
|
2294
|
-
// Calculate cartesian coordinates (with shifted polar origin)
|
|
2295
|
-
var x = polarRadius * Math.cos(thetaRad);
|
|
2296
|
-
var y = polarRadius * Math.sin(thetaRad);
|
|
2297
|
-
// Calculate the cartesian coordinates of the original polar origin (0,0)
|
|
2298
|
-
// This is the point that should be mapped to (0,0) in cartesian coordinates
|
|
2299
|
-
if (sindex === 0 && ptindex === 0) {
|
|
2300
|
-
// For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
|
|
2301
|
-
// But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
|
|
2302
|
-
originX = radiusShift;
|
|
2303
|
-
}
|
|
2304
|
-
series.x.push(x);
|
|
2305
|
-
series.y.push(y);
|
|
2306
|
-
allX.push(x);
|
|
2307
|
-
allY.push(y);
|
|
2308
|
-
}
|
|
2309
|
-
// Map text to each data point for downstream chart rendering
|
|
2310
|
-
if (series.x && series.y) {
|
|
2311
|
-
series.data = series.x.map(function (xVal, idx) { return (__assign({ x: xVal, y: series.y[idx] }, (series.text ? { text: series.text[idx] } : {}))); });
|
|
2312
2231
|
}
|
|
2313
|
-
|
|
2314
|
-
};
|
|
2315
|
-
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
2316
|
-
_loop_1(sindex);
|
|
2317
|
-
}
|
|
2318
|
-
// 7. Recenter all cartesian coordinates
|
|
2319
|
-
if (originX !== null) {
|
|
2320
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2321
|
-
var series = projection.data[sindex];
|
|
2322
|
-
if (series.x && series.y) {
|
|
2323
|
-
series.x = series.x.map(function (v) { return v - originX; });
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
// Also recenter allX for normalization
|
|
2327
|
-
for (var i = 0; i < allX.length; i++) {
|
|
2328
|
-
allX[i] = allX[i] - originX;
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
// 8. Find the maximum absolute value among all x and y
|
|
2332
|
-
var maxAbs = Math.max.apply(Math, __spreadArray(__spreadArray([], allX.map(Math.abs), false), allY.map(Math.abs), false));
|
|
2333
|
-
maxAbs = maxAbs === 0 ? 1 : maxAbs;
|
|
2334
|
-
// 9. Rescale all points so that the largest |x| or |y| is 0.5
|
|
2335
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2336
|
-
var series = projection.data[sindex];
|
|
2337
|
-
if (series.x && series.y) {
|
|
2338
|
-
series.x = series.x.map(function (v) { return v / (2 * maxAbs); });
|
|
2339
|
-
series.y = series.y.map(function (v) { return v / (2 * maxAbs); });
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
// 10. Customize layout for perfect square with absolute positioning
|
|
2343
|
-
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;
|
|
2344
|
-
projection.layout = __assign(__assign({}, projection.layout), { width: size, height: size });
|
|
2345
|
-
// Attach originX as custom properties
|
|
2346
|
-
projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
|
|
2347
|
-
return projection;
|
|
2232
|
+
});
|
|
2233
|
+
return __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));
|
|
2348
2234
|
};
|
|
2349
2235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2350
2236
|
function isPlainObject(obj) {
|
|
@@ -2655,6 +2541,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2655
2541
|
var domainXInfo = {
|
|
2656
2542
|
start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
|
|
2657
2543
|
end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1,
|
|
2544
|
+
cellName: "x".concat(domainX.length === 0 ? '' : domainX.length + 1),
|
|
2658
2545
|
};
|
|
2659
2546
|
domainX.push(domainXInfo);
|
|
2660
2547
|
}
|
|
@@ -2673,6 +2560,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2673
2560
|
var domainYInfo = {
|
|
2674
2561
|
start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
|
|
2675
2562
|
end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1,
|
|
2563
|
+
cellName: "x".concat(domainY.length === 0 ? '' : domainY.length + 1),
|
|
2676
2564
|
};
|
|
2677
2565
|
domainY.push(domainYInfo);
|
|
2678
2566
|
}
|
|
@@ -2686,16 +2574,36 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2686
2574
|
var domainXInfo = {
|
|
2687
2575
|
start: ((_b = series.domain) === null || _b === void 0 ? void 0 : _b.x) ? series.domain.x[0] : 0,
|
|
2688
2576
|
end: ((_c = series.domain) === null || _c === void 0 ? void 0 : _c.x) ? series.domain.x[1] : 1,
|
|
2577
|
+
cellName: "".concat(NON_PLOT_KEY_PREFIX).concat(domainX.length - cartesianDomains + 1),
|
|
2689
2578
|
};
|
|
2690
2579
|
var domainYInfo = {
|
|
2691
2580
|
start: ((_d = series.domain) === null || _d === void 0 ? void 0 : _d.y) ? series.domain.y[0] : 0,
|
|
2692
2581
|
end: ((_e = series.domain) === null || _e === void 0 ? void 0 : _e.y) ? series.domain.y[1] : 1,
|
|
2582
|
+
cellName: "".concat(NON_PLOT_KEY_PREFIX).concat(domainY.length - cartesianDomains + 1),
|
|
2693
2583
|
};
|
|
2694
2584
|
domainX.push(domainXInfo);
|
|
2695
2585
|
domainY.push(domainYInfo);
|
|
2696
2586
|
}
|
|
2697
2587
|
});
|
|
2698
2588
|
if (layout !== undefined && layout !== null && Object.keys(layout).length > 0) {
|
|
2589
|
+
Object.keys(layout !== null && layout !== void 0 ? layout : {}).forEach(function (key) {
|
|
2590
|
+
var _a, _b, _c, _d;
|
|
2591
|
+
if (key.startsWith('polar')) {
|
|
2592
|
+
var polarLayout = layout[key];
|
|
2593
|
+
var domainXInfo = {
|
|
2594
|
+
start: ((_a = polarLayout.domain) === null || _a === void 0 ? void 0 : _a.x) ? polarLayout.domain.x[0] : 0,
|
|
2595
|
+
end: ((_b = polarLayout.domain) === null || _b === void 0 ? void 0 : _b.x) ? polarLayout.domain.x[1] : 1,
|
|
2596
|
+
cellName: key,
|
|
2597
|
+
};
|
|
2598
|
+
var domainYInfo = {
|
|
2599
|
+
start: ((_c = polarLayout.domain) === null || _c === void 0 ? void 0 : _c.y) ? polarLayout.domain.y[0] : 0,
|
|
2600
|
+
end: ((_d = polarLayout.domain) === null || _d === void 0 ? void 0 : _d.y) ? polarLayout.domain.y[1] : 1,
|
|
2601
|
+
cellName: key,
|
|
2602
|
+
};
|
|
2603
|
+
domainX.push(domainXInfo);
|
|
2604
|
+
domainY.push(domainYInfo);
|
|
2605
|
+
}
|
|
2606
|
+
});
|
|
2699
2607
|
(_a = layout.annotations) === null || _a === void 0 ? void 0 : _a.forEach(function (annotation) {
|
|
2700
2608
|
var xMatches = domainX.flatMap(function (interval, idx) {
|
|
2701
2609
|
return (annotation === null || annotation === void 0 ? void 0 : annotation.x) >= interval.start && (annotation === null || annotation === void 0 ? void 0 : annotation.x) <= interval.end ? [idx] : [];
|
|
@@ -2731,9 +2639,6 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2731
2639
|
.sort();
|
|
2732
2640
|
templateColumns = "repeat(".concat(sortedXStart_1.length, ", 1fr)");
|
|
2733
2641
|
domainX.forEach(function (interval, index) {
|
|
2734
|
-
var cellName = index >= cartesianDomains
|
|
2735
|
-
? "".concat(NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2736
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2737
2642
|
var columnIndex = sortedXStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2738
2643
|
var columnNumber = columnIndex + 1; // Column numbers are 1-based
|
|
2739
2644
|
var annotationProps = annotations[index];
|
|
@@ -2745,7 +2650,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2745
2650
|
xDomain: interval,
|
|
2746
2651
|
yDomain: { start: 0, end: 1 }, // Default yDomain for x-axis
|
|
2747
2652
|
};
|
|
2748
|
-
gridLayout[cellName] = row;
|
|
2653
|
+
gridLayout[interval.cellName] = row;
|
|
2749
2654
|
});
|
|
2750
2655
|
}
|
|
2751
2656
|
if (domainY.length > 0) {
|
|
@@ -2762,14 +2667,11 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2762
2667
|
var numberOfRows_1 = sortedYStart_1.length;
|
|
2763
2668
|
templateRows = "repeat(".concat(numberOfRows_1, ", 1fr)");
|
|
2764
2669
|
domainY.forEach(function (interval, index) {
|
|
2765
|
-
var cellName = index >= cartesianDomains
|
|
2766
|
-
? "".concat(NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2767
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2768
2670
|
var rowIndex = sortedYStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2769
2671
|
var rowNumber = numberOfRows_1 - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
|
|
2770
2672
|
var annotationProps = annotations[index];
|
|
2771
2673
|
var yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
|
|
2772
|
-
var cell = gridLayout[cellName];
|
|
2674
|
+
var cell = gridLayout[interval.cellName];
|
|
2773
2675
|
if (cell !== undefined) {
|
|
2774
2676
|
cell.row = rowNumber;
|
|
2775
2677
|
cell.yAnnotation = yAnnotation;
|
|
@@ -2920,19 +2822,20 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2920
2822
|
return;
|
|
2921
2823
|
}
|
|
2922
2824
|
var axType = getAxisType(data, ax);
|
|
2825
|
+
if (axId === 'x' && axType === 'category') {
|
|
2826
|
+
props.xAxis = {
|
|
2827
|
+
tickLayout: 'auto',
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2923
2830
|
if ((!ax.tickmode || ax.tickmode === 'array') && isArrayOrTypedArray(ax.tickvals)) {
|
|
2924
2831
|
var tickValues = axType === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
2925
2832
|
if (axId === 'x') {
|
|
2926
2833
|
props.tickValues = tickValues;
|
|
2927
|
-
props.xAxis = {
|
|
2928
|
-
tickText: ax.ticktext,
|
|
2929
|
-
};
|
|
2834
|
+
props.xAxis = __assign(__assign({}, props.xAxis), { tickText: ax.ticktext });
|
|
2930
2835
|
}
|
|
2931
2836
|
else if (axId === 'y') {
|
|
2932
2837
|
props.yAxisTickValues = tickValues;
|
|
2933
|
-
props.yAxis = {
|
|
2934
|
-
tickText: ax.ticktext,
|
|
2935
|
-
};
|
|
2838
|
+
props.yAxis = __assign(__assign({}, props.yAxis), { tickText: ax.ticktext });
|
|
2936
2839
|
}
|
|
2937
2840
|
return;
|
|
2938
2841
|
}
|
|
@@ -2940,16 +2843,10 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2940
2843
|
var dtick = plotlyDtick(ax.dtick, axType);
|
|
2941
2844
|
var tick0 = plotlyTick0(ax.tick0, axType, dtick);
|
|
2942
2845
|
if (axId === 'x') {
|
|
2943
|
-
props.xAxis = {
|
|
2944
|
-
tickStep: dtick,
|
|
2945
|
-
tick0: tick0,
|
|
2946
|
-
};
|
|
2846
|
+
props.xAxis = __assign(__assign({}, props.xAxis), { tickStep: dtick, tick0: tick0 });
|
|
2947
2847
|
}
|
|
2948
2848
|
else if (axId === 'y') {
|
|
2949
|
-
props.yAxis = {
|
|
2950
|
-
tickStep: dtick,
|
|
2951
|
-
tick0: tick0,
|
|
2952
|
-
};
|
|
2849
|
+
props.yAxis = __assign(__assign({}, props.yAxis), { tickStep: dtick, tick0: tick0 });
|
|
2953
2850
|
}
|
|
2954
2851
|
return;
|
|
2955
2852
|
}
|
|
@@ -3102,4 +2999,92 @@ var getAxisValueResolver = function (axType, dateParser) {
|
|
|
3102
2999
|
}
|
|
3103
3000
|
};
|
|
3104
3001
|
};
|
|
3002
|
+
var POLAR_AXIS_BY_DATA_KEY = {
|
|
3003
|
+
r: 'radialAxis',
|
|
3004
|
+
theta: 'angularAxis',
|
|
3005
|
+
};
|
|
3006
|
+
export var DEFAULT_POLAR_SUBPLOT = 'polar';
|
|
3007
|
+
var getPolarLayout = function (trace, layout) {
|
|
3008
|
+
var subplotId = ((trace === null || trace === void 0 ? void 0 : trace.subplot) || DEFAULT_POLAR_SUBPLOT);
|
|
3009
|
+
return layout === null || layout === void 0 ? void 0 : layout[subplotId];
|
|
3010
|
+
};
|
|
3011
|
+
var getValidAxisValues = function (data, dataKey) {
|
|
3012
|
+
var values = [];
|
|
3013
|
+
data.forEach(function (series) {
|
|
3014
|
+
if (isArrayOrTypedArray(series[dataKey])) {
|
|
3015
|
+
series[dataKey].forEach(function (val) {
|
|
3016
|
+
if (!isInvalidValue(val)) {
|
|
3017
|
+
values.push(val);
|
|
3018
|
+
}
|
|
3019
|
+
});
|
|
3020
|
+
}
|
|
3021
|
+
});
|
|
3022
|
+
return values;
|
|
3023
|
+
};
|
|
3024
|
+
var getPolarAxisType = function (data, dataKey, declaredType) {
|
|
3025
|
+
if (['linear', 'log', 'date', 'category'].includes(declaredType !== null && declaredType !== void 0 ? declaredType : '')) {
|
|
3026
|
+
return declaredType;
|
|
3027
|
+
}
|
|
3028
|
+
var values = getValidAxisValues(data, dataKey);
|
|
3029
|
+
if (isNumberArray(values) && !isYearArray(values)) {
|
|
3030
|
+
return 'linear';
|
|
3031
|
+
}
|
|
3032
|
+
if (isDateArray(values)) {
|
|
3033
|
+
return 'date';
|
|
3034
|
+
}
|
|
3035
|
+
return 'category';
|
|
3036
|
+
};
|
|
3037
|
+
var getPolarAxis = function (data, dataKey, layout) {
|
|
3038
|
+
var polarLayout = getPolarLayout(data[0], layout);
|
|
3039
|
+
var ax = polarLayout === null || polarLayout === void 0 ? void 0 : polarLayout[POLAR_AXIS_BY_DATA_KEY[dataKey].toLowerCase()];
|
|
3040
|
+
return __assign(__assign({}, ax), { _dataKey: dataKey, _type: getPolarAxisType(data, dataKey, ax === null || ax === void 0 ? void 0 : ax.type) });
|
|
3041
|
+
};
|
|
3042
|
+
var getPolarAxisTickProps = function (data, ax) {
|
|
3043
|
+
var props = {};
|
|
3044
|
+
if ((!ax.tickmode || ax.tickmode === 'array') && isArrayOrTypedArray(ax.tickvals)) {
|
|
3045
|
+
var tickValues = ax._type === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
3046
|
+
props.tickValues = tickValues;
|
|
3047
|
+
props.tickText = ax.ticktext;
|
|
3048
|
+
return props;
|
|
3049
|
+
}
|
|
3050
|
+
if ((!ax.tickmode || ax.tickmode === 'linear') && ax.dtick) {
|
|
3051
|
+
var dtick = plotlyDtick(ax.dtick, ax._type);
|
|
3052
|
+
var tick0 = plotlyTick0(ax.tick0, ax._type, dtick);
|
|
3053
|
+
props.tickStep = dtick;
|
|
3054
|
+
props.tick0 = tick0;
|
|
3055
|
+
return props;
|
|
3056
|
+
}
|
|
3057
|
+
if ((!ax.tickmode || ax.tickmode === 'auto') && typeof ax.nticks === 'number' && ax.nticks >= 0) {
|
|
3058
|
+
props.tickCount = ax.nticks;
|
|
3059
|
+
}
|
|
3060
|
+
return props;
|
|
3061
|
+
};
|
|
3062
|
+
var getPolarAxisCategoryOrder = function (data, ax) {
|
|
3063
|
+
if (ax._type !== 'category') {
|
|
3064
|
+
return 'data';
|
|
3065
|
+
}
|
|
3066
|
+
var isValidArray = isArrayOrTypedArray(ax.categoryarray) && ax.categoryarray.length > 0;
|
|
3067
|
+
if (isValidArray && (!ax.categoryorder || ax.categoryorder === 'array')) {
|
|
3068
|
+
return ax.categoryarray;
|
|
3069
|
+
}
|
|
3070
|
+
if (!ax.categoryorder || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
|
|
3071
|
+
var values = getValidAxisValues(data, ax._dataKey);
|
|
3072
|
+
var categoriesInTraceOrder = Array.from(new Set(values));
|
|
3073
|
+
return ax.autorange === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
|
|
3074
|
+
}
|
|
3075
|
+
return ax.categoryorder;
|
|
3076
|
+
};
|
|
3077
|
+
var getPolarAxisProps = function (data, layout) {
|
|
3078
|
+
var props = {};
|
|
3079
|
+
Object.keys(POLAR_AXIS_BY_DATA_KEY).forEach(function (dataKey) {
|
|
3080
|
+
var propName = POLAR_AXIS_BY_DATA_KEY[dataKey];
|
|
3081
|
+
var ax = getPolarAxis(data, dataKey, layout);
|
|
3082
|
+
props[propName] = __assign(__assign({ scaleType: ax._type === 'log' ? 'log' : 'default', categoryOrder: getPolarAxisCategoryOrder(data, ax), tickFormat: ax.tickformat }, getPolarAxisTickProps(data, ax)), (isArrayOrTypedArray(ax.range) ? { rangeStart: ax.range[0], rangeEnd: ax.range[1] } : {}));
|
|
3083
|
+
if (propName === 'angularAxis') {
|
|
3084
|
+
props[propName].unit = ax.thetaunit;
|
|
3085
|
+
props.direction = ax.direction;
|
|
3086
|
+
}
|
|
3087
|
+
});
|
|
3088
|
+
return props;
|
|
3089
|
+
};
|
|
3105
3090
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|