chart = Plot.plot({
x: { type: "log", grid: true },
y: {grid: true},
r: { range: [1, width / 17] },
color: {
legend: true,
domain: ["americas", "europe", "africa", "asia", "unknown"],
range: [ "#7feb00", "#ffe700", "#00d5e9", "#ff5872", "#ffb600" ]
},
width,
height,
marks: [
Plot.dot(data, {
filter: f => f.time === year,
x: "gdp_pcap",
y: "lex",
strokeWidth: 1,
stroke: "black",
fill: "world_4region",
r: "pop",
opacity: 0.8,
tip: true,
title: "name"
})
]
})