chart = Plot.plot({
width: 960,
height: 600,
projection: {
type: "azimuthal-equal-area",
rotate: [-13, -59],
domain: {
type: "MultiPoint",
coordinates: focus
}
},
color: {
domain: sources,
range: colors
},
marks: [
Plot.sphere({ fill: "white" }),
Plot.geo(land),
Plot.graticule(),
Plot.geo(countries, {
stroke: "#333",
strokeWidth: 0.2,
fill: "#e1e1e1",
title: (d) => d.id
}),
Plot.geo(countrymesh, { stroke: "#999", strokeWidth: 0.5 }),
Plot.geo(upper_zones, {
stroke: "#FFF",
strokeWidth: 0.5,
fill: (d) => d.properties.legal_status,
fillOpacity: 0.5,
title: (d) =>
`${d.properties.name}\nlegal status: ${d.properties.legal_status}`
}),
Plot.text(
[{ longitude: -18, latitude: 67.85, label: "Upper airspace" }],
{
x: "longitude",
y: "latitude",
text: "label",
fontSize: 22,
fontWeight: 400,
stroke: "white",
fill: "black",
textAnchor: "start",
dx: 0
}
),
sources.map(
(source, i) => [
Plot.dot([1], {
frameAnchor: "left",
r: 7,
fill: [source],
fillOpacity: 0.5,
stroke: "black",
strokeWidth: 0.7,
dy: i * 24 - 275,
dx: 682
}),
Plot.text([1], {
frameAnchor: "left",
fontSize: 22,
stroke: "white",
fill: "black",
text: () =>
source == "1"
? "state body"
: source == "2"
? "State-owned enterprise"
: source == "3"
? "International organisation"
: "Public Private Partnership",
dy: i * 24 - 275 - 1,
dx: 705
})
]
),
lower_airspace_inset(),
Plot.sphere({ stroke: "#aaa" })
]
})