@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.
|
|
3
|
+
exports.DEFAULT_POLAR_SUBPLOT = exports.getGridProperties = exports.isNonPlotType = exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.getAllupLegendsProps = exports.transformPlotlyJsonToPolarChartProps = exports.transformPlotlyJsonToFunnelChartProps = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToGanttChartProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToLineChartProps = exports.transformPlotlyJsonToAreaChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports.transformPlotlyJsonToAnnotationChartProps = exports.normalizeObjectArrayForGVBC = exports.resolveXAxisPoint = exports._getGaugeAxisColor = exports.correctYearMonth = exports.SINGLE_REPEAT = exports.NON_PLOT_KEY_PREFIX = void 0;
|
|
4
4
|
exports.findArrayAttributes = findArrayAttributes;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var d3_array_1 = require("d3-array");
|
|
@@ -55,12 +55,15 @@ var dashOptions = {
|
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
function getTitles(layout) {
|
|
58
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
59
|
+
var titleObj = layout === null || layout === void 0 ? void 0 : layout.title;
|
|
60
|
+
var chartTitle = typeof titleObj === 'string' ? titleObj : (_a = titleObj === null || titleObj === void 0 ? void 0 : titleObj.text) !== null && _a !== void 0 ? _a : '';
|
|
61
|
+
var titleFont = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.font : undefined;
|
|
62
|
+
var titleXAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.xanchor : undefined;
|
|
63
|
+
var titleYAnchor = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.yanchor : undefined;
|
|
64
|
+
var titlePad = typeof titleObj === 'object' ? titleObj === null || titleObj === void 0 ? void 0 : titleObj.pad : undefined;
|
|
65
|
+
var titleStyles = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (titleFont ? { titleFont: titleFont } : {})), (titleXAnchor ? { titleXAnchor: titleXAnchor } : {})), (titleYAnchor ? { titleYAnchor: titleYAnchor } : {})), (titlePad ? { titlePad: titlePad } : {}));
|
|
66
|
+
var titles = tslib_1.__assign(tslib_1.__assign({ chartTitle: chartTitle }, (Object.keys(titleStyles).length > 0 ? { titleStyles: titleStyles } : {})), { xAxisTitle: typeof ((_b = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _b === void 0 ? void 0 : _b.title) === 'string' ? (_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title : (_f = (_e = (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.text) !== null && _f !== void 0 ? _f : '', yAxisTitle: typeof ((_g = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _g === void 0 ? void 0 : _g.title) === 'string' ? (_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title : (_l = (_k = (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title) === null || _k === void 0 ? void 0 : _k.text) !== null && _l !== void 0 ? _l : '', xAxisAnnotation: chartTitle });
|
|
64
67
|
return titles;
|
|
65
68
|
}
|
|
66
69
|
var getXAxisTickFormat = function (series, layout) {
|
|
@@ -92,6 +95,18 @@ var getYMinMaxValues = function (series, layout) {
|
|
|
92
95
|
}
|
|
93
96
|
return {};
|
|
94
97
|
};
|
|
98
|
+
var getXMinMaxValues = function (series, layout) {
|
|
99
|
+
var _a;
|
|
100
|
+
var range = (_a = getXAxisProperties(series, layout)) === null || _a === void 0 ? void 0 : _a.range;
|
|
101
|
+
if (range && range.length === 2) {
|
|
102
|
+
return {
|
|
103
|
+
xMinValue: range[0],
|
|
104
|
+
xMaxValue: range[1],
|
|
105
|
+
showRoundOffXTickValues: false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {};
|
|
109
|
+
};
|
|
95
110
|
var getYAxisProperties = function (series, layout) {
|
|
96
111
|
return layout === null || layout === void 0 ? void 0 : layout.yaxis;
|
|
97
112
|
};
|
|
@@ -219,6 +234,64 @@ var resolveXAxisPoint = function (x, isXYearCategory, isXString, isXDate, isXNum
|
|
|
219
234
|
return x;
|
|
220
235
|
};
|
|
221
236
|
exports.resolveXAxisPoint = resolveXAxisPoint;
|
|
237
|
+
/**
|
|
238
|
+
* Formats text values according to the texttemplate specification
|
|
239
|
+
* Supports D3 format specifiers within %{text:format} patterns
|
|
240
|
+
* @param textValue The raw text value to format
|
|
241
|
+
* @param textTemplate The template string (e.g., "%{text:.1f}%", "%{text:.2%}", "%{text:,.0f}")
|
|
242
|
+
* @param index Optional index for array-based templates
|
|
243
|
+
* @returns Formatted text string
|
|
244
|
+
*
|
|
245
|
+
* Examples:
|
|
246
|
+
* - "%{text:.1f}%" → Formats number with 1 decimal place and adds % suffix
|
|
247
|
+
* - "%{text:.2%}" → Formats as percentage with 2 decimal places
|
|
248
|
+
* - "%{text:,.0f}" → Formats with thousands separator and no decimals
|
|
249
|
+
* - "%{text:$,.2f}" → Formats as currency with thousands separator and 2 decimals
|
|
250
|
+
*/
|
|
251
|
+
var formatTextWithTemplate = function (textValue, textTemplate, index) {
|
|
252
|
+
if (!textTemplate) {
|
|
253
|
+
return String(textValue);
|
|
254
|
+
}
|
|
255
|
+
var numVal = typeof textValue === 'number' ? textValue : parseFloat(String(textValue));
|
|
256
|
+
if (isNaN(numVal)) {
|
|
257
|
+
return String(textValue);
|
|
258
|
+
}
|
|
259
|
+
var template = typeof textTemplate === 'string' ? textTemplate : textTemplate[index || 0] || '';
|
|
260
|
+
// Match Plotly's texttemplate pattern: %{text:format} or %{text}
|
|
261
|
+
// Can be followed by any literal text like %, $, etc.
|
|
262
|
+
var plotlyPattern = /%\{text(?::([^}]+))?\}(.*)$/;
|
|
263
|
+
var match = template.match(plotlyPattern);
|
|
264
|
+
if (match) {
|
|
265
|
+
var formatSpec = match[1]; // The format specifier (e.g., ".1f", ".2%", ",.0f") or undefined
|
|
266
|
+
var suffix = match[2]; // Any text after the closing brace (e.g., "%", " units")
|
|
267
|
+
// If no format specifier is provided (e.g., %{text}%), try to infer from suffix
|
|
268
|
+
if (!formatSpec) {
|
|
269
|
+
// Check if suffix starts with % - assume simple percentage with 1 decimal
|
|
270
|
+
if (suffix.startsWith('%')) {
|
|
271
|
+
return "".concat(numVal.toFixed(1)).concat(suffix);
|
|
272
|
+
}
|
|
273
|
+
// No format specifier, just return the number with the suffix
|
|
274
|
+
return "".concat(numVal).concat(suffix);
|
|
275
|
+
}
|
|
276
|
+
try {
|
|
277
|
+
// Use D3 format function to apply the format specifier
|
|
278
|
+
var formatter = (0, d3_format_1.format)(formatSpec);
|
|
279
|
+
var formattedValue = formatter(numVal);
|
|
280
|
+
return "".concat(formattedValue).concat(suffix);
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
// Try to extract precision for basic fallback
|
|
284
|
+
var precisionMatch = formatSpec.match(/\.(\d+)[f%]/);
|
|
285
|
+
var precision = precisionMatch ? parseInt(precisionMatch[1], 10) : 2;
|
|
286
|
+
// Check if it's a percentage format
|
|
287
|
+
if (formatSpec.includes('%')) {
|
|
288
|
+
return "".concat((numVal * 100).toFixed(precision), "%").concat(suffix);
|
|
289
|
+
}
|
|
290
|
+
return "".concat(numVal.toFixed(precision)).concat(suffix);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return String(textValue);
|
|
294
|
+
};
|
|
222
295
|
/**
|
|
223
296
|
* Extracts unique X-axis categories from Plotly data traces
|
|
224
297
|
* @param data Array of Plotly data traces
|
|
@@ -963,7 +1036,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
963
1036
|
var innerRadius = firstData.hole
|
|
964
1037
|
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
|
|
965
1038
|
: utilities_1.MIN_DONUT_RADIUS;
|
|
966
|
-
var
|
|
1039
|
+
var _r = getTitles(input.layout), chartTitle = _r.chartTitle, titleStyles = _r.titleStyles;
|
|
967
1040
|
// Build anticlockwise order by keeping the first item, reversing the rest
|
|
968
1041
|
var legends = Object.keys(mapLegendToDataPoint);
|
|
969
1042
|
var reorderedEntries = legends.length > 1
|
|
@@ -974,34 +1047,26 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
974
1047
|
.reverse()
|
|
975
1048
|
.map(function (key) { return [key, mapLegendToDataPoint[key]]; }), true)
|
|
976
1049
|
: legends.map(function (key) { return [key, mapLegendToDataPoint[key]]; });
|
|
977
|
-
return {
|
|
978
|
-
data: {
|
|
1050
|
+
return tslib_1.__assign({ data: {
|
|
979
1051
|
chartTitle: chartTitle,
|
|
980
1052
|
chartData: reorderedEntries.map(function (_a) {
|
|
981
1053
|
var v = _a[1];
|
|
982
1054
|
return v;
|
|
983
1055
|
}),
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
height: height,
|
|
988
|
-
innerRadius: innerRadius,
|
|
989
|
-
hideLabels: hideLabels,
|
|
990
|
-
showLabelsInPercent: firstData.textinfo ? ['percent', 'label+percent'].includes(firstData.textinfo) : true,
|
|
991
|
-
roundCorners: true,
|
|
992
|
-
order: 'sorted',
|
|
993
|
-
};
|
|
1056
|
+
}, 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
|
|
1057
|
+
? ['percent', 'label+percent', 'percent+label'].includes(firstData.textinfo)
|
|
1058
|
+
: true, roundCorners: true, order: 'sorted' }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
994
1059
|
};
|
|
995
1060
|
exports.transformPlotlyJsonToDonutProps = transformPlotlyJsonToDonutProps;
|
|
996
1061
|
var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot,
|
|
997
1062
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
998
1063
|
colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
999
|
-
var _a, _b, _c, _d, _e
|
|
1064
|
+
var _a, _b, _c, _d, _e;
|
|
1000
1065
|
var mapXToDataPoints = {};
|
|
1001
1066
|
var yMaxValue = 0;
|
|
1002
1067
|
var yMinValue = 0;
|
|
1003
1068
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
1004
|
-
var
|
|
1069
|
+
var _f = getLegendProps(input.data, input.layout, isMultiPlot), legends = _f.legends, hideLegend = _f.hideLegend;
|
|
1005
1070
|
var colorScale = undefined;
|
|
1006
1071
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1007
1072
|
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
@@ -1017,6 +1082,11 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1017
1082
|
var rangeStart = _a[0], rangeEnd = _a[1];
|
|
1018
1083
|
var rangeXValues = series.x.slice(rangeStart, rangeEnd);
|
|
1019
1084
|
var rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
1085
|
+
var textValues = Array.isArray(series.text)
|
|
1086
|
+
? series.text.slice(rangeStart, rangeEnd)
|
|
1087
|
+
: typeof series.text === 'string'
|
|
1088
|
+
? series.text
|
|
1089
|
+
: undefined;
|
|
1020
1090
|
rangeXValues.forEach(function (x, index2) {
|
|
1021
1091
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1022
1092
|
if (!mapXToDataPoints[x]) {
|
|
@@ -1036,13 +1106,13 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1036
1106
|
var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index2);
|
|
1037
1107
|
var yVal = rangeYValues[index2];
|
|
1038
1108
|
var yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
|
|
1109
|
+
var barLabel = Array.isArray(textValues) ? textValues[index2] : textValues;
|
|
1110
|
+
// Apply texttemplate formatting if specified
|
|
1111
|
+
if (barLabel && series.texttemplate) {
|
|
1112
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index2);
|
|
1113
|
+
}
|
|
1039
1114
|
if (series.type === 'bar') {
|
|
1040
|
-
mapXToDataPoints[x].chartData.push({
|
|
1041
|
-
legend: legend,
|
|
1042
|
-
data: yVal,
|
|
1043
|
-
color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color,
|
|
1044
|
-
yAxisCalloutData: yAxisCalloutData,
|
|
1045
|
-
});
|
|
1115
|
+
mapXToDataPoints[x].chartData.push(tslib_1.__assign({ legend: legend, data: yVal, color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color, yAxisCalloutData: yAxisCalloutData }, (barLabel ? { barLabel: String(barLabel) } : {})));
|
|
1046
1116
|
if (typeof yVal === 'number') {
|
|
1047
1117
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
1048
1118
|
}
|
|
@@ -1075,6 +1145,14 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1075
1145
|
var _a, _b, _c;
|
|
1076
1146
|
var lineColor = (_a = shape.line) === null || _a === void 0 ? void 0 : _a.color;
|
|
1077
1147
|
var resolveX = function (val) {
|
|
1148
|
+
if (shape.xref === 'x domain') {
|
|
1149
|
+
if (val === 0) {
|
|
1150
|
+
return xCategories[0];
|
|
1151
|
+
}
|
|
1152
|
+
if (val === 1) {
|
|
1153
|
+
return xCategories[xCategories.length - 1];
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1078
1156
|
if (typeof val === 'number' && Array.isArray(xCategories)) {
|
|
1079
1157
|
if (xCategories[val] !== undefined) {
|
|
1080
1158
|
return xCategories[val];
|
|
@@ -1125,7 +1203,7 @@ colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
|
1125
1203
|
});
|
|
1126
1204
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
1127
1205
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1128
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ 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,
|
|
1206
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width, height: (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1129
1207
|
};
|
|
1130
1208
|
exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
|
|
1131
1209
|
var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot,
|
|
@@ -1184,12 +1262,13 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1184
1262
|
: (0, PlotlyColorAdapter_1.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);
|
|
1185
1263
|
var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, xIndex);
|
|
1186
1264
|
var yVal = series.y[xIndex];
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
}
|
|
1265
|
+
// Extract text value for barLabel
|
|
1266
|
+
var barLabel = Array.isArray(series.text) ? series.text[xIndex] : series.text;
|
|
1267
|
+
// Apply texttemplate formatting if specified
|
|
1268
|
+
if (barLabel && series.texttemplate) {
|
|
1269
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, xIndex);
|
|
1270
|
+
}
|
|
1271
|
+
return tslib_1.__assign({ x: x.toString(), y: yVal, yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat), color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color }, (barLabel ? { barLabel: String(barLabel) } : {}));
|
|
1193
1272
|
})
|
|
1194
1273
|
.filter(function (item) { return typeof item !== 'undefined'; }),
|
|
1195
1274
|
useSecondaryYScale: usesSecondaryYScale(series, processedInput.layout),
|
|
@@ -1227,15 +1306,15 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1227
1306
|
}
|
|
1228
1307
|
});
|
|
1229
1308
|
var annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
1230
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ 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,
|
|
1309
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dataV2: gvbcDataV2, width: (_a = processedInput.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = processedInput.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barwidth: 'auto', mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }), getXMinMaxValues(processedInput.data[0], processedInput.layout)), getTitles(processedInput.layout)), getAxisCategoryOrderProps(processedInput.data, processedInput.layout)), getYMinMaxValues(processedInput.data[0], processedInput.layout)), getXAxisTickFormat(processedInput.data[0], processedInput.layout)), yAxisTickFormat), getBarProps(processedInput.data, processedInput.layout)), getAxisTickProps(processedInput.data, processedInput.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1231
1310
|
};
|
|
1232
1311
|
exports.transformPlotlyJsonToGVBCProps = transformPlotlyJsonToGVBCProps;
|
|
1233
1312
|
var transformPlotlyJsonToVBCProps = function (input, isMultiPlot,
|
|
1234
1313
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1235
1314
|
colorMap, colorwayType, isDarkTheme) {
|
|
1236
|
-
var _a, _b, _c
|
|
1315
|
+
var _a, _b, _c;
|
|
1237
1316
|
var vbcData = [];
|
|
1238
|
-
var
|
|
1317
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
1239
1318
|
var colorScale = undefined;
|
|
1240
1319
|
input.data.forEach(function (series, seriesIdx) {
|
|
1241
1320
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1284,13 +1363,18 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1284
1363
|
: (0, PlotlyColorAdapter_1.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);
|
|
1285
1364
|
var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index);
|
|
1286
1365
|
var yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
|
|
1287
|
-
|
|
1366
|
+
// Handle text values and texttemplate formatting for histogram bins
|
|
1367
|
+
var barLabel = Array.isArray(series.text) ? series.text[index] : series.text;
|
|
1368
|
+
if (barLabel && series.texttemplate) {
|
|
1369
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index);
|
|
1370
|
+
}
|
|
1371
|
+
vbcData.push(tslib_1.__assign(tslib_1.__assign({ x: isXString ? bin.join(', ') : getBinCenter(bin), y: yVal, legend: legend, color: (_h = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _h !== void 0 ? _h : color }, (isXString
|
|
1288
1372
|
? {}
|
|
1289
|
-
: { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })));
|
|
1373
|
+
: { xAxisCalloutData: "[".concat(bin.x0, " - ").concat(bin.x1, ")") })), (barLabel ? { barLabel: String(barLabel) } : {})));
|
|
1290
1374
|
});
|
|
1291
1375
|
});
|
|
1292
1376
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1293
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true,
|
|
1377
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vbcData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, supportNegativeData: true, mode: 'histogram', hideTickOverlap: true, maxBarWidth: 50, hideLegend: hideLegend, roundCorners: true, roundedTicks: true, showYAxisLables: true }, getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1294
1378
|
};
|
|
1295
1379
|
exports.transformPlotlyJsonToVBCProps = transformPlotlyJsonToVBCProps;
|
|
1296
1380
|
var transformPlotlyJsonToAreaChartProps = function (input, isMultiPlot,
|
|
@@ -1349,9 +1433,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1349
1433
|
var mode = 'tonexty';
|
|
1350
1434
|
var _q = getLegendProps(input.data, input.layout, isMultiPlot), legends = _q.legends, hideLegend = _q.hideLegend;
|
|
1351
1435
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1352
|
-
var
|
|
1353
|
-
var resolveXValue = getAxisValueResolver(xAxisType);
|
|
1354
|
-
var shouldWrapLabels = xAxisType === 'category';
|
|
1436
|
+
var resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
1355
1437
|
var chartData = input.data
|
|
1356
1438
|
.map(function (series, index) {
|
|
1357
1439
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -1486,12 +1568,12 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1486
1568
|
scatterChartData: tslib_1.__spreadArray(tslib_1.__spreadArray([], chartData, true), lineShape, true),
|
|
1487
1569
|
};
|
|
1488
1570
|
var annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1489
|
-
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ 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,
|
|
1571
|
+
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (_m = input.layout) === null || _m === void 0 ? void 0 : _m.width, height: (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.height) !== null && _p !== void 0 ? _p : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000, showYAxisLables: true, roundedTicks: true }), getXMinMaxValues(input.data[0], input.layout)), getTitles(input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getAxisScaleTypeProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout)), (annotations ? { annotations: annotations } : {}));
|
|
1490
1572
|
if (isAreaChart) {
|
|
1491
1573
|
return tslib_1.__assign({ data: chartProps, mode: mode }, commonProps);
|
|
1492
1574
|
}
|
|
1493
1575
|
else {
|
|
1494
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: isScatterChart ? scatterChartProps : chartProps,
|
|
1576
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: isScatterChart ? scatterChartProps : chartProps, enableReflow: false }, commonProps), yMinMax), (isScatterChart
|
|
1495
1577
|
? tslib_1.__assign({ showYAxisLablesTooltip: true }, getAxisCategoryOrderProps(input.data, input.layout)) : {})), (!isScatterChart &&
|
|
1496
1578
|
(function () {
|
|
1497
1579
|
var bars = mapColorFillBars(input.layout);
|
|
@@ -1514,7 +1596,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1514
1596
|
var legend = legends[index];
|
|
1515
1597
|
return series.y
|
|
1516
1598
|
.map(function (yValue, i) {
|
|
1517
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1599
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1518
1600
|
if ((0, chart_utilities_1.isInvalidValue)(yValue)) {
|
|
1519
1601
|
return null;
|
|
1520
1602
|
}
|
|
@@ -1525,12 +1607,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1525
1607
|
: 0)
|
|
1526
1608
|
: (0, PlotlyColorAdapter_1.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);
|
|
1527
1609
|
var opacity = (0, PlotlyColorAdapter_1.getOpacity)(series, i);
|
|
1528
|
-
return {
|
|
1529
|
-
x: (0, chart_utilities_1.isInvalidValue)((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i],
|
|
1530
|
-
y: yValue,
|
|
1531
|
-
legend: legend,
|
|
1532
|
-
color: (_j = (0, d3_color_1.rgb)(color).copy({ opacity: opacity }).formatHex8()) !== null && _j !== void 0 ? _j : color,
|
|
1533
|
-
};
|
|
1610
|
+
return tslib_1.__assign({ x: (0, chart_utilities_1.isInvalidValue)((_h = series.x) === null || _h === void 0 ? void 0 : _h[i]) ? 0 : series.x[i], y: yValue, legend: legend, color: (_j = (0, d3_color_1.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() } : {}));
|
|
1534
1611
|
})
|
|
1535
1612
|
.filter(function (point) { return point !== null; });
|
|
1536
1613
|
})
|
|
@@ -1543,9 +1620,9 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1543
1620
|
var scalingFactor = 0.01;
|
|
1544
1621
|
var gapFactor = 1 / (1 + scalingFactor * numberOfRows);
|
|
1545
1622
|
var barHeight = availableHeight / (numberOfRows * (1 + gapFactor));
|
|
1546
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__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'
|
|
1623
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__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'
|
|
1547
1624
|
? (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.yaxis2) === null || _m === void 0 ? void 0 : _m.title
|
|
1548
|
-
: ((_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));
|
|
1625
|
+
: ((_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));
|
|
1549
1626
|
};
|
|
1550
1627
|
exports.transformPlotlyJsonToHorizontalBarWithAxisProps = transformPlotlyJsonToHorizontalBarWithAxisProps;
|
|
1551
1628
|
var transformPlotlyJsonToGanttChartProps = function (input, isMultiPlot,
|
|
@@ -1622,34 +1699,72 @@ exports.transformPlotlyJsonToGanttChartProps = transformPlotlyJsonToGanttChartPr
|
|
|
1622
1699
|
var transformPlotlyJsonToHeatmapProps = function (input, isMultiPlot,
|
|
1623
1700
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1624
1701
|
colorMap, colorwayType, isDarkTheme) {
|
|
1625
|
-
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;
|
|
1702
|
+
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;
|
|
1626
1703
|
var firstData = input.data[0];
|
|
1627
1704
|
var heatmapDataPoints = [];
|
|
1628
1705
|
var zMin = Number.POSITIVE_INFINITY;
|
|
1629
1706
|
var zMax = Number.NEGATIVE_INFINITY;
|
|
1707
|
+
// Build a 2D array of annotations based on their grid position
|
|
1708
|
+
var annotationGrid = [];
|
|
1709
|
+
var rawAnnotations = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.annotations;
|
|
1710
|
+
if (rawAnnotations) {
|
|
1711
|
+
var annotationsArray = Array.isArray(rawAnnotations) ? rawAnnotations : [rawAnnotations];
|
|
1712
|
+
// Collect all unique x and y values from valid annotations
|
|
1713
|
+
var xSet_1 = new Set();
|
|
1714
|
+
var ySet_1 = new Set();
|
|
1715
|
+
var validAnnotations_1 = [];
|
|
1716
|
+
annotationsArray.forEach(function (a) {
|
|
1717
|
+
if (a &&
|
|
1718
|
+
typeof a.x === 'number' &&
|
|
1719
|
+
typeof a.y === 'number' &&
|
|
1720
|
+
typeof a.text === 'string' &&
|
|
1721
|
+
(a.xref === 'x' || a.xref === undefined) &&
|
|
1722
|
+
(a.yref === 'y' || a.yref === undefined)) {
|
|
1723
|
+
xSet_1.add(a.x);
|
|
1724
|
+
ySet_1.add(a.y);
|
|
1725
|
+
validAnnotations_1.push({ x: a.x, y: a.y, text: cleanText(a.text) });
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
if (validAnnotations_1.length > 0) {
|
|
1729
|
+
// Get sorted unique x and y values
|
|
1730
|
+
var xValues_1 = Array.from(xSet_1).sort(function (a, b) { return a - b; });
|
|
1731
|
+
var yValues_1 = Array.from(ySet_1).sort(function (a, b) { return a - b; });
|
|
1732
|
+
// Initialize 2D grid and populate
|
|
1733
|
+
validAnnotations_1.forEach(function (annotation) {
|
|
1734
|
+
var xIdx = xValues_1.indexOf(annotation.x);
|
|
1735
|
+
var yIdx = yValues_1.indexOf(annotation.y);
|
|
1736
|
+
if (!annotationGrid[yIdx]) {
|
|
1737
|
+
annotationGrid[yIdx] = [];
|
|
1738
|
+
}
|
|
1739
|
+
annotationGrid[yIdx][xIdx] = annotation.text;
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
// Helper function to get annotation from 2D grid by index
|
|
1744
|
+
var getAnnotationByIndex = function (xIdx, yIdx) { var _a; return (_a = annotationGrid[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx]; };
|
|
1630
1745
|
if (firstData.type === 'histogram2d') {
|
|
1631
|
-
var
|
|
1632
|
-
var
|
|
1746
|
+
var xValues_2 = [];
|
|
1747
|
+
var yValues_2 = [];
|
|
1633
1748
|
var zValues_1 = [];
|
|
1634
|
-
(
|
|
1749
|
+
(_b = firstData.x) === null || _b === void 0 ? void 0 : _b.forEach(function (xVal, index) {
|
|
1635
1750
|
var _a, _b;
|
|
1636
1751
|
var zVal = (_a = (0, exports.getNumberAtIndexOrDefault)(firstData.z, index)) !== null && _a !== void 0 ? _a : 0;
|
|
1637
1752
|
if ((0, chart_utilities_1.isInvalidValue)(xVal) || (0, chart_utilities_1.isInvalidValue)((_b = firstData.y) === null || _b === void 0 ? void 0 : _b[index])) {
|
|
1638
1753
|
return;
|
|
1639
1754
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1755
|
+
xValues_2.push(xVal);
|
|
1756
|
+
yValues_2.push(firstData.y[index]);
|
|
1642
1757
|
zValues_1.push(zVal);
|
|
1643
1758
|
});
|
|
1644
|
-
var isXString_1 = (0, chart_utilities_1.isStringArray)(
|
|
1645
|
-
var isYString_1 = (0, chart_utilities_1.isStringArray)(
|
|
1646
|
-
var xBins_1 = createBins(
|
|
1647
|
-
var yBins_1 = createBins(
|
|
1759
|
+
var isXString_1 = (0, chart_utilities_1.isStringArray)(xValues_2);
|
|
1760
|
+
var isYString_1 = (0, chart_utilities_1.isStringArray)(yValues_2);
|
|
1761
|
+
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);
|
|
1762
|
+
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);
|
|
1648
1763
|
var zBins_1 = yBins_1.map(function () { return xBins_1.map(function () { return []; }); });
|
|
1649
1764
|
var total_1 = 0;
|
|
1650
|
-
|
|
1765
|
+
xValues_2.forEach(function (xVal, index) {
|
|
1651
1766
|
var xBinIdx = findBinIndex(xBins_1, xVal, isXString_1);
|
|
1652
|
-
var yBinIdx = findBinIndex(yBins_1,
|
|
1767
|
+
var yBinIdx = findBinIndex(yBins_1, yValues_2[index], isYString_1);
|
|
1653
1768
|
if (xBinIdx !== -1 && yBinIdx !== -1) {
|
|
1654
1769
|
zBins_1[yBinIdx][xBinIdx].push(zValues_1[index]);
|
|
1655
1770
|
}
|
|
@@ -1664,11 +1779,12 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1664
1779
|
xBins_1.forEach(function (xBin, xIdx) {
|
|
1665
1780
|
yBins_1.forEach(function (yBin, yIdx) {
|
|
1666
1781
|
var zVal = calculateHistNorm(firstData.histnorm, z_1[yIdx][xIdx], total_1, isXString_1 ? xBin.length : getBinSize(xBin), isYString_1 ? yBin.length : getBinSize(yBin));
|
|
1782
|
+
var annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1667
1783
|
heatmapDataPoints.push({
|
|
1668
1784
|
x: isXString_1 ? xBin.join(', ') : getBinCenter(xBin),
|
|
1669
1785
|
y: isYString_1 ? yBin.join(', ') : getBinCenter(yBin),
|
|
1670
1786
|
value: zVal,
|
|
1671
|
-
rectText: zVal,
|
|
1787
|
+
rectText: annotationText || zVal,
|
|
1672
1788
|
});
|
|
1673
1789
|
if (typeof zVal === 'number') {
|
|
1674
1790
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1678,17 +1794,27 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1678
1794
|
});
|
|
1679
1795
|
}
|
|
1680
1796
|
else {
|
|
1681
|
-
|
|
1682
|
-
|
|
1797
|
+
// If x and y are not provided, generate indices based on z dimensions
|
|
1798
|
+
var zArray_1 = firstData.z;
|
|
1799
|
+
var xValues = firstData.x;
|
|
1800
|
+
var yValues = firstData.y;
|
|
1801
|
+
// Determine the dimensions from z array
|
|
1802
|
+
var yLength_1 = (_j = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1.length) !== null && _j !== void 0 ? _j : 0;
|
|
1803
|
+
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;
|
|
1804
|
+
// Use provided x/y values or generate indices
|
|
1805
|
+
var xData = xValues !== null && xValues !== void 0 ? xValues : Array.from({ length: xLength }, function (_, i) { return i; });
|
|
1806
|
+
var yData_1 = yValues !== null && yValues !== void 0 ? yValues : Array.from({ length: yLength_1 }, function (_, i) { return yLength_1 - 1 - i; });
|
|
1807
|
+
xData.forEach(function (xVal, xIdx) {
|
|
1683
1808
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1684
|
-
|
|
1685
|
-
var _a, _b, _c, _d, _e
|
|
1686
|
-
var zVal = (
|
|
1809
|
+
yData_1.forEach(function (yVal, yIdx) {
|
|
1810
|
+
var _a, _b, _c, _d, _e;
|
|
1811
|
+
var zVal = (_a = zArray_1 === null || zArray_1 === void 0 ? void 0 : zArray_1[yIdx]) === null || _a === void 0 ? void 0 : _a[xIdx];
|
|
1812
|
+
var annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1687
1813
|
heatmapDataPoints.push({
|
|
1688
|
-
x: ((
|
|
1689
|
-
y: ((
|
|
1814
|
+
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,
|
|
1815
|
+
y: ((_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.yaxis) === null || _e === void 0 ? void 0 : _e.type) === 'date' ? yVal : yVal,
|
|
1690
1816
|
value: zVal,
|
|
1691
|
-
rectText: zVal,
|
|
1817
|
+
rectText: annotationText || zVal,
|
|
1692
1818
|
});
|
|
1693
1819
|
if (typeof zVal === 'number') {
|
|
1694
1820
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1698,7 +1824,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1698
1824
|
});
|
|
1699
1825
|
}
|
|
1700
1826
|
var heatmapData = {
|
|
1701
|
-
legend: (
|
|
1827
|
+
legend: (_m = firstData.name) !== null && _m !== void 0 ? _m : '',
|
|
1702
1828
|
data: heatmapDataPoints,
|
|
1703
1829
|
value: 0,
|
|
1704
1830
|
};
|
|
@@ -1709,7 +1835,7 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1709
1835
|
(0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color2),
|
|
1710
1836
|
(0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color3),
|
|
1711
1837
|
];
|
|
1712
|
-
var colorscale = (
|
|
1838
|
+
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;
|
|
1713
1839
|
// determine if the types diverging, sequential or sequentialminus are present in colorscale
|
|
1714
1840
|
if (colorscale &&
|
|
1715
1841
|
typeof colorscale === 'object' &&
|
|
@@ -1733,14 +1859,14 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1733
1859
|
var rangeValuesForColorScale = Array.isArray(colorscale)
|
|
1734
1860
|
? colorscale.map(function (arr) { return arr[1]; })
|
|
1735
1861
|
: defaultRange;
|
|
1736
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (
|
|
1862
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: [heatmapData], domainValuesForColorScale: domainValuesForColorScale, rangeValuesForColorScale: rangeValuesForColorScale, hideLegend: true, showYAxisLables: true, sortOrder: 'none', width: (_9 = input.layout) === null || _9 === void 0 ? void 0 : _9.width, height: (_11 = (_10 = input.layout) === null || _10 === void 0 ? void 0 : _10.height) !== null && _11 !== void 0 ? _11 : 350, hideTickOverlap: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true }, getTitles(input.layout)), getAxisCategoryOrderProps([firstData], input.layout)), getAxisTickProps(input.data, input.layout));
|
|
1737
1863
|
};
|
|
1738
1864
|
exports.transformPlotlyJsonToHeatmapProps = transformPlotlyJsonToHeatmapProps;
|
|
1739
1865
|
var transformPlotlyJsonToSankeyProps = function (input, isMultiPlot,
|
|
1740
1866
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1741
1867
|
colorMap, colorwayType, isDarkTheme) {
|
|
1742
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1743
|
-
var
|
|
1868
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1869
|
+
var _r = input.data[0], link = _r.link, node = _r.node;
|
|
1744
1870
|
var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
|
|
1745
1871
|
.map(function (val, index) {
|
|
1746
1872
|
var _a, _b;
|
|
@@ -1756,8 +1882,9 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1756
1882
|
// Filter out negative nodes, unequal nodes and self-references (circular links)
|
|
1757
1883
|
.filter(function (x) { return x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target; });
|
|
1758
1884
|
var extractedNodeColors = (0, PlotlyColorAdapter_1.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);
|
|
1885
|
+
var extractedLinkColors = (0, PlotlyColorAdapter_1.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);
|
|
1759
1886
|
var sankeyChartData = {
|
|
1760
|
-
nodes: (
|
|
1887
|
+
nodes: (_h = node.label) === null || _h === void 0 ? void 0 : _h.map(function (label, index) {
|
|
1761
1888
|
var _a, _b, _c;
|
|
1762
1889
|
var color = (0, PlotlyColorAdapter_1.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);
|
|
1763
1890
|
return {
|
|
@@ -1768,23 +1895,19 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1768
1895
|
}),
|
|
1769
1896
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1770
1897
|
links: validLinks.map(function (validLink, index) {
|
|
1771
|
-
|
|
1898
|
+
var _a, _b, _c;
|
|
1899
|
+
var color = (0, PlotlyColorAdapter_1.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);
|
|
1900
|
+
return tslib_1.__assign(tslib_1.__assign({}, validLink), { color: color });
|
|
1772
1901
|
}),
|
|
1773
1902
|
};
|
|
1774
1903
|
var styles = {
|
|
1775
|
-
root: tslib_1.__assign({}, (((
|
|
1904
|
+
root: tslib_1.__assign({}, (((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.font) === null || _k === void 0 ? void 0 : _k.size) ? { fontSize: (_l = input.layout.font) === null || _l === void 0 ? void 0 : _l.size } : {})),
|
|
1776
1905
|
};
|
|
1777
|
-
var
|
|
1778
|
-
return {
|
|
1779
|
-
data: {
|
|
1906
|
+
var _s = getTitles(input.layout), chartTitle = _s.chartTitle, titleStyles = _s.titleStyles;
|
|
1907
|
+
return tslib_1.__assign({ data: {
|
|
1780
1908
|
chartTitle: chartTitle,
|
|
1781
1909
|
SankeyChartData: sankeyChartData,
|
|
1782
|
-
},
|
|
1783
|
-
width: (_j = input.layout) === null || _j === void 0 ? void 0 : _j.width,
|
|
1784
|
-
height: (_l = (_k = input.layout) === null || _k === void 0 ? void 0 : _k.height) !== null && _l !== void 0 ? _l : 468,
|
|
1785
|
-
styles: styles,
|
|
1786
|
-
enableReflow: false,
|
|
1787
|
-
};
|
|
1910
|
+
}, 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 } : {}));
|
|
1788
1911
|
};
|
|
1789
1912
|
exports.transformPlotlyJsonToSankeyProps = transformPlotlyJsonToSankeyProps;
|
|
1790
1913
|
var transformPlotlyJsonToGaugeProps = function (input, isMultiPlot,
|
|
@@ -1840,22 +1963,10 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1840
1963
|
fill: sublabelColor,
|
|
1841
1964
|
},
|
|
1842
1965
|
};
|
|
1843
|
-
var
|
|
1844
|
-
return {
|
|
1845
|
-
segments: segments,
|
|
1846
|
-
chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0,
|
|
1847
|
-
chartTitle: chartTitle,
|
|
1848
|
-
sublabel: sublabel,
|
|
1966
|
+
var _32 = getTitles(input.layout), chartTitle = _32.chartTitle, titleStyles = _32.titleStyles;
|
|
1967
|
+
return tslib_1.__assign({ segments: segments, chartValue: (_14 = firstData.value) !== null && _14 !== void 0 ? _14 : 0, chartTitle: chartTitle, sublabel: sublabel,
|
|
1849
1968
|
// range values can be null
|
|
1850
|
-
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,
|
|
1851
|
-
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,
|
|
1852
|
-
chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
|
|
1853
|
-
width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width,
|
|
1854
|
-
height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220,
|
|
1855
|
-
styles: styles,
|
|
1856
|
-
variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment,
|
|
1857
|
-
roundCorners: true,
|
|
1858
|
-
};
|
|
1969
|
+
minValue: typeof ((_17 = (_16 = (_15 = firstData.gauge) === null || _15 === void 0 ? void 0 : _15.axis) === null || _16 === void 0 ? void 0 : _16.range) === null || _17 === void 0 ? void 0 : _17[0]) === 'number' ? (_20 = (_19 = (_18 = firstData.gauge) === null || _18 === void 0 ? void 0 : _18.axis) === null || _19 === void 0 ? void 0 : _19.range) === null || _20 === void 0 ? void 0 : _20[0] : undefined, maxValue: typeof ((_23 = (_22 = (_21 = firstData.gauge) === null || _21 === void 0 ? void 0 : _21.axis) === null || _22 === void 0 ? void 0 : _22.range) === null || _23 === void 0 ? void 0 : _23[1]) === 'number' ? (_26 = (_25 = (_24 = firstData.gauge) === null || _24 === void 0 ? void 0 : _24.axis) === null || _25 === void 0 ? void 0 : _25.range) === null || _26 === void 0 ? void 0 : _26[1] : undefined, chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; }, width: (_27 = input.layout) === null || _27 === void 0 ? void 0 : _27.width, height: (_29 = (_28 = input.layout) === null || _28 === void 0 ? void 0 : _28.height) !== null && _29 !== void 0 ? _29 : 220, styles: styles, variant: ((_31 = (_30 = firstData.gauge) === null || _30 === void 0 ? void 0 : _30.steps) === null || _31 === void 0 ? void 0 : _31.length) ? index_1.GaugeChartVariant.MultipleSegments : index_1.GaugeChartVariant.SingleSegment, roundCorners: true }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1859
1970
|
};
|
|
1860
1971
|
exports.transformPlotlyJsonToGaugeProps = transformPlotlyJsonToGaugeProps;
|
|
1861
1972
|
var cleanText = function (text) {
|
|
@@ -1970,13 +2081,8 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
1970
2081
|
font: tslib_1.__assign(tslib_1.__assign({}, ((_t = templateHeader === null || templateHeader === void 0 ? void 0 : templateHeader.font) !== null && _t !== void 0 ? _t : {})), ((_u = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.font) !== null && _u !== void 0 ? _u : {})),
|
|
1971
2082
|
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 : [],
|
|
1972
2083
|
};
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
rows: rows,
|
|
1976
|
-
width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width,
|
|
1977
|
-
height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height,
|
|
1978
|
-
styles: styles,
|
|
1979
|
-
};
|
|
2084
|
+
var _1 = getTitles(input.layout), chartTitle = _1.chartTitle, titleStyles = _1.titleStyles;
|
|
2085
|
+
return tslib_1.__assign({ headers: normalizeHeaders((_y = (_x = tableData.header) === null || _x === void 0 ? void 0 : _x.values) !== null && _y !== void 0 ? _y : [], header), rows: rows, width: (_z = input.layout) === null || _z === void 0 ? void 0 : _z.width, height: (_0 = input.layout) === null || _0 === void 0 ? void 0 : _0.height, styles: styles, chartTitle: chartTitle }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
1980
2086
|
};
|
|
1981
2087
|
exports.transformPlotlyJsonToChartTableProps = transformPlotlyJsonToChartTableProps;
|
|
1982
2088
|
function getCategoriesAndValues(series) {
|
|
@@ -2094,144 +2200,62 @@ colorMap, colorwayType, isDarkTheme) {
|
|
|
2094
2200
|
});
|
|
2095
2201
|
});
|
|
2096
2202
|
}
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width,
|
|
2100
|
-
height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height,
|
|
2101
|
-
orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical',
|
|
2102
|
-
hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false,
|
|
2103
|
-
};
|
|
2203
|
+
var _e = getTitles(input.layout), chartTitle = _e.chartTitle, titleStyles = _e.titleStyles;
|
|
2204
|
+
return tslib_1.__assign({ data: funnelData, chartTitle: chartTitle, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height, orientation: ((_c = input.data[0]) === null || _c === void 0 ? void 0 : _c.orientation) === 'v' ? 'horizontal' : 'vertical', hideLegend: isMultiPlot || ((_d = input.layout) === null || _d === void 0 ? void 0 : _d.showlegend) === false }, (titleStyles ? { titleStyles: titleStyles } : {}));
|
|
2104
2205
|
};
|
|
2105
2206
|
exports.transformPlotlyJsonToFunnelChartProps = transformPlotlyJsonToFunnelChartProps;
|
|
2106
|
-
var
|
|
2107
|
-
var _a, _b, _c
|
|
2108
|
-
var
|
|
2109
|
-
|
|
2110
|
-
var
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
var
|
|
2114
|
-
if (
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
projection.data[sindex] = series;
|
|
2150
|
-
return "continue";
|
|
2151
|
-
}
|
|
2152
|
-
// retrieve polar axis settings
|
|
2153
|
-
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;
|
|
2154
|
-
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;
|
|
2155
|
-
// Compute tick positions if categorical
|
|
2156
|
-
var uniqueTheta = [];
|
|
2157
|
-
var categorical = false;
|
|
2158
|
-
if (!(0, chart_utilities_1.isNumberArray)(thetas)) {
|
|
2159
|
-
uniqueTheta = Array.from(new Set(thetas));
|
|
2160
|
-
categorical = true;
|
|
2161
|
-
}
|
|
2162
|
-
for (var ptindex = 0; ptindex < rVals.length; ptindex++) {
|
|
2163
|
-
if ((0, chart_utilities_1.isInvalidValue)(thetas === null || thetas === void 0 ? void 0 : thetas[ptindex]) || (0, chart_utilities_1.isInvalidValue)(rVals === null || rVals === void 0 ? void 0 : rVals[ptindex])) {
|
|
2164
|
-
continue;
|
|
2165
|
-
}
|
|
2166
|
-
// Map theta to angle in radians
|
|
2167
|
-
var thetaRad = void 0;
|
|
2168
|
-
if (categorical) {
|
|
2169
|
-
var idx = uniqueTheta.indexOf(thetas[ptindex]);
|
|
2170
|
-
var step = (2 * Math.PI) / uniqueTheta.length;
|
|
2171
|
-
thetaRad = startAngleInRad + dirMultiplier * idx * step;
|
|
2207
|
+
var transformPlotlyJsonToPolarChartProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
2208
|
+
var _a, _b, _c;
|
|
2209
|
+
var polarData = [];
|
|
2210
|
+
var _d = getLegendProps(input.data, input.layout, isMultiPlot), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
2211
|
+
var resolveRValue = getAxisValueResolver(getPolarAxis(input.data, 'r', input.layout)._type);
|
|
2212
|
+
input.data.forEach(function (series, index) {
|
|
2213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2214
|
+
var legend = legends[index];
|
|
2215
|
+
if (series.type === 'scatterpolar') {
|
|
2216
|
+
var isAreaTrace = series.fill === 'toself' || series.fill === 'tonext';
|
|
2217
|
+
var isLineTrace = typeof series.mode === 'undefined' ? true : series.mode.includes('lines');
|
|
2218
|
+
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;
|
|
2219
|
+
var extractedColors_2 = (0, PlotlyColorAdapter_1.extractColor)((_e = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.template) === null || _d === void 0 ? void 0 : _d.layout) === null || _e === void 0 ? void 0 : _e.colorway, colorwayType, colors, colorMap, isDarkTheme);
|
|
2220
|
+
var seriesColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, index, legend, colorMap, (_h = (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.layout) === null || _h === void 0 ? void 0 : _h.colorway, isDarkTheme);
|
|
2221
|
+
var seriesOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, index);
|
|
2222
|
+
var finalSeriesColor_1 = (0, d3_color_1.rgb)(seriesColor).copy({ opacity: seriesOpacity }).formatHex8();
|
|
2223
|
+
var lineOptions = getLineOptions(series.line);
|
|
2224
|
+
var thetaUnit_1 = series.thetaunit;
|
|
2225
|
+
var commonProps = {
|
|
2226
|
+
legend: legend,
|
|
2227
|
+
legendShape: getLegendShape(series),
|
|
2228
|
+
color: finalSeriesColor_1,
|
|
2229
|
+
data: ((_j = series.r) === null || _j === void 0 ? void 0 : _j.map(function (r, rIndex) {
|
|
2230
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2231
|
+
var theta = (_a = series.theta) === null || _a === void 0 ? void 0 : _a[rIndex];
|
|
2232
|
+
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;
|
|
2233
|
+
var text = Array.isArray(series.text) ? series.text[rIndex] : series.text;
|
|
2234
|
+
var markerColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors_2, rIndex, legend, colorMap, (_f = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.template) === null || _e === void 0 ? void 0 : _e.layout) === null || _f === void 0 ? void 0 : _f.colorway, isDarkTheme);
|
|
2235
|
+
var markerOpacity = (0, PlotlyColorAdapter_1.getOpacity)(series, rIndex);
|
|
2236
|
+
if ((0, chart_utilities_1.isInvalidValue)(resolveRValue(r)) || (0, chart_utilities_1.isInvalidValue)(theta)) {
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
return tslib_1.__assign(tslib_1.__assign({ r: resolveRValue(r), theta: typeof theta === 'number'
|
|
2240
|
+
? thetaUnit_1 === 'radians'
|
|
2241
|
+
? (theta * 180) / Math.PI
|
|
2242
|
+
: thetaUnit_1 === 'gradians'
|
|
2243
|
+
? theta * 0.9
|
|
2244
|
+
: theta
|
|
2245
|
+
: theta, color: markerColor ? (0, d3_color_1.rgb)(markerColor).copy({ opacity: markerOpacity }).formatHex8() : finalSeriesColor_1 }, (typeof markerSize !== 'undefined' ? { markerSize: markerSize } : {})), (typeof text !== 'undefined' ? { text: text } : {}));
|
|
2246
|
+
}).filter(function (item) { return typeof item !== 'undefined'; })) || [],
|
|
2247
|
+
};
|
|
2248
|
+
if (isAreaTrace || isLineTrace) {
|
|
2249
|
+
polarData.push(tslib_1.__assign(tslib_1.__assign({ type: isAreaTrace ? 'areapolar' : 'linepolar' }, commonProps), { lineOptions: lineOptions }));
|
|
2172
2250
|
}
|
|
2173
2251
|
else {
|
|
2174
|
-
|
|
2175
|
-
}
|
|
2176
|
-
// Shift only the polar origin (not the cartesian)
|
|
2177
|
-
var rawRadius = rVals[ptindex];
|
|
2178
|
-
var polarRadius = rawRadius + radiusShift; // Only for projection
|
|
2179
|
-
// Calculate cartesian coordinates (with shifted polar origin)
|
|
2180
|
-
var x = polarRadius * Math.cos(thetaRad);
|
|
2181
|
-
var y = polarRadius * Math.sin(thetaRad);
|
|
2182
|
-
// Calculate the cartesian coordinates of the original polar origin (0,0)
|
|
2183
|
-
// This is the point that should be mapped to (0,0) in cartesian coordinates
|
|
2184
|
-
if (sindex === 0 && ptindex === 0) {
|
|
2185
|
-
// For polar origin (r=0, θ=0), cartesian coordinates are (0,0)
|
|
2186
|
-
// But since we shifted the radius by radiusShift, the cartesian origin is at (radiusShift, 0)
|
|
2187
|
-
originX = radiusShift;
|
|
2252
|
+
polarData.push(tslib_1.__assign({ type: 'scatterpolar' }, commonProps));
|
|
2188
2253
|
}
|
|
2189
|
-
series.x.push(x);
|
|
2190
|
-
series.y.push(y);
|
|
2191
|
-
allX.push(x);
|
|
2192
|
-
allY.push(y);
|
|
2193
2254
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
series.data = series.x.map(function (xVal, idx) { return (tslib_1.__assign({ x: xVal, y: series.y[idx] }, (series.text ? { text: series.text[idx] } : {}))); });
|
|
2197
|
-
}
|
|
2198
|
-
projection.data[sindex] = series;
|
|
2199
|
-
};
|
|
2200
|
-
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
2201
|
-
_loop_1(sindex);
|
|
2202
|
-
}
|
|
2203
|
-
// 7. Recenter all cartesian coordinates
|
|
2204
|
-
if (originX !== null) {
|
|
2205
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2206
|
-
var series = projection.data[sindex];
|
|
2207
|
-
if (series.x && series.y) {
|
|
2208
|
-
series.x = series.x.map(function (v) { return v - originX; });
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
// Also recenter allX for normalization
|
|
2212
|
-
for (var i = 0; i < allX.length; i++) {
|
|
2213
|
-
allX[i] = allX[i] - originX;
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
// 8. Find the maximum absolute value among all x and y
|
|
2217
|
-
var maxAbs = Math.max.apply(Math, tslib_1.__spreadArray(tslib_1.__spreadArray([], allX.map(Math.abs), false), allY.map(Math.abs), false));
|
|
2218
|
-
maxAbs = maxAbs === 0 ? 1 : maxAbs;
|
|
2219
|
-
// 9. Rescale all points so that the largest |x| or |y| is 0.5
|
|
2220
|
-
for (var sindex = 0; sindex < projection.data.length; sindex++) {
|
|
2221
|
-
var series = projection.data[sindex];
|
|
2222
|
-
if (series.x && series.y) {
|
|
2223
|
-
series.x = series.x.map(function (v) { return v / (2 * maxAbs); });
|
|
2224
|
-
series.y = series.y.map(function (v) { return v / (2 * maxAbs); });
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
// 10. Customize layout for perfect square with absolute positioning
|
|
2228
|
-
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;
|
|
2229
|
-
projection.layout = tslib_1.__assign(tslib_1.__assign({}, projection.layout), { width: size, height: size });
|
|
2230
|
-
// Attach originX as custom properties
|
|
2231
|
-
projection.layout.__polarOriginX = originX !== null && originX !== void 0 ? originX : undefined;
|
|
2232
|
-
return projection;
|
|
2255
|
+
});
|
|
2256
|
+
return tslib_1.__assign({ data: polarData, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 400, hideLegend: hideLegend }, getPolarAxisProps(input.data, input.layout));
|
|
2233
2257
|
};
|
|
2234
|
-
exports.
|
|
2258
|
+
exports.transformPlotlyJsonToPolarChartProps = transformPlotlyJsonToPolarChartProps;
|
|
2235
2259
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2236
2260
|
function isPlainObject(obj) {
|
|
2237
2261
|
if (window && window.process && window.process.versions) {
|
|
@@ -2515,7 +2539,7 @@ var getIndexFromKey = function (key, pattern) {
|
|
|
2515
2539
|
return parseInt(normalizedKey, 10) - 1;
|
|
2516
2540
|
};
|
|
2517
2541
|
var isNonPlotType = function (chartType) {
|
|
2518
|
-
return ['donut', 'sankey', 'pie', 'annotation'].includes(chartType);
|
|
2542
|
+
return ['donut', 'sankey', 'pie', 'annotation', 'table', 'gauge', 'funnel'].includes(chartType);
|
|
2519
2543
|
};
|
|
2520
2544
|
exports.isNonPlotType = isNonPlotType;
|
|
2521
2545
|
var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
@@ -2545,6 +2569,7 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2545
2569
|
var domainXInfo = {
|
|
2546
2570
|
start: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[0] : 0,
|
|
2547
2571
|
end: (xAxisLayout === null || xAxisLayout === void 0 ? void 0 : xAxisLayout.domain) ? xAxisLayout.domain[1] : 1,
|
|
2572
|
+
cellName: "x".concat(domainX.length === 0 ? '' : domainX.length + 1),
|
|
2548
2573
|
};
|
|
2549
2574
|
domainX.push(domainXInfo);
|
|
2550
2575
|
}
|
|
@@ -2563,6 +2588,7 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2563
2588
|
var domainYInfo = {
|
|
2564
2589
|
start: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[0] : 0,
|
|
2565
2590
|
end: (yAxisLayout === null || yAxisLayout === void 0 ? void 0 : yAxisLayout.domain) ? yAxisLayout.domain[1] : 1,
|
|
2591
|
+
cellName: "x".concat(domainY.length === 0 ? '' : domainY.length + 1),
|
|
2566
2592
|
};
|
|
2567
2593
|
domainY.push(domainYInfo);
|
|
2568
2594
|
}
|
|
@@ -2576,16 +2602,36 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2576
2602
|
var domainXInfo = {
|
|
2577
2603
|
start: ((_b = series.domain) === null || _b === void 0 ? void 0 : _b.x) ? series.domain.x[0] : 0,
|
|
2578
2604
|
end: ((_c = series.domain) === null || _c === void 0 ? void 0 : _c.x) ? series.domain.x[1] : 1,
|
|
2605
|
+
cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainX.length - cartesianDomains + 1),
|
|
2579
2606
|
};
|
|
2580
2607
|
var domainYInfo = {
|
|
2581
2608
|
start: ((_d = series.domain) === null || _d === void 0 ? void 0 : _d.y) ? series.domain.y[0] : 0,
|
|
2582
2609
|
end: ((_e = series.domain) === null || _e === void 0 ? void 0 : _e.y) ? series.domain.y[1] : 1,
|
|
2610
|
+
cellName: "".concat(exports.NON_PLOT_KEY_PREFIX).concat(domainY.length - cartesianDomains + 1),
|
|
2583
2611
|
};
|
|
2584
2612
|
domainX.push(domainXInfo);
|
|
2585
2613
|
domainY.push(domainYInfo);
|
|
2586
2614
|
}
|
|
2587
2615
|
});
|
|
2588
2616
|
if (layout !== undefined && layout !== null && Object.keys(layout).length > 0) {
|
|
2617
|
+
Object.keys(layout !== null && layout !== void 0 ? layout : {}).forEach(function (key) {
|
|
2618
|
+
var _a, _b, _c, _d;
|
|
2619
|
+
if (key.startsWith('polar')) {
|
|
2620
|
+
var polarLayout = layout[key];
|
|
2621
|
+
var domainXInfo = {
|
|
2622
|
+
start: ((_a = polarLayout.domain) === null || _a === void 0 ? void 0 : _a.x) ? polarLayout.domain.x[0] : 0,
|
|
2623
|
+
end: ((_b = polarLayout.domain) === null || _b === void 0 ? void 0 : _b.x) ? polarLayout.domain.x[1] : 1,
|
|
2624
|
+
cellName: key,
|
|
2625
|
+
};
|
|
2626
|
+
var domainYInfo = {
|
|
2627
|
+
start: ((_c = polarLayout.domain) === null || _c === void 0 ? void 0 : _c.y) ? polarLayout.domain.y[0] : 0,
|
|
2628
|
+
end: ((_d = polarLayout.domain) === null || _d === void 0 ? void 0 : _d.y) ? polarLayout.domain.y[1] : 1,
|
|
2629
|
+
cellName: key,
|
|
2630
|
+
};
|
|
2631
|
+
domainX.push(domainXInfo);
|
|
2632
|
+
domainY.push(domainYInfo);
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2589
2635
|
(_a = layout.annotations) === null || _a === void 0 ? void 0 : _a.forEach(function (annotation) {
|
|
2590
2636
|
var xMatches = domainX.flatMap(function (interval, idx) {
|
|
2591
2637
|
return (annotation === null || annotation === void 0 ? void 0 : annotation.x) >= interval.start && (annotation === null || annotation === void 0 ? void 0 : annotation.x) <= interval.end ? [idx] : [];
|
|
@@ -2621,9 +2667,6 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2621
2667
|
.sort();
|
|
2622
2668
|
templateColumns = "repeat(".concat(sortedXStart_1.length, ", 1fr)");
|
|
2623
2669
|
domainX.forEach(function (interval, index) {
|
|
2624
|
-
var cellName = index >= cartesianDomains
|
|
2625
|
-
? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2626
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2627
2670
|
var columnIndex = sortedXStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2628
2671
|
var columnNumber = columnIndex + 1; // Column numbers are 1-based
|
|
2629
2672
|
var annotationProps = annotations[index];
|
|
@@ -2635,7 +2678,7 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2635
2678
|
xDomain: interval,
|
|
2636
2679
|
yDomain: { start: 0, end: 1 }, // Default yDomain for x-axis
|
|
2637
2680
|
};
|
|
2638
|
-
gridLayout[cellName] = row;
|
|
2681
|
+
gridLayout[interval.cellName] = row;
|
|
2639
2682
|
});
|
|
2640
2683
|
}
|
|
2641
2684
|
if (domainY.length > 0) {
|
|
@@ -2652,14 +2695,11 @@ var getGridProperties = function (schema, isMultiPlot, validTracesInfo) {
|
|
|
2652
2695
|
var numberOfRows_1 = sortedYStart_1.length;
|
|
2653
2696
|
templateRows = "repeat(".concat(numberOfRows_1, ", 1fr)");
|
|
2654
2697
|
domainY.forEach(function (interval, index) {
|
|
2655
|
-
var cellName = index >= cartesianDomains
|
|
2656
|
-
? "".concat(exports.NON_PLOT_KEY_PREFIX).concat(index - cartesianDomains + 1)
|
|
2657
|
-
: "x".concat(index === 0 ? '' : index + 1);
|
|
2658
2698
|
var rowIndex = sortedYStart_1.findIndex(function (start) { return start === interval.start; });
|
|
2659
2699
|
var rowNumber = numberOfRows_1 - rowIndex; // Rows are 1-based and we need to reverse the order for CSS grid
|
|
2660
2700
|
var annotationProps = annotations[index];
|
|
2661
2701
|
var yAnnotation = annotationProps === null || annotationProps === void 0 ? void 0 : annotationProps.yAnnotation;
|
|
2662
|
-
var cell = gridLayout[cellName];
|
|
2702
|
+
var cell = gridLayout[interval.cellName];
|
|
2663
2703
|
if (cell !== undefined) {
|
|
2664
2704
|
cell.row = rowNumber;
|
|
2665
2705
|
cell.yAnnotation = yAnnotation;
|
|
@@ -2811,19 +2851,20 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2811
2851
|
return;
|
|
2812
2852
|
}
|
|
2813
2853
|
var axType = getAxisType(data, ax);
|
|
2854
|
+
if (axId === 'x' && axType === 'category') {
|
|
2855
|
+
props.xAxis = {
|
|
2856
|
+
tickLayout: 'auto',
|
|
2857
|
+
};
|
|
2858
|
+
}
|
|
2814
2859
|
if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
|
|
2815
2860
|
var tickValues = axType === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
2816
2861
|
if (axId === 'x') {
|
|
2817
2862
|
props.tickValues = tickValues;
|
|
2818
|
-
props.xAxis = {
|
|
2819
|
-
tickText: ax.ticktext,
|
|
2820
|
-
};
|
|
2863
|
+
props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickText: ax.ticktext });
|
|
2821
2864
|
}
|
|
2822
2865
|
else if (axId === 'y') {
|
|
2823
2866
|
props.yAxisTickValues = tickValues;
|
|
2824
|
-
props.yAxis = {
|
|
2825
|
-
tickText: ax.ticktext,
|
|
2826
|
-
};
|
|
2867
|
+
props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickText: ax.ticktext });
|
|
2827
2868
|
}
|
|
2828
2869
|
return;
|
|
2829
2870
|
}
|
|
@@ -2831,16 +2872,10 @@ var getAxisTickProps = function (data, layout) {
|
|
|
2831
2872
|
var dtick = plotlyDtick(ax.dtick, axType);
|
|
2832
2873
|
var tick0 = plotlyTick0(ax.tick0, axType, dtick);
|
|
2833
2874
|
if (axId === 'x') {
|
|
2834
|
-
props.xAxis = {
|
|
2835
|
-
tickStep: dtick,
|
|
2836
|
-
tick0: tick0,
|
|
2837
|
-
};
|
|
2875
|
+
props.xAxis = tslib_1.__assign(tslib_1.__assign({}, props.xAxis), { tickStep: dtick, tick0: tick0 });
|
|
2838
2876
|
}
|
|
2839
2877
|
else if (axId === 'y') {
|
|
2840
|
-
props.yAxis = {
|
|
2841
|
-
tickStep: dtick,
|
|
2842
|
-
tick0: tick0,
|
|
2843
|
-
};
|
|
2878
|
+
props.yAxis = tslib_1.__assign(tslib_1.__assign({}, props.yAxis), { tickStep: dtick, tick0: tick0 });
|
|
2844
2879
|
}
|
|
2845
2880
|
return;
|
|
2846
2881
|
}
|
|
@@ -2993,4 +3028,92 @@ var getAxisValueResolver = function (axType, dateParser) {
|
|
|
2993
3028
|
}
|
|
2994
3029
|
};
|
|
2995
3030
|
};
|
|
3031
|
+
var POLAR_AXIS_BY_DATA_KEY = {
|
|
3032
|
+
r: 'radialAxis',
|
|
3033
|
+
theta: 'angularAxis',
|
|
3034
|
+
};
|
|
3035
|
+
exports.DEFAULT_POLAR_SUBPLOT = 'polar';
|
|
3036
|
+
var getPolarLayout = function (trace, layout) {
|
|
3037
|
+
var subplotId = ((trace === null || trace === void 0 ? void 0 : trace.subplot) || exports.DEFAULT_POLAR_SUBPLOT);
|
|
3038
|
+
return layout === null || layout === void 0 ? void 0 : layout[subplotId];
|
|
3039
|
+
};
|
|
3040
|
+
var getValidAxisValues = function (data, dataKey) {
|
|
3041
|
+
var values = [];
|
|
3042
|
+
data.forEach(function (series) {
|
|
3043
|
+
if ((0, chart_utilities_1.isArrayOrTypedArray)(series[dataKey])) {
|
|
3044
|
+
series[dataKey].forEach(function (val) {
|
|
3045
|
+
if (!(0, chart_utilities_1.isInvalidValue)(val)) {
|
|
3046
|
+
values.push(val);
|
|
3047
|
+
}
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
});
|
|
3051
|
+
return values;
|
|
3052
|
+
};
|
|
3053
|
+
var getPolarAxisType = function (data, dataKey, declaredType) {
|
|
3054
|
+
if (['linear', 'log', 'date', 'category'].includes(declaredType !== null && declaredType !== void 0 ? declaredType : '')) {
|
|
3055
|
+
return declaredType;
|
|
3056
|
+
}
|
|
3057
|
+
var values = getValidAxisValues(data, dataKey);
|
|
3058
|
+
if ((0, chart_utilities_1.isNumberArray)(values) && !(0, chart_utilities_1.isYearArray)(values)) {
|
|
3059
|
+
return 'linear';
|
|
3060
|
+
}
|
|
3061
|
+
if ((0, chart_utilities_1.isDateArray)(values)) {
|
|
3062
|
+
return 'date';
|
|
3063
|
+
}
|
|
3064
|
+
return 'category';
|
|
3065
|
+
};
|
|
3066
|
+
var getPolarAxis = function (data, dataKey, layout) {
|
|
3067
|
+
var polarLayout = getPolarLayout(data[0], layout);
|
|
3068
|
+
var ax = polarLayout === null || polarLayout === void 0 ? void 0 : polarLayout[POLAR_AXIS_BY_DATA_KEY[dataKey].toLowerCase()];
|
|
3069
|
+
return tslib_1.__assign(tslib_1.__assign({}, ax), { _dataKey: dataKey, _type: getPolarAxisType(data, dataKey, ax === null || ax === void 0 ? void 0 : ax.type) });
|
|
3070
|
+
};
|
|
3071
|
+
var getPolarAxisTickProps = function (data, ax) {
|
|
3072
|
+
var props = {};
|
|
3073
|
+
if ((!ax.tickmode || ax.tickmode === 'array') && (0, chart_utilities_1.isArrayOrTypedArray)(ax.tickvals)) {
|
|
3074
|
+
var tickValues = ax._type === 'date' ? ax.tickvals.map(function (v) { return new Date(v); }) : ax.tickvals;
|
|
3075
|
+
props.tickValues = tickValues;
|
|
3076
|
+
props.tickText = ax.ticktext;
|
|
3077
|
+
return props;
|
|
3078
|
+
}
|
|
3079
|
+
if ((!ax.tickmode || ax.tickmode === 'linear') && ax.dtick) {
|
|
3080
|
+
var dtick = plotlyDtick(ax.dtick, ax._type);
|
|
3081
|
+
var tick0 = plotlyTick0(ax.tick0, ax._type, dtick);
|
|
3082
|
+
props.tickStep = dtick;
|
|
3083
|
+
props.tick0 = tick0;
|
|
3084
|
+
return props;
|
|
3085
|
+
}
|
|
3086
|
+
if ((!ax.tickmode || ax.tickmode === 'auto') && typeof ax.nticks === 'number' && ax.nticks >= 0) {
|
|
3087
|
+
props.tickCount = ax.nticks;
|
|
3088
|
+
}
|
|
3089
|
+
return props;
|
|
3090
|
+
};
|
|
3091
|
+
var getPolarAxisCategoryOrder = function (data, ax) {
|
|
3092
|
+
if (ax._type !== 'category') {
|
|
3093
|
+
return 'data';
|
|
3094
|
+
}
|
|
3095
|
+
var isValidArray = (0, chart_utilities_1.isArrayOrTypedArray)(ax.categoryarray) && ax.categoryarray.length > 0;
|
|
3096
|
+
if (isValidArray && (!ax.categoryorder || ax.categoryorder === 'array')) {
|
|
3097
|
+
return ax.categoryarray;
|
|
3098
|
+
}
|
|
3099
|
+
if (!ax.categoryorder || ax.categoryorder === 'trace' || ax.categoryorder === 'array') {
|
|
3100
|
+
var values = getValidAxisValues(data, ax._dataKey);
|
|
3101
|
+
var categoriesInTraceOrder = Array.from(new Set(values));
|
|
3102
|
+
return ax.autorange === 'reversed' ? categoriesInTraceOrder.reverse() : categoriesInTraceOrder;
|
|
3103
|
+
}
|
|
3104
|
+
return ax.categoryorder;
|
|
3105
|
+
};
|
|
3106
|
+
var getPolarAxisProps = function (data, layout) {
|
|
3107
|
+
var props = {};
|
|
3108
|
+
Object.keys(POLAR_AXIS_BY_DATA_KEY).forEach(function (dataKey) {
|
|
3109
|
+
var propName = POLAR_AXIS_BY_DATA_KEY[dataKey];
|
|
3110
|
+
var ax = getPolarAxis(data, dataKey, layout);
|
|
3111
|
+
props[propName] = tslib_1.__assign(tslib_1.__assign({ scaleType: ax._type === 'log' ? 'log' : 'default', categoryOrder: getPolarAxisCategoryOrder(data, ax), tickFormat: ax.tickformat }, getPolarAxisTickProps(data, ax)), ((0, chart_utilities_1.isArrayOrTypedArray)(ax.range) ? { rangeStart: ax.range[0], rangeEnd: ax.range[1] } : {}));
|
|
3112
|
+
if (propName === 'angularAxis') {
|
|
3113
|
+
props[propName].unit = ax.thetaunit;
|
|
3114
|
+
props.direction = ax.direction;
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
return props;
|
|
3118
|
+
};
|
|
2996
3119
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|