@fluentui/react-charts 9.3.5 → 9.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -2
- package/dist/index.d.ts +239 -55
- package/lib/AnnotationOnlyChart.js +1 -0
- package/lib/AnnotationOnlyChart.js.map +1 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +194 -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/AreaChart.js +3 -16
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- 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 +2 -10
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.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 +159 -132
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +1 -2
- package/lib/components/CommonComponents/ChartPopover.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 +32 -14
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
- 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 +1 -2
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +83 -40
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -8
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +692 -94
- 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 +3 -12
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- 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/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +2 -10
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +6 -19
- 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 +2 -10
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
- 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 +4 -17
- 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/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 +5 -23
- 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.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.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 +11 -20
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.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/SankeyChart/SankeyChart.js +3 -9
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.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 +24 -24
- 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/Sparkline/Sparkline.js +11 -7
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +3 -15
- 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 +8 -18
- 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/DataPoint.js.map +1 -1
- 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/getWindow.js +0 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js +34 -0
- package/lib/utilities/hooks.js.map +1 -0
- package/lib/utilities/image-export-utils.js +221 -73
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +39 -37
- 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 +205 -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/AreaChart.js +2 -15
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- 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 -10
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.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 +159 -131
- 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/ChartPopover.js +1 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.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 +35 -22
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
- 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 +0 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +82 -39
- 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 +678 -60
- 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 +2 -11
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- 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/DonutChart/useDonutChartStyles.styles.js +2 -2
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +2 -10
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.js +5 -18
- 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 +2 -10
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
- 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 +3 -16
- 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/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 +4 -21
- 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.types.js.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.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 +11 -20
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.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/SankeyChart/SankeyChart.js +3 -9
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.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 +22 -22
- 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/Sparkline/Sparkline.js +11 -7
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -15
- 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 +7 -17
- 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/DataPoint.js.map +1 -1
- 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.map +1 -1
- package/lib-commonjs/utilities/getWindow.js +0 -1
- package/lib-commonjs/utilities/getWindow.js.map +1 -1
- package/lib-commonjs/utilities/hooks.js +45 -0
- package/lib-commonjs/utilities/hooks.js.map +1 -0
- package/lib-commonjs/utilities/image-export-utils.js +222 -74
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +37 -33
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +11 -11
|
@@ -49,6 +49,9 @@ _export(exports, {
|
|
|
49
49
|
resolveXAxisPoint: function() {
|
|
50
50
|
return resolveXAxisPoint;
|
|
51
51
|
},
|
|
52
|
+
transformPlotlyJsonToAnnotationChartProps: function() {
|
|
53
|
+
return transformPlotlyJsonToAnnotationChartProps;
|
|
54
|
+
},
|
|
52
55
|
transformPlotlyJsonToAreaChartProps: function() {
|
|
53
56
|
return transformPlotlyJsonToAreaChartProps;
|
|
54
57
|
},
|
|
@@ -182,6 +185,18 @@ const getYMinMaxValues = (series, layout)=>{
|
|
|
182
185
|
}
|
|
183
186
|
return {};
|
|
184
187
|
};
|
|
188
|
+
const getXMinMaxValues = (series, layout)=>{
|
|
189
|
+
var _getXAxisProperties;
|
|
190
|
+
const range = (_getXAxisProperties = getXAxisProperties(series, layout)) === null || _getXAxisProperties === void 0 ? void 0 : _getXAxisProperties.range;
|
|
191
|
+
if (range && range.length === 2) {
|
|
192
|
+
return {
|
|
193
|
+
xMinValue: range[0],
|
|
194
|
+
xMaxValue: range[1],
|
|
195
|
+
showRoundOffXTickValues: false
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
return {};
|
|
199
|
+
};
|
|
185
200
|
const getYAxisProperties = (series, layout)=>{
|
|
186
201
|
return layout === null || layout === void 0 ? void 0 : layout.yaxis;
|
|
187
202
|
};
|
|
@@ -298,6 +313,24 @@ const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNumber)=>{
|
|
|
298
313
|
}
|
|
299
314
|
return x;
|
|
300
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Extracts unique X-axis categories from Plotly data traces
|
|
318
|
+
* @param data Array of Plotly data traces
|
|
319
|
+
* @returns Array of unique x values
|
|
320
|
+
*/ const extractXCategories = (data)=>{
|
|
321
|
+
return Array.from(new Set((data !== null && data !== void 0 ? data : []).flatMap((trace)=>{
|
|
322
|
+
const xData = trace.x;
|
|
323
|
+
if (!xData) {
|
|
324
|
+
return [];
|
|
325
|
+
}
|
|
326
|
+
if (Array.isArray(xData)) {
|
|
327
|
+
return xData.flat().map((x)=>{
|
|
328
|
+
return x;
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
return [];
|
|
332
|
+
}).filter((x)=>x !== undefined && x !== null)));
|
|
333
|
+
};
|
|
301
334
|
/**
|
|
302
335
|
* Checks if a key should be ignored during normalization
|
|
303
336
|
* @param key The key to check
|
|
@@ -336,6 +369,526 @@ const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNumber)=>{
|
|
|
336
369
|
}
|
|
337
370
|
return flattened;
|
|
338
371
|
};
|
|
372
|
+
const encodeHtmlEntities = (value)=>value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
373
|
+
const toFiniteNumber = (value)=>{
|
|
374
|
+
if (value === undefined || value === null) {
|
|
375
|
+
return undefined;
|
|
376
|
+
}
|
|
377
|
+
const numeric = typeof value === 'number' ? value : Number(value);
|
|
378
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* Normalizes Plotly axis reference strings so equivalent aliases (e.g. `xaxis1`, `x1`) collapse to the base axis id.
|
|
382
|
+
*/ const normalizeAxisRef = (ref, axis)=>{
|
|
383
|
+
if (!ref) {
|
|
384
|
+
return axis;
|
|
385
|
+
}
|
|
386
|
+
const normalized = ref.toLowerCase();
|
|
387
|
+
if (normalized === axis || normalized === `${axis}axis` || normalized === `${axis}axis1` || normalized === `${axis}1`) {
|
|
388
|
+
return axis;
|
|
389
|
+
}
|
|
390
|
+
const match = normalized.match(/^([xy])(axis)?(\d+)$/);
|
|
391
|
+
if (match && match[1] === axis && match[3]) {
|
|
392
|
+
return match[3] === '1' ? axis : `${axis}${match[3]}`;
|
|
393
|
+
}
|
|
394
|
+
return normalized;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Scans the data traces bound to a given axis and returns the numeric min/max values plotted on that axis.
|
|
398
|
+
*/ const getAxisNumericRangeFromData = (axis, ref, layout, data)=>{
|
|
399
|
+
if (!data || data.length === 0) {
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
const axisLayout = getAxisLayoutByRef(layout, ref, axis);
|
|
403
|
+
const targetRef = normalizeAxisRef(ref, axis);
|
|
404
|
+
const traceAxisKey = axis === 'x' ? 'xaxis' : 'yaxis';
|
|
405
|
+
let minValue;
|
|
406
|
+
let maxValue;
|
|
407
|
+
data.forEach((trace)=>{
|
|
408
|
+
const plotTrace = trace;
|
|
409
|
+
const traceAxisRef = normalizeAxisRef(plotTrace[traceAxisKey], axis);
|
|
410
|
+
if (traceAxisRef !== targetRef) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
const values = axis === 'x' ? plotTrace.x : plotTrace.y;
|
|
414
|
+
if (!(0, _chartutilities.isArrayOrTypedArray)(values)) {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
const arrayLike = values;
|
|
418
|
+
for(let index = 0; index < arrayLike.length; index++){
|
|
419
|
+
const value = arrayLike[index];
|
|
420
|
+
const numeric = toNumericValue(convertDataValue(value, axisLayout));
|
|
421
|
+
if (numeric === undefined || Number.isNaN(numeric)) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
minValue = minValue === undefined ? numeric : Math.min(minValue, numeric);
|
|
425
|
+
maxValue = maxValue === undefined ? numeric : Math.max(maxValue, numeric);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
if (minValue === undefined || maxValue === undefined || minValue === maxValue) {
|
|
429
|
+
return undefined;
|
|
430
|
+
}
|
|
431
|
+
return [
|
|
432
|
+
minValue,
|
|
433
|
+
maxValue
|
|
434
|
+
];
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Converts Plotly's bottom-origin relative Y coordinate into the SVG top-origin space used by our overlay.
|
|
438
|
+
*/ const transformRelativeYForChart = (value)=>{
|
|
439
|
+
if (value === undefined) {
|
|
440
|
+
return undefined;
|
|
441
|
+
}
|
|
442
|
+
if (!Number.isFinite(value)) {
|
|
443
|
+
return undefined;
|
|
444
|
+
}
|
|
445
|
+
return 1 - value;
|
|
446
|
+
};
|
|
447
|
+
const mapHorizontalAlign = (anchor)=>{
|
|
448
|
+
switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
|
|
449
|
+
case 'left':
|
|
450
|
+
return 'start';
|
|
451
|
+
case 'center':
|
|
452
|
+
return 'center';
|
|
453
|
+
case 'right':
|
|
454
|
+
return 'end';
|
|
455
|
+
default:
|
|
456
|
+
return undefined;
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const mapVerticalAlign = (anchor)=>{
|
|
460
|
+
switch((anchor !== null && anchor !== void 0 ? anchor : '').toLowerCase()){
|
|
461
|
+
case 'top':
|
|
462
|
+
return 'top';
|
|
463
|
+
case 'middle':
|
|
464
|
+
return 'middle';
|
|
465
|
+
case 'bottom':
|
|
466
|
+
return 'bottom';
|
|
467
|
+
default:
|
|
468
|
+
return undefined;
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
const appendPx = (value)=>{
|
|
472
|
+
if (value === undefined || value === null) {
|
|
473
|
+
return undefined;
|
|
474
|
+
}
|
|
475
|
+
if (typeof value === 'string') {
|
|
476
|
+
return value;
|
|
477
|
+
}
|
|
478
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
479
|
+
return `${value}px`;
|
|
480
|
+
}
|
|
481
|
+
return undefined;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* Maps Plotly's axis reference string to one of our coordinate interpretation modes (axis, relative, or pixel).
|
|
485
|
+
*/ const resolveRefType = (ref, axis)=>{
|
|
486
|
+
if (!ref) {
|
|
487
|
+
return 'axis';
|
|
488
|
+
}
|
|
489
|
+
const normalized = ref.toLowerCase();
|
|
490
|
+
if (normalized === 'pixel') {
|
|
491
|
+
return 'pixel';
|
|
492
|
+
}
|
|
493
|
+
if (normalized === 'paper') {
|
|
494
|
+
return 'relative';
|
|
495
|
+
}
|
|
496
|
+
if (normalized.endsWith(' domain')) {
|
|
497
|
+
return normalized.startsWith(axis) ? 'relative' : undefined;
|
|
498
|
+
}
|
|
499
|
+
const match = normalized.match(/^([xy])(\d*)$/);
|
|
500
|
+
if (match && match[1] === axis) {
|
|
501
|
+
return 'axis';
|
|
502
|
+
}
|
|
503
|
+
return undefined;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Retrieves the appropriate axis layout section from Plotly's layout given an axis reference alias.
|
|
507
|
+
*/ const getAxisLayoutByRef = (layout, ref, axis)=>{
|
|
508
|
+
if (!layout) {
|
|
509
|
+
return undefined;
|
|
510
|
+
}
|
|
511
|
+
const defaultAxisKey = `${axis}axis`;
|
|
512
|
+
if (!ref) {
|
|
513
|
+
return layout[defaultAxisKey];
|
|
514
|
+
}
|
|
515
|
+
const normalized = ref.toLowerCase();
|
|
516
|
+
if (normalized === 'paper' || normalized === 'pixel' || normalized.endsWith(' domain')) {
|
|
517
|
+
return layout[defaultAxisKey];
|
|
518
|
+
}
|
|
519
|
+
const match = normalized.match(/^([xy])(\d*)$/);
|
|
520
|
+
if (match && match[1] === axis) {
|
|
521
|
+
const index = match[2];
|
|
522
|
+
if (index && index !== '' && index !== '1') {
|
|
523
|
+
const axisKey = `${axis}axis${index}`;
|
|
524
|
+
return layout[axisKey];
|
|
525
|
+
}
|
|
526
|
+
return layout[defaultAxisKey];
|
|
527
|
+
}
|
|
528
|
+
return layout[defaultAxisKey];
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Normalizes raw Plotly data values into canonical number/date/string types based on axis configuration.
|
|
532
|
+
*/ const convertDataValue = (value, axisLayout)=>{
|
|
533
|
+
if (value === undefined || value === null) {
|
|
534
|
+
return undefined;
|
|
535
|
+
}
|
|
536
|
+
if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'date' || (0, _chartutilities.isDate)(value)) {
|
|
537
|
+
const dateValue = value instanceof Date ? value : new Date(value);
|
|
538
|
+
return Number.isNaN(dateValue.getTime()) ? undefined : dateValue;
|
|
539
|
+
}
|
|
540
|
+
if (typeof value === 'number') {
|
|
541
|
+
return value;
|
|
542
|
+
}
|
|
543
|
+
if ((axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'linear' || (axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.type) === 'log') {
|
|
544
|
+
const numeric = Number(value);
|
|
545
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
546
|
+
}
|
|
547
|
+
if (value instanceof Date) {
|
|
548
|
+
return value;
|
|
549
|
+
}
|
|
550
|
+
return value;
|
|
551
|
+
};
|
|
552
|
+
const toNumericValue = (value)=>{
|
|
553
|
+
if (value instanceof Date) {
|
|
554
|
+
const timestamp = value.getTime();
|
|
555
|
+
return Number.isFinite(timestamp) ? timestamp : undefined;
|
|
556
|
+
}
|
|
557
|
+
if (typeof value === 'number') {
|
|
558
|
+
return Number.isFinite(value) ? value : undefined;
|
|
559
|
+
}
|
|
560
|
+
if (typeof value === 'string') {
|
|
561
|
+
const numeric = Number(value);
|
|
562
|
+
return Number.isFinite(numeric) ? numeric : undefined;
|
|
563
|
+
}
|
|
564
|
+
return undefined;
|
|
565
|
+
};
|
|
566
|
+
const toRelativeCoordinate = (value, axisLayout, fallbackRange)=>{
|
|
567
|
+
const range = Array.isArray(axisLayout === null || axisLayout === void 0 ? void 0 : axisLayout.range) ? axisLayout.range : undefined;
|
|
568
|
+
let start = range && range.length >= 2 ? toNumericValue(convertDataValue(range[0], axisLayout)) : undefined;
|
|
569
|
+
let end = range && range.length >= 2 ? toNumericValue(convertDataValue(range[1], axisLayout)) : undefined;
|
|
570
|
+
if ((start === undefined || end === undefined || start === end) && fallbackRange) {
|
|
571
|
+
[start, end] = fallbackRange;
|
|
572
|
+
}
|
|
573
|
+
const current = toNumericValue(convertDataValue(value, axisLayout));
|
|
574
|
+
if (start === undefined || end === undefined || current === undefined || start === end) {
|
|
575
|
+
return undefined;
|
|
576
|
+
}
|
|
577
|
+
const relative = (current - start) / (end - start);
|
|
578
|
+
return Number.isFinite(relative) ? relative : undefined;
|
|
579
|
+
};
|
|
580
|
+
const createAnnotationId = (text, index)=>{
|
|
581
|
+
const normalized = text.replace(/\s+/g, ' ').trim();
|
|
582
|
+
if (normalized) {
|
|
583
|
+
const slug = normalized.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 32);
|
|
584
|
+
if (slug) {
|
|
585
|
+
return `annotation-${index}-${slug}`;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return `annotation-${index}`;
|
|
589
|
+
};
|
|
590
|
+
const DEFAULT_ARROW_OFFSET = -40;
|
|
591
|
+
const mapArrowsideToArrow = (annotation)=>{
|
|
592
|
+
let includeStart = false;
|
|
593
|
+
let includeEnd = false;
|
|
594
|
+
const arrowSide = typeof (annotation === null || annotation === void 0 ? void 0 : annotation.arrowside) === 'string' ? annotation === null || annotation === void 0 ? void 0 : annotation.arrowside.toLowerCase() : undefined;
|
|
595
|
+
if (arrowSide) {
|
|
596
|
+
includeStart = arrowSide.includes('start');
|
|
597
|
+
includeEnd = arrowSide.includes('end');
|
|
598
|
+
}
|
|
599
|
+
const endHead = toFiniteNumber(annotation === null || annotation === void 0 ? void 0 : annotation.arrowhead);
|
|
600
|
+
const startHead = toFiniteNumber(annotation.startarrowhead);
|
|
601
|
+
if (endHead !== undefined && endHead > 0) {
|
|
602
|
+
includeEnd = true;
|
|
603
|
+
}
|
|
604
|
+
if (startHead !== undefined && startHead > 0) {
|
|
605
|
+
includeStart = true;
|
|
606
|
+
}
|
|
607
|
+
if (includeStart && includeEnd) {
|
|
608
|
+
return 'both';
|
|
609
|
+
}
|
|
610
|
+
if (includeStart) {
|
|
611
|
+
return 'start';
|
|
612
|
+
}
|
|
613
|
+
if (includeEnd) {
|
|
614
|
+
return 'end';
|
|
615
|
+
}
|
|
616
|
+
return 'none';
|
|
617
|
+
};
|
|
618
|
+
const mapArrowDashToPattern = (value)=>{
|
|
619
|
+
if (!value) {
|
|
620
|
+
return undefined;
|
|
621
|
+
}
|
|
622
|
+
const normalized = value.trim().toLowerCase();
|
|
623
|
+
switch(normalized){
|
|
624
|
+
case 'solid':
|
|
625
|
+
return undefined;
|
|
626
|
+
case 'dot':
|
|
627
|
+
return '1, 5';
|
|
628
|
+
case 'dash':
|
|
629
|
+
return '5, 5';
|
|
630
|
+
case 'longdash':
|
|
631
|
+
return '10, 5';
|
|
632
|
+
case 'dashdot':
|
|
633
|
+
return '5, 5, 1, 5';
|
|
634
|
+
case 'longdashdot':
|
|
635
|
+
return '10, 5, 1, 5';
|
|
636
|
+
default:
|
|
637
|
+
if (/^\d+(\s|,)*\d*$/.test(normalized.replace(/\s+/g, ' '))) {
|
|
638
|
+
return normalized.replace(/\s+/g, ' ');
|
|
639
|
+
}
|
|
640
|
+
return value;
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Converts a Plotly annotation definition into the internal `ChartAnnotation` format, translating coordinates,
|
|
645
|
+
* layout alignment, styling, and connector metadata while skipping unsupported configurations.
|
|
646
|
+
*/ const convertPlotlyAnnotation = (annotation, layout, data, index)=>{
|
|
647
|
+
if (!annotation || annotation.visible === false) {
|
|
648
|
+
return undefined;
|
|
649
|
+
}
|
|
650
|
+
const xRefType = resolveRefType(annotation.xref, 'x');
|
|
651
|
+
const yRefType = resolveRefType(annotation.yref, 'y');
|
|
652
|
+
if (!xRefType || !yRefType) {
|
|
653
|
+
return undefined;
|
|
654
|
+
}
|
|
655
|
+
let coordinates;
|
|
656
|
+
if (xRefType === 'axis' && yRefType === 'axis') {
|
|
657
|
+
const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
|
|
658
|
+
const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
|
|
659
|
+
const xValue = convertDataValue(annotation.x, xAxisLayout);
|
|
660
|
+
const yValue = convertDataValue(annotation.y, yAxisLayout);
|
|
661
|
+
if (xValue === undefined || yValue === undefined) {
|
|
662
|
+
return undefined;
|
|
663
|
+
}
|
|
664
|
+
const yRefNormalized = typeof annotation.yref === 'string' ? annotation.yref.toLowerCase() : undefined;
|
|
665
|
+
coordinates = {
|
|
666
|
+
type: 'data',
|
|
667
|
+
x: xValue,
|
|
668
|
+
y: yValue,
|
|
669
|
+
...yRefNormalized === 'y2' ? {
|
|
670
|
+
yAxis: 'secondary'
|
|
671
|
+
} : {}
|
|
672
|
+
};
|
|
673
|
+
} else if (xRefType === 'relative' && yRefType === 'relative') {
|
|
674
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
675
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
676
|
+
const chartRelativeY = transformRelativeYForChart(yValue);
|
|
677
|
+
if (xValue === undefined || chartRelativeY === undefined) {
|
|
678
|
+
return undefined;
|
|
679
|
+
}
|
|
680
|
+
coordinates = {
|
|
681
|
+
type: 'relative',
|
|
682
|
+
x: xValue,
|
|
683
|
+
y: chartRelativeY
|
|
684
|
+
};
|
|
685
|
+
} else if (xRefType === 'relative' && yRefType === 'axis') {
|
|
686
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
687
|
+
const yAxisLayout = getAxisLayoutByRef(layout, annotation.yref, 'y');
|
|
688
|
+
const yFallbackRange = getAxisNumericRangeFromData('y', annotation.yref, layout, data);
|
|
689
|
+
const yRelative = toRelativeCoordinate(annotation.y, yAxisLayout, yFallbackRange);
|
|
690
|
+
const chartRelativeY = transformRelativeYForChart(yRelative);
|
|
691
|
+
if (xValue === undefined || chartRelativeY === undefined) {
|
|
692
|
+
return undefined;
|
|
693
|
+
}
|
|
694
|
+
coordinates = {
|
|
695
|
+
type: 'relative',
|
|
696
|
+
x: xValue,
|
|
697
|
+
y: chartRelativeY
|
|
698
|
+
};
|
|
699
|
+
} else if (xRefType === 'axis' && yRefType === 'relative') {
|
|
700
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
701
|
+
const xAxisLayout = getAxisLayoutByRef(layout, annotation.xref, 'x');
|
|
702
|
+
const xFallbackRange = getAxisNumericRangeFromData('x', annotation.xref, layout, data);
|
|
703
|
+
const xRelative = toRelativeCoordinate(annotation.x, xAxisLayout, xFallbackRange);
|
|
704
|
+
const chartRelativeY = transformRelativeYForChart(yValue);
|
|
705
|
+
if (xRelative === undefined || chartRelativeY === undefined) {
|
|
706
|
+
return undefined;
|
|
707
|
+
}
|
|
708
|
+
coordinates = {
|
|
709
|
+
type: 'relative',
|
|
710
|
+
x: xRelative,
|
|
711
|
+
y: chartRelativeY
|
|
712
|
+
};
|
|
713
|
+
} else if (xRefType === 'pixel' && yRefType === 'pixel') {
|
|
714
|
+
const xValue = toFiniteNumber(annotation.x);
|
|
715
|
+
const yValue = toFiniteNumber(annotation.y);
|
|
716
|
+
if (xValue === undefined || yValue === undefined) {
|
|
717
|
+
return undefined;
|
|
718
|
+
}
|
|
719
|
+
coordinates = {
|
|
720
|
+
type: 'pixel',
|
|
721
|
+
x: xValue,
|
|
722
|
+
y: yValue
|
|
723
|
+
};
|
|
724
|
+
} else {
|
|
725
|
+
return undefined;
|
|
726
|
+
}
|
|
727
|
+
const textValue = annotation.text;
|
|
728
|
+
const rawText = textValue === undefined || textValue === null ? '' : String(textValue);
|
|
729
|
+
const encodedText = encodeHtmlEntities(rawText);
|
|
730
|
+
const chartAnnotation = {
|
|
731
|
+
id: createAnnotationId(encodedText, index),
|
|
732
|
+
text: encodedText,
|
|
733
|
+
coordinates
|
|
734
|
+
};
|
|
735
|
+
const layoutProps = {};
|
|
736
|
+
const styleProps = {};
|
|
737
|
+
const showArrow = annotation.showarrow === undefined ? false : !!annotation.showarrow;
|
|
738
|
+
const clipOnAxis = annotation.cliponaxis;
|
|
739
|
+
if (clipOnAxis !== undefined) {
|
|
740
|
+
layoutProps.clipToBounds = !!clipOnAxis;
|
|
741
|
+
} else if (coordinates.type === 'data') {
|
|
742
|
+
layoutProps.clipToBounds = true;
|
|
743
|
+
}
|
|
744
|
+
const horizontalAlign = mapHorizontalAlign(annotation.xanchor);
|
|
745
|
+
if (horizontalAlign) {
|
|
746
|
+
layoutProps.align = horizontalAlign;
|
|
747
|
+
}
|
|
748
|
+
if (!layoutProps.align) {
|
|
749
|
+
const alignProp = mapHorizontalAlign(annotation.align);
|
|
750
|
+
if (alignProp) {
|
|
751
|
+
layoutProps.align = alignProp;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
const verticalAlign = mapVerticalAlign(annotation.yanchor);
|
|
755
|
+
if (verticalAlign) {
|
|
756
|
+
layoutProps.verticalAlign = verticalAlign;
|
|
757
|
+
}
|
|
758
|
+
if (!layoutProps.verticalAlign) {
|
|
759
|
+
const valignProp = mapVerticalAlign(annotation.valign);
|
|
760
|
+
if (valignProp) {
|
|
761
|
+
layoutProps.verticalAlign = valignProp;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const offsetXComponents = [];
|
|
765
|
+
let hasExplicitOffset = false;
|
|
766
|
+
const ax = toFiniteNumber(annotation.ax);
|
|
767
|
+
const axRef = typeof annotation.axref === 'string' ? annotation.axref.toLowerCase() : undefined;
|
|
768
|
+
if (ax !== undefined && (axRef === undefined || axRef === 'pixel')) {
|
|
769
|
+
offsetXComponents.push(ax);
|
|
770
|
+
hasExplicitOffset = true;
|
|
771
|
+
}
|
|
772
|
+
const xShift = toFiniteNumber(annotation.xshift);
|
|
773
|
+
if (xShift !== undefined) {
|
|
774
|
+
offsetXComponents.push(xShift);
|
|
775
|
+
hasExplicitOffset = true;
|
|
776
|
+
}
|
|
777
|
+
if (offsetXComponents.length > 0) {
|
|
778
|
+
const offsetX = offsetXComponents.reduce((sum, value)=>sum + value, 0);
|
|
779
|
+
if (offsetX !== 0) {
|
|
780
|
+
layoutProps.offsetX = offsetX;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
const offsetYComponents = [];
|
|
784
|
+
const ay = toFiniteNumber(annotation.ay);
|
|
785
|
+
const ayRef = typeof annotation.ayref === 'string' ? annotation.ayref.toLowerCase() : undefined;
|
|
786
|
+
if (ay !== undefined && (ayRef === undefined || ayRef === 'pixel')) {
|
|
787
|
+
offsetYComponents.push(ay);
|
|
788
|
+
hasExplicitOffset = true;
|
|
789
|
+
}
|
|
790
|
+
const yShift = toFiniteNumber(annotation.yshift);
|
|
791
|
+
if (yShift !== undefined) {
|
|
792
|
+
offsetYComponents.push(yShift);
|
|
793
|
+
hasExplicitOffset = true;
|
|
794
|
+
}
|
|
795
|
+
if (offsetYComponents.length > 0) {
|
|
796
|
+
const offsetY = offsetYComponents.reduce((sum, value)=>sum + value, 0);
|
|
797
|
+
if (offsetY !== 0) {
|
|
798
|
+
layoutProps.offsetY = offsetY;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
if (showArrow && !hasExplicitOffset && layoutProps.offsetY === undefined) {
|
|
802
|
+
layoutProps.offsetY = DEFAULT_ARROW_OFFSET;
|
|
803
|
+
}
|
|
804
|
+
const maxWidth = toFiniteNumber(annotation.width);
|
|
805
|
+
if (maxWidth !== undefined) {
|
|
806
|
+
layoutProps.maxWidth = maxWidth;
|
|
807
|
+
}
|
|
808
|
+
if (annotation.bgcolor) {
|
|
809
|
+
styleProps.backgroundColor = annotation.bgcolor;
|
|
810
|
+
}
|
|
811
|
+
if (annotation.bordercolor) {
|
|
812
|
+
styleProps.borderColor = annotation.bordercolor;
|
|
813
|
+
}
|
|
814
|
+
const borderWidth = toFiniteNumber(annotation.borderwidth);
|
|
815
|
+
if (borderWidth !== undefined) {
|
|
816
|
+
styleProps.borderWidth = borderWidth;
|
|
817
|
+
}
|
|
818
|
+
const borderPad = appendPx(annotation.borderpad);
|
|
819
|
+
if (borderPad) {
|
|
820
|
+
styleProps.padding = borderPad;
|
|
821
|
+
}
|
|
822
|
+
const opacity = toFiniteNumber(annotation.opacity);
|
|
823
|
+
if (opacity !== undefined) {
|
|
824
|
+
styleProps.opacity = opacity;
|
|
825
|
+
}
|
|
826
|
+
if (annotation.font) {
|
|
827
|
+
const font = annotation.font;
|
|
828
|
+
if (font === null || font === void 0 ? void 0 : font.color) {
|
|
829
|
+
styleProps.textColor = font.color;
|
|
830
|
+
}
|
|
831
|
+
const fontSize = appendPx(font === null || font === void 0 ? void 0 : font.size);
|
|
832
|
+
if (fontSize) {
|
|
833
|
+
styleProps.fontSize = fontSize;
|
|
834
|
+
}
|
|
835
|
+
if (font === null || font === void 0 ? void 0 : font.weight) {
|
|
836
|
+
styleProps.fontWeight = font.weight;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
const textAngle = annotation === null || annotation === void 0 ? void 0 : annotation.textangle;
|
|
840
|
+
if (typeof textAngle === 'number' && !Number.isNaN(textAngle)) {
|
|
841
|
+
styleProps.rotation = textAngle;
|
|
842
|
+
} else if (typeof textAngle === 'string' && textAngle.toLowerCase() !== 'auto') {
|
|
843
|
+
const parsedAngle = Number(textAngle);
|
|
844
|
+
if (!Number.isNaN(parsedAngle)) {
|
|
845
|
+
styleProps.rotation = parsedAngle;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
if (Object.keys(layoutProps).length > 0) {
|
|
849
|
+
chartAnnotation.layout = layoutProps;
|
|
850
|
+
}
|
|
851
|
+
if (Object.keys(styleProps).length > 0) {
|
|
852
|
+
chartAnnotation.style = styleProps;
|
|
853
|
+
}
|
|
854
|
+
if (showArrow) {
|
|
855
|
+
var _annotation_arrowcolor;
|
|
856
|
+
const arrowColor = (_annotation_arrowcolor = annotation.arrowcolor) !== null && _annotation_arrowcolor !== void 0 ? _annotation_arrowcolor : styleProps.textColor;
|
|
857
|
+
const arrowWidth = toFiniteNumber(annotation.arrowwidth);
|
|
858
|
+
const endPadding = toFiniteNumber(annotation.standoff);
|
|
859
|
+
const startPadding = toFiniteNumber(annotation.startstandoff);
|
|
860
|
+
const dashPattern = mapArrowDashToPattern(annotation.arrowdash);
|
|
861
|
+
chartAnnotation.connector = {
|
|
862
|
+
...arrowColor ? {
|
|
863
|
+
strokeColor: arrowColor
|
|
864
|
+
} : {},
|
|
865
|
+
...arrowWidth !== undefined ? {
|
|
866
|
+
strokeWidth: arrowWidth
|
|
867
|
+
} : {},
|
|
868
|
+
...endPadding !== undefined ? {
|
|
869
|
+
endPadding: Math.max(endPadding, 0)
|
|
870
|
+
} : {},
|
|
871
|
+
...startPadding !== undefined ? {
|
|
872
|
+
startPadding: Math.max(startPadding, 0)
|
|
873
|
+
} : {},
|
|
874
|
+
...dashPattern ? {
|
|
875
|
+
dashArray: dashPattern
|
|
876
|
+
} : {},
|
|
877
|
+
arrow: mapArrowsideToArrow(annotation)
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
return chartAnnotation;
|
|
881
|
+
};
|
|
882
|
+
const getChartAnnotationsFromLayout = (layout, data, isMultiPlot)=>{
|
|
883
|
+
if (isMultiPlot || !(layout === null || layout === void 0 ? void 0 : layout.annotations)) {
|
|
884
|
+
return undefined;
|
|
885
|
+
}
|
|
886
|
+
const annotationsArray = Array.isArray(layout.annotations) ? layout.annotations : [
|
|
887
|
+
layout.annotations
|
|
888
|
+
];
|
|
889
|
+
const converted = annotationsArray.map((annotation, index)=>convertPlotlyAnnotation(annotation, layout, data, index)).filter((annotation)=>annotation !== undefined);
|
|
890
|
+
return converted.length > 0 ? converted : undefined;
|
|
891
|
+
};
|
|
339
892
|
const normalizeObjectArrayForGVBC = (data, xLabels)=>{
|
|
340
893
|
if (!data || data.length === 0) {
|
|
341
894
|
return {
|
|
@@ -407,6 +960,34 @@ const normalizeObjectArrayForGVBC = (data, xLabels)=>{
|
|
|
407
960
|
x
|
|
408
961
|
};
|
|
409
962
|
};
|
|
963
|
+
const transformPlotlyJsonToAnnotationChartProps = (input, isMultiPlot, _colorMap, _colorwayType, _isDarkTheme)=>{
|
|
964
|
+
var _layoutWithMeta_meta, _input_layout, _input_layout1, _input_layout2, _input_layout3, _input_layout_font, _input_layout4, _input_layout_font1, _input_layout5, _input_layout6;
|
|
965
|
+
var _getChartAnnotationsFromLayout;
|
|
966
|
+
const annotations = (_getChartAnnotationsFromLayout = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot)) !== null && _getChartAnnotationsFromLayout !== void 0 ? _getChartAnnotationsFromLayout : [];
|
|
967
|
+
const titles = getTitles(input.layout);
|
|
968
|
+
const layoutTitle = titles.chartTitle || undefined;
|
|
969
|
+
const layoutWithMeta = input.layout;
|
|
970
|
+
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;
|
|
971
|
+
const width = typeof ((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.width) === 'number' ? input.layout.width : undefined;
|
|
972
|
+
const height = typeof ((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) === 'number' ? input.layout.height : undefined;
|
|
973
|
+
const paperBackgroundColor = typeof ((_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.paper_bgcolor) === 'string' ? input.layout.paper_bgcolor : undefined;
|
|
974
|
+
const plotBackgroundColor = typeof ((_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.plot_bgcolor) === 'string' ? input.layout.plot_bgcolor : undefined;
|
|
975
|
+
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;
|
|
976
|
+
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;
|
|
977
|
+
const margin = (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.margin;
|
|
978
|
+
return {
|
|
979
|
+
annotations,
|
|
980
|
+
chartTitle: layoutTitle,
|
|
981
|
+
description,
|
|
982
|
+
width,
|
|
983
|
+
height,
|
|
984
|
+
paperBackgroundColor,
|
|
985
|
+
plotBackgroundColor,
|
|
986
|
+
fontColor,
|
|
987
|
+
fontFamily,
|
|
988
|
+
margin
|
|
989
|
+
};
|
|
990
|
+
};
|
|
410
991
|
const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
411
992
|
var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _firstData_marker, _input_layout3, _input_layout4, _input_layout5, _input_layout6;
|
|
412
993
|
const firstData = input.data[0];
|
|
@@ -574,19 +1155,7 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
574
1155
|
});
|
|
575
1156
|
});
|
|
576
1157
|
});
|
|
577
|
-
|
|
578
|
-
const xCategories = Array.from(new Set(((_input_data = input.data) !== null && _input_data !== void 0 ? _input_data : []).flatMap((trace)=>{
|
|
579
|
-
const xData = trace.x;
|
|
580
|
-
if (!xData) {
|
|
581
|
-
return [];
|
|
582
|
-
}
|
|
583
|
-
if (Array.isArray(xData)) {
|
|
584
|
-
return xData.flat().map((x)=>{
|
|
585
|
-
return x;
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
return [];
|
|
589
|
-
}).filter((x)=>x !== undefined && x !== null)));
|
|
1158
|
+
const xCategories = extractXCategories(input.data);
|
|
590
1159
|
var _input_layout_shapes;
|
|
591
1160
|
((_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)=>{
|
|
592
1161
|
var _shape_line;
|
|
@@ -628,24 +1197,29 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
628
1197
|
};
|
|
629
1198
|
const y0Val = resolveY(shape.y0);
|
|
630
1199
|
const y1Val = resolveY(shape.y1);
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
1200
|
+
if (mapXToDataPoints[x0Key]) {
|
|
1201
|
+
var _rgb_formatHex8;
|
|
1202
|
+
mapXToDataPoints[x0Key].lineData.push({
|
|
1203
|
+
legend: `Reference_${shapeIdx}`,
|
|
1204
|
+
y: y0Val,
|
|
1205
|
+
color: (_rgb_formatHex8 = (0, _d3color.rgb)(lineColor).formatHex8()) !== null && _rgb_formatHex8 !== void 0 ? _rgb_formatHex8 : lineColor,
|
|
1206
|
+
lineOptions: getLineOptions(shape.line),
|
|
1207
|
+
useSecondaryYScale: false
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
if (mapXToDataPoints[x1Key]) {
|
|
1211
|
+
var _rgb_formatHex81;
|
|
1212
|
+
mapXToDataPoints[x1Key].lineData.push({
|
|
1213
|
+
legend: `Reference_${shapeIdx}`,
|
|
1214
|
+
y: y1Val,
|
|
1215
|
+
color: (_rgb_formatHex81 = (0, _d3color.rgb)(lineColor).formatHex8()) !== null && _rgb_formatHex81 !== void 0 ? _rgb_formatHex81 : lineColor,
|
|
1216
|
+
lineOptions: getLineOptions(shape.line),
|
|
1217
|
+
useSecondaryYScale: false
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
647
1220
|
});
|
|
648
1221
|
const vsbcData = Object.values(mapXToDataPoints);
|
|
1222
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
649
1223
|
var _input_layout_height;
|
|
650
1224
|
return {
|
|
651
1225
|
data: vsbcData,
|
|
@@ -664,13 +1238,18 @@ const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
664
1238
|
showYAxisLables: true,
|
|
665
1239
|
noOfCharsToTruncate: 20,
|
|
666
1240
|
showYAxisLablesTooltip: true,
|
|
1241
|
+
roundedTicks: true,
|
|
1242
|
+
...getXMinMaxValues(input.data[0], input.layout),
|
|
667
1243
|
...getTitles(input.layout),
|
|
668
1244
|
...getXAxisTickFormat(input.data[0], input.layout),
|
|
669
1245
|
...yAxisTickFormat,
|
|
670
1246
|
...getAxisCategoryOrderProps(input.data, input.layout),
|
|
671
1247
|
...getBarProps(input.data, input.layout),
|
|
672
1248
|
...getYMinMaxValues(input.data[0], input.layout),
|
|
673
|
-
...getAxisTickProps(input.data, input.layout)
|
|
1249
|
+
...getAxisTickProps(input.data, input.layout),
|
|
1250
|
+
...annotations ? {
|
|
1251
|
+
annotations
|
|
1252
|
+
} : {}
|
|
674
1253
|
};
|
|
675
1254
|
};
|
|
676
1255
|
const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -777,6 +1356,7 @@ const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
777
1356
|
});
|
|
778
1357
|
}
|
|
779
1358
|
});
|
|
1359
|
+
const annotations = getChartAnnotationsFromLayout(processedInput.layout, processedInput.data, isMultiPlot);
|
|
780
1360
|
var _processedInput_layout_height;
|
|
781
1361
|
return {
|
|
782
1362
|
dataV2: gvbcDataV2,
|
|
@@ -789,13 +1369,19 @@ const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, colorwayTy
|
|
|
789
1369
|
wrapXAxisLables: true,
|
|
790
1370
|
hideLegend,
|
|
791
1371
|
roundCorners: true,
|
|
1372
|
+
showYAxisLables: true,
|
|
1373
|
+
roundedTicks: true,
|
|
1374
|
+
...getXMinMaxValues(processedInput.data[0], processedInput.layout),
|
|
792
1375
|
...getTitles(processedInput.layout),
|
|
793
1376
|
...getAxisCategoryOrderProps(processedInput.data, processedInput.layout),
|
|
794
1377
|
...getYMinMaxValues(processedInput.data[0], processedInput.layout),
|
|
795
1378
|
...getXAxisTickFormat(processedInput.data[0], processedInput.layout),
|
|
796
1379
|
...yAxisTickFormat,
|
|
797
1380
|
...getBarProps(processedInput.data, processedInput.layout),
|
|
798
|
-
...getAxisTickProps(processedInput.data, processedInput.layout)
|
|
1381
|
+
...getAxisTickProps(processedInput.data, processedInput.layout),
|
|
1382
|
+
...annotations ? {
|
|
1383
|
+
annotations
|
|
1384
|
+
} : {}
|
|
799
1385
|
};
|
|
800
1386
|
};
|
|
801
1387
|
const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -860,6 +1446,7 @@ const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayTyp
|
|
|
860
1446
|
});
|
|
861
1447
|
});
|
|
862
1448
|
});
|
|
1449
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
863
1450
|
var _input_layout_height;
|
|
864
1451
|
return {
|
|
865
1452
|
data: vbcData,
|
|
@@ -871,9 +1458,15 @@ const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayTyp
|
|
|
871
1458
|
maxBarWidth: 50,
|
|
872
1459
|
hideLegend,
|
|
873
1460
|
roundCorners: true,
|
|
1461
|
+
showYAxisLables: true,
|
|
1462
|
+
roundedTicks: true,
|
|
1463
|
+
...getXMinMaxValues(input.data[0], input.layout),
|
|
874
1464
|
...getTitles(input.layout),
|
|
875
1465
|
...getYMinMaxValues(input.data[0], input.layout),
|
|
876
|
-
...getAxisCategoryOrderProps(input.data, input.layout)
|
|
1466
|
+
...getAxisCategoryOrderProps(input.data, input.layout),
|
|
1467
|
+
...annotations ? {
|
|
1468
|
+
annotations
|
|
1469
|
+
} : {}
|
|
877
1470
|
};
|
|
878
1471
|
};
|
|
879
1472
|
const transformPlotlyJsonToAreaChartProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -996,11 +1589,19 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
996
1589
|
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;
|
|
997
1590
|
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;
|
|
998
1591
|
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;
|
|
1592
|
+
const xCategories = extractXCategories(input.data);
|
|
999
1593
|
var _input_layout_shapes;
|
|
1000
1594
|
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)=>{
|
|
1001
1595
|
var _shape_line;
|
|
1002
1596
|
const lineColor = (_shape_line = shape.line) === null || _shape_line === void 0 ? void 0 : _shape_line.color;
|
|
1003
1597
|
const resolveX = (val)=>{
|
|
1598
|
+
if (typeof val === 'number' && Array.isArray(xCategories)) {
|
|
1599
|
+
if (xCategories[val] !== undefined) {
|
|
1600
|
+
return xCategories[val];
|
|
1601
|
+
} else {
|
|
1602
|
+
return xCategories[shapeIdx];
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1004
1605
|
if (shape.xref === 'paper') {
|
|
1005
1606
|
if (val === 0) {
|
|
1006
1607
|
return xMinValue;
|
|
@@ -1035,11 +1636,11 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1035
1636
|
legend: `Reference_${shapeIdx}`,
|
|
1036
1637
|
data: [
|
|
1037
1638
|
{
|
|
1038
|
-
x: resolveX(shape.x0),
|
|
1639
|
+
x: resolveXValue(resolveX(shape.x0)),
|
|
1039
1640
|
y: resolveY(shape.y0)
|
|
1040
1641
|
},
|
|
1041
1642
|
{
|
|
1042
|
-
x: resolveX(shape.x1),
|
|
1643
|
+
x: resolveXValue(resolveX(shape.x1)),
|
|
1043
1644
|
y: resolveY(shape.y1)
|
|
1044
1645
|
}
|
|
1045
1646
|
],
|
|
@@ -1062,8 +1663,12 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1062
1663
|
]
|
|
1063
1664
|
};
|
|
1064
1665
|
const scatterChartProps = {
|
|
1065
|
-
scatterChartData:
|
|
1666
|
+
scatterChartData: [
|
|
1667
|
+
...chartData,
|
|
1668
|
+
...lineShape
|
|
1669
|
+
]
|
|
1066
1670
|
};
|
|
1671
|
+
const annotations = getChartAnnotationsFromLayout(input.layout, input.data, isMultiPlot);
|
|
1067
1672
|
var _input_layout_height;
|
|
1068
1673
|
const commonProps = {
|
|
1069
1674
|
supportNegativeData: true,
|
|
@@ -1073,13 +1678,19 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1073
1678
|
hideTickOverlap: true,
|
|
1074
1679
|
hideLegend,
|
|
1075
1680
|
useUTC: false,
|
|
1076
|
-
|
|
1681
|
+
wrapXAxisLabels: shouldWrapLabels,
|
|
1077
1682
|
optimizeLargeData: numDataPoints > 1000,
|
|
1683
|
+
showYAxisLables: true,
|
|
1684
|
+
roundedTicks: true,
|
|
1685
|
+
...getXMinMaxValues(input.data[0], input.layout),
|
|
1078
1686
|
...getTitles(input.layout),
|
|
1079
1687
|
...getXAxisTickFormat(input.data[0], input.layout),
|
|
1080
1688
|
...yAxisTickFormat,
|
|
1081
1689
|
...getAxisScaleTypeProps(input.data, input.layout),
|
|
1082
|
-
...getAxisTickProps(input.data, input.layout)
|
|
1690
|
+
...getAxisTickProps(input.data, input.layout),
|
|
1691
|
+
...annotations ? {
|
|
1692
|
+
annotations
|
|
1693
|
+
} : {}
|
|
1083
1694
|
};
|
|
1084
1695
|
if (isAreaChart) {
|
|
1085
1696
|
return {
|
|
@@ -1090,7 +1701,6 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1090
1701
|
} else {
|
|
1091
1702
|
return {
|
|
1092
1703
|
data: isScatterChart ? scatterChartProps : chartProps,
|
|
1093
|
-
roundedTicks: true,
|
|
1094
1704
|
...commonProps,
|
|
1095
1705
|
...yMinMax,
|
|
1096
1706
|
...isScatterChart ? {
|
|
@@ -1158,6 +1768,8 @@ const transformPlotlyJsonToHorizontalBarWithAxisProps = (input, isMultiPlot, col
|
|
|
1158
1768
|
showYAxisLablesTooltip: true,
|
|
1159
1769
|
hideLegend,
|
|
1160
1770
|
roundCorners: true,
|
|
1771
|
+
roundedTicks: true,
|
|
1772
|
+
...getXMinMaxValues(input.data[0], input.layout),
|
|
1161
1773
|
...getTitles(input.layout),
|
|
1162
1774
|
...getAxisCategoryOrderProps(input.data, input.layout),
|
|
1163
1775
|
...getBarProps(input.data, input.layout, true),
|
|
@@ -1381,7 +1993,7 @@ const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap, colorwa
|
|
|
1381
1993
|
};
|
|
1382
1994
|
};
|
|
1383
1995
|
const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
1384
|
-
var _input_layout_template_layout, _input_layout_template, _input_layout,
|
|
1996
|
+
var _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _node_label, _input_layout2, _input_layout3;
|
|
1385
1997
|
const { link, node } = input.data[0];
|
|
1386
1998
|
var _link_value;
|
|
1387
1999
|
const validLinks = ((_link_value = link === null || link === void 0 ? void 0 : link.value) !== null && _link_value !== void 0 ? _link_value : []).map((val, index)=>{
|
|
@@ -1397,6 +2009,7 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
|
|
|
1397
2009
|
}) // Filter out negative nodes, unequal nodes and self-references (circular links)
|
|
1398
2010
|
.filter((x)=>x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target);
|
|
1399
2011
|
const extractedNodeColors = (0, _PlotlyColorAdapter.extractColor)((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
|
|
2012
|
+
const extractedLinkColors = (0, _PlotlyColorAdapter.extractColor)((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template1 = _input_layout1.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_layout1 = _input_layout_template1.layout) === null || _input_layout_template_layout1 === void 0 ? void 0 : _input_layout_template_layout1.colorway, colorwayType, link === null || link === void 0 ? void 0 : link.color, colorMap, isDarkTheme);
|
|
1400
2013
|
const sankeyChartData = {
|
|
1401
2014
|
nodes: (_node_label = node.label) === null || _node_label === void 0 ? void 0 : _node_label.map((label, index)=>{
|
|
1402
2015
|
var _input_layout_template_layout, _input_layout_template, _input_layout;
|
|
@@ -1409,8 +2022,11 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
|
|
|
1409
2022
|
}),
|
|
1410
2023
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1411
2024
|
links: validLinks.map((validLink, index)=>{
|
|
2025
|
+
var _input_layout_template_layout, _input_layout_template, _input_layout;
|
|
2026
|
+
const color = (0, _PlotlyColorAdapter.resolveColor)(extractedLinkColors, index, validLink.target, colorMap, (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme);
|
|
1412
2027
|
return {
|
|
1413
|
-
...validLink
|
|
2028
|
+
...validLink,
|
|
2029
|
+
color
|
|
1414
2030
|
};
|
|
1415
2031
|
})
|
|
1416
2032
|
};
|
|
@@ -1426,8 +2042,8 @@ const transformPlotlyJsonToSankeyProps = (input, isMultiPlot, colorMap, colorway
|
|
|
1426
2042
|
chartTitle,
|
|
1427
2043
|
SankeyChartData: sankeyChartData
|
|
1428
2044
|
},
|
|
1429
|
-
width: (
|
|
1430
|
-
height: (_input_layout_height = (
|
|
2045
|
+
width: (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.width,
|
|
2046
|
+
height: (_input_layout_height = (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : _input_layout3.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 468
|
|
1431
2047
|
};
|
|
1432
2048
|
};
|
|
1433
2049
|
const transformPlotlyJsonToGaugeProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
@@ -2110,23 +2726,25 @@ const getAllupLegendsProps = (input, colorMap, colorwayType, traceInfo, isDarkTh
|
|
|
2110
2726
|
if (toShowLegend) {
|
|
2111
2727
|
input.data.forEach((series, index)=>{
|
|
2112
2728
|
if (traceInfo[index].type === 'donut') {
|
|
2113
|
-
var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker
|
|
2729
|
+
var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1, _input_layout2, _pieSeries_marker;
|
|
2114
2730
|
const pieSeries = series;
|
|
2115
2731
|
var _input_layout_piecolorway, _input_layout_piecolorway1;
|
|
2116
2732
|
const colors = (0, _PlotlyColorAdapter.extractColor)((_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, colorwayType, (_input_layout_piecolorway1 = (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : _input_layout2.piecolorway) !== null && _input_layout_piecolorway1 !== void 0 ? _input_layout_piecolorway1 : pieSeries === null || pieSeries === void 0 ? void 0 : (_pieSeries_marker = pieSeries.marker) === null || _pieSeries_marker === void 0 ? void 0 : _pieSeries_marker.colors, colorMap, isDarkTheme, true);
|
|
2117
|
-
(
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
allupLegends.
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2733
|
+
if ((0, _chartutilities.isArrayOrTypedArray)(pieSeries.labels)) {
|
|
2734
|
+
pieSeries.labels.forEach((label, labelIndex)=>{
|
|
2735
|
+
var _input_layout, _input_layout_template_layout, _input_layout_template, _input_layout1;
|
|
2736
|
+
const legend = `${label}`;
|
|
2737
|
+
var _input_layout_piecolorway;
|
|
2738
|
+
// resolve color for each legend from the extracted colors
|
|
2739
|
+
const color = (0, _PlotlyColorAdapter.resolveColor)(colors, labelIndex, legend, colorMap, (_input_layout_piecolorway = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.piecolorway) !== null && _input_layout_piecolorway !== void 0 ? _input_layout_piecolorway : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_template = _input_layout1.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme, true);
|
|
2740
|
+
if (legend !== '' && allupLegends.some((group)=>group.title === legend) === false) {
|
|
2741
|
+
allupLegends.push({
|
|
2742
|
+
title: legend,
|
|
2743
|
+
color
|
|
2744
|
+
});
|
|
2745
|
+
}
|
|
2746
|
+
});
|
|
2747
|
+
}
|
|
2130
2748
|
} else if (isNonPlotType(traceInfo[index].type) === false) {
|
|
2131
2749
|
var _plotSeries_line, _plotSeries_marker, _input_layout_template_layout1, _input_layout_template1, _input_layout3;
|
|
2132
2750
|
const plotSeries = series;
|
|
@@ -2210,7 +2828,8 @@ const isNonPlotType = (chartType)=>{
|
|
|
2210
2828
|
return [
|
|
2211
2829
|
'donut',
|
|
2212
2830
|
'sankey',
|
|
2213
|
-
'pie'
|
|
2831
|
+
'pie',
|
|
2832
|
+
'annotation'
|
|
2214
2833
|
].includes(chartType);
|
|
2215
2834
|
};
|
|
2216
2835
|
const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
|
|
@@ -2609,9 +3228,8 @@ const getAxisType = (data, ax)=>{
|
|
|
2609
3228
|
const values = [];
|
|
2610
3229
|
data.forEach((series)=>{
|
|
2611
3230
|
const axId = series[`${axLetter}axis`];
|
|
2612
|
-
if (axId === ax._id || !axId && ax._id === axLetter) {
|
|
2613
|
-
|
|
2614
|
-
(_series_axLetter = series[axLetter]) === null || _series_axLetter === void 0 ? void 0 : _series_axLetter.forEach((val)=>{
|
|
3231
|
+
if ((axId === ax._id || !axId && ax._id === axLetter) && (0, _chartutilities.isArrayOrTypedArray)(series[axLetter])) {
|
|
3232
|
+
series[axLetter].forEach((val)=>{
|
|
2615
3233
|
if (!(0, _chartutilities.isInvalidValue)(val)) {
|
|
2616
3234
|
values.push(val);
|
|
2617
3235
|
}
|