@fluentui/react-charting 5.25.4 → 5.25.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +107 -1
- package/CHANGELOG.md +30 -2
- package/bundle-size/PolarChart.fixture.js +7 -0
- package/dist/react-charting.d.ts +424 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +93 -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 +20 -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 +390 -267
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib/components/DonutChart/Pie/Pie.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 +6 -18
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +55 -5
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib/components/LineChart/LineChart.base.js +2 -26
- 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 +10 -3
- 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 +14 -32
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +12 -80
- 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 +19 -31
- 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 +107 -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 +32 -8
- package/lib/utilities/utilities.js +232 -111
- 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 +20 -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 +392 -269
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib-amd/components/DonutChart/Pie/Pie.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 +4 -16
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -2
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-amd/components/LineChart/LineChart.base.js +1 -25
- 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 +10 -4
- 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 +13 -31
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +12 -79
- 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 +19 -30
- 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 +107 -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 +32 -8
- package/lib-amd/utilities/utilities.js +239 -114
- 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 +20 -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 +392 -269
- 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/DonutChart/Pie/Pie.js +4 -2
- package/lib-commonjs/components/DonutChart/Pie/Pie.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 +4 -16
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +54 -4
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +9 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +1 -25
- 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 +10 -3
- 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 +13 -31
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +4 -0
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +11 -79
- 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 +18 -30
- 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 +107 -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 +32 -8
- package/lib-commonjs/utilities/utilities.js +239 -114
- 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 +22 -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/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +11 -0
- package/src/components/PolarChart/PolarChart.types.ts +232 -0
- package/src/components/SankeyChart/SankeyChart.types.ts +22 -0
- package/src/components/ScatterChart/ScatterChart.types.ts +5 -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) {
|
|
@@ -88,6 +91,18 @@ var getYMinMaxValues = function (series, layout) {
|
|
|
88
91
|
}
|
|
89
92
|
return {};
|
|
90
93
|
};
|
|
94
|
+
var getXMinMaxValues = function (series, layout) {
|
|
95
|
+
var _a;
|
|
96
|
+
var range = (_a = getXAxisProperties(series, layout)) === null || _a === void 0 ? void 0 : _a.range;
|
|
97
|
+
if (range && range.length === 2) {
|
|
98
|
+
return {
|
|
99
|
+
xMinValue: range[0],
|
|
100
|
+
xMaxValue: range[1],
|
|
101
|
+
showRoundOffXTickValues: false,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {};
|
|
105
|
+
};
|
|
91
106
|
var getYAxisProperties = function (series, layout) {
|
|
92
107
|
return layout === null || layout === void 0 ? void 0 : layout.yaxis;
|
|
93
108
|
};
|
|
@@ -212,6 +227,64 @@ export var resolveXAxisPoint = function (x, isXYearCategory, isXString, isXDate,
|
|
|
212
227
|
}
|
|
213
228
|
return x;
|
|
214
229
|
};
|
|
230
|
+
/**
|
|
231
|
+
* Formats text values according to the texttemplate specification
|
|
232
|
+
* Supports D3 format specifiers within %{text:format} patterns
|
|
233
|
+
* @param textValue The raw text value to format
|
|
234
|
+
* @param textTemplate The template string (e.g., "%{text:.1f}%", "%{text:.2%}", "%{text:,.0f}")
|
|
235
|
+
* @param index Optional index for array-based templates
|
|
236
|
+
* @returns Formatted text string
|
|
237
|
+
*
|
|
238
|
+
* Examples:
|
|
239
|
+
* - "%{text:.1f}%" → Formats number with 1 decimal place and adds % suffix
|
|
240
|
+
* - "%{text:.2%}" → Formats as percentage with 2 decimal places
|
|
241
|
+
* - "%{text:,.0f}" → Formats with thousands separator and no decimals
|
|
242
|
+
* - "%{text:$,.2f}" → Formats as currency with thousands separator and 2 decimals
|
|
243
|
+
*/
|
|
244
|
+
var formatTextWithTemplate = function (textValue, textTemplate, index) {
|
|
245
|
+
if (!textTemplate) {
|
|
246
|
+
return String(textValue);
|
|
247
|
+
}
|
|
248
|
+
var numVal = typeof textValue === 'number' ? textValue : parseFloat(String(textValue));
|
|
249
|
+
if (isNaN(numVal)) {
|
|
250
|
+
return String(textValue);
|
|
251
|
+
}
|
|
252
|
+
var template = typeof textTemplate === 'string' ? textTemplate : textTemplate[index || 0] || '';
|
|
253
|
+
// Match Plotly's texttemplate pattern: %{text:format} or %{text}
|
|
254
|
+
// Can be followed by any literal text like %, $, etc.
|
|
255
|
+
var plotlyPattern = /%\{text(?::([^}]+))?\}(.*)$/;
|
|
256
|
+
var match = template.match(plotlyPattern);
|
|
257
|
+
if (match) {
|
|
258
|
+
var formatSpec = match[1]; // The format specifier (e.g., ".1f", ".2%", ",.0f") or undefined
|
|
259
|
+
var suffix = match[2]; // Any text after the closing brace (e.g., "%", " units")
|
|
260
|
+
// If no format specifier is provided (e.g., %{text}%), try to infer from suffix
|
|
261
|
+
if (!formatSpec) {
|
|
262
|
+
// Check if suffix starts with % - assume simple percentage with 1 decimal
|
|
263
|
+
if (suffix.startsWith('%')) {
|
|
264
|
+
return "".concat(numVal.toFixed(1)).concat(suffix);
|
|
265
|
+
}
|
|
266
|
+
// No format specifier, just return the number with the suffix
|
|
267
|
+
return "".concat(numVal).concat(suffix);
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
// Use D3 format function to apply the format specifier
|
|
271
|
+
var formatter = d3Format(formatSpec);
|
|
272
|
+
var formattedValue = formatter(numVal);
|
|
273
|
+
return "".concat(formattedValue).concat(suffix);
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
// Try to extract precision for basic fallback
|
|
277
|
+
var precisionMatch = formatSpec.match(/\.(\d+)[f%]/);
|
|
278
|
+
var precision = precisionMatch ? parseInt(precisionMatch[1], 10) : 2;
|
|
279
|
+
// Check if it's a percentage format
|
|
280
|
+
if (formatSpec.includes('%')) {
|
|
281
|
+
return "".concat((numVal * 100).toFixed(precision), "%").concat(suffix);
|
|
282
|
+
}
|
|
283
|
+
return "".concat(numVal.toFixed(precision)).concat(suffix);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return String(textValue);
|
|
287
|
+
};
|
|
215
288
|
/**
|
|
216
289
|
* Extracts unique X-axis categories from Plotly data traces
|
|
217
290
|
* @param data Array of Plotly data traces
|
|
@@ -954,7 +1027,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
954
1027
|
var innerRadius = firstData.hole
|
|
955
1028
|
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
|
|
956
1029
|
: MIN_DONUT_RADIUS;
|
|
957
|
-
var
|
|
1030
|
+
var _r = getTitles(input.layout), chartTitle = _r.chartTitle, titleStyles = _r.titleStyles;
|
|
958
1031
|
// Build anticlockwise order by keeping the first item, reversing the rest
|
|
959
1032
|
var legends = Object.keys(mapLegendToDataPoint);
|
|
960
1033
|
var reorderedEntries = legends.length > 1
|
|
@@ -965,33 +1038,25 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
965
1038
|
.reverse()
|
|
966
1039
|
.map(function (key) { return [key, mapLegendToDataPoint[key]]; }), true)
|
|
967
1040
|
: legends.map(function (key) { return [key, mapLegendToDataPoint[key]]; });
|
|
968
|
-
return {
|
|
969
|
-
data: {
|
|
1041
|
+
return __assign({ data: {
|
|
970
1042
|
chartTitle: chartTitle,
|
|
971
1043
|
chartData: reorderedEntries.map(function (_a) {
|
|
972
1044
|
var v = _a[1];
|
|
973
1045
|
return v;
|
|
974
1046
|
}),
|
|
975
|
-
},
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
height: height,
|
|
979
|
-
innerRadius: innerRadius,
|
|
980
|
-
hideLabels: hideLabels,
|
|
981
|
-
showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,
|
|
982
|
-
roundCorners: true,
|
|
983
|
-
order: 'sorted',
|
|
984
|
-
};
|
|
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
|
|
1048
|
+
? ['percent', 'label+percent', 'percent+label'].includes(firstData.textinfo)
|
|
1049
|
+
: true, roundCorners: true, order: 'sorted' }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
985
1050
|
};
|
|
986
1051
|
export var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot,
|
|
987
1052
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
988
1053
|
colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
989
|
-
var _a, _b, _c, _d, _e
|
|
1054
|
+
var _a, _b, _c, _d, _e;
|
|
990
1055
|
var mapXToDataPoints = {};
|
|
991
1056
|
var yMaxValue = 0;
|
|
992
1057
|
var yMinValue = 0;
|
|
993
1058
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
994
|
-
var
|
|
1059
|
+
var _f = getLegendProps(input.data, input.layout, isMultiPlot), legends = _f.legends, hideLegend = _f.hideLegend;
|
|
995
1060
|
var colorScale = undefined;
|
|
996
1061
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
997
1062
|
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
@@ -1007,6 +1072,11 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1007
1072
|
var rangeStart = _a[0], rangeEnd = _a[1];
|
|
1008
1073
|
var rangeXValues = series.x.slice(rangeStart, rangeEnd);
|
|
1009
1074
|
var rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
1075
|
+
var textValues = Array.isArray(series.text)
|
|
1076
|
+
? series.text.slice(rangeStart, rangeEnd)
|
|
1077
|
+
: typeof series.text === 'string'
|
|
1078
|
+
? series.text
|
|
1079
|
+
: undefined;
|
|
1010
1080
|
rangeXValues.forEach(function (x, index2) {
|
|
1011
1081
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1012
1082
|
if (!mapXToDataPoints[x]) {
|
|
@@ -1026,13 +1096,13 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1026
1096
|
var opacity = getOpacity(series, index2);
|
|
1027
1097
|
var yVal = rangeYValues[index2];
|
|
1028
1098
|
var yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
|
|
1099
|
+
var barLabel = Array.isArray(textValues) ? textValues[index2] : textValues;
|
|
1100
|
+
// Apply texttemplate formatting if specified
|
|
1101
|
+
if (barLabel && series.texttemplate) {
|
|
1102
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index2);
|
|
1103
|
+
}
|
|
1029
1104
|
if (series.type === 'bar') {
|
|
1030
|
-
mapXToDataPoints[x].chartData.push({
|
|
1031
|
-
legend: legend,
|
|
1032
|
-
data: yVal,
|
|
1033
|
-
color: (_h = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color,
|
|
1034
|
-
yAxisCalloutData: yAxisCalloutData,
|
|
1035
|
-
});
|
|
1105
|
+
mapXToDataPoints[x].chartData.push(__assign({ legend: legend, data: yVal, color: (_h = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color, yAxisCalloutData: yAxisCalloutData }, (barLabel ? { barLabel: String(barLabel) } : {})));
|
|
1036
1106
|
if (typeof yVal === 'number') {
|
|
1037
1107
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
1038
1108
|
}
|
|
@@ -1065,6 +1135,14 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1065
1135
|
var _a, _b, _c;
|
|
1066
1136
|
var lineColor = (_a = shape.line) === null || _a === void 0 ? void 0 : _a.color;
|
|
1067
1137
|
var resolveX = function (val) {
|
|
1138
|
+
if (shape.xref === 'x domain') {
|
|
1139
|
+
if (val === 0) {
|
|
1140
|
+
return xCategories[0];
|
|
1141
|
+
}
|
|
1142
|
+
if (val === 1) {
|
|
1143
|
+
return xCategories[xCategories.length - 1];
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1068
1146
|
if (typeof val === 'number' && Array.isArray(xCategories)) {
|
|
1069
1147
|
if (xCategories[val] !== undefined) {
|
|
1070
1148
|
return xCategories[val];
|
|
@@ -1115,7 +1193,7 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1115
1193
|
});
|
|
1116
1194
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
1117
1195
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1118
|
-
return __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,
|
|
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 } : {}));
|
|
1119
1197
|
};
|
|
1120
1198
|
export var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot,
|
|
1121
1199
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1173,12 +1251,13 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1173
1251
|
: resolveColor(extractedBarColors_1, xIndex, legend, colorMap, (_h = (_g = (_f = processedInput.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);
|
|
1174
1252
|
var opacity = getOpacity(series, xIndex);
|
|
1175
1253
|
var yVal = series.y[xIndex];
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
}
|
|
1254
|
+
// Extract text value for barLabel
|
|
1255
|
+
var barLabel = Array.isArray(series.text) ? series.text[xIndex] : series.text;
|
|
1256
|
+
// Apply texttemplate formatting if specified
|
|
1257
|
+
if (barLabel && series.texttemplate) {
|
|
1258
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, xIndex);
|
|
1259
|
+
}
|
|
1260
|
+
return __assign({ x: x.toString(), y: yVal, yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat), color: (_j = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color }, (barLabel ? { barLabel: String(barLabel) } : {}));
|
|
1182
1261
|
})
|
|
1183
1262
|
.filter(function (item) { return typeof item !== 'undefined'; }),
|
|
1184
1263
|
useSecondaryYScale: usesSecondaryYScale(series, processedInput.layout),
|
|
@@ -1216,14 +1295,14 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1216
1295
|
}
|
|
1217
1296
|
});
|
|
1218
1297
|
var annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
1219
|
-
return __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,
|
|
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 } : {}));
|
|
1220
1299
|
};
|
|
1221
1300
|
export var transformPlotlyJsonToVBCProps = function (input, isMultiPlot,
|
|
1222
1301
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1223
1302
|
colorMap, colorwayType, isDarkTheme) {
|
|
1224
|
-
var _a, _b, _c
|
|
1303
|
+
var _a, _b, _c;
|
|
1225
1304
|
var vbcData = [];
|
|
1226
|
-
var
|
|
1305
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
1227
1306
|
var colorScale = undefined;
|
|
1228
1307
|
input.data.forEach(function (series, seriesIdx) {
|
|
1229
1308
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1272,13 +1351,18 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1272
1351
|
: resolveColor(extractedColors, index, legend, colorMap, (_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, isDarkTheme);
|
|
1273
1352
|
var opacity = getOpacity(series, index);
|
|
1274
1353
|
var yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
|
|
1275
|
-
|
|
1354
|
+
// Handle text values and texttemplate formatting for histogram bins
|
|
1355
|
+
var barLabel = Array.isArray(series.text) ? series.text[index] : series.text;
|
|
1356
|
+
if (barLabel && series.texttemplate) {
|
|
1357
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index);
|
|
1358
|
+
}
|
|
1359
|
+
vbcData.push(__assign(__assign({ x: isXString ? bin.join(', ') : getBinCenter(bin), y: yVal, legend: legend, color: (_h = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color }, (isXString
|
|
1276
1360
|
? {}
|
|
1277
|
-
: { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })));
|
|
1361
|
+
: { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })), (barLabel ? { barLabel: String(barLabel) } : {})));
|
|
1278
1362
|
});
|
|
1279
1363
|
});
|
|
1280
1364
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1281
|
-
return __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,
|
|
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 } : {}));
|
|
1282
1366
|
};
|
|
1283
1367
|
export var transformPlotlyJsonToAreaChartProps = function (input, isMultiPlot,
|
|
1284
1368
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1333,9 +1417,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1333
1417
|
var mode = 'tonexty';
|
|
1334
1418
|
var _q = getLegendProps(input.data, input.layout, isMultiPlot), legends = _q.legends, hideLegend = _q.hideLegend;
|
|
1335
1419
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1336
|
-
var
|
|
1337
|
-
var resolveXValue = getAxisValueResolver(xAxisType);
|
|
1338
|
-
var shouldWrapLabels = xAxisType === 'category';
|
|
1420
|
+
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
1339
1421
|
var chartData = input.data
|
|
1340
1422
|
.map(function (series, index) {
|
|
1341
1423
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -1470,12 +1552,12 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1470
1552
|
scatterChartData: __spreadArray(__spreadArray([], chartData, true), lineShape, true),
|
|
1471
1553
|
};
|
|
1472
1554
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1473
|
-
var commonProps = __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 } : {}));
|
|
1474
1556
|
if (isAreaChart) {
|
|
1475
1557
|
return __assign({ data: chartProps, mode: mode }, commonProps);
|
|
1476
1558
|
}
|
|
1477
1559
|
else {
|
|
1478
|
-
return __assign(__assign(__assign(__assign({ data: isScatterChart ? scatterChartProps : chartProps,
|
|
1560
|
+
return __assign(__assign(__assign(__assign({ data: isScatterChart ? scatterChartProps : chartProps, enableReflow: false }, commonProps), yMinMax), (isScatterChart
|
|
1479
1561
|
? __assign({ showYAxisLablesTooltip: true }, getAxisCategoryOrderProps(input.data, input.layout)) : {})), (!isScatterChart &&
|
|
1480
1562
|
(function () {
|
|
1481
1563
|
var bars = mapColorFillBars(input.layout);
|
|
@@ -1498,7 +1580,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1498
1580
|
var legend = legends[index];
|
|
1499
1581
|
return series.y
|
|
1500
1582
|
.map(function (yValue, i) {
|
|
1501
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1583
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1502
1584
|
if (isInvalidValue(yValue)) {
|
|
1503
1585
|
return null;
|
|
1504
1586
|
}
|
|
@@ -1509,12 +1591,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1509
1591
|
: 0)
|
|
1510
1592
|
: resolveColor(extractedColors, i, legend, colorMap, (_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, isDarkTheme);
|
|
1511
1593
|
var opacity = getOpacity(series, i);
|
|
1512
|
-
return {
|
|
1513
|
-
x: isInvalidValue((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i],
|
|
1514
|
-
y: yValue,
|
|
1515
|
-
legend: legend,
|
|
1516
|
-
color: (_j = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color,
|
|
1517
|
-
};
|
|
1594
|
+
return __assign({ x: isInvalidValue((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i], y: yValue, legend: legend, color: (_j = rgb(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color }, (((_k = series.text) === null || _k === void 0 ? void 0 : _k[i]) ? { barLabel: series.text[i].toString() } : {}));
|
|
1518
1595
|
})
|
|
1519
1596
|
.filter(function (point) { return point !== null; });
|
|
1520
1597
|
})
|
|
@@ -1527,9 +1604,9 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1527
1604
|
var scalingFactor = 0.01;
|
|
1528
1605
|
var gapFactor = 1 / (1 + scalingFactor * numberOfRows);
|
|
1529
1606
|
var barHeight = availableHeight / (numberOfRows * (1 + gapFactor));
|
|
1530
|
-
return __assign(__assign(__assign(__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
|
|
1607
|
+
return __assign(__assign(__assign(__assign(__assign({ data: chartData, secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
|
|
1531
1608
|
? (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.yaxis2) === null || _m === void 0 ? void 0 : _m.title
|
|
1532
|
-
: ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true }, getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true)), getAxisTickProps(input.data, input.layout));
|
|
1609
|
+
: ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '', barHeight: barHeight, showYAxisLables: true, height: chartHeight, width: (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width, hideTickOverlap: true, hideLegend: hideLegend, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundCorners: true, roundedTicks: true }, getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getBarProps(input.data, input.layout, true)), getAxisTickProps(input.data, input.layout));
|
|
1533
1610
|
};
|
|
1534
1611
|
export var transformPlotlyJsonToGanttChartProps = function (input, isMultiPlot,
|
|
1535
1612
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1604,34 +1681,72 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1604
1681
|
export var transformPlotlyJsonToHeatmapProps = function (input, isMultiPlot,
|
|
1605
1682
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1606
1683
|
colorMap, colorwayType, isDarkTheme) {
|
|
1607
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
1684
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
1608
1685
|
var firstData = input.data[0];
|
|
1609
1686
|
var heatmapDataPoints = [];
|
|
1610
1687
|
var zMin = Number.POSITIVE_INFINITY;
|
|
1611
1688
|
var zMax = Number.NEGATIVE_INFINITY;
|
|
1689
|
+
// Build a 2D array of annotations based on their grid position
|
|
1690
|
+
var annotationGrid = [];
|
|
1691
|
+
var rawAnnotations = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.annotations;
|
|
1692
|
+
if (rawAnnotations) {
|
|
1693
|
+
var annotationsArray = Array.isArray(rawAnnotations) ? rawAnnotations : [rawAnnotations];
|
|
1694
|
+
// Collect all unique x and y values from valid annotations
|
|
1695
|
+
var xSet_1 = new Set();
|
|
1696
|
+
var ySet_1 = new Set();
|
|
1697
|
+
var validAnnotations_1 = [];
|
|
1698
|
+
annotationsArray.forEach(function (a) {
|
|
1699
|
+
if (a &&
|
|
1700
|
+
typeof a.x === 'number' &&
|
|
1701
|
+
typeof a.y === 'number' &&
|
|
1702
|
+
typeof a.text === 'string' &&
|
|
1703
|
+
(a.xref === 'x' || a.xref === undefined) &&
|
|
1704
|
+
(a.yref === 'y' || a.yref === undefined)) {
|
|
1705
|
+
xSet_1.add(a.x);
|
|
1706
|
+
ySet_1.add(a.y);
|
|
1707
|
+
validAnnotations_1.push({ x: a.x, y: a.y, text: cleanText(a.text) });
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
if (validAnnotations_1.length > 0) {
|
|
1711
|
+
// Get sorted unique x and y values
|
|
1712
|
+
var xValues_1 = Array.from(xSet_1).sort(function (a, b) { return a - b; });
|
|
1713
|
+
var yValues_1 = Array.from(ySet_1).sort(function (a, b) { return a - b; });
|
|
1714
|
+
// Initialize 2D grid and populate
|
|
1715
|
+
validAnnotations_1.forEach(function (annotation) {
|
|
1716
|
+
var xIdx = xValues_1.indexOf(annotation.x);
|
|
1717
|
+
var yIdx = yValues_1.indexOf(annotation.y);
|
|
1718
|
+
if (!annotationGrid[yIdx]) {
|
|
1719
|
+
annotationGrid[yIdx] = [];
|
|
1720
|
+
}
|
|
1721
|
+
annotationGrid[yIdx][xIdx] = annotation.text;
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
// Helper function to get annotation from 2D grid by index
|
|
1726
|
+
var getAnnotationByIndex = function (xIdx, yIdx) { var _a; return (_a = annotationGrid[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx]; };
|
|
1612
1727
|
if (firstData.type === 'histogram2d') {
|
|
1613
|
-
var
|
|
1614
|
-
var
|
|
1728
|
+
var xValues_2 = [];
|
|
1729
|
+
var yValues_2 = [];
|
|
1615
1730
|
var zValues_1 = [];
|
|
1616
|
-
(
|
|
1731
|
+
(_b = firstData.x) === null || _b === void 0 ? void 0 : _b.forEach(function (xVal, index) {
|
|
1617
1732
|
var _a, _b;
|
|
1618
1733
|
var zVal = (_a = getNumberAtIndexOrDefault(firstData.z, index)) !== null && _a !== void 0 ? _a : 0;
|
|
1619
1734
|
if (isInvalidValue(xVal) || isInvalidValue((_b = firstData.y) === null || _b === void 0 ? void 0 : _b[index])) {
|
|
1620
1735
|
return;
|
|
1621
1736
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1737
|
+
xValues_2.push(xVal);
|
|
1738
|
+
yValues_2.push(firstData.y[index]);
|
|
1624
1739
|
zValues_1.push(zVal);
|
|
1625
1740
|
});
|
|
1626
|
-
var isXString_1 = isStringArray(
|
|
1627
|
-
var isYString_1 = isStringArray(
|
|
1628
|
-
var xBins_1 = createBins(
|
|
1629
|
-
var yBins_1 = createBins(
|
|
1741
|
+
var isXString_1 = isStringArray(xValues_2);
|
|
1742
|
+
var isYString_1 = isStringArray(yValues_2);
|
|
1743
|
+
var xBins_1 = createBins(xValues_2, (_c = firstData.xbins) === null || _c === void 0 ? void 0 : _c.start, (_d = firstData.xbins) === null || _d === void 0 ? void 0 : _d.end, (_e = firstData.xbins) === null || _e === void 0 ? void 0 : _e.size);
|
|
1744
|
+
var yBins_1 = createBins(yValues_2, (_f = firstData.ybins) === null || _f === void 0 ? void 0 : _f.start, (_g = firstData.ybins) === null || _g === void 0 ? void 0 : _g.end, (_h = firstData.ybins) === null || _h === void 0 ? void 0 : _h.size);
|
|
1630
1745
|
var zBins_1 = yBins_1.map(function () { return xBins_1.map(function () { return []; }); });
|
|
1631
1746
|
var total_1 = 0;
|
|
1632
|
-
|
|
1747
|
+
xValues_2.forEach(function (xVal, index) {
|
|
1633
1748
|
var xBinIdx = findBinIndex(xBins_1, xVal, isXString_1);
|
|
1634
|
-
var yBinIdx = findBinIndex(yBins_1,
|
|
1749
|
+
var yBinIdx = findBinIndex(yBins_1, yValues_2[index], isYString_1);
|
|
1635
1750
|
if (xBinIdx !== -1 && yBinIdx !== -1) {
|
|
1636
1751
|
zBins_1[yBinIdx][xBinIdx].push(zValues_1[index]);
|
|
1637
1752
|
}
|
|
@@ -1646,11 +1761,12 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1646
1761
|
xBins_1.forEach(function (xBin, xIdx) {
|
|
1647
1762
|
yBins_1.forEach(function (yBin, yIdx) {
|
|
1648
1763
|
var zVal = calculateHistNorm(firstData.histnorm, z_1[yIdx][xIdx], total_1, isXString_1 ? xBin.length : getBinSize(xBin), isYString_1 ? yBin.length : getBinSize(yBin));
|
|
1764
|
+
var annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1649
1765
|
heatmapDataPoints.push({
|
|
1650
1766
|
x: isXString_1 ? xBin.join(', ') : getBinCenter(xBin),
|
|
1651
1767
|
y: isYString_1 ? yBin.join(', ') : getBinCenter(yBin),
|
|
1652
1768
|
value: zVal,
|
|
1653
|
-
rectText: zVal,
|
|
1769
|
+
rectText: annotationText || zVal,
|
|
1654
1770
|
});
|
|
1655
1771
|
if (typeof zVal === 'number') {
|
|
1656
1772
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1660,17 +1776,27 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1660
1776
|
});
|
|
1661
1777
|
}
|
|
1662
1778
|
else {
|
|
1663
|
-
|
|
1664
|
-
|
|
1779
|
+
// If x and y are not provided, generate indices based on z dimensions
|
|
1780
|
+
var zArray_1 = firstData.z;
|
|
1781
|
+
var xValues = firstData.x;
|
|
1782
|
+
var yValues = firstData.y;
|
|
1783
|
+
// Determine the dimensions from z array
|
|
1784
|
+
var yLength_1 = (_j = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1.length) !== null && _j !== void 0 ? _j : 0;
|
|
1785
|
+
var xLength = (_l = (_k = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1[0]) === null || _k === void 0 ? void 0 : _k.length) !== null && _l !== void 0 ? _l : 0;
|
|
1786
|
+
// Use provided x/y values or generate indices
|
|
1787
|
+
var xData = xValues !== null && xValues !== void 0 ? xValues : Array.from({ length: xLength }, function (_, i) { return i; });
|
|
1788
|
+
var yData_1 = yValues !== null && yValues !== void 0 ? yValues : Array.from({ length: yLength_1 }, function (_, i) { return yLength_1 - 1 - i; });
|
|
1789
|
+
xData.forEach(function (xVal, xIdx) {
|
|
1665
1790
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1666
|
-
|
|
1667
|
-
var _a, _b, _c, _d, _e
|
|
1668
|
-
var zVal = (
|
|
1791
|
+
yData_1.forEach(function (yVal, yIdx) {
|
|
1792
|
+
var _a, _b, _c, _d, _e;
|
|
1793
|
+
var zVal = (_a = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx];
|
|
1794
|
+
var annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1669
1795
|
heatmapDataPoints.push({
|
|
1670
|
-
x: ((
|
|
1671
|
-
y: ((
|
|
1796
|
+
x: ((_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.xaxis) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? xVal : xVal !== null && xVal !== void 0 ? xVal : 0,
|
|
1797
|
+
y: ((_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.yaxis) === null || _e === void 0 ? void 0 : _e.type) === 'date' ? yVal : yVal,
|
|
1672
1798
|
value: zVal,
|
|
1673
|
-
rectText: zVal,
|
|
1799
|
+
rectText: annotationText || zVal,
|
|
1674
1800
|
});
|
|
1675
1801
|
if (typeof zVal === 'number') {
|
|
1676
1802
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1680,7 +1806,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1680
1806
|
});
|
|
1681
1807
|
}
|
|
1682
1808
|
var heatmapData = {
|
|
1683
|
-
legend: (
|
|
1809
|
+
legend: (_m = firstData.name) !== null && _m !== void 0 ? _m : '',
|
|
1684
1810
|
data: heatmapDataPoints,
|
|
1685
1811
|
value: 0,
|
|
1686
1812
|
};
|
|
@@ -1691,7 +1817,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1691
1817
|
getColorFromToken(DataVizPalette.color2),
|
|
1692
1818
|
getColorFromToken(DataVizPalette.color3),
|
|
1693
1819
|
];
|
|
1694
|
-
var colorscale = (
|
|
1820
|
+
var colorscale = (_3 = (_x = (_t = (_q = (_o = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _o !== void 0 ? _o : (_p = input.layout) === null || _p === void 0 ? void 0 : _p.colorscale) !== null && _q !== void 0 ? _q : (_s = (_r = input.layout) === null || _r === void 0 ? void 0 : _r.coloraxis) === null || _s === void 0 ? void 0 : _s.colorscale) !== null && _t !== void 0 ? _t : (_w = (_v = (_u = input.layout) === null || _u === void 0 ? void 0 : _u.template) === null || _v === void 0 ? void 0 : _v.layout) === null || _w === void 0 ? void 0 : _w.colorscale) !== null && _x !== void 0 ? _x : (firstData.type === 'histogram2d' && ((_2 = (_1 = (_0 = (_z = (_y = input.layout) === null || _y === void 0 ? void 0 : _y.template) === null || _z === void 0 ? void 0 : _z.data) === null || _0 === void 0 ? void 0 : _0.histogram2d) === null || _1 === void 0 ? void 0 : _1[0]) === null || _2 === void 0 ? void 0 : _2.colorscale))) !== null && _3 !== void 0 ? _3 : (_8 = (_7 = (_6 = (_5 = (_4 = input.layout) === null || _4 === void 0 ? void 0 : _4.template) === null || _5 === void 0 ? void 0 : _5.data) === null || _6 === void 0 ? void 0 : _6.heatmap) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.colorscale;
|
|
1695
1821
|
// determine if the types diverging, sequential or sequentialminus are present in colorscale
|
|
1696
1822
|
if (colorscale &&
|
|
1697
1823
|
typeof colorscale === 'object' &&
|
|
@@ -1715,13 +1841,13 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1715
1841
|
var rangeValuesForColorScale = Array.isArray(colorscale)
|
|
1716
1842
|
? colorscale.map(function (arr) { return arr[1]; })
|
|
1717
1843
|
: defaultRange;
|
|
1718
|
-
return __assign(__assign(__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (
|
|
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));
|
|
1719
1845
|
};
|
|
1720
1846
|
export var transformPlotlyJsonToSankeyProps = function (input, isMultiPlot,
|
|
1721
1847
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1722
1848
|
colorMap, colorwayType, isDarkTheme) {
|
|
1723
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1724
|
-
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;
|
|
1725
1851
|
var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
|
|
1726
1852
|
.map(function (val, index) {
|
|
1727
1853
|
var _a, _b;
|
|
@@ -1737,8 +1863,9 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1737
1863
|
// Filter out negative nodes, unequal nodes and self-references (circular links)
|
|
1738
1864
|
.filter(function (x) { return x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target; });
|
|
1739
1865
|
var extractedNodeColors = extractColor((_d = (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.template) === null || _c === void 0 ? void 0 : _c.layout) === null || _d === void 0 ? void 0 : _d.colorway, colorwayType, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
|
|
1866
|
+
var extractedLinkColors = extractColor((_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, colorwayType, link === null || link === void 0 ? void 0 : link.color, colorMap, isDarkTheme);
|
|
1740
1867
|
var sankeyChartData = {
|
|
1741
|
-
nodes: (
|
|
1868
|
+
nodes: (_h = node.label) === null || _h === void 0 ? void 0 : _h.map(function (label, index) {
|
|
1742
1869
|
var _a, _b, _c;
|
|
1743
1870
|
var color = resolveColor(extractedNodeColors, index, label, colorMap, (_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, isDarkTheme);
|
|
1744
1871
|
return {
|
|
@@ -1749,23 +1876,19 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1749
1876
|
}),
|
|
1750
1877
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1751
1878
|
links: validLinks.map(function (validLink, index) {
|
|
1752
|
-
|
|
1879
|
+
var _a, _b, _c;
|
|
1880
|
+
var color = resolveColor(extractedLinkColors, index, validLink.target, colorMap, (_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, isDarkTheme);
|
|
1881
|
+
return __assign(__assign({}, validLink), { color: color });
|
|
1753
1882
|
}),
|
|
1754
1883
|
};
|
|
1755
1884
|
var styles = {
|
|
1756
|
-
root: __assign({}, (((
|
|
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 } : {})),
|
|
1757
1886
|
};
|
|
1758
|
-
var
|
|
1759
|
-
return {
|
|
1760
|
-
data: {
|
|
1887
|
+
var _s = getTitles(input.layout), chartTitle = _s.chartTitle, titleStyles = _s.titleStyles;
|
|
1888
|
+
return __assign({ data: {
|
|
1761
1889
|
chartTitle: chartTitle,
|
|
1762
1890
|
SankeyChartData: sankeyChartData,
|
|
1763
|
-
},
|
|
1764
|
-
width: (_j = input.layout) === null || _j === void 0 ? void 0 : _j.width,
|
|
1765
|
-
height: (_l = (_k = input.layout) === null || _k === void 0 ? void 0 : _k.height) !== null && _l !== void 0 ? _l : 468,
|
|
1766
|
-
styles: styles,
|
|
1767
|
-
enableReflow: false,
|
|
1768
|
-
};
|
|
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 } : {}));
|
|
1769
1892
|
};
|
|
1770
1893
|
export var transformPlotlyJsonToGaugeProps = function (input, isMultiPlot,
|
|
1771
1894
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1820,22 +1943,10 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1820
1943
|
fill: sublabelColor,
|
|
1821
1944
|
},
|
|
1822
1945
|
};
|
|
1823
|
-
var
|
|
1824
|
-
return {
|
|
1825
|
-
segments: segments,
|
|
1826
|
-
chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0,
|
|
1827
|
-
chartTitle: chartTitle,
|
|
1828
|
-
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,
|
|
1829
1948
|
// range values can be null
|
|
1830
|
-
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,
|
|
1831
|
-
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,
|
|
1832
|
-
chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
|
|
1833
|
-
width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width,
|
|
1834
|
-
height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220,
|
|
1835
|
-
styles: styles,
|
|
1836
|
-
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,
|
|
1837
|
-
roundCorners: true,
|
|
1838
|
-
};
|
|
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 } : {}));
|
|
1839
1950
|
};
|
|
1840
1951
|
var cleanText = function (text) {
|
|
1841
1952
|
return text
|
|
@@ -1949,13 +2060,8 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1949
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 : {})),
|
|
1950
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 : [],
|
|
1951
2062
|
};
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
rows: rows,
|
|
1955
|
-
width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width,
|
|
1956
|
-
height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height,
|
|
1957
|
-
styles: styles,
|
|
1958
|
-
};
|
|
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 } : {}));
|
|
1959
2065
|
};
|
|
1960
2066
|
function getCategoriesAndValues(series) {
|
|
1961
2067
|
var _a, _b, _c, _d;
|
|
@@ -2072,141 +2178,59 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
2072
2178
|
});
|
|
2073
2179
|
});
|
|
2074
2180
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
|
|
2078
|
-
height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
|
|
2079
|
-
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
2080
|
-
hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
|
|
2081
|
-
};
|
|
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 } : {}));
|
|
2082
2183
|
};
|
|
2083
|
-
export var
|
|
2084
|
-
var _a, _b, _c
|
|
2085
|
-
var
|
|
2086
|
-
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
var
|
|
2091
|
-
if (
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
projection.data[sindex] = series;
|
|
2127
|
-
return "continue";
|
|
2128
|
-
}
|
|
2129
|
-
// retrieve polar axis settings
|
|
2130
|
-
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;
|
|
2131
|
-
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;
|
|
2132
|
-
// Compute tick positions if categorical
|
|
2133
|
-
var uniqueTheta = [];
|
|
2134
|
-
var categorical = false;
|
|
2135
|
-
if (!isNumberArray(thetas)) {
|
|
2136
|
-
uniqueTheta = Array.from(new Set(thetas));
|
|
2137
|
-
categorical = true;
|
|
2138
|
-
}
|
|
2139
|
-
for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
|
|
2140
|
-
if (isInvalidValue(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || isInvalidValue(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
|
|
2141
|
-
continue;
|
|
2142
|
-
}
|
|
2143
|
-
// Map theta to angle in radians
|
|
2144
|
-
var thetaRad = void 0;
|
|
2145
|
-
if (categorical) {
|
|
2146
|
-
var idx = uniqueTheta.indexOf(thetas[ptindex]);
|
|
2147
|
-
var step = (2 * Math.PI) / uniqueTheta.length;
|
|
2148
|
-
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 }));
|
|
2149
2227
|
}
|
|
2150
2228
|
else {
|
|
2151
|
-
|
|
2152
|
-
}
|
|
2153
|
-
// Shift only the polar origin (not the cartesian)
|
|
2154
|
-
var rawRadius = rVals[ptindex];
|
|
2155
|
-
var polarRadius = rawRadius + radiusShift; // Only for projection
|
|
2156
|
-
// Calculate cartesian coordinates (with shifted polar origin)
|
|
2157
|
-
var x = polarRadius * Math.cos(thetaRad);
|
|
2158
|
-
var y = polarRadius * Math.sin(thetaRad);
|
|
2159
|
-
// Calculate the cartesian coordinates of the original polar origin (0,0)
|
|
2160
|
-
// This is the point that should be mapped to (0,0) in cartesian coordinates
|
|
2161
|
-
if (sindex === 0 && ptindex === 0) {
|
|
2162
|
-
// For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
|
|
2163
|
-
// But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
|
|
2164
|
-
originX = radiusShift;
|
|
2229
|
+
polarData.push(__assign({ type: 'scatterpolar' }, commonProps));
|
|
2165
2230
|
}
|
|
2166
|
-
series.x.push(x);
|
|
2167
|
-
series.y.push(y);
|
|
2168
|
-
allX.push(x);
|
|
2169
|
-
allY.push(y);
|
|
2170
2231
|
}
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
series.data = series.x.map(function (xVal, idx) { return (__assign({ x: xVal, y: series.y[idx] }, (series.text ? { text: series.text[idx] } : {}))); });
|
|
2174
|
-
}
|
|
2175
|
-
projection.data[sindex] = series;
|
|
2176
|
-
};
|
|
2177
|
-
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
2178
|
-
_loop_1(sindex);
|
|
2179
|
-
}
|
|
2180
|
-
// 7. Recenter all cartesian coordinates
|
|
2181
|
-
if (originX !== null) {
|
|
2182
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2183
|
-
var series = projection.data[sindex];
|
|
2184
|
-
if (series.x && series.y) {
|
|
2185
|
-
series.x = series.x.map(function (v) { return v - originX; });
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
// Also recenter allX for normalization
|
|
2189
|
-
for (var i = 0; i < allX.length; i++) {
|
|
2190
|
-
allX[i] = allX[i] - originX;
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
// 8. Find the maximum absolute value among all x and y
|
|
2194
|
-
var maxAbs = Math.max.apply(Math, __spreadArray(__spreadArray([], allX.map(Math.abs), false), allY.map(Math.abs), false));
|
|
2195
|
-
maxAbs = maxAbs === 0 ? 1 : maxAbs;
|
|
2196
|
-
// 9. Rescale all points so that the largest |x| or |y| is 0.5
|
|
2197
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2198
|
-
var series = projection.data[sindex];
|
|
2199
|
-
if (series.x && series.y) {
|
|
2200
|
-
series.x = series.x.map(function (v) { return v / (2 * maxAbs); });
|
|
2201
|
-
series.y = series.y.map(function (v) { return v / (2 * maxAbs); });
|
|
2202
|
-
}
|
|
2203
|
-
}
|
|
2204
|
-
// 10. Customize layout for perfect square with absolute positioning
|
|
2205
|
-
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;
|
|
2206
|
-
projection.layout = __assign(__assign({}, projection.layout), { width: size, height: size });
|
|
2207
|
-
// Attach originX as custom properties
|
|
2208
|
-
projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
|
|
2209
|
-
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));
|
|
2210
2234
|
};
|
|
2211
2235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2212
2236
|
function isPlainObject(obj) {
|
|
@@ -2488,7 +2512,7 @@ var getIndexFromKey = function (key, pattern) {
|
|
|
2488
2512
|
return parseInt(normalizedKey, 10) - 1;
|
|
2489
2513
|
};
|
|
2490
2514
|
export var isNonPlotType = function (chartType) {
|
|
2491
|
-
return ['donut', 'sankey', 'pie', 'annotation'].includes(chartType);
|
|
2515
|
+
return ['donut', 'sankey', 'pie', 'annotation', 'table', 'gauge', 'funnel'].includes(chartType);
|
|
2492
2516
|
};
|
|
2493
2517
|
export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
2494
2518
|
var _a;
|
|
@@ -2517,6 +2541,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2517
2541
|
var domainXInfo = {
|
|
2518
2542
|
start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
|
|
2519
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),
|
|
2520
2545
|
};
|
|
2521
2546
|
domainX.push(domainXInfo);
|
|
2522
2547
|
}
|
|
@@ -2535,6 +2560,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2535
2560
|
var domainYInfo = {
|
|
2536
2561
|
start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
|
|
2537
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),
|
|
2538
2564
|
};
|
|
2539
2565
|
domainY.push(domainYInfo);
|
|
2540
2566
|
}
|
|
@@ -2548,16 +2574,36 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2548
2574
|
var domainXInfo = {
|
|
2549
2575
|
start: ((_b = series.domain) === null || _b === void 0 ? void 0 : _b.x) ? series.domain.x[0] : 0,
|
|
2550
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),
|
|
2551
2578
|
};
|
|
2552
2579
|
var domainYInfo = {
|
|
2553
2580
|
start: ((_d = series.domain) === null || _d === void 0 ? void 0 : _d.y) ? series.domain.y[0] : 0,
|
|
2554
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),
|
|
2555
2583
|
};
|
|
2556
2584
|
domainX.push(domainXInfo);
|
|
2557
2585
|
domainY.push(domainYInfo);
|
|
2558
2586
|
}
|
|
2559
2587
|
});
|
|
2560
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
|
+
});
|
|
2561
2607
|
(_a = layout.annotations) === null || _a === void 0 ? void 0 : _a.forEach(function (annotation) {
|
|
2562
2608
|
var xMatches = domainX.flatMap(function (interval, idx) {
|
|
2563
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] : [];
|
|
@@ -2593,9 +2639,6 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2593
2639
|
.sort();
|
|
2594
2640
|
templateColumns = "repeat(".concat(sortedXStart_1.length, ", 1fr)");
|
|
2595
2641
|
domainX.forEach(function (interval, index) {
|
|
2596
|
-
var cellName = index >= cartesianDomains
|
|
2597
|
-
? "".concat(NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2598
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2599
2642
|
var columnIndex = sortedXStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2600
2643
|
var columnNumber = columnIndex + 1; // Column numbers are 1-based
|
|
2601
2644
|
var annotationProps = annotations[index];
|
|
@@ -2607,7 +2650,7 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2607
2650
|
xDomain: interval,
|
|
2608
2651
|
yDomain: { start: 0, end: 1 }, // Default yDomain for x-axis
|
|
2609
2652
|
};
|
|
2610
|
-
gridLayout[cellName] = row;
|
|
2653
|
+
gridLayout[interval.cellName] = row;
|
|
2611
2654
|
});
|
|
2612
2655
|
}
|
|
2613
2656
|
if (domainY.length > 0) {
|
|
@@ -2624,14 +2667,11 @@ export var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2624
2667
|
var numberOfRows_1 = sortedYStart_1.length;
|
|
2625
2668
|
templateRows = "repeat(".concat(numberOfRows_1, ", 1fr)");
|
|
2626
2669
|
domainY.forEach(function (interval, index) {
|
|
2627
|
-
var cellName = index >= cartesianDomains
|
|
2628
|
-
? "".concat(NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2629
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2630
2670
|
var rowIndex = sortedYStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2631
2671
|
var rowNumber = numberOfRows_1 - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
|
|
2632
2672
|
var annotationProps = annotations[index];
|
|
2633
2673
|
var yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
|
|
2634
|
-
var cell = gridLayout[cellName];
|
|
2674
|
+
var cell = gridLayout[interval.cellName];
|
|
2635
2675
|
if (cell !== undefined) {
|
|
2636
2676
|
cell.row = rowNumber;
|
|
2637
2677
|
cell.yAnnotation = yAnnotation;
|
|
@@ -2782,19 +2822,20 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2782
2822
|
return;
|
|
2783
2823
|
}
|
|
2784
2824
|
var axType = getAxisType(data, ax);
|
|
2825
|
+
if (axId === 'x' && axType === 'category') {
|
|
2826
|
+
props.xAxis = {
|
|
2827
|
+
tickLayout: 'auto',
|
|
2828
|
+
};
|
|
2829
|
+
}
|
|
2785
2830
|
if ((!ax.tickmode || ax.tickmode === 'array') && isArrayOrTypedArray(ax.tickvals)) {
|
|
2786
2831
|
var tickValues = axType === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
2787
2832
|
if (axId === 'x') {
|
|
2788
2833
|
props.tickValues = tickValues;
|
|
2789
|
-
props.xAxis = {
|
|
2790
|
-
tickText: ax.ticktext,
|
|
2791
|
-
};
|
|
2834
|
+
props.xAxis = __assign(__assign({}, props.xAxis), { tickText: ax.ticktext });
|
|
2792
2835
|
}
|
|
2793
2836
|
else if (axId === 'y') {
|
|
2794
2837
|
props.yAxisTickValues = tickValues;
|
|
2795
|
-
props.yAxis = {
|
|
2796
|
-
tickText: ax.ticktext,
|
|
2797
|
-
};
|
|
2838
|
+
props.yAxis = __assign(__assign({}, props.yAxis), { tickText: ax.ticktext });
|
|
2798
2839
|
}
|
|
2799
2840
|
return;
|
|
2800
2841
|
}
|
|
@@ -2802,16 +2843,10 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2802
2843
|
var dtick = plotlyDtick(ax.dtick, axType);
|
|
2803
2844
|
var tick0 = plotlyTick0(ax.tick0, axType, dtick);
|
|
2804
2845
|
if (axId === 'x') {
|
|
2805
|
-
props.xAxis = {
|
|
2806
|
-
tickStep: dtick,
|
|
2807
|
-
tick0: tick0,
|
|
2808
|
-
};
|
|
2846
|
+
props.xAxis = __assign(__assign({}, props.xAxis), { tickStep: dtick, tick0: tick0 });
|
|
2809
2847
|
}
|
|
2810
2848
|
else if (axId === 'y') {
|
|
2811
|
-
props.yAxis = {
|
|
2812
|
-
tickStep: dtick,
|
|
2813
|
-
tick0: tick0,
|
|
2814
|
-
};
|
|
2849
|
+
props.yAxis = __assign(__assign({}, props.yAxis), { tickStep: dtick, tick0: tick0 });
|
|
2815
2850
|
}
|
|
2816
2851
|
return;
|
|
2817
2852
|
}
|
|
@@ -2964,4 +2999,92 @@ var getAxisValueResolver = function (axType, dateParser) {
|
|
|
2964
2999
|
}
|
|
2965
3000
|
};
|
|
2966
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
|
+
};
|
|
2967
3090
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|