From 95aa6e00fa941b91418e74275b1135f090debd60 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 28 Jan 2016 17:41:10 -0800 Subject: [PATCH] [fix] can't back out with back button --- TODO.md | 2 -- panoramix/static/panoramix.js | 12 +++++++++--- panoramix/templates/panoramix/explore.html | 12 ++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index 1cb83a9574..23df1bc2ca 100644 --- a/TODO.md +++ b/TODO.md @@ -7,8 +7,6 @@ List of TODO items for Panoramix * **Dashboard URL filters:** `{dash_url}#fltin__fieldname__value1,value2` * **Default slice:** choose a default slice for the dataset instead of default endpoint * **refresh freq**: specifying the refresh frequency of a dashboard and specific slices within it, some randomization would be nice -* **Color hash in JS:** it'd be nice to use the same hash function for color attribution of series - on the js side as on the python side (`panoramix.utils.color`) * **Widget sets / chart grids:** a way to have all charts support making a series of charts and putting them in a grid. the same way that you can groupby for series, you could chart by. The form fieldset would be common and use a single field to "grid by", a limit number of chart as an N * N grid size. diff --git a/panoramix/static/panoramix.js b/panoramix/static/panoramix.js index 019ceacf39..aa9acf9483 100644 --- a/panoramix/static/panoramix.js +++ b/panoramix/static/panoramix.js @@ -254,11 +254,14 @@ var px = (function() { i++; }); } - function druidify(){ + function renderSlice(){ prepForm(); + slice.render(); + } + function druidify(){ $('div.alert').remove(); history.pushState({}, document.title, slice.querystring()); - slice.render(); + renderSlice(); } function initExploreView() { @@ -519,6 +522,9 @@ var px = (function() { initDashboardView: initDashboardView, formatDate: formatDate, timeFormatFactory: timeFormatFactory, - color: color(), + colorBnb: colorBnb, + bnbColors: bnbColors, + color: colorBnb(), + renderSlice: renderSlice, } })(); diff --git a/panoramix/templates/panoramix/explore.html b/panoramix/templates/panoramix/explore.html index 06a03c585d..f291edee88 100644 --- a/panoramix/templates/panoramix/explore.html +++ b/panoramix/templates/panoramix/explore.html @@ -221,12 +221,12 @@ var data = $('.slice').data('slice'); var slice = px.Slice(data); $('.slice').data('slice', slice); - px.druidify(); + px.renderSlice(); + $(':checkbox') + .addClass('pull-right') + .attr("data-onstyle", "default") + .bootstrapToggle({size: 'mini'}); + $('div.toggle').addClass('pull-right'); }); - $(':checkbox') - .addClass('pull-right') - .attr("data-onstyle", "default") - .bootstrapToggle({size: 'mini'}); - $('div.toggle').addClass('pull-right'); {% endblock %}