Skip to content

Commit

Permalink
Small change
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Nov 5, 2024
1 parent cf707f8 commit 16063d1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ type LensToChartMap = {
[K in ValueOf<typeof LensVisualizationType>]: ChartType;
};
const lensTypesToChartTypes: LensToChartMap = {
[LensVisualizationType.lnsXY]: ChartType.XY,
[LensVisualizationType.lnsMetric]: ChartType.Metric,
[LensVisualizationType.lnsLegacyMetric]: ChartType.Metric,
[LensVisualizationType.lnsPie]: ChartType.Pie,
[LensVisualizationType.lnsHeatmap]: ChartType.Heatmap,
[LensVisualizationType.lnsGauge]: ChartType.Gauge,
[LensVisualizationType.lnsDatatable]: ChartType.Table,
[LensVisualizationType.XY]: ChartType.XY,
[LensVisualizationType.Metric]: ChartType.Metric,
[LensVisualizationType.LegacyMetric]: ChartType.Metric,
[LensVisualizationType.Pie]: ChartType.Pie,
[LensVisualizationType.Heatmap]: ChartType.Heatmap,
[LensVisualizationType.Gauge]: ChartType.Gauge,
[LensVisualizationType.Datatable]: ChartType.Table,
};
function isLensVisualizationType(value: string): value is LensVisualizationType {
return value in LensVisualizationType;
return Object.values(LensVisualizationType).includes(value as LensVisualizationType);
}
export const mapVisToChartType = (visualizationType: string) => {
if (isLensVisualizationType(visualizationType)) {
Expand Down
14 changes: 7 additions & 7 deletions packages/kbn-visualization-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export enum ChartType {
}

export enum LensVisualizationType {
lnsXY = 'lnsXY',
lnsMetric = 'lnsMetric',
lnsPie = 'lnsPie',
lnsHeatmap = 'lnsHeatmap',
lnsGauge = 'lnsGauge',
lnsDatatable = 'lnsDatatable',
lnsLegacyMetric = 'lnsLegacyMetric',
XY = 'lnsXY',
Metric = 'lnsMetric',
Pie = 'lnsPie',
Heatmap = 'lnsHeatmap',
Gauge = 'lnsGauge',
Datatable = 'lnsDatatable',
LegacyMetric = 'lnsLegacyMetric',
}

0 comments on commit 16063d1

Please sign in to comment.