Plot.plot({
caption: "Fonte: Censo 2022 (IBGE)",
height: 500,
x: {
axis: null
},
y: {
grid: false,
label: "",
fontFamily: "Roboto"
},
marginLeft: 170,
marginRight: 100,
marks: [
Plot.axisY({ fontFamily: "Roboto", fontSize: 12 }),
Plot.text(dados, {
x: "populacao_2022",
y: "nome_municipio",
text: (d) => d3.format(".3s")(d.populacao_2022),
textAnchor: "start",
fontFamily: "Roboto",
fontSize: 12,
fontWeight: "bold",
dx: 10
}),
Plot.barX(dados, {
x: "populacao_2022",
y: "nome_municipio",
fill: "#C0C0C0",
sort: { y: "x", reverse: true },
fill: (d) => (d.nome_municipio == "Aracaju" ? "#d62828" : "#eae2b7")
}),
Plot.ruleX([0])
]
})