Skip to content

Commit

Permalink
Added bucket types
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLasitsa committed Nov 19, 2020
1 parent 4504020 commit d24c5fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@
* under the License.
*/

export const METRIC_TYPES = {
PERCENTILE: 'percentile',
PERCENTILE_RANK: 'percentile_rank',
TOP_HIT: 'top_hit',
COUNT: 'count',
DERIVATIVE: 'derivative',
STD_DEVIATION: 'std_deviation',
VARIANCE: 'variance',
SUM_OF_SQUARES: 'sum_of_squares',
CARDINALITY: 'cardinality',
VALUE_COUNT: 'value_count',
AVERAGE: 'avg',
SUM: 'sum',
};
// We should probably use METRIC_TYPES from data plugin in future.
export enum METRIC_TYPES {
PERCENTILE = 'percentile',
PERCENTILE_RANK = 'percentile_rank',
TOP_HIT = 'top_hit',
COUNT = 'count',
DERIVATIVE = 'derivative',
STD_DEVIATION = 'std_deviation',
VARIANCE = 'variance',
SUM_OF_SQUARES = 'sum_of_squares',
CARDINALITY = 'cardinality',
VALUE_COUNT = 'value_count',
AVERAGE = 'avg',
SUM = 'sum',
}

// We should probably use BUCKET_TYPES from data plugin in future.
export enum BUCKET_TYPES {
TERMS = 'terms',
}

export const EXTENDED_STATS_TYPES = [
METRIC_TYPES.STD_DEVIATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { QueryBarWrapper } from '../query_bar_wrapper';
import { getDefaultQueryLanguage } from '../lib/get_default_query_language';
import { VisDataContext } from './../../contexts/vis_data_context';
import { BUCKET_TYPES } from '../../../../common/metric_types';
export class TablePanelConfig extends Component {
static contextType = VisDataContext;
constructor(props) {
Expand Down Expand Up @@ -123,7 +124,7 @@ export class TablePanelConfig extends Component {
indexPattern={model.index_pattern}
onChange={this.handlePivotChange}
uiRestrictions={this.context.uiRestrictions}
type={'terms'}
type={BUCKET_TYPES.TERMS}
fullWidth
/>
</EuiFormRow>
Expand Down

0 comments on commit d24c5fe

Please sign in to comment.