mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fitting data should respect filters (#17727)
This commit is contained in:
parent
19b9265425
commit
56690d1992
3 changed files with 8 additions and 4 deletions
|
@ -1,14 +1,12 @@
|
|||
import _ from 'lodash';
|
||||
import { GeohashLayer } from './geohash_layer';
|
||||
import { BaseMapsVisualizationProvider } from './base_maps_visualization';
|
||||
import { SearchSourceProvider } from 'ui/courier/data_source/search_source';
|
||||
import { VisAggConfigProvider } from 'ui/vis/agg_config';
|
||||
import './styles/_tilemap.less';
|
||||
|
||||
export function CoordinateMapsVisualizationProvider(Notifier, Private) {
|
||||
|
||||
const AggConfig = Private(VisAggConfigProvider);
|
||||
const SearchSource = Private(SearchSourceProvider);
|
||||
const BaseMapsVisualization = Private(BaseMapsVisualizationProvider);
|
||||
|
||||
class CoordinateMapsVisualization extends BaseMapsVisualization {
|
||||
|
@ -142,8 +140,7 @@ export function CoordinateMapsVisualizationProvider(Notifier, Private) {
|
|||
async getGeohashBounds() {
|
||||
const agg = this._getGeoHashAgg();
|
||||
if (agg) {
|
||||
const searchSource = new SearchSource();
|
||||
searchSource.index(this.vis.indexPattern);
|
||||
const searchSource = this.vis.API.createInheritedSearchSource(this.vis.searchSource);
|
||||
searchSource.size(0);
|
||||
searchSource.aggs(function () {
|
||||
const geoBoundsAgg = new AggConfig(agg.vis, {
|
||||
|
|
|
@ -64,6 +64,12 @@ export function VisProvider(Private, Promise, indexPatterns, timefilter, getAppS
|
|||
const appState = getAppState();
|
||||
brushEvent(appState)(event);
|
||||
}
|
||||
},
|
||||
createInheritedSearchSource: (parentSearchSource) => {
|
||||
if (!parentSearchSource) {
|
||||
throw new Error('Unable to inherit search source, visualize saved object does not have search source.');
|
||||
}
|
||||
return new SearchSource().inherits(parentSearchSource);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ uiModules
|
|||
});
|
||||
|
||||
$scope.vis = $scope.savedObj.vis;
|
||||
$scope.vis.searchSource = $scope.savedObj.searchSource;
|
||||
|
||||
// Set the passed in uiState to the vis object. uiState reference should never be changed
|
||||
if (!$scope.uiState) $scope.uiState = $scope.vis.getUiState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue