From 7ee61ab4afba11556c7163fee35579a5a78c2ca1 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 5 Nov 2024 14:18:44 +0100 Subject: [PATCH] Update packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com> --- .../src/map_vis_to_chart_type.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts b/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts index a0a18d379b60..85e7c4ad5375 100644 --- a/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts +++ b/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts @@ -10,28 +10,19 @@ import { ChartType, LensVisualizationType } from './types'; export const mapVisToChartType = (visualizationType: string) => { - let chartType: ChartType | undefined; - switch (visualizationType) { case LensVisualizationType.XY: - chartType = ChartType.XY; - break; + return ChartType.XY; case LensVisualizationType.Metric: - chartType = ChartType.Metric; - break; + case LensVisualizationType.LegacyMetric: + return ChartType.Metric; case LensVisualizationType.Pie: - chartType = ChartType.Pie; - break; + return ChartType.Pie; case LensVisualizationType.Heatmap: - chartType = ChartType.Heatmap; - break; + return ChartType.Heatmap; + case LensVisualizationType.Gauge: + return ChartType.Gauge; case LensVisualizationType.Datatable: - chartType = ChartType.Table; - break; - case LensVisualizationType.LegacyMetric: - chartType = ChartType.Metric; - break; + return ChartType.Table; } - - return chartType; };