Published
Edited
Oct 11, 2022
Insert cell
Insert cell
Insert cell
Insert cell
dados = FileAttachment("dados-4.csv").csv()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Getcolor("GO","1864")// ela recebe uma sigla de estado e um dos anos e retorna uma cor.
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
states2 = FileAttachment("dados-4.csv").csv({typed: true})
Insert cell
anos = states2.columns.slice(1)
Insert cell
estadosPop = anos.flatMap(ano => states2.map(d => ({Região: d.Regiões, ano, população: d[ano]}))) // pivot longer
Insert cell
function rgb(r, g, b){
r = Math.floor(r);
g = Math.floor(g);
b = Math.floor(b);
return ["rgb(",r,",",g,",",b,")"].join("");
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {states_contour,states,path,br,topojson,d3_geo,d3} from "@arbezerra/brazil-map"
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