Skip to content

Commit

Permalink
Make nvd3 refresh smoother. (apache#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-dcruz authored and Alanna Scott committed Nov 18, 2016
1 parent ab5a410 commit e546746
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions superset/assets/javascripts/explore/explore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function query(forceUpdate, pushState) {
// update the url after prepForm() fix the field ids
history.pushState({}, document.title, slice.querystring());
}
slice.container.html('');
slice.render(force);
}

Expand Down
3 changes: 3 additions & 0 deletions superset/assets/javascripts/modules/superset.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ const px = function () {
always(data);
controller.error(this);
},
clearError() {
$(selector + ' div.alert').remove();
},
width() {
return token.width();
},
Expand Down
3 changes: 2 additions & 1 deletion superset/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ function nvd3Vis(slice) {

const render = function () {
d3.json(slice.jsonEndpoint(), function (error, payload) {
slice.container.html('');
// Check error first, otherwise payload can be null
if (error) {
slice.error(error.responseText, error);
return;
}

slice.clearError();

// Calculates the longest label size for stretching bottom margin
function calculateStretchMargins(payloadData) {
let stretchMargin = 0;
Expand Down

0 comments on commit e546746

Please sign in to comment.