Published
Edited
Apr 6, 2021
1 fork
4 stars
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
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
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
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//calcGeral = {
// let ret={}
// let loop=[...new Set(grad_matriculados_cor.map(d => d.Centro))]
// loop.forEach(centro=>{
// let ret2={}
// let loop2=[[grad_matriculados_cor,"racaCor"],[grad_matriculados_genero,"sexo"],[grad_matriculados_renda,"renda"]]
// loop2.forEach(([dados,atributo])=>{
// let dados_filtrados=dados.filter(d=>d.Centro==centro&&d.periodo>0&&d.periodo<3) //periodos 1 e 2
// let periodos=[...new Set(dados_filtrados.map(d => d.ano+"."+d.periodo))].sort() //obtem todos os periodos
// let opcoes=[...new Set(dados.map(d => d[atributo]))].sort() //obtem todos os valores possiveis do campo desejado
// let dados4=[]
// periodos.forEach(function(d){ //para cada periodo disponivel
// let novo={periodo:d} //cria objeto referente ao periodo
// let total=0 //inicializa total de alunos
// opcoes.forEach(function (e){ //para cada valor possivel de resposta
// let subtotal=dados_filtrados.filter(f=>f.ano+"."+f.periodo==d&&f[atributo]==e).map(f=>parseInt(f.QTD)||0).reduce((acc,val)=>acc+val,0) //obtem registro p tal resposta
// novo[converter4(e)]=subtotal //armazena qtd de alunos com tal resposta no novo objeto
// total+=subtotal //adiciona ao total de alunos do periodo (soma de todas as respostas)
// })
// novo.total=total //armazena total de alunos no periodo
// dados4.push(novo) //insere no final do array a ser retornado
// })
// //if (sellimpar4=="Sim") dados4=limpar4(dados4) //remove anos pouco significativos, se desejado
// // adiciona array com nomes das colunas ao array a ser retornado e ordena na ordem desejada
// dados4.columns=["periodo"].concat([...new Set(opcoes.map(d=>converter4(d)))]).sort((a,b)=>ordem4[a]-ordem4[b])
// ret2[atributo]=(selordem4=="Crescente")?dados4:dados4.sort((a,b)=>b.periodo-a.periodo) //ordena ordem (de)crescente de tempo
// })
// ret[centro]=ret2
// })
// return ret
//}
Insert cell
Insert cell
//function detalhe (categoria){
// //e.stopPropagation()
// if (dados4.columns.includes("Outros")){
// mutable dados4=prevdados4
// return
// }
// mutable prevdados4=dados4
// let ncolumns=dados4.columns.concat(["Outros"])
// mutable dados4=dados4.map(d=>{
// let ndado={}
// Object.entries(d).forEach(entry=>{
// if (["periodo",categoria,"total"].includes(entry[0]))
// ndado[entry[0]]=entry[1]
// else
// ndado[entry[0]]=0
// })
// ndado["Outros"]=d.total-d[categoria]
// return ndado
// })
// mutable dados4.columns=ncolumns //["periodo",click,"Outros"]
// return
//}
Insert cell
//mutable prevdados4=[]
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//dados55Sim={
// let ret={},sim
// bairros.forEach(d=>ret[d]=0)
// geo_dados55.forEach(d=>{ //para cada registro
// let norm=d.bairro.trim().toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "") //normaliza nome do bairro
// if (d.ano>=intervalo55[0] && d.ano<=intervalo55[1] //verifica se esta no intervalo de tempo desejado
// && !(d.bairro=="Centro"&&d.municipio!="Rio de Janeiro") //sem Centro de outro municipio
// && !(d.bairro=="Tijuca"&&d.municipio!="Rio de Janeiro") //sem Tijuca de outro municipio
// && !(d.bairro=="Copacabana"&&d.municipio!="Rio de Janeiro")){ //sem Copacabana de outro municipio
// sim=stringSimilarity.findBestMatch(norm,bairros).bestMatch //busca bairro mais similar
// if (sim.rating>=0.5) ret[sim.target]+=parseInt(d.QTD) //adiciona ao bairro a qtd
// }
// })
// return ret
//}
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//viewof ano62 = Scrubber(Array(2019 - ((filtro6=="Ingressantes")?1969:1976) + 1).fill().map((_, idx) => ((filtro6=="Ingressantes")?1969:1976) + idx), {delay: 1000, autoplay: false, loopDelay: 5000, initial:2019})
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
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
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
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
//data10={
// let data=[], filtr=grad_matriculados.filter(d=>d.ano>1970&&d.ano<2020) //remove anos incompletos
// filtr.forEach(raw=>{
// if (raw.periodo==0||raw.periodo==3) return //considera apenas periodos 1 e 2
// if (raw.curso.includes("EAD")) return //remove cursos de EAD
// let f=data.find(d=>d.date==raw.ano+"."+raw.periodo&&d.name==raw.curso) //procura se ja registrado
// if (f)
// f.value+=parseInt(raw["QTD-matriculados"]) //incrementa se encontrado
// else
// data.push({date:raw.ano+"."+raw.periodo,name:raw.curso,category:raw["Faculdade / Escola"]+"@"+raw.Centro,value:parseInt(raw["QTD-matriculados"])}) //insere se nova entrada
// })
// return data
//}
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
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
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
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
Insert cell
Insert cell
//termos=(filtro15=="artigos")?database_artigos.filter(d=>filtro15_3=="Todas"||d.areas.map(e=>e[0]).includes(filtro15_3)).map(d=>d[filtro15_2]).flat().map(d=>d.toUpperCase()):database_eventos.filter(d=>filtro15_3=="Todas"||d.areas.map(e=>e[0]).includes(filtro15_3)).map(d=>d[filtro15_2]).flat().map(d=>d.toUpperCase())
Insert cell
//data15 = d3.rollups(termos, group => group.length, w => w)
// .sort(([, a], [, b]) => d3.descending(a, b))
// .slice(0, (filtro15_2=="keywords")?500:100)
// .map(([text, value],i) => ({text, value, i}))
Insert cell
//temp={
// let artigos={},
// eventos={},
// grandes_areas=["Todas"].concat([...new Set(database_artigos.map(d=>d.areas).flat().map(d=>d[0]))])
// grandes_areas.forEach(grande_area=>{
// let termos=database_artigos
// .filter(d=>grande_area=="Todas"||d.areas.map(e=>e[0]).includes(grande_area))
// .map(d=>d[filtro15_2])
// .flat()
// .map(d=>d.toUpperCase())
// artigos[grande_area]=d3.rollups(termos, group => group.length, w => w)
// .sort(([, a], [, b]) => d3.descending(a, b))
// .slice(0, 500)
// .map(([text, value],i) => ({text, value, i}))
// })
// grandes_areas.forEach(grande_area=>{
// let termos=database_eventos
// .filter(d=>grande_area=="Todas"||d.areas.map(e=>e[0]).includes(grande_area))
// .map(d=>d[filtro15_2])
// .flat()
// .map(d=>d.toUpperCase())
// eventos[grande_area]=d3.rollups(termos, group => group.length, w => w)
// .sort(([, a], [, b]) => d3.descending(a, b))
// .slice(0, 500)
// .map(([text, value],i) => ({text, value, i}))
// })
// return {artigos,eventos}
//}
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
//[... new Set(database_eventos.filter(d=>i18n.getAlpha2Code(d["PAIS-DO-EVENTO"],"pt")==undefined).filter(d=>Object.keys(excecoes_paises).includes(d["PAIS-DO-EVENTO"])==false).map(d=>d["PAIS-DO-EVENTO"]))]
Insert cell
//database_eventos.filter(d=>d["PAIS-DO-EVENTO"]=="Britsh Indian Ocean")
Insert cell
Insert cell
//dados16={
// let conjDados=(filtro16=="Publicações")?database_artigos:database_eventos,
// atributo=(filtro16=="Publicações")?"PAIS-DE-PUBLICACAO":"PAIS-DO-EVENTO",
// dados16={}
// paises.forEach(d=>dados16[d]=0)
// conjDados.forEach(d=>{ //para cada registro
//excecoes
//if (d[atributo]=="Inglaterra") d[atributo]="Reino Unido"
//if (d[atributo]=="Coréia do Sul") d[atributo]="Coreia do Sul"
//if (d[atributo]=="Austria") d[atributo]="Áustria"
//if (d[atributo]=="Suiça") d[atributo]="Suíça"
//if (d[atributo]=="Grã-Bretanha") d[atributo]="Reino Unido"
//if (d[atributo]=="Belarus") d[atributo]="Bielorrússia"
//if (d[atributo]=="Escócia") d[atributo]="Reino Unido"
////if (d[atributo]=="Coréia do Norte") d[atributo]="Coreia do Norte"
//if (d[atributo]=="Emirados Árabes") d[atributo]="Emirados Árabes Unidos"
//if (d[atributo]=="Kuweit") d[atributo]="Kuwait"
//if (d[atributo]=="Malavi") d[atributo]="Malawi"
//if (d[atributo]=="Hong Kong") d[atributo]="Hong Kong, RAE da China"
//if (d[atributo]=="Bielorússia") d[atributo]="Bielorrússia"
//if (d[atributo]=="Irlanda do Norte") d[atributo]="Reino Unido"
//if (d[atributo]=="Gales") d[atributo]="Reino Unido"
//if (d[atributo]=="Formosa") d[atributo]="Taiwan"
//if (d[atributo]=="Bósnia") d[atributo]="Bósnia e Herzegovina"
//
// if (d[atributo] in excecoes_paises) d[atributo]=excecoes_paises[d[atributo]]
// let norm=i18n.alpha2ToNumeric(i18n.getAlpha2Code(d[atributo],"pt"))
// if (norm && norm in dados16) dados16[norm]+=1
// })
// return dados16
//}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//i18n=import("https://cdn.skypack.dev/i18n-iso-countries").then(module=>{
// d3.json("https://cdn.skypack.dev/i18n-iso-countries/langs/pt.json").then(lang=>module.registerLocale(lang))
// return module
//})
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
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//inep20102013=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20102013.csv")
Insert cell
//inep20142018ufrj=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018ufrj.csv")
Insert cell
//inep20142018macae=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018macae.csv")
Insert cell
//inep20142018caxaisxerem=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018caxiasxerem.csv")
Insert cell
//inep20142018ccje=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018ccje.csv")
Insert cell
//inep20142018ccmn=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018ccmn.csv")
Insert cell
//inep20142018css=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018ccs.csv")
Insert cell
//inep20142018cfch=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018cfch.csv")
Insert cell
//inep20142018cla=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018cla.csv")
Insert cell
//inep20142018ct=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018ct.csv")
Insert cell
//inep20142018multiunidade=d3.csv("https://raw.githubusercontent.com/lucasbarcellosoliveira/100AnosUFRJ/master/inep20142018multiunidade.csv")
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
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
//stringSimilarity=require('https://bundle.run/string-similarity@4.0.2')
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