Plot.plot({
grid: true,
width: width,
height: 800,
inset:40,
color: {
domain:[-30,60],
type: "diverging",
scheme: "RdBu"
},
x: {
label: "fallecidos c/100k hab (último mes) →",
tickFormat: t=>d3.format(".1r")(t*1e5),
grid:null
},
y: {
label: "↑ Casos c/100k hab (último mes)",
tickFormat: t=>d3.format(".1r")(t*1e5),
grid:null
},
marks: [
Plot.dot(datos, {
y: "2010",
x: d=>d["2021"]/d["2010"],
fill: "silver",
stroke: "white"
}),
Plot.text(datos, {
filter: f=>(f["2010"]>5e5) ,
y: "2010",
x: d=>d["2021"]/d["2010"],
text: "Departamento", dy: -6})
]
})