Skip to content

Commit

Permalink
fixing render complete issue and doulbe rendering with maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jun 29, 2017
1 parent d51983b commit cd213d3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
1 change: 0 additions & 1 deletion src/core_plugins/table_vis/public/table_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function TableVisTypeProvider(Private) {
}
])
},
implementsRenderComplete: true,
hierarchicalData: function (vis) {
return Boolean(vis.params.showPartialRows || vis.params.showMeticsAtAllLevels);
}
Expand Down
39 changes: 18 additions & 21 deletions src/core_plugins/tile_map/public/maps_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,23 @@ export function MapsVisualizationProvider(Private, serviceSettings, Notifier, co

async render(esResponse) {

if (esResponse && typeof esResponse.geohashGridAgg === 'undefined') {
this._updateParams();
return;
}
return new Promise((resolve) => {
if (esResponse && typeof esResponse.geohashGridAgg === 'undefined') {
this._updateParams();
return resolve();
}

//todo: do render complete!
this._dataDirty = true;
this._kibanaMapReady.then(() => {
this._chartData = esResponse;
this._geohashGeoJson = this._chartData.geoJson;
this._recreateGeohashLayer();
this._kibanaMap.useUiStateFromVisualization(this.vis);
this._kibanaMap.resize();
this._dataDirty = false;
this._doRenderComplete();
//todo: do render complete!
this._dataDirty = true;
this._kibanaMapReady.then(() => {
this._chartData = esResponse;
this._geohashGeoJson = this._chartData.geoJson;
this._recreateGeohashLayer();
this._kibanaMap.useUiStateFromVisualization(this.vis);
this._kibanaMap.resize();
this._dataDirty = false;
this._doRenderComplete(resolve);
});
});
}

Expand Down Expand Up @@ -114,7 +116,6 @@ export function MapsVisualizationProvider(Private, serviceSettings, Notifier, co
} else {
this._recreateGeohashLayer();
this._dataDirty = false;
this._doRenderComplete();
}
});

Expand All @@ -127,7 +128,6 @@ export function MapsVisualizationProvider(Private, serviceSettings, Notifier, co
});
this._kibanaMap.on('baseLayer:loaded', () => {
this._baseLayerDirty = false;
this._doRenderComplete();
});
this._kibanaMap.on('baseLayer:loading', () => {
this._baseLayerDirty = true;
Expand Down Expand Up @@ -236,10 +236,7 @@ export function MapsVisualizationProvider(Private, serviceSettings, Notifier, co
};
}

_doRenderComplete() {

//todo
return;
_doRenderComplete(resolve) {

if (this._paramsDirty || this._dataDirty || this._baseLayerDirty) {
const mapParams = this._getMapsParams();
Expand All @@ -256,7 +253,7 @@ export function MapsVisualizationProvider(Private, serviceSettings, Notifier, co

return;
}
this.$el.trigger('renderComplete');
resolve('renderComplete');
}

}
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/vis/editors/default/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const defaultEditor = function ($rootScope, $compile) {
$scope.visData = visData;
$scope.uiState = this.vis.getUiState();
$scope.searchSource = searchSource;
$scope.$apply();
};

return new Promise(resolve => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/vis/vis_types/vislib_vis_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function VislibVisTypeProvider(Private) {
}

resize() {
this.render(this._response);
return this.render(this._response);
}

destroy() {
Expand Down
5 changes: 0 additions & 5 deletions src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ uiModules

resizeChecker.on('resize', resizeFunction);

$scope.$watch('visData', () => {
$scope.$broadcast('render');
});


function jQueryGetter(selector) {
return function () {
const $sel = $el.find(selector);
Expand Down

0 comments on commit cd213d3

Please sign in to comment.