Public
Edited
May 18
Fork of Encodings
Insert cell
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
Insert cell
abTemp = FileAttachment("Temperature_Anomaly@1.csv").csv()
Insert cell
Insert cell
Insert cell
vl.markPoint()
.data(abTemp)
.encode(
vl.x().fieldQ('Temperature_Anomaly')
)
.render()
Insert cell
vl.markPoint()
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly')
)
.render()
Insert cell
vl.markPoint()
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year')
)
.render()
Insert cell
vl.markPoint()
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.size().fieldQ('Temperature_Anomaly')
)
.render()
Insert cell
vl.markPoint()
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.size().fieldQ('Temperature_Anomaly'),
vl.opacity().value(0.3),
)
.width(600)
.render()

Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().fieldQ('Temperature_Anomaly'),
)
.width(600)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly'),
)
.width(600)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly').scale({"range": "diverging"}),
)
.width(600)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly').scale({
"domain": [-1,0,.05, 1.8],
"range": ["#0000ff","#88ccff","#f98d5d", "#ff0000"]}),
)
.width(600)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly').scale({
"domain": [-1,0,.05, 1.8],
"range": ["#0000ff","#88ccff","#f98d5d", "#ff0000"]}),
vl.tooltip().fieldO('Month')
)
.width(600)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly').scale({
"domain": [-1,0,.05, 1.8],
"range": ["#0000ff","#88ccff","#f98d5d", "#ff0000"]}),
vl.tooltip().fieldO('Month'),
vl.column().fieldO('Month').sort(["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"])
)
.width(200)
.height(150)
.render()
Insert cell
vl.markPoint({filled: true})
.data(abTemp)
.encode(
vl.y().fieldQ('Temperature_Anomaly'),
vl.x().fieldT('Year'),
vl.opacity().value(0.5),
vl.color().fieldQ('Temperature_Anomaly').scale({
"domain": [-1,0,.05, 1.8],
"range": ["#0000ff","#88ccff","#f98d5d", "#ff0000"]}),
vl.tooltip().fieldO('Month'),
vl.column().fieldO('Month').sort(["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"])
)
.width(200)
.height(150)
.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