datawrapper.on('hash.change',(event) => {
var chart = document.getElementById("datawrapper-chart-"+event.chartId);
if (event.data.hash === '#none') return;
console.log(`hash has changed to ${event.data.hash}`);
console.log(`hash has changed to ${event.data.hash}`);
// set page url based on hash
window.location.hash = event.data.hash;
// reset hash
chart.src = chart.src.replace(event.data.hash,'#none');
});