Plot.plot({
marginLeft: 50,
color: { domain: keys, scheme: "Warm", legend: true },
facet: { data: population, x: "state" },
y: { tickFormat: "s", grid: true },
x: { axis: null, domain: keys },
marks: [
Plot.ruleX(population, {
x: "key",
y: "population",
stroke: "key",
strokeWidth: 3
}),
Plot.dot(population, {
x: "key",
y: "population",
fill: "key",
r: 5,
sort: { fx: "y", reduce: "sum", reverse: true }
}),
Plot.ruleY([0])
]
})