Published
Edited
Jul 8, 2021
Insert cell
Insert cell
Plot.plot({
grid: true,
width: width,
height: 800,
inset:60,
marginLeft:70,
color: {
domain:[-30,60],
type: "diverging",
scheme: "RdBu"
},
x: {
label: "Población 2010 →",
//tickFormat: t=>d3.format(".1r")(t*1e5),
grid:null
},
y: {
label: "↑ porcentaje de crecimiento 2010 → 2021",
tickFormat:"%",
grid:null


},
marks: [
// Plot.link([1], {
// x1: () => 0,
// y1: () => 0,
// x2: () => 0.0002*5,
// y2: () => 0.01*5
// }),
Plot.ruleY([0]),

Plot.dot(datos, {
x: "2010",
y: d=>(d["2021"]-d["2010"])/d["2010"],
fill: "silver",
stroke: "white"
}),
Plot.text(datos, {
filter: f=>(f["2010"]>4e5 || (f["2021"]-f["2010"])/f["2010"]>0.4 || (f["2021"]-f["2010"])/f["2010"]<-0.2 ) ,
x: "2010",
y: d=>(d["2021"]-d["2010"])/d["2010"],
text: t=>t.Departamento + "("+t.Provincia+")", dy: -6})

]
})
Insert cell
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.link([1], {
// x1: () => 0,
// y1: () => 0,
// x2: () => 0.0002*5,
// y2: () => 0.01*5
// }),

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})

]
})
Insert cell
datos = d3.csvParse(await FileAttachment("Proyección población.csv").text(), d3.autoType)
Insert cell
renaperCleaned = renaper.map(d=>{return{
parent: d.ndp,
denominacion : d.ndd,
renaper: +d.ca3_18a59 + (+d.ca3_60ym),
// indec : Object.values(indec).filter(e=>e.parent == d.ndp).filter(r=>r.denominacion==d.ndd)[0]
}
})
Insert cell
renaper= d3.csvParse(await FileAttachment("Poblacion_x_Dpto2020_MinInterior.csv").text(), d3.autoType)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more