mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
do not handle click when no aggregation has been specified (#18825)
This commit is contained in:
parent
87badd6bc4
commit
2ced21b4eb
1 changed files with 13 additions and 1 deletions
|
@ -126,6 +126,14 @@ export function RegionMapsVisualizationProvider(Private, Notifier, config) {
|
|||
}
|
||||
|
||||
this._choroplethLayer.on('select', (event) => {
|
||||
|
||||
|
||||
if (!this._isAggReady()) {
|
||||
//even though we have maps data available and have added the choropleth layer to the map
|
||||
//the aggregation may not be available yet
|
||||
return;
|
||||
}
|
||||
|
||||
const agg = this._vis.aggs.bySchemaName.segment[0];
|
||||
const filter = agg.createFilter(event);
|
||||
this._vis.API.queryFilter.addFilters(filter);
|
||||
|
@ -145,10 +153,14 @@ export function RegionMapsVisualizationProvider(Private, Notifier, config) {
|
|||
|
||||
}
|
||||
|
||||
_isAggReady() {
|
||||
return this._vis.getAggConfig().bySchemaName.segment && this._vis.getAggConfig().bySchemaName.segment[0];
|
||||
}
|
||||
|
||||
|
||||
_setTooltipFormatter() {
|
||||
const metricsAgg = _.first(this._vis.getAggConfig().bySchemaName.metric);
|
||||
if (this._vis.getAggConfig().bySchemaName.segment && this._vis.getAggConfig().bySchemaName.segment[0]) {
|
||||
if (this._isAggReady()) {
|
||||
const fieldName = this._vis.getAggConfig().bySchemaName.segment[0].makeLabel();
|
||||
this._choroplethLayer.setTooltipFormatter(tooltipFormatter, metricsAgg, fieldName);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue