Published
Edited
Apr 28, 2022
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
seattleWeatherTyped = FileAttachment("seattle-weather.csv").csv({typed: true})
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Daily Max Temperatures (2012-2015)")
.encode(
vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count')
)
.render();
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("istogram of Daily Max Temperatures (2012-2015)")
.encode(
vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'),
vl.color().fieldN('weather')
)
.render();
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures (2012-2015)")
.encode(
vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'),
vl.color().scale({
scale: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).fieldN('weather').sort("descending")
)
.render();
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Daily Max Temperatures (2012-2015)")
.encode(
vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'),
vl.color().scale({
range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).fieldN('weather'),
vl.column().fieldN('weather')
)
.width(150)
.height(200)
.render();
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
vl.markPoint()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures (2012-2015)")
.encode(
vl.y().fieldQ('temp_max'),
vl.x().field('date').bin(true)
)
.render();
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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
import {toc} from "@jonfroehlich/collapsible-toc"
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