Public
Edited
Oct 2, 2023
Insert cell
Insert cell
Insert cell
Insert cell
choromap = vl.markGeoshape({stroke: '#aaa', strokeWidth: 0.25})
.data(vl.topojson(usa).feature('counties'))
.transform(
vl.lookup('id').from(vl.data(unemployment).key('id').fields('rate'))
)
.encode( //yellowgreenblue
vl.color().fieldQ('rate').scale({domain: [0, 0.3], type: 'quantize', clamp: true, scheme: {name:'inferno', count:9}}).legend({format: '%', title: 'Taxa de desempregados'}),
vl.tooltip().fieldQ('rate').format('.0%')
)
.project(vl.projection('albersUsa'))
.width(890).height(500)
.render()
Insert cell
unemployment = d3.tsv(datasets['unemployment.tsv'].url)
Insert cell
unemployment
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
usa = datasets['us-10m.json']()
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
datasets = require('vega-datasets')
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