Public
Edited
Feb 7, 2024
Insert cell
Insert cell
Insert cell
Insert cell
world = await fetch("https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/world.geojson").then(d => d.json())
Insert cell
airports = await FileAttachment("World_Airports.csv").csv()
Insert cell
flights = await FileAttachment("2023_combined_flights@1.json").json()
Insert cell
finalData = flights.map(f => {

const deptInfo = airports.find(x => x.airport_ident === f.departure)
const deptLatitude = +deptInfo?.latitude_deg
const deptLongitude = +deptInfo?.longitude_deg
const deptCity = deptInfo?.municipality

const arrivalInfo = airports.find(x => x.airport_ident === f.arrival)
const arrivalLatitude = +arrivalInfo?.latitude_deg
const arrivalLongitude = +arrivalInfo?.longitude_deg
const arrivalCity = arrivalInfo?.municipality

return {...f, celeb: f.celeb.toLowerCase(), deptLatitude, deptLongitude, arrivalLatitude, arrivalLongitude, deptCity, arrivalCity }
} )
Insert cell
Insert cell
labels = [
{city: "Austin", lat:30.100941, lon: -97.672607 },
{city: "Nashville", lat: 36.12450027, lon: -86.67819977},
{city: "London", lat: 51.88499832, lon:0.234999999 },
{city: "Oakland", lat: 37.721298, lon: -122.221001}
]
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