Skip to content

Commit

Permalink
Fixed remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLasitsa committed Feb 14, 2022
1 parent 4b05314 commit 49a8f75
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
*/

export const EXPRESSION_METRIC_NAME = 'metricVis';

export const LabelPosition = {
BOTTOM: 'bottom',
TOP: 'top',
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../../../../expressions';
import { ExpressionValueVisDimension } from '../../../../visualizations/common';
import { ColorMode, CustomPaletteState, PaletteOutput } from '../../../../charts/common';
import { VisParams, visType } from './expression_renderers';
import { VisParams, visType, LabelPositionType } from './expression_renderers';
import { EXPRESSION_METRIC_NAME } from '../constants';

export interface MetricArguments {
Expand All @@ -24,7 +24,7 @@ export interface MetricArguments {
palette?: PaletteOutput<CustomPaletteState>;
font: Style;
labelFont: Style;
labelPosition: 'bottom' | 'top';
labelPosition: LabelPositionType;
metric: ExpressionValueVisDimension[];
bucket?: ExpressionValueVisDimension;
autoScale?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { $Values } from '@kbn/utility-types';
import { ExpressionValueVisDimension } from '../../../../visualizations/common';
import {
ColorMode,
Expand All @@ -14,6 +15,7 @@ import {
Style as ChartStyle,
} from '../../../../charts/common';
import { Style } from '../../../../expressions/common';
import { LabelPosition } from '../constants';

export const visType = 'metric';

Expand All @@ -22,13 +24,17 @@ export interface DimensionsVisParam {
bucket?: ExpressionValueVisDimension;
}

export type LabelPositionType = $Values<typeof LabelPosition>;

export type MetricStyle = Style & Pick<ChartStyle, 'bgColor' | 'labelColor'>;

export type LabelsConfig = Labels & { style: Style; position: LabelPositionType };
export interface MetricVisParam {
percentageMode: boolean;
percentageFormatPattern?: string;
metricColorMode: ColorMode;
palette?: CustomPaletteState;
labels: Labels & { style: Style; position: 'bottom' | 'top' };
labels: LabelsConfig;
style: MetricStyle;
autoScale?: boolean;
}
Expand Down

0 comments on commit 49a8f75

Please sign in to comment.