Published
Edited
Apr 30, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart_embed = dos_columnas(blocks(viewof select_partido_2,chart8), blocks(viewof select_partido_3, chart9), "", "")
Insert cell
Insert cell
chart9 = ColombiaHexChart(datos_dep_partido_ganador, {
id: d => d.dep,
value: d => parseInt(d[select_partido_3]) / parseInt(d['Participación/Total votación']),
width_ : 400,
fontSize: 12,
colorScale: d3.scaleLinear().range(["#fff",colorEscala2 , colorEscala]),
scaleDomain: [0,0.25,0.5]
})
Insert cell
viewof select_partido_3 = Inputs.select(partidos.map(d=>d.original), {label: "Escoge un partido"})
Insert cell
Insert cell
datos_dep_partido_ganador
Insert cell
chart7 = Plot.plot({
marginLeft: 150,
marks: [
Plot.barX(datos_dep_partido_ganador, {x: select_partido, y: "Depto", fill: colorEscala ,sort: {y: "x", reverse: true}})
]
})
Insert cell
chart6 = ColombiaHexChart(datos_dep_partido_ganador, {
id: d => d.dep,
value: d => parseInt(d[select_partido]),
width_ : 400,
fontSize: 12,
colorScale: d3.scaleLinear().range(["#fff", colorEscala]),
})
Insert cell
Insert cell
datos_dep_partido_ganador
Insert cell
Insert cell
colorEscala2
Insert cell
import {dos_columnas, colorEscala, colorEscala2} from "@nestorandrespe/visualizando-datos-geograficos-de-colombia"
Insert cell
blocks = (chart_, chart2_) => {
return html`
<style>
.container_blocks {
}
.hijo {
border: 1px solid #dcdcdc;
}
.hijo svg {
max-width: 100%;
height: auto;
}
</style>
<div class="container_blocks">
<div class="hijo">
${chart_}
</div>
<div class="hijo">
${chart2_}
</div>
</div>
`
}
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more