@fluentui/react-charts 9.3.4 → 9.3.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.md +41 -2
- package/dist/index.d.ts +225 -46
- package/lib/AnnotationOnlyChart.js +1 -0
- package/lib/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +208 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/index.js +2 -0
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +31 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +23 -0
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +11 -6
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +3 -1
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.js +59 -39
- package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +5 -5
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +617 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/index.js +2 -0
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +173 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +126 -0
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.js +182 -153
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js +2 -0
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +29 -13
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +14 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +2 -6
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +42 -25
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +635 -38
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +23 -8
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +12 -7
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +5 -5
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +3 -3
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js +3 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +3 -1
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +11 -6
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +6 -6
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +3 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +25 -12
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +4 -4
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/Legends.js +3 -1
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.js +97 -37
- package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js +10 -11
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +6 -5
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +15 -10
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -10
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +1 -1
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -8
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +4 -2
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +13 -8
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +13 -5
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +11 -6
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/ChartAnnotation.js +1 -0
- package/lib/types/ChartAnnotation.js.map +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/Common.styles.js +1 -2
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +1 -2
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js +8 -8
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/image-export-utils.js +108 -0
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +16 -13
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/AnnotationOnlyChart.js +6 -0
- package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +219 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +6 -0
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js +7 -0
- package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +56 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +33 -0
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +14 -15
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +3 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +74 -102
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +4 -4
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +628 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +4 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js +7 -0
- package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +265 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +161 -0
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +182 -152
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.js +2 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +32 -21
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +14 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -14
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +2 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +41 -24
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +638 -38
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +25 -16
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +12 -7
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +5 -5
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +3 -3
- package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +3 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +3 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +14 -15
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +6 -6
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +3 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +47 -34
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js +3 -1
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +144 -86
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +9 -10
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +6 -5
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +18 -19
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +16 -19
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +16 -17
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +4 -2
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +16 -17
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +13 -5
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +14 -15
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.js +6 -0
- package/lib-commonjs/types/ChartAnnotation.js.map +1 -0
- package/lib-commonjs/types/index.js +1 -0
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +1 -2
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +1 -2
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js +8 -8
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +108 -0
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +16 -13
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +11 -11
|
@@ -205,6 +205,24 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
|
|
|
205
205
|
}
|
|
206
206
|
return x;
|
|
207
207
|
};
|
|
208
|
+
/**
|
|
209
|
+
* Extracts unique X-axis categories from Plotly data traces
|
|
210
|
+
* @param data Array of Plotly data traces
|
|
211
|
+
* @returns Array of unique x values
|
|
212
|
+
*/ const extractXCategories = (data)=>{
|
|
213
|
+
return Array.from(new Set((data !== null && data !== void 0 ? data : []).flatMap((trace)=>{
|
|
214
|
+
const xData = trace.x;
|
|
215
|
+
if (!xData) {
|
|
216
|
+
return [];
|
|
217
|
+
}
|
|
218
|
+
if (Array.isArray(xData)) {
|
|
219
|
+
return xData.flat().map((x)=>{
|
|
220
|
+
return x;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return [];
|
|
224
|
+
}).filter((x)=>x !== undefined && x !== null)));
|
|
225
|
+
};
|
|
208
226
|
/**
|
|
209
227
|
* Checks if a key should be ignored during normalization
|
|
210
228
|
* @param key The key to check
|
|
@@ -243,6 +261,526 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
|
|
|
243
261
|
}
|
|
244
262
|
return flattened;
|
|
245
263
|
};
|
|
264
|
+
const encodeHtmlEntities = (value)=>value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
265
|
+
const toFiniteNumber = (value)=>{
|
|
266
|
+
if (value === undefined || value === null) {
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
const numeric = typeof value === 'number' ? value : Number(value);
|
|
270
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Normalizes Plotly axis reference strings so equivalent aliases (e.g. `xaxis1`, `x1`) collapse to the base axis id.
|
|
274
|
+
*/ const normalizeAxisRef = (ref, axis)=>{
|
|
275
|
+
if (!ref) {
|
|
276
|
+
return axis;
|
|
277
|
+
}
|
|
278
|
+
const normalized = ref.toLowerCase();
|
|
279
|
+
if (normalized === axis || normalized === `${axis}axis` || normalized === `${axis}axis1` || normalized === `${axis}1`) {
|
|
280
|
+
return axis;
|
|
281
|
+
}
|
|
282
|
+
const match = normalized.match(/^([xy])(axis)?(\d+)$/);
|
|
283
|
+
if (match && match[1] === axis && match[3]) {
|
|
284
|
+
return match[3] === '1' ? axis : `${axis}${match[3]}`;
|
|
285
|
+
}
|
|
286
|
+
return normalized;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Scans the data traces bound to a given axis and returns the numeric min/max values plotted on that axis.
|
|
290
|
+
*/ const getAxisNumericRangeFromData = (axis, ref, layout, data)=>{
|
|
291
|
+
if (!data || data.length === 0) {
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
const axisLayout = getAxisLayoutByRef(layout, ref, axis);
|
|
295
|
+
const targetRef = normalizeAxisRef(ref, axis);
|
|
296
|
+
const traceAxisKey = axis === 'x' ? 'xaxis' : 'yaxis';
|
|
297
|
+
let minValue;
|
|
298
|
+
let maxValue;
|
|
299
|
+
data.forEach((trace)=>{
|
|
300
|
+
const plotTrace = trace;
|
|
301
|
+
const traceAxisRef = normalizeAxisRef(plotTrace[traceAxisKey], axis);
|
|
302
|
+
if (traceAxisRef !== targetRef) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const values = axis === 'x' ? plotTrace.x : plotTrace.y;
|
|
306
|
+
if (!isArrayOrTypedArray(values)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const arrayLike = values;
|
|
310
|
+
for(let index = 0; index < arrayLike.length; index++){
|
|
311
|
+
const value = arrayLike[index];
|
|
312
|
+
const numeric = toNumericValue(convertDataValue(value, axisLayout));
|
|
313
|
+
if (numeric === undefined || Number.isNaN(numeric)) {
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
minValue = minValue === undefined ? numeric : Math.min(minValue, numeric);
|
|
317
|
+
maxValue = maxValue === undefined ? numeric : Math.max(maxValue, numeric);
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
if (minValue === undefined || maxValue === undefined || minValue === maxValue) {
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
return [
|
|
324
|
+
minValue,
|
|
325
|
+
maxValue
|
|
326
|
+
];
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Converts Plotly's bottom-origin relative Y coordinate into the SVG top-origin space used by our overlay.
|
|
330
|
+
*/ const transformRelativeYForChart = (value)=>{
|
|
331
|
+
if (value === undefined) {
|
|
332
|
+
return undefined;
|
|
333
|
+
}
|
|
334
|
+
if (!Number.isFinite(value)) {
|
|
335
|
+
return undefined;
|
|
336
|
+
}
|
|
337
|
+
return 1 - value;
|
|
338
|
+
};
|
|
339
|
+
const mapHorizontalAlign = (anchor)=>{
|
|
340
|
+
switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
|
|
341
|
+
case 'left':
|
|
342
|
+
return 'start';
|
|
343
|
+
case 'center':
|
|
344
|
+
return 'center';
|
|
345
|
+
case 'right':
|
|
346
|
+
return 'end';
|
|
347
|
+
default:
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
const mapVerticalAlign = (anchor)=>{
|
|
352
|
+
switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
|
|
353
|
+
case 'top':
|
|
354
|
+
return 'top';
|
|
355
|
+
case 'middle':
|
|
356
|
+
return 'middle';
|
|
357
|
+
case 'bottom':
|
|
358
|
+
return 'bottom';
|
|
359
|
+
default:
|
|
360
|
+
return undefined;
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
const appendPx = (value)=>{
|
|
364
|
+
if (value === undefined || value === null) {
|
|
365
|
+
return undefined;
|
|
366
|
+
}
|
|
367
|
+
if (typeof value === 'string') {
|
|
368
|
+
return value;
|
|
369
|
+
}
|
|
370
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
371
|
+
return `${value}px`;
|
|
372
|
+
}
|
|
373
|
+
return undefined;
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Maps Plotly's axis reference string to one of our coordinate interpretation modes (axis, relative, or pixel).
|
|
377
|
+
*/ const resolveRefType = (ref, axis)=>{
|
|
378
|
+
if (!ref) {
|
|
379
|
+
return 'axis';
|
|
380
|
+
}
|
|
381
|
+
const normalized = ref.toLowerCase();
|
|
382
|
+
if (normalized === 'pixel') {
|
|
383
|
+
return 'pixel';
|
|
384
|
+
}
|
|
385
|
+
if (normalized === 'paper') {
|
|
386
|
+
return 'relative';
|
|
387
|
+
}
|
|
388
|
+
if (normalized.endsWith(' domain')) {
|
|
389
|
+
return normalized.startsWith(axis) ? 'relative' : undefined;
|
|
390
|
+
}
|
|
391
|
+
const match = normalized.match(/^([xy])(\d*)$/);
|
|
392
|
+
if (match && match[1] === axis) {
|
|
393
|
+
return 'axis';
|
|
394
|
+
}
|
|
395
|
+
return undefined;
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Retrieves the appropriate axis layout section from Plotly's layout given an axis reference alias.
|
|
399
|
+
*/ const getAxisLayoutByRef = (layout, ref, axis)=>{
|
|
400
|
+
if (!layout) {
|
|
401
|
+
return undefined;
|
|
402
|
+
}
|
|
403
|
+
const defaultAxisKey = `${axis}axis`;
|
|
404
|
+
if (!ref) {
|
|
405
|
+
return layout[defaultAxisKey];
|
|
406
|
+
}
|
|
407
|
+
const normalized = ref.toLowerCase();
|
|
408
|
+
if (normalized === 'paper' || normalized === 'pixel' || normalized.endsWith(' domain')) {
|
|
409
|
+
return layout[defaultAxisKey];
|
|
410
|
+
}
|
|
411
|
+
const match = normalized.match(/^([xy])(\d*)$/);
|
|
412
|
+
if (match && match[1] === axis) {
|
|
413
|
+
const index = match[2];
|
|
414
|
+
if (index && index !== '' && index !== '1') {
|
|
415
|
+
const axisKey = `${axis}axis${index}`;
|
|
416
|
+
return layout[axisKey];
|
|
417
|
+
}
|
|
418
|
+
return layout[defaultAxisKey];
|
|
419
|
+
}
|
|
420
|
+
return layout[defaultAxisKey];
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Normalizes raw Plotly data values into canonical number/date/string types based on axis configuration.
|
|
424
|
+
*/ const convertDataValue = (value, axisLayout)=>{
|
|
425
|
+
if (value === undefined || value === null) {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'date' || isDate(value)) {
|
|
429
|
+
const dateValue = value instanceof Date ? value : new Date(value);
|
|
430
|
+
return Number.isNaN(dateValue.getTime()) ? undefined : dateValue;
|
|
431
|
+
}
|
|
432
|
+
if (typeof value === 'number') {
|
|
433
|
+
return value;
|
|
434
|
+
}
|
|
435
|
+
if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'linear' || (axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'log') {
|
|
436
|
+
const numeric = Number(value);
|
|
437
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
438
|
+
}
|
|
439
|
+
if (value instanceof Date) {
|
|
440
|
+
return value;
|
|
441
|
+
}
|
|
442
|
+
return value;
|
|
443
|
+
};
|
|
444
|
+
const toNumericValue = (value)=>{
|
|
445
|
+
if (value instanceof Date) {
|
|
446
|
+
const timestamp = value.getTime();
|
|
447
|
+
return Number.isFinite(timestamp) ? timestamp : undefined;
|
|
448
|
+
}
|
|
449
|
+
if (typeof value === 'number') {
|
|
450
|
+
return Number.isFinite(value) ? value : undefined;
|
|
451
|
+
}
|
|
452
|
+
if (typeof value === 'string') {
|
|
453
|
+
const numeric = Number(value);
|
|
454
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
455
|
+
}
|
|
456
|
+
return undefined;
|
|
457
|
+
};
|
|
458
|
+
const toRelativeCoordinate = (value, axisLayout, fallbackRange)=>{
|
|
459
|
+
const range = Array.isArray(axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.range) ? axisLayout.range : undefined;
|
|
460
|
+
let start = range && range.length >= 2 ? toNumericValue(convertDataValue(range[0], axisLayout)) : undefined;
|
|
461
|
+
let end = range && range.length >= 2 ? toNumericValue(convertDataValue(range[1], axisLayout)) : undefined;
|
|
462
|
+
if ((start === undefined || end === undefined || start === end) && fallbackRange) {
|
|
463
|
+
[start, end] = fallbackRange;
|
|
464
|
+
}
|
|
465
|
+
const current = toNumericValue(convertDataValue(value, axisLayout));
|
|
466
|
+
if (start === undefined || end === undefined || current === undefined || start === end) {
|
|
467
|
+
return undefined;
|
|
468
|
+
}
|
|
469
|
+
const relative = (current - start) / (end - start);
|
|
470
|
+
return Number.isFinite(relative) ? relative : undefined;
|
|
471
|
+
};
|
|
472
|
+
const createAnnotationId = (text, index)=>{
|
|
473
|
+
const normalized = text.replace(/\s+/g, ' ').trim();
|
|
474
|
+
if (normalized) {
|
|
475
|
+
const slug = normalized.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 32);
|
|
476
|
+
if (slug) {
|
|
477
|
+
return `annotation-${index}-${slug}`;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return `annotation-${index}`;
|
|
481
|
+
};
|
|
482
|
+
const DEFAULT_ARROW_OFFSET = -40;
|
|
483
|
+
const mapArrowsideToArrow = (annotation)=>{
|
|
484
|
+
let includeStart = false;
|
|
485
|
+
let includeEnd = false;
|
|
486
|
+
const arrowSide = typeof (annotation === null || annotation === void 0 ? void 0 : annotation.arrowside) === 'string' ? annotation === null || annotation === void 0 ? void 0 : annotation.arrowside.toLowerCase() : undefined;
|
|
487
|
+
if (arrowSide) {
|
|
488
|
+
includeStart = arrowSide.includes('start');
|
|
489
|
+
includeEnd = arrowSide.includes('end');
|
|
490
|
+
}
|
|
491
|
+
const endHead = toFiniteNumber(annotation === null || annotation === void 0 ? void 0 : annotation.arrowhead);
|
|
492
|
+
const startHead = toFiniteNumber(annotation.startarrowhead);
|
|
493
|
+
if (endHead !== undefined && endHead > 0) {
|
|
494
|
+
includeEnd = true;
|
|
495
|
+
}
|
|
496
|
+
if (startHead !== undefined && startHead > 0) {
|
|
497
|
+
includeStart = true;
|
|
498
|
+
}
|
|
499
|
+
if (includeStart && includeEnd) {
|
|
500
|
+
return 'both';
|
|
501
|
+
}
|
|
502
|
+
if (includeStart) {
|
|
503
|
+
return 'start';
|
|
504
|
+
}
|
|
505
|
+
if (includeEnd) {
|
|
506
|
+
return 'end';
|
|
507
|
+
}
|
|
508
|
+
return 'none';
|
|
509
|
+
};
|
|
510
|
+
const mapArrowDashToPattern = (value)=>{
|
|
511
|
+
if (!value) {
|
|
512
|
+
return undefined;
|
|
513
|
+
}
|
|
514
|
+
const normalized = value.trim().toLowerCase();
|
|
515
|
+
switch(normalized){
|
|
516
|
+
case 'solid':
|
|
517
|
+
return undefined;
|
|
518
|
+
case 'dot':
|
|
519
|
+
return '1, 5';
|
|
520
|
+
case 'dash':
|
|
521
|
+
return '5, 5';
|
|
522
|
+
case 'longdash':
|
|
523
|
+
return '10, 5';
|
|
524
|
+
case 'dashdot':
|
|
525
|
+
return '5, 5, 1, 5';
|
|
526
|
+
case 'longdashdot':
|
|
527
|
+
return '10, 5, 1, 5';
|
|
528
|
+
default:
|
|
529
|
+
if (/^\d+(\s|,)*\d*$/.test(normalized.replace(/\s+/g, ' '))) {
|
|
530
|
+
return normalized.replace(/\s+/g, ' ');
|
|
531
|
+
}
|
|
532
|
+
return value;
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Converts a Plotly annotation definition into the internal `ChartAnnotation` format, translating coordinates,
|
|
537
|
+
* layout alignment, styling, and connector metadata while skipping unsupported configurations.
|
|
538
|
+
*/ const convertPlotlyAnnotation = (annotation, layout, data, index)=>{
|
|
539
|
+
if (!annotation || annotation.visible === false) {
|
|
540
|
+
return undefined;
|
|
541
|
+
}
|
|
542
|
+
const xRefType = resolveRefType(annotation.xref, 'x');
|
|
543
|
+
const yRefType = resolveRefType(annotation.yref, 'y');
|
|
544
|
+
if (!xRefType || !yRefType) {
|
|
545
|
+
return undefined;
|
|
546
|
+
}
|
|
547
|
+
let coordinates;
|
|
548
|
+
if (xRefType === 'axis' && yRefType === 'axis') {
|
|
549
|
+
const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
|
|
550
|
+
const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
|
|
551
|
+
const xValue = convertDataValue(annotation.x, xAxisLayout);
|
|
552
|
+
const yValue = convertDataValue(annotation.y, yAxisLayout);
|
|
553
|
+
if (xValue === undefined || yValue === undefined) {
|
|
554
|
+
return undefined;
|
|
555
|
+
}
|
|
556
|
+
const yRefNormalized = typeof annotation.yref === 'string' ? annotation.yref.toLowerCase() : undefined;
|
|
557
|
+
coordinates = {
|
|
558
|
+
type: 'data',
|
|
559
|
+
x: xValue,
|
|
560
|
+
y: yValue,
|
|
561
|
+
...yRefNormalized === 'y2' ? {
|
|
562
|
+
yAxis: 'secondary'
|
|
563
|
+
} : {}
|
|
564
|
+
};
|
|
565
|
+
} else if (xRefType === 'relative' && yRefType === 'relative') {
|
|
566
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
567
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
568
|
+
const chartRelativeY = transformRelativeYForChart(yValue);
|
|
569
|
+
if (xValue === undefined || chartRelativeY === undefined) {
|
|
570
|
+
return undefined;
|
|
571
|
+
}
|
|
572
|
+
coordinates = {
|
|
573
|
+
type: 'relative',
|
|
574
|
+
x: xValue,
|
|
575
|
+
y: chartRelativeY
|
|
576
|
+
};
|
|
577
|
+
} else if (xRefType === 'relative' && yRefType === 'axis') {
|
|
578
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
579
|
+
const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
|
|
580
|
+
const yFallbackRange = getAxisNumericRangeFromData('y', annotation.yref, layout, data);
|
|
581
|
+
const yRelative = toRelativeCoordinate(annotation.y, yAxisLayout, yFallbackRange);
|
|
582
|
+
const chartRelativeY = transformRelativeYForChart(yRelative);
|
|
583
|
+
if (xValue === undefined || chartRelativeY === undefined) {
|
|
584
|
+
return undefined;
|
|
585
|
+
}
|
|
586
|
+
coordinates = {
|
|
587
|
+
type: 'relative',
|
|
588
|
+
x: xValue,
|
|
589
|
+
y: chartRelativeY
|
|
590
|
+
};
|
|
591
|
+
} else if (xRefType === 'axis' && yRefType === 'relative') {
|
|
592
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
593
|
+
const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
|
|
594
|
+
const xFallbackRange = getAxisNumericRangeFromData('x', annotation.xref, layout, data);
|
|
595
|
+
const xRelative = toRelativeCoordinate(annotation.x, xAxisLayout, xFallbackRange);
|
|
596
|
+
const chartRelativeY = transformRelativeYForChart(yValue);
|
|
597
|
+
if (xRelative === undefined || chartRelativeY === undefined) {
|
|
598
|
+
return undefined;
|
|
599
|
+
}
|
|
600
|
+
coordinates = {
|
|
601
|
+
type: 'relative',
|
|
602
|
+
x: xRelative,
|
|
603
|
+
y: chartRelativeY
|
|
604
|
+
};
|
|
605
|
+
} else if (xRefType === 'pixel' && yRefType === 'pixel') {
|
|
606
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
607
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
608
|
+
if (xValue === undefined || yValue === undefined) {
|
|
609
|
+
return undefined;
|
|
610
|
+
}
|
|
611
|
+
coordinates = {
|
|
612
|
+
type: 'pixel',
|
|
613
|
+
x: xValue,
|
|
614
|
+
y: yValue
|
|
615
|
+
};
|
|
616
|
+
} else {
|
|
617
|
+
return undefined;
|
|
618
|
+
}
|
|
619
|
+
const textValue = annotation.text;
|
|
620
|
+
const rawText = textValue === undefined || textValue === null ? '' : String(textValue);
|
|
621
|
+
const encodedText = encodeHtmlEntities(rawText);
|
|
622
|
+
const chartAnnotation = {
|
|
623
|
+
id: createAnnotationId(encodedText, index),
|
|
624
|
+
text: encodedText,
|
|
625
|
+
coordinates
|
|
626
|
+
};
|
|
627
|
+
const layoutProps = {};
|
|
628
|
+
const styleProps = {};
|
|
629
|
+
const showArrow = annotation.showarrow === undefined ? false : !!annotation.showarrow;
|
|
630
|
+
const clipOnAxis = annotation.cliponaxis;
|
|
631
|
+
if (clipOnAxis !== undefined) {
|
|
632
|
+
layoutProps.clipToBounds = !!clipOnAxis;
|
|
633
|
+
} else if (coordinates.type === 'data') {
|
|
634
|
+
layoutProps.clipToBounds = true;
|
|
635
|
+
}
|
|
636
|
+
const horizontalAlign = mapHorizontalAlign(annotation.xanchor);
|
|
637
|
+
if (horizontalAlign) {
|
|
638
|
+
layoutProps.align = horizontalAlign;
|
|
639
|
+
}
|
|
640
|
+
if (!layoutProps.align) {
|
|
641
|
+
const alignProp = mapHorizontalAlign(annotation.align);
|
|
642
|
+
if (alignProp) {
|
|
643
|
+
layoutProps.align = alignProp;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
const verticalAlign = mapVerticalAlign(annotation.yanchor);
|
|
647
|
+
if (verticalAlign) {
|
|
648
|
+
layoutProps.verticalAlign = verticalAlign;
|
|
649
|
+
}
|
|
650
|
+
if (!layoutProps.verticalAlign) {
|
|
651
|
+
const valignProp = mapVerticalAlign(annotation.valign);
|
|
652
|
+
if (valignProp) {
|
|
653
|
+
layoutProps.verticalAlign = valignProp;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
const offsetXComponents = [];
|
|
657
|
+
let hasExplicitOffset = false;
|
|
658
|
+
const ax = toFiniteNumber(annotation.ax);
|
|
659
|
+
const axRef = typeof annotation.axref === 'string' ? annotation.axref.toLowerCase() : undefined;
|
|
660
|
+
if (ax !== undefined && (axRef === undefined || axRef === 'pixel')) {
|
|
661
|
+
offsetXComponents.push(ax);
|
|
662
|
+
hasExplicitOffset = true;
|
|
663
|
+
}
|
|
664
|
+
const xShift = toFiniteNumber(annotation.xshift);
|
|
665
|
+
if (xShift !== undefined) {
|
|
666
|
+
offsetXComponents.push(xShift);
|
|
667
|
+
hasExplicitOffset = true;
|
|
668
|
+
}
|
|
669
|
+
if (offsetXComponents.length > 0) {
|
|
670
|
+
const offsetX = offsetXComponents.reduce((sum, value)=>sum + value, 0);
|
|
671
|
+
if (offsetX !== 0) {
|
|
672
|
+
layoutProps.offsetX = offsetX;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
const offsetYComponents = [];
|
|
676
|
+
const ay = toFiniteNumber(annotation.ay);
|
|
677
|
+
const ayRef = typeof annotation.ayref === 'string' ? annotation.ayref.toLowerCase() : undefined;
|
|
678
|
+
if (ay !== undefined && (ayRef === undefined || ayRef === 'pixel')) {
|
|
679
|
+
offsetYComponents.push(ay);
|
|
680
|
+
hasExplicitOffset = true;
|
|
681
|
+
}
|
|
682
|
+
const yShift = toFiniteNumber(annotation.yshift);
|
|
683
|
+
if (yShift !== undefined) {
|
|
684
|
+
offsetYComponents.push(yShift);
|
|
685
|
+
hasExplicitOffset = true;
|
|
686
|
+
}
|
|
687
|
+
if (offsetYComponents.length > 0) {
|
|
688
|
+
const offsetY = offsetYComponents.reduce((sum, value)=>sum + value, 0);
|
|
689
|
+
if (offsetY !== 0) {
|
|
690
|
+
layoutProps.offsetY = offsetY;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
if (showArrow && !hasExplicitOffset && layoutProps.offsetY === undefined) {
|
|
694
|
+
layoutProps.offsetY = DEFAULT_ARROW_OFFSET;
|
|
695
|
+
}
|
|
696
|
+
const maxWidth = toFiniteNumber(annotation.width);
|
|
697
|
+
if (maxWidth !== undefined) {
|
|
698
|
+
layoutProps.maxWidth = maxWidth;
|
|
699
|
+
}
|
|
700
|
+
if (annotation.bgcolor) {
|
|
701
|
+
styleProps.backgroundColor = annotation.bgcolor;
|
|
702
|
+
}
|
|
703
|
+
if (annotation.bordercolor) {
|
|
704
|
+
styleProps.borderColor = annotation.bordercolor;
|
|
705
|
+
}
|
|
706
|
+
const borderWidth = toFiniteNumber(annotation.borderwidth);
|
|
707
|
+
if (borderWidth !== undefined) {
|
|
708
|
+
styleProps.borderWidth = borderWidth;
|
|
709
|
+
}
|
|
710
|
+
const borderPad = appendPx(annotation.borderpad);
|
|
711
|
+
if (borderPad) {
|
|
712
|
+
styleProps.padding = borderPad;
|
|
713
|
+
}
|
|
714
|
+
const opacity = toFiniteNumber(annotation.opacity);
|
|
715
|
+
if (opacity !== undefined) {
|
|
716
|
+
styleProps.opacity = opacity;
|
|
717
|
+
}
|
|
718
|
+
if (annotation.font) {
|
|
719
|
+
const font = annotation.font;
|
|
720
|
+
if (font === null || font === void 0 ? void 0 : font.color) {
|
|
721
|
+
styleProps.textColor = font.color;
|
|
722
|
+
}
|
|
723
|
+
const fontSize = appendPx(font === null || font === void 0 ? void 0 : font.size);
|
|
724
|
+
if (fontSize) {
|
|
725
|
+
styleProps.fontSize = fontSize;
|
|
726
|
+
}
|
|
727
|
+
if (font === null || font === void 0 ? void 0 : font.weight) {
|
|
728
|
+
styleProps.fontWeight = font.weight;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
const textAngle = annotation === null || annotation === void 0 ? void 0 : annotation.textangle;
|
|
732
|
+
if (typeof textAngle === 'number' && !Number.isNaN(textAngle)) {
|
|
733
|
+
styleProps.rotation = textAngle;
|
|
734
|
+
} else if (typeof textAngle === 'string' && textAngle.toLowerCase() !== 'auto') {
|
|
735
|
+
const parsedAngle = Number(textAngle);
|
|
736
|
+
if (!Number.isNaN(parsedAngle)) {
|
|
737
|
+
styleProps.rotation = parsedAngle;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (Object.keys(layoutProps).length > 0) {
|
|
741
|
+
chartAnnotation.layout = layoutProps;
|
|
742
|
+
}
|
|
743
|
+
if (Object.keys(styleProps).length > 0) {
|
|
744
|
+
chartAnnotation.style = styleProps;
|
|
745
|
+
}
|
|
746
|
+
if (showArrow) {
|
|
747
|
+
var _annotation_arrowcolor;
|
|
748
|
+
const arrowColor = (_annotation_arrowcolor = annotation.arrowcolor) !== null && _annotation_arrowcolor !== void 0 ? _annotation_arrowcolor : styleProps.textColor;
|
|
749
|
+
const arrowWidth = toFiniteNumber(annotation.arrowwidth);
|
|
750
|
+
const endPadding = toFiniteNumber(annotation.standoff);
|
|
751
|
+
const startPadding = toFiniteNumber(annotation.startstandoff);
|
|
752
|
+
const dashPattern = mapArrowDashToPattern(annotation.arrowdash);
|
|
753
|
+
chartAnnotation.connector = {
|
|
754
|
+
...arrowColor ? {
|
|
755
|
+
strokeColor: arrowColor
|
|
756
|
+
} : {},
|
|
757
|
+
...arrowWidth !== undefined ? {
|
|
758
|
+
strokeWidth: arrowWidth
|
|
759
|
+
} : {},
|
|
760
|
+
...endPadding !== undefined ? {
|
|
761
|
+
endPadding: Math.max(endPadding, 0)
|
|
762
|
+
} : {},
|
|
763
|
+
...startPadding !== undefined ? {
|
|
764
|
+
startPadding: Math.max(startPadding, 0)
|
|
765
|
+
} : {},
|
|
766
|
+
...dashPattern ? {
|
|
767
|
+
dashArray: dashPattern
|
|
768
|
+
} : {},
|
|
769
|
+
arrow: mapArrowsideToArrow(annotation)
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
return chartAnnotation;
|
|
773
|
+
};
|
|
774
|
+
const getChartAnnotationsFromLayout = (layout, data, isMultiPlot)=>{
|
|
775
|
+
if (isMultiPlot || !(layout === null || layout === void 0 ? void 0 : layout.annotations)) {
|
|
776
|
+
return undefined;
|
|
777
|
+
}
|
|
778
|
+
const annotationsArray = Array.isArray(layout.annotations) ? layout.annotations : [
|
|
779
|
+
layout.annotations
|
|
780
|
+
];
|
|
781
|
+
const converted = annotationsArray.map((annotation, index)=>convertPlotlyAnnotation(annotation, layout, data, index)).filter((annotation)=>annotation !== undefined);
|
|
782
|
+
return converted.length > 0 ? converted : undefined;
|
|
783
|
+
};
|
|
246
784
|
/**
|
|
247
785
|
* Normalizes an array of objects by flattening nested structures and creating grouped data
|
|
248
786
|
* Uses json_normalize approach with D3 color detection and filtering
|
|
@@ -319,6 +857,34 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
|
|
|
319
857
|
x
|
|
320
858
|
};
|
|
321
859
|
};
|
|
860
|
+
export const transformPlotlyJsonToAnnotationChartProps = (input, isMultiPlot, _colorMap, _colorwayType, _isDarkTheme)=>{
|
|
861
|
+
var _layoutWithMeta_meta, _input_layout, _input_layout1, _input_layout2, _input_layout3, _input_layout_font, _input_layout4, _input_layout_font1, _input_layout5, _input_layout6;
|
|
862
|
+
var _getChartAnnotationsFromLayout;
|
|
863
|
+
const annotations = (_getChartAnnotationsFromLayout = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot)) !== null && _getChartAnnotationsFromLayout !== void 0 ? _getChartAnnotationsFromLayout : [];
|
|
864
|
+
const titles = getTitles(input.layout);
|
|
865
|
+
const layoutTitle = titles.chartTitle || undefined;
|
|
866
|
+
const layoutWithMeta = input.layout;
|
|
867
|
+
const description = typeof (layoutWithMeta === null || layoutWithMeta === void 0 ? void 0 : (_layoutWithMeta_meta = layoutWithMeta.meta) === null || _layoutWithMeta_meta === void 0 ? void 0 : _layoutWithMeta_meta.description) === 'string' ? layoutWithMeta.meta.description : undefined;
|
|
868
|
+
const width = typeof ((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width) === 'number' ? input.layout.width : undefined;
|
|
869
|
+
const height = typeof ((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) === 'number' ? input.layout.height : undefined;
|
|
870
|
+
const paperBackgroundColor = typeof ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.paper_bgcolor) === 'string' ? input.layout.paper_bgcolor : undefined;
|
|
871
|
+
const plotBackgroundColor = typeof ((_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.plot_bgcolor) === 'string' ? input.layout.plot_bgcolor : undefined;
|
|
872
|
+
const fontColor = typeof ((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : (_input_layout_font = _input_layout4.font) === null || _input_layout_font === void 0 ? void 0 : _input_layout_font.color) === 'string' ? input.layout.font.color : undefined;
|
|
873
|
+
const fontFamily = typeof ((_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_font1 = _input_layout5.font) === null || _input_layout_font1 === void 0 ? void 0 : _input_layout_font1.family) === 'string' ? input.layout.font.family : undefined;
|
|
874
|
+
const margin = (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.margin;
|
|
875
|
+
return {
|
|
876
|
+
annotations,
|
|
877
|
+
chartTitle: layoutTitle,
|
|
878
|
+
description,
|
|
879
|
+
width,
|
|
880
|
+
height,
|
|
881
|
+
paperBackgroundColor,
|
|
882
|
+
plotBackgroundColor,
|
|
883
|
+
fontColor,
|
|
884
|
+
fontFamily,
|
|
885
|
+
margin
|
|
886
|
+
};
|
|
887
|
+
};
|
|
322
888
|
export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
323
889
|
var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _firstData_marker, _input_layout3, _input_layout4, _input_layout5, _input_layout6;
|
|
324
890
|
const firstData = input.data[0];
|
|
@@ -486,24 +1052,20 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
486
1052
|
});
|
|
487
1053
|
});
|
|
488
1054
|
});
|
|
489
|
-
|
|
490
|
-
const xCategories = Array.from(new Set(((_input_data = input.data) !== null && _input_data !== void 0 ? _input_data : []).flatMap((trace)=>{
|
|
491
|
-
const xData = trace.x;
|
|
492
|
-
if (!xData) {
|
|
493
|
-
return [];
|
|
494
|
-
}
|
|
495
|
-
if (Array.isArray(xData)) {
|
|
496
|
-
return xData.flat().map((x)=>{
|
|
497
|
-
return x;
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
return [];
|
|
501
|
-
}).filter((x)=>x !== undefined && x !== null)));
|
|
1055
|
+
const xCategories = extractXCategories(input.data);
|
|
502
1056
|
var _input_layout_shapes;
|
|
503
1057
|
((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').forEach((shape, shapeIdx)=>{
|
|
504
1058
|
var _shape_line;
|
|
505
1059
|
const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
|
|
506
1060
|
const resolveX = (val)=>{
|
|
1061
|
+
if (shape.xref === 'x domain') {
|
|
1062
|
+
if (val === 0) {
|
|
1063
|
+
return xCategories[0];
|
|
1064
|
+
}
|
|
1065
|
+
if (val === 1) {
|
|
1066
|
+
return xCategories[xCategories.length - 1];
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
507
1069
|
if (typeof val === 'number' && Array.isArray(xCategories)) {
|
|
508
1070
|
if (xCategories[val] !== undefined) {
|
|
509
1071
|
return xCategories[val];
|
|
@@ -532,24 +1094,29 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
532
1094
|
};
|
|
533
1095
|
const y0Val = resolveY(shape.y0);
|
|
534
1096
|
const y1Val = resolveY(shape.y1);
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1097
|
+
if (mapXToDataPoints[x0Key]) {
|
|
1098
|
+
var _rgb_formatHex8;
|
|
1099
|
+
mapXToDataPoints[x0Key].lineData.push({
|
|
1100
|
+
legend: `Reference_${shapeIdx}`,
|
|
1101
|
+
y: y0Val,
|
|
1102
|
+
color: (_rgb_formatHex8 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex8 !== void 0 ? _rgb_formatHex8 : lineColor,
|
|
1103
|
+
lineOptions: getLineOptions(shape.line),
|
|
1104
|
+
useSecondaryYScale: false
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
if (mapXToDataPoints[x1Key]) {
|
|
1108
|
+
var _rgb_formatHex81;
|
|
1109
|
+
mapXToDataPoints[x1Key].lineData.push({
|
|
1110
|
+
legend: `Reference_${shapeIdx}`,
|
|
1111
|
+
y: y1Val,
|
|
1112
|
+
color: (_rgb_formatHex81 = rgb(lineColor).formatHex8()) !== null && _rgb_formatHex81 !== void 0 ? _rgb_formatHex81 : lineColor,
|
|
1113
|
+
lineOptions: getLineOptions(shape.line),
|
|
1114
|
+
useSecondaryYScale: false
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
551
1117
|
});
|
|
552
1118
|
const vsbcData = Object.values(mapXToDataPoints);
|
|
1119
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
553
1120
|
var _input_layout_height;
|
|
554
1121
|
return {
|
|
555
1122
|
data: vsbcData,
|
|
@@ -574,7 +1141,10 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
574
1141
|
...getAxisCategoryOrderProps(input.data, input.layout),
|
|
575
1142
|
...getBarProps(input.data, input.layout),
|
|
576
1143
|
...getYMinMaxValues(input.data[0], input.layout),
|
|
577
|
-
...getAxisTickProps(input.data, input.layout)
|
|
1144
|
+
...getAxisTickProps(input.data, input.layout),
|
|
1145
|
+
...annotations ? {
|
|
1146
|
+
annotations
|
|
1147
|
+
} : {}
|
|
578
1148
|
};
|
|
579
1149
|
};
|
|
580
1150
|
export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -681,6 +1251,7 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
681
1251
|
});
|
|
682
1252
|
}
|
|
683
1253
|
});
|
|
1254
|
+
const annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
684
1255
|
var _processedInput_layout_height;
|
|
685
1256
|
return {
|
|
686
1257
|
dataV2: gvbcDataV2,
|
|
@@ -693,13 +1264,17 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
693
1264
|
wrapXAxisLables: true,
|
|
694
1265
|
hideLegend,
|
|
695
1266
|
roundCorners: true,
|
|
1267
|
+
showYAxisLables: true,
|
|
696
1268
|
...getTitles(processedInput.layout),
|
|
697
1269
|
...getAxisCategoryOrderProps(processedInput.data, processedInput.layout),
|
|
698
1270
|
...getYMinMaxValues(processedInput.data[0], processedInput.layout),
|
|
699
1271
|
...getXAxisTickFormat(processedInput.data[0], processedInput.layout),
|
|
700
1272
|
...yAxisTickFormat,
|
|
701
1273
|
...getBarProps(processedInput.data, processedInput.layout),
|
|
702
|
-
...getAxisTickProps(processedInput.data, processedInput.layout)
|
|
1274
|
+
...getAxisTickProps(processedInput.data, processedInput.layout),
|
|
1275
|
+
...annotations ? {
|
|
1276
|
+
annotations
|
|
1277
|
+
} : {}
|
|
703
1278
|
};
|
|
704
1279
|
};
|
|
705
1280
|
export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -764,6 +1339,7 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
764
1339
|
});
|
|
765
1340
|
});
|
|
766
1341
|
});
|
|
1342
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
767
1343
|
var _input_layout_height;
|
|
768
1344
|
return {
|
|
769
1345
|
data: vbcData,
|
|
@@ -775,9 +1351,13 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
775
1351
|
maxBarWidth: 50,
|
|
776
1352
|
hideLegend,
|
|
777
1353
|
roundCorners: true,
|
|
1354
|
+
showYAxisLables: true,
|
|
778
1355
|
...getTitles(input.layout),
|
|
779
1356
|
...getYMinMaxValues(input.data[0], input.layout),
|
|
780
|
-
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
1357
|
+
...getAxisCategoryOrderProps(input.data, input.layout),
|
|
1358
|
+
...annotations ? {
|
|
1359
|
+
annotations
|
|
1360
|
+
} : {}
|
|
781
1361
|
};
|
|
782
1362
|
};
|
|
783
1363
|
export const transformPlotlyJsonToAreaChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -900,11 +1480,19 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
900
1480
|
const xMaxValue = (_chartData_1 = chartData[0]) === null || _chartData_1 === void 0 ? void 0 : (_chartData__data_1 = _chartData_1.data[chartData[0].data.length - 1]) === null || _chartData__data_1 === void 0 ? void 0 : _chartData__data_1.x;
|
|
901
1481
|
const yMinValue = (_chartData_2 = chartData[0]) === null || _chartData_2 === void 0 ? void 0 : (_chartData__data_2 = _chartData_2.data[0]) === null || _chartData__data_2 === void 0 ? void 0 : _chartData__data_2.y;
|
|
902
1482
|
const yMaxValue = (_chartData_3 = chartData[0]) === null || _chartData_3 === void 0 ? void 0 : (_chartData__data_3 = _chartData_3.data[chartData[0].data.length - 1]) === null || _chartData__data_3 === void 0 ? void 0 : _chartData__data_3.y;
|
|
1483
|
+
const xCategories = extractXCategories(input.data);
|
|
903
1484
|
var _input_layout_shapes;
|
|
904
1485
|
const lineShape = ((_input_layout_shapes = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.shapes) !== null && _input_layout_shapes !== void 0 ? _input_layout_shapes : []).filter((shape)=>shape.type === 'line').map((shape, shapeIdx)=>{
|
|
905
1486
|
var _shape_line;
|
|
906
1487
|
const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
|
|
907
1488
|
const resolveX = (val)=>{
|
|
1489
|
+
if (typeof val === 'number' && Array.isArray(xCategories)) {
|
|
1490
|
+
if (xCategories[val] !== undefined) {
|
|
1491
|
+
return xCategories[val];
|
|
1492
|
+
} else {
|
|
1493
|
+
return xCategories[shapeIdx];
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
908
1496
|
if (shape.xref === 'paper') {
|
|
909
1497
|
if (val === 0) {
|
|
910
1498
|
return xMinValue;
|
|
@@ -939,11 +1527,11 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
939
1527
|
legend: `Reference_${shapeIdx}`,
|
|
940
1528
|
data: [
|
|
941
1529
|
{
|
|
942
|
-
x: resolveX(shape.x0),
|
|
1530
|
+
x: resolveXValue(resolveX(shape.x0)),
|
|
943
1531
|
y: resolveY(shape.y0)
|
|
944
1532
|
},
|
|
945
1533
|
{
|
|
946
|
-
x: resolveX(shape.x1),
|
|
1534
|
+
x: resolveXValue(resolveX(shape.x1)),
|
|
947
1535
|
y: resolveY(shape.y1)
|
|
948
1536
|
}
|
|
949
1537
|
],
|
|
@@ -966,8 +1554,12 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
966
1554
|
]
|
|
967
1555
|
};
|
|
968
1556
|
const scatterChartProps = {
|
|
969
|
-
scatterChartData:
|
|
1557
|
+
scatterChartData: [
|
|
1558
|
+
...chartData,
|
|
1559
|
+
...lineShape
|
|
1560
|
+
]
|
|
970
1561
|
};
|
|
1562
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
971
1563
|
var _input_layout_height;
|
|
972
1564
|
const commonProps = {
|
|
973
1565
|
supportNegativeData: true,
|
|
@@ -977,13 +1569,17 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
977
1569
|
hideTickOverlap: true,
|
|
978
1570
|
hideLegend,
|
|
979
1571
|
useUTC: false,
|
|
980
|
-
|
|
1572
|
+
wrapXAxisLabels: shouldWrapLabels,
|
|
981
1573
|
optimizeLargeData: numDataPoints > 1000,
|
|
1574
|
+
showYAxisLables: true,
|
|
982
1575
|
...getTitles(input.layout),
|
|
983
1576
|
...getXAxisTickFormat(input.data[0], input.layout),
|
|
984
1577
|
...yAxisTickFormat,
|
|
985
1578
|
...getAxisScaleTypeProps(input.data, input.layout),
|
|
986
|
-
...getAxisTickProps(input.data, input.layout)
|
|
1579
|
+
...getAxisTickProps(input.data, input.layout),
|
|
1580
|
+
...annotations ? {
|
|
1581
|
+
annotations
|
|
1582
|
+
} : {}
|
|
987
1583
|
};
|
|
988
1584
|
if (isAreaChart) {
|
|
989
1585
|
return {
|
|
@@ -2120,7 +2716,8 @@ export const isNonPlotType = (chartType)=>{
|
|
|
2120
2716
|
return [
|
|
2121
2717
|
'donut',
|
|
2122
2718
|
'sankey',
|
|
2123
|
-
'pie'
|
|
2719
|
+
'pie',
|
|
2720
|
+
'annotation'
|
|
2124
2721
|
].includes(chartType);
|
|
2125
2722
|
};
|
|
2126
2723
|
export const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
|