From ed8650f579ead0e4c2c69b863411074f05fa415a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 5 Nov 2018 15:10:13 +0100 Subject: put dataset in hash --- client/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client/index.js') diff --git a/client/index.js b/client/index.js index 00729e4..fd40bb4 100644 --- a/client/index.js +++ b/client/index.js @@ -223,6 +223,7 @@ function pick_dataset(key){ console.log('pick dataset:', key, datasets[key]) i = 0 mass_i = 0 + window.location.hash = key dataset = datasets[key] bounds = get_bounds(dataset) diff = get_diff_bounds(bounds.rows) @@ -344,8 +345,9 @@ function ready() { document.querySelector('.loading').classList.remove('loading') - document.querySelector('#dataset').value = 'Mass Shootings' - pick_dataset('Mass Shootings') + const initial_dataset = decodeURIComponent(window.location.hash.substr(1)) || 'Mass Shootings' + document.querySelector('#dataset').value = initial_dataset + pick_dataset(initial_dataset) document.querySelector('#scale').value = '14' scales.pick(14) -- cgit v1.2.3-70-g09d2