Public
Edited
Dec 1, 2024
Paused
1 star
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
allData = fetch(
"https://notions.stringer.io/precipitation?stationid=GHCND:USW00094846"
)
.then((response) => {
if (!response.ok) {
return response.text().then((text) => {
throw new Error(text);
});
}
return response.json();
})
.then((data) => {
const timeParse = d3.timeParse("%Y-%m-%d");
const cumulative = new Map();
const result = [];
data.forEach(([d, p]) => {
let date = timeParse(d);
let year = date.getFullYear();
let inches = p / 254;
let item = {
date,
precipitation: inches,
year,
cumulative: cumulative.has(year)
? cumulative.get(year) + inches
: inches,
dateInYear: toDateInYear(date)
};
cumulative.set(item.year, item.cumulative);
result.push(item);
});
return result;
})
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