Public
Edited
Jan 17, 2023
Insert cell
Insert cell
// Source: https://observablehq.com/@mbostock/dashboard
grid = html`<div style="
background: #fff;
margin: 0;
border: none ;
display: grid;
width: ${screen.width};
grid-template-areas:
'd d'
'a b'
'a b'
'a b'
'c c';
grid-gap: 10px;
">
<div name="d" style="grid-area: d; position: relative;">${viewof current_date}</div>
<div name="b" style="grid-area: b; position: relative;">${dep}</div>
<div name="c" style="grid-area: c; position: relative;">${variable}</div>
<div name="a" style="grid-area: a; position: relative;">${chart}</div>
</div>`

Insert cell
Insert cell
Insert cell
viewof current_date = Scrubber(dates,
{
autoplay: false,
loop: false,
delay: 100,
format: current_date => current_date.toLocaleString("fr", {month: "long", year: "numeric"})
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
projection = d3.geoMercator().fitExtent([[0, 0], [975, 610]], communes)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
max_pop = Math.log(Math.max(...communes.features.map(d => d.properties.POPULATION)))
Insert cell
min_pop = Math.log(Math.min(...communes.features.map(d => d.properties.POPULATION)))
Insert cell
min_value = Math.min(...data_filtered.map(d => d.value))
Insert cell
max_value = Math.max(...data_filtered.map(d => d.value))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof extrait = {
return Inputs.table(data_filtered, {height: 200, layout: "auto", maxWidth: 500})
}
Insert cell
Insert cell
import {Legend} from "@d3/color-legend"
Insert cell
import {Choropleth} from "271261860678801f"
Insert cell
import {Scrubber} from "@mbostock/scrubber"
Insert cell
N = d3.map(data_filtered, d => d.id);

Insert cell
V = d3.map(data_filtered, d => d.value).map(d => d == null ? NaN : +d);

Insert cell
Im = new d3.InternMap(N.map((id, i) => [id, i]));

Insert cell
communes.features
Insert cell
If = communes.features.map(d => d.id);
Insert cell
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