Public
Edited
Apr 27, 2023
Insert cell
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
import {printTable} from '@jonfroehlich/data-utilities'
Insert cell
import {printTableTypes} from '@jonfroehlich/data-utilities'
Insert cell
Insert cell
Insert cell
Insert cell
seattleWeatherFile = FileAttachment("seattle-weather.csv")
Insert cell
Insert cell
seattleWeather = seattleWeatherFile.csv()
Insert cell
seattleWeather
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
printTableTypes(seattleWeather)
Insert cell
seattleWeaherTyped = seattleWeatherFile.csv({typed: true})
Insert cell
printTableTypes(seattleWeaherTyped)
Insert cell
Insert cell
vl.markPoint().data(seattleWeaherTyped).render()
Insert cell
Insert cell
vl.markPoint()
.data(seattleWeaherTyped)
.render()
Insert cell
vl.markPoint()
.data(seattleWeaherTyped)
.encode(vl.x().fieldQ('temp_max').title("Max Temp"))
.render()
Insert cell
Insert cell
Insert cell
vl.markPoint()
.data(seattleWeaherTyped)
.encode(
vl.x().fieldQ('temp_min').title("Min Temp"),
vl.y().fieldQ('temp_max').title("Max Temp"))
.render()
Insert cell
Insert cell
vl.markCircle({opacity: 0.6})
.data(seattleWeaherTyped)
.encode(
vl.x().fieldQ('temp_min').title("Min Temp"),
vl.y().fieldQ('temp_max').title("Max Temp"),
vl.color().fieldN('weather'))
.render()
Insert cell
Insert cell
vl.markCircle({opacity: 0.6, tooltip: true})
.data(seattleWeaherTyped)
.encode(
vl.x().fieldQ('temp_min').title("Min Temp"),
vl.y().fieldQ('temp_max').title("Max Temp"),
vl.color().fieldN('weather').scale({range: ["#AEC7E8", "#C7C7C7", "#1F77B4", "#9467bd", "#E7BA52"]}),
vl.size().fieldQ('precipitation').scale({range:[4, 500]})
).render()
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