Skip to content

Commit

Permalink
[Maps] remove 'Top term' metric from ESGeoGridSource editor (elastic#…
Browse files Browse the repository at this point in the history
…125803)

* [Maps] remove 'Top term' metric from ESGeoGridSource editor

* simplify comment

* update snapshot

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and lucasfcosta committed Mar 2, 2022
1 parent e613fb9 commit 02fcad3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ export class UpdateSourceEditor extends Component<Props, State> {
};

_getMetricsFilter() {
if (this.props.currentLayerType === LAYER_TYPE.HEATMAP) {
return (metric: EuiComboBoxOptionOption<AGG_TYPE>) => {
// these are countable metrics, where blending heatmap color blobs make sense
return metric.value ? isMetricCountable(metric.value) : false;
};
}

if (this.props.resolution === GRID_RESOLUTION.SUPER_FINE) {
return (metric: EuiComboBoxOptionOption<AGG_TYPE>) => {
return metric.value !== AGG_TYPE.TERMS;
};
}
return this.props.currentLayerType === LAYER_TYPE.HEATMAP
? (metric: EuiComboBoxOptionOption<AGG_TYPE>) => {
// these are countable metrics, where blending heatmap color blobs make sense
return metric.value ? isMetricCountable(metric.value) : false;
}
: (metric: EuiComboBoxOptionOption<AGG_TYPE>) => {
// terms aggregation is not supported with Elasticsearch _mvt endpoint
// The goal is to remove GeoJSON ESGeoGridSource implemenation and only have MVT ESGeoGridSource implemenation
// First step is to deprecate terms aggregation for ESGeoGridSource
// and prevent new uses of terms aggregation for ESGeoGridSource
return metric.value !== AGG_TYPE.TERMS;
};
}

_renderMetricsPanel() {
Expand Down

0 comments on commit 02fcad3

Please sign in to comment.