Public
Edited
Jan 4, 2023
Insert cell
Insert cell
spokes = FileAttachment("spokes.geojson").json()
Insert cell
spokesAttrs = spokes.features.map(spoke => spoke.properties)
Insert cell
Insert cell
Plot.plot({
x: {
round: true,
label: "Spoke distance",
grid: true,
// Scale
type: "pow",
exponent: .25,
domain: [100, 5000]
},
y: {
grid: true,
label: "N of flights"
},
marks: [
Plot.rectY(spokesAttrs,
Plot.binX(
//{y: d => d.map(spoke => spoke.PASSENGERS).reduce((a,b) => a+b) / 1000},
{ y: d => d.map(spoke => spoke.DEPARTURES_PERFORMED).reduce((a,b) => a+b) },
{ x: d => d.DISTANCE }
)
),
// Plot.ruleY([0, 100, 500, 1000])
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
spokes.features.map(spoke => totalCO2(spoke.properties)).reduce((a,b) => a+b)
Insert cell
Insert cell
spokes.features.map(spoke => spoke.properties.PASSENGERS).reduce((a,b) => a+b)
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