kibana/x-pack/plugins/lens/public/pie_visualization/types.ts

44 lines
1.2 KiB
TypeScript
Raw Normal View History

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { PaletteOutput } from 'src/plugins/charts/public';
import { LensMultiTable } from '../types';
2021-02-03 12:03:55 +01:00
export interface SharedPieLayerState {
groups: string[];
metric?: string;
numberDisplay: 'hidden' | 'percent' | 'value';
categoryDisplay: 'default' | 'inside' | 'hide';
legendDisplay: 'default' | 'show' | 'hide';
2020-07-22 12:14:59 +02:00
legendPosition?: 'left' | 'right' | 'top' | 'bottom';
nestedLegend?: boolean;
percentDecimals?: number;
}
2021-02-03 12:03:55 +01:00
export type PieLayerState = SharedPieLayerState & {
layerId: string;
};
export interface PieVisualizationState {
shape: 'donut' | 'pie' | 'treemap';
2021-02-03 12:03:55 +01:00
layers: PieLayerState[];
palette?: PaletteOutput;
}
2021-02-03 12:03:55 +01:00
export type PieExpressionArgs = SharedPieLayerState & {
title?: string;
description?: string;
shape: 'pie' | 'donut' | 'treemap';
hideLabels: boolean;
palette: PaletteOutput;
};
export interface PieExpressionProps {
data: LensMultiTable;
args: PieExpressionArgs;
}