Published
Edited
Jan 18, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
grupoSeleccionado
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
esquemas.map(esquema => ({
nombre: esquema.id,
titulo_esquema: esquema.titulo,
poblacion: data[esquema.id] && data[esquema.id].poblacion || 0,
casos: data[esquema.id] && data[esquema.id][keys[indicadorSeleccionado].attr_absoluto] || 0,
incidencia: data[esquema.id] && data[esquema.id][keys[indicadorSeleccionado].attr_incidencia] || 0,
titulo: keys[indicadorSeleccionado].titulo,
unidad: keys[indicadorSeleccionado].unidad
}))
Insert cell
githubCommits = d3.json("https://api.github.com/repos/MinCiencia/Datos-COVID19/commits?path=output/producto89/incidencia_en_vacunados_edad.csv")
Insert cell
Insert cell
dataRaw_all_commits_mutiple_per_day = {
return Promise.all(githubCommits.filter(d => !ignoreCommits.includes(d.sha)).map(d => Promise.all([d.sha,d.commit.author.date, d.commit.message, getDelimitedData(d.sha)])))
}
Insert cell
dataRaw_all_commits_mutiple_per_day2 = {
return Promise.all(githubCommits.filter(d => !ignoreCommits.includes(d.sha)).map(d => Promise.all([d.sha,d.commit.author.date, d.commit.message, d3.csv(`https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/${d.sha}/output/producto89/incidencia_en_vacunados_edad.csv`)])))
}
Insert cell
getDelimitedData("ffc584e6ca464a7850d7767df72a5cfb15f4f730")
Insert cell
function getDelimitedData(commit) {
return new Promise((resolve, reject) => {
d3.text(`https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/${commit}/output/producto89/incidencia_en_vacunados_edad.csv`)
.then(text => {
if (text.match(/;/)) {
const parser = d3.dsvFormat(";")
resolve(parser.parse(text))
} else {
const parser = d3.dsvFormat(",")
resolve(parser.parse(text))
}

})
.catch(e => reject(e))
})

}
Insert cell
incidencia(dictPubSemanas["2021-11-10"]["31"], {esquema: "con esquema completo"})
Insert cell
function incidencia(data, options) {
const esquema = options && options.esquema || "con esquema completo";
const desenlace = options && options.desenlace || "caso";
const datosTotal = _.chain(data).filter(d => d.grupo_edad == "Total").groupBy(d => d.estado_vacunacion).value();
const record = datosTotal[esquema] && datosTotal[esquema][0]
const casos = record && (record[`casos_confirmados`] || +record[`casos_Casos`])
const fallecidos = record && (+record[`casos_def`] || +record[`casos_Fallecidos`])
const uci = record && (+record[`casos_uci`] || +record[`casos_UCI`])
const poblacion = record && (+record[`poblacion`] )

return {
caso: record && (100000 * casos / poblacion) || "",
uci: record && (100000 * uci / poblacion) || "",
fallecido: record && (100000 * fallecidos / poblacion) || "",
}
}
Insert cell
fechasPub = _.chain(dictPubSemanas).keys().sortBy().value()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
classes = ["sin_completo", "con_completo", "refuerzo"]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
semanaSeleccionada.semana
Insert cell
grupoSeleccionado.grupo
Insert cell
_.uniq(dataRaw.map((d) => d.semana_epidemiologica)).filter(
(d) => d == semanaSeleccionada.semana
)
Insert cell
_.chain(dataRaw)
.filter(
(d) => d.semana_epidemiologica == semanaSeleccionada.semana //&&
//d.grupo_edad == grupoSeleccionado.grupo
)
.value()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataRawText = d3.text("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto89/incidencia_en_vacunados_edad.csv")
Insert cell
separator = ","
Insert cell
dataRaw__ = {
const parser = d3.dsvFormat(separator);
return parser.parse(dataRawText)
}
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

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