Public
Edited
May 14
1 fork
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
vl.markBar()
.data(countries)
.encode(
vl.x().fieldN('country').sort('-y').title("País"),
vl.y().fieldQ('life_expect').title("Expectativa de Vida (anos)")
)
.width(800)
.height(400)
.title("Expectativa de Vida por País")
.render()

Insert cell
Insert cell
{return vl.markPoint({ filled: true, size: 50 })
.data(countries)
.encode(
vl.x().fieldQ("life_expect").title("Expectativa de Vida (anos)"),
vl.y().fieldQ("fertility").title("Taxa de Fertilidade"),
vl.tooltip(["country", "life_expect", "fertility"]),
vl.column().fieldN("year").title("Ano")
)
.transform(
vl.filter(vl.field("year").oneOf([1980, 1990, 2000]))
)
.width(200)
.height(200)
.render();
}

Insert cell
Insert cell
[>https://lerneri.github.io/datavis-course/intro_web_vis/index.html](https://lerneri.github.io/datavis-course/intro_vega_lite/index.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