Skip to content

Commit

Permalink
Update packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Marta Bondyra <[email protected]>
  • Loading branch information
stratoula and mbondyra authored Nov 5, 2024
1 parent abbe859 commit 7ee61ab
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit 7ee61ab

Please sign in to comment.