Published
Edited
May 21, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
minvalue = 0
Insert cell
Insert cell
last_column = dfcsv.columnNames()[dfcsv.columnNames().length - 1]
Insert cell
dfcsv = aq.loadCSV(dataurl)
Insert cell
Insert cell
Insert cell
municipio_order = {
return municipio_order_complete
.objects()
.slice(0,50)
}
Insert cell
max_mun = aq.agg(df.groupby(['municipio']).rollup({ total: d => op.sum(d.selected)}), d => op.max(d.total))
Insert cell
Insert cell
nombres = indice_csv2.orderby('nombre_comun').select('nombre_comun').objects().map(d => d.nombre_comun)
Insert cell
Insert cell
dfo = {
return df
.select('dep', 'municipio', 'mes', column)
.filter(aq.escape(d => d[column] > 0))
.derive({ mes: aq.escape(d => new Date(d.mes))})
.derive({ color: aq.escape(d => colores[d.dep])})
.objects()
}
Insert cell
nonempty
Insert cell
dfo2 = {
if (is_sex_compare) {
return df
.derive({ mes: aq.escape(d => new Date(d.mes))})
.derive({ color: aq.escape(d => colores[d.dep])})
.derive({ s0: aq.escape(d => d[sex_compare[0]] + Math.random() * .3)})
.derive({ s1: aq.escape(d => d[sex_compare[1]] + Math.random() * .3)})
.objects()
} else {
return null
}
}
Insert cell
municipio_vista = {
return df
.filter(aq.escape((d) => d.municipio == munselect))
.objects()
}
Insert cell
Insert cell
Insert cell
import { aq, op } from '@uwdata/arquero'
Insert cell
sex_cols = d3.json('https://mauforonda.github.io/vigilancia-epidemiologica/resources/column_compare_sexo.json')
Insert cell
is_sex_compare = valid_comparisons.length > 0
Insert cell
Insert cell
sex_max = {
if (is_sex_compare) {
return d3.max([d3.max(dfo2.map(d => d.s0)), d3.max(dfo2.map(d => d.s1))])
} else {
return null
}
}
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