{
const xy = Plot.normalizeX("sum", {x: "population", y: "state", z: "state"});
return Plot.plot({
height: 660,
x: {axis: "top", percent: true, grid: true},
y: {axis: null},
color: {scheme: "spectral", legend: true},
marks: [
Plot.ruleX([0]),
Plot.ruleY(stateage, Plot.groupY({x1: "min", x2: "max"}, {...xy, sort: {y: "x1"}})),
Plot.dot(stateage, {...xy, fill: "age", title: "age", sort: {color: null}}),
Plot.text(stateage, Plot.selectMinX({...xy, textAnchor: "end", dx: -6, text: "state"}))
]
});
}