import { EsFieldName } from '../../../../../../../common/types/fields' ; import { GroupByConfigWithUiSupport , PIVOT_SUPPORTED_GROUP_BY_AGGS } from '../../../../../common' ; export function getDefaultGroupByConfig ( aggName , dropDownName , fieldName , groupByAgg ) { switch ( groupByAgg ) { case PIVOT_SUPPORTED_GROUP_BY_AGGS . TERMS : return { agg : groupByAgg , aggName , dropDownName , field : fieldName , } ; case PIVOT_SUPPORTED_GROUP_BY_AGGS . HISTOGRAM : return { agg : groupByAgg , aggName , dropDownName , field : fieldName , interval : '10' , } ; case PIVOT_SUPPORTED_GROUP_BY_AGGS . DATE_HISTOGRAM : return { agg : groupByAgg , aggName , dropDownName , field : fieldName , calendar_interval : '1m' , } ; } }