diff --git a/caravel/assets/javascripts/dashboard.js b/caravel/assets/javascripts/dashboard.js index d2e4f5f016fc6..da711d725faa1 100644 --- a/caravel/assets/javascripts/dashboard.js +++ b/caravel/assets/javascripts/dashboard.js @@ -18,6 +18,7 @@ var Dashboard = function (dashboardData) { filters: {}, init: function () { this.initDashboardView(); + this.firstLoad = true; px.initFavStars(); var sliceObjects = [], dash = this; @@ -67,15 +68,17 @@ var Dashboard = function (dashboardData) { startPeriodicRender: function (interval) { this.stopPeriodicRender(); var dash = this; - var maxRandomDelay = Math.min(interval * 0.1, 5000); + var maxRandomDelay = Math.min(interval * 0.2, 5000); var refreshAll = function () { dash.slices.forEach(function (slice) { + var force = !dash.firstLoad; setTimeout(function () { - slice.render(true); - }, - //Randomize to prevent all widgets refreshing at the same time - maxRandomDelay * Math.random()); + slice.render(force); + }, + //Randomize to prevent all widgets refreshing at the same time + maxRandomDelay * Math.random()); }); + dash.firstLoad = false; }; var fetchAndRender = function () { diff --git a/caravel/viz.py b/caravel/viz.py index 5c0c6df174261..4839899948426 100644 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -120,13 +120,16 @@ def get_url(self, **kwargs): del d['action'] d.update(kwargs) # Remove unchecked checkboxes because HTML is weird like that - for key in d.keys(): + od = OrderedDict() + for key in sorted(d.keys()): if d[key] is False: del d[key] + else: + od[key] = d[key] href = Href( '/caravel/explore/{self.datasource.type}/' '{self.datasource.id}/'.format(**locals())) - return href(d) + return href(od) def get_df(self, query_obj=None): """Returns a pandas dataframe based on the query object"""