Published
Edited
Aug 4, 2022
2 stars
Also listed in…
CO₂
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = aranetData(await FileAttachment("Aranet4 13BA0_2022-07-30T10_42_39-0400.csv").csv())
Insert cell
milestones = [
[utc(2022, 6, 25, 23, 0), 'EVEN Hotel', 'Fast asleep 😴'],
[utc(2022, 6, 26, 8, 54), 'Walking'],
[utc(2022, 6, 26, 9, 17), 'Breakfast', 'Office'],
[utc(2022, 6, 26, 10, 0), 'All staff activities', 'Office'],
[utc(2022, 6, 26, 12, 30), 'Lunch', 'Office'],
[utc(2022, 6, 26, 14, 0), 'All staff activities', 'Office'],
[utc(2022, 6, 26, 16, 23), 'Walking'],
[utc(2022, 6, 26, 16, 44), 'EVEN Hotel'],
[utc(2022, 6, 26, 18, 12), 'Subway', 'and walking'],
[utc(2022, 6, 26, 18, 28), 'Barcade', 'Indoor arcade and bar, surprisingly low CO₂ levels!'],
[utc(2022, 6, 26, 20, 30), 'Cafe Argentino', 'Outdoor Dining'],
[utc(2022, 6, 26, 22, 15), 'Subway', 'and walking'],
[utc(2022, 6, 26, 22, 32), 'EVEN Hotel', 'Fast asleep 🛌💤'],
[utc(2022, 6, 27, 9, 32), 'Subway', 'and walking'],
[utc(2022, 6, 27, 9, 53), 'All staff activities', 'Office'],
[utc(2022, 6, 27, 12, 30), 'Lunch', 'Office'],
[utc(2022, 6, 27, 14, 0), 'All staff activities', 'Office'],
[utc(2022, 6, 27, 16, 55), 'Subway', 'and walking'],
[utc(2022, 6, 27, 17, 13), 'EVEN Hotel'],
[utc(2022, 6, 27, 18, 10), 'Subway', 'and walking'],
[utc(2022, 6, 27, 18, 26), 'Time Out Market', 'and eating outdoors on the waterfront'],
[utc(2022, 6, 27, 20, 0), 'Westville', 'Outdoor patio drinks'],
[utc(2022, 6, 27, 21, 10), '58 Jay St Bar', 'Outdoor patio drinks'],
[utc(2022, 6, 27, 22, 28), 'Walking'],
[utc(2022, 6, 27, 22, 57), 'EVEN Hotel', 'Fast asleep 😪'],

[utc(2022, 6, 28, 9, 41), 'Walking'],
[utc(2022, 6, 28, 9, 57), 'Breakfast', 'Office'],
[utc(2022, 6, 28, 10, 40), 'All staff activities', 'Office'],
[utc(2022, 6, 28, 13, 0), 'Group Photos', 'Rooftop'],
[utc(2022, 6, 28, 13, 45), 'All staff activities', 'Office'],
[utc(2022, 6, 28, 18, 0), 'Seamore’s', 'Outdoor Dining'],
[utc(2022, 6, 28, 20, 56), 'Walking', 'Across the Manhattan Bridge'],
[utc(2022, 6, 28, 21, 10), 'Up Stairs', 'Lively karaoke bar'],
[utc(2022, 6, 28, 23, 4), 'Subway'],
[utc(2022, 6, 28, 23, 19), 'EVEN Hotel', 'Fast asleep 🥱'],

[utc(2022, 6, 29, 5, 28), 'Lyft'],
[utc(2022, 6, 29, 5, 43), 'Penn Station'],
[utc(2022, 6, 29, 6, 16), 'Acela'],
[utc(2022, 6, 29, 10, 3), 'MBTA'],
[utc(2022, 6, 29, 10, 30), 'Walking'],
[utc(2022, 6, 29, 10, 50), 'Home'],
[utc(2022, 6, 29, 12, 0)],
]
Insert cell
periods = milestonesToPeriods(milestones)
Insert cell
officeStats = {
const officePeriods = periods.filter(d => d.description === 'Office')
const officeReadings = officePeriods.map(p => data.filter(d => +d.date > +p.start && +d.date < +p.end)).flat()
return {
mean: d3.mean(officeReadings, d => d.co2),
max: d3.max(officeReadings, d => d.co2),
}
}
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more