Public
Edited
Jun 22
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
datedData = sensorHistory.data
.sort((a, b) => a[0] - b[0])
.map(e => new Object({
// map array values to objects with named properties for easier/idiomatic Plot syntax
// convert unix timestamps to Javascript
timestamp: new Date(e[0] * 1000),

// I'm sure there is a more succinct idiom to spread/assign these fields
humidity: e[1],
temperature: e[2],
pressure: e[3],
pm2_5_alt: e[4],
pm1_0_atm: e[5],
pm2_5_atm: e[6],
pm10_0_atm: e[7]
})
)
Insert cell
Inputs.table(datedData)
Insert cell
Insert cell
period = [new Date("June 1, 2025"), new Date("June 15, 2025")]
Insert cell
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