From f86aafd95b59b74dfaba8820b5eee20031cd8047 Mon Sep 17 00:00:00 2001 From: Andrew Tate Date: Mon, 17 Oct 2022 08:54:04 -0500 Subject: [PATCH] fix some types --- .../common/convert_to_lens/types/configurations.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts b/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts index 761254b842c4c..60f97a588c2a9 100644 --- a/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts +++ b/src/plugins/visualizations/common/convert_to_lens/types/configurations.ts @@ -43,6 +43,8 @@ export type GaugeLabelMajorMode = $Values; export type GaugeCentralMajorMode = $Values; export type GaugeTicksPosition = $Values; +type CollapseFunction = 'sum' | 'avg' | 'min' | 'max'; + export interface AxisExtentConfig { mode: 'full' | 'custom' | 'dataBounds'; lowerBound?: number; @@ -72,7 +74,7 @@ export interface XYDataLayerConfig { yConfig?: YConfig[]; splitAccessor?: string; palette?: PaletteOutput; - collapseFn?: string; + collapseFn?: CollapseFunction; xScaleType?: 'time' | 'linear' | 'ordinal'; isHistogram?: boolean; columnToLabel?: string; @@ -179,7 +181,7 @@ export interface ColumnState { columnId: string; summaryRow?: 'none' | 'sum' | 'avg' | 'count' | 'min' | 'max'; alignment?: 'left' | 'right' | 'center'; - collapseFn?: string; + collapseFn?: CollapseFunction; } export interface TableVisConfiguration { @@ -203,7 +205,7 @@ export interface MetricVisConfiguration { breakdownByAccessor?: string; // the dimensions can optionally be single numbers // computed by collapsing all rows - collapseFn?: string; + collapseFn?: CollapseFunction; subtitle?: string; secondaryPrefix?: string; progressDirection?: LayoutDirection; @@ -219,7 +221,7 @@ export interface PartitionLayerState { primaryGroups: string[]; secondaryGroups?: string[]; metric?: string; - collapseFns?: Record; + collapseFns?: Record; numberDisplay: NumberDisplayType; categoryDisplay: CategoryDisplayType; legendDisplay: LegendDisplayType;