summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-11-05 15:10:13 +0100
committerJules Laplace <julescarbon@gmail.com>2018-11-05 15:10:13 +0100
commited8650f579ead0e4c2c69b863411074f05fa415a (patch)
tree1301bd2bc6d0ba06d80b25c8d473aee37a256cf0 /client/index.js
parentdf282a2ac1cf9e9799b2600590b34f43b4f9d4e2 (diff)
put dataset in hash
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js6
1 files changed, 4 insertions, 2 deletions
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)