Published
Edited
Aug 26, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = {
const data = [];
for (let d of selected) {
const counts = await (
await (
await fetch(
`https://api.inaturalist.org/v1/observations/histogram?taxon_id=${d.id}&nelat=${neLatitude}&nelng=${neLongitude}&swlat=${swLatitude}&swlng=${swLongitude}&date_field=observed&interval=month_of_year&verifiable=true`
)
).json()
).results;

data.push(
...Object.entries(counts.month_of_year).map(([month_number, value]) => ({
...d,
month: new Date(Date.UTC(2021, +month_number - 1, 1)),
value
}))
);

yield data;
await Promises.delay(250);
}
}
Insert cell
species = (
await (
await fetch(
"https://api.inaturalist.org/v1/observations/species_counts?taxon_id=47113&nelat=37.499811&nelng=-122.492738&swlat=37.492805&swlng=-122.50542&date_field=observed&verifiable=true"
)
).json()
).results.map((d) => d.taxon)
Insert cell
// https://github.com/observablehq/plot/pull/459
Plot = require(await FileAttachment("plot.umd.js").url())
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