Public
Edited
Apr 3, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
c = d3.scaleOrdinal().domain(bigEmitters).range(['darkorange', 'darksalmon', 'steelblue', 'skyblue', 'pink'])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
byOrg = countByGroup('association')
Insert cell
byCompany = countByGroup('company').slice(0, 10)
Insert cell
Insert cell
Insert cell
function countByGroup(category) {
const group = Object.groupBy(lobbyists.filter(d => d.COP >= 14), d => d[category])

return Object.entries(group).map(([key, value]) => {
return {[category]: key, count: value.length}
}).filter(d => d[category] && d[category] !== "NaN")
.sort((a, b) => b.count - a.count)
}
Insert cell
total_cop_attendees.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
total_people.map(d => d.conference.split("COP")[1])
Insert cell
emissions = await FileAttachment("cop28_emissions.csv").csv()
Insert cell
bigEmitters = {
const b = emissions.sort((a,b) => +b.scope_1_2 - +a.scope_1_2).slice(0, 6).map(d => d.Company)
return [...new Set(byYearCompanyAll.filter(d => b.includes(d.company)).map(d => d.company))]
}
Insert cell
import {Swatches} from '@d3/color-legend'
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