Published
Edited
Oct 19, 2018
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// leafletCSS = html`<link href='${resolve('leaflet@1.2.0/dist/leaflet.css')}' rel='stylesheet' />`
Insert cell
// heatLayer = L, require('leaflet.heat').catch(() => L.heatLayer)
Insert cell
// update_heatmap = {
// if (map.heat_layer) { map.removeLayer(map.heat_layer) };
// replay;
// const heatmapLayer = map.heat_layer = L.layerGroup();
// heatmapLayer.addTo(map);
// // const heat_layer = heatLayer([], {
// // minOpacity: 0.4,
// // maxZoom: 18,
// // max: 1.0,
// // radius: 8,
// // blur: 6,
// // gradient: null
// // }).addTo(heatmapLayer)

// const delay = d3.scaleTime()
// .domain([filtered_incidents[0].declared, filtered_incidents[filtered_incidents.length - 1].declared])
// .range([0, total_duration * 1000]);
// heat_layer.incidents = [];
// // There is no method to remove a 'marker' from a heatmap yet
// // So we have redraw with every addition/subtraction
// // Hide a point according to the time between declaration and treatment finishing
// filtered_incidents.forEach(incident => {
// d3.timeout(function() {
// mutable current_date = incident.declared;
// mutable active_cases = heat_layer.incidents.length;
// heat_layer.incidents.push([incident.lat, incident.long, 0.3]);
// heat_layer.setLatLngs(heat_layer.incidents);
// let duration = Math.max(delay(incident.treatment_finished) - delay(incident.declared), 1);
// d3.timeout(function() {
// heat_layer.incidents.pop();
// heat_layer.setLatLngs(heat_layer.incidents);
// }, duration + decay)
// }, delay(incident.declared))
// })
// }
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more