Public
Edited
May 14
Insert cell
Insert cell
Insert cell
Insert cell
countries = data['countries.json']()
Insert cell
countries
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
bar_vega_lite = {
const bars = vl.markBar()
.data(countries)
.encode(
vl.x().average('life_expect'),
vl.y().fieldN('country')
.sort(vl.average('life_expect').order('descending'))
)
return bars.render()
}
Insert cell
Insert cell
scatter = {
const scatter = vl.markCircle()
.data(countries)
.transform(
vl.filter('datum.year == 1980 || datum.year == 1990 || datum.year == 2000')
)
.encode(
vl.x().fieldQ('fertility').title('Fertility'),
vl.y().fieldQ('life_expect').title('Expectativa de Vida'),
vl.size().value(100),
vl.column().fieldO('year').title('Ano')
)
.width(300)
.height(300)
.title('Fertilidade vs Expectativa de Vida (1980, 1990, 2000)')
return scatter.render()
}

Insert cell
Insert cell
> Modifique esta célula com o link: https://brenofernandes-pdf.github.io/datavis2025/export.html
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
data = require('vega-datasets')
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