File tree Expand file tree Collapse file tree
x-pack/plugins/maps/public/classes/layers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414import {
1515 AGG_TYPE ,
1616 COLOR_MAP_TYPE ,
17+ DEFAULT_PERCENTILE ,
1718 FIELD_ORIGIN ,
1819 GRID_RESOLUTION ,
1920 RENDER_AS ,
@@ -61,14 +62,16 @@ export function createAggDescriptor(
6162
6263 if ( ! aggType || aggType === AGG_TYPE . COUNT || ! metricFieldName ) {
6364 return { type : AGG_TYPE . COUNT } ;
64- } else if ( aggType === AGG_TYPE . PERCENTILE ) {
65- return { type : aggType , field : metricFieldName , percentile : 50 } ;
65+ }
66+
67+ if ( isHeatmap ( mapType ) ) {
68+ return isMetricCountable ( aggType )
69+ ? { type : aggType , field : metricFieldName }
70+ : { type : AGG_TYPE . COUNT } ;
6671 } else {
67- if ( isHeatmap ( mapType ) && isMetricCountable ( aggType ) ) {
68- return { type : AGG_TYPE . COUNT } ;
69- } else {
70- return { type : aggType , field : metricFieldName } ;
71- }
72+ return aggType === AGG_TYPE . PERCENTILE
73+ ? { type : aggType , field : metricFieldName , percentile : DEFAULT_PERCENTILE }
74+ : { type : aggType , field : metricFieldName } ;
7275 }
7376}
7477
You can’t perform that action at this time.
0 commit comments