Public
Edited
Jun 23, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
filtered_data = all_data.filter(d => d.year == 2020 && d.month > m || d.year == 2021 && d.month <= m)
Insert cell
all_data = {
const url = `https://prototipi.iit.cnr.it/drought_bulletin_api/spi/measures?year_range=1951,2021&time_scale=${scale}&reverse_chronology=true`;
const headers = { 'Accept': 'application/x-msgpack' };
const measures = [];
const response = await fetch(url, { headers });
for await (const item of msgpack.decodeMultiStream(response.body)) {
measures.push(item);
}
return measures;
}
Insert cell
msgpack = require('@msgpack/msgpack')
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