Public
Edited
Jul 24, 2023
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
size = width/2-4
Insert cell
Insert cell
Insert cell
all_data = {
const url = `https://prototipi.iit.cnr.it/drought_bulletin_api/spi/measures?year_range=${year1},${year2+1}&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
data1 = all_data.filter(d => d.year == year1 || d.year == year1+1 && d.month == 1)
Insert cell
data2 = all_data.filter(d => d.year == year2 || d.year == year2+1 && d.month == 1)
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