Public
Edited
Apr 28, 2023
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 in Seattle (2012-2015)")
.encode(vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'))
.render()
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Daily Max Temperatures in Seattle (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("Histogram of Daily Max Temperatures in Seattle (2012-2015)")
.encode(vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]))
.render()
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Daily Max Temperatures in Seattle (2012-2015)")
.encode(vl.x().fieldQ('temp_max').bin(true),
vl.y().aggregate('count'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]),
vl.column().fieldN('weather'))
.width(180)
.height(170)
.render()
Insert cell
Insert cell
Insert cell
vl.markPoint()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('temp_max')
).render()
Insert cell
Insert cell
vl.markCircle()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('temp_max'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]))
.render()
Insert cell
Insert cell
vl.markCircle()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('temp_max'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]),
vl.size().fieldQ('precipitation').scale({range:[5, 350]}))
.render()
Insert cell
Insert cell
vl.markCircle()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.x().fieldT('date').timeUnit('monthdate'),
vl.y().fieldQ('temp_max'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]),
vl.size().fieldQ('precipitation').scale({range:[5, 350]}))
.render()
Insert cell
Insert cell
vl.markCircle()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.x().fieldT('date').timeUnit('monthdate'),
vl.y().fieldQ('temp_max'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]),
vl.size().fieldQ('precipitation').scale({range:[5, 350]}),
vl.column().fieldN('weather'))
.width(160)
.height(170)
.render()
Insert cell
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Daily Max Temperatures in Seattle (2012-2015)")
.encode(vl.x().fieldT('date'),
vl.y().fieldQ('temp_max'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]))
.render()
Insert cell
Insert cell
vl.markBar()
.data(seattleWeatherTyped)
.title("Histogram of Precipitation in Seattle (2012-2016)")
.encode(vl.x().fieldT('date'),
vl.y().fieldQ('precipitation'))
.render()
Insert cell
Insert cell
vl.markCircle()
.data(seattleWeatherTyped)
.title("Seattle Daily Max Temperatures 2012-2015")
.encode(
vl.y().fieldQ('precipitation'),
vl.x().fieldT('date'),
vl.color().fieldN('weather').scale({range: ["#e7ba52","#c7c7c7","#aec7e8", "#1f77b4","#9467bd"]}).sort(["sun", "fog", "drizzle", "rain", "snow"]))
.render()
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