import { i18n } from '@osd/i18n' ; import { MetricAggType } from './metric_agg_type' ; import { METRIC_TYPES } from './metric_agg_types' ; import { OSD_FIELD_TYPES } from '../../../../common' ; import { BaseAggParams } from '../types' ; export interface AggParamsGeoBounds extends BaseAggParams { field : string ; } const geoBoundsTitle = i18n . translate ( 'data.search.aggs.metrics.geoBoundsTitle' , { defaultMessage : 'Geo Bounds' , } ) ; const geoBoundsLabel = i18n . translate ( 'data.search.aggs.metrics.geoBoundsLabel' , { defaultMessage : 'Geo Bounds' , } ) ; export const getGeoBoundsMetricAgg = ( ) => { return new MetricAggType ( { name : METRIC_TYPES . GEO_BOUNDS , title : geoBoundsTitle , makeLabel : ( ) => geoBoundsLabel , params : [ { name : 'field' , type : 'field' , filterFieldTypes : OSD_FIELD_TYPES . GEO_POINT , } , ] , } ) ; } ;