Public
Edited
Feb 17, 2024
Insert cell
Insert cell
import {vl} from "@vega/vega-lite-api-v5"
Insert cell
import {printTable} from "@uwdata/data-utilities"
Insert cell
earthquakes.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
printTable(earthquakes.slice(0,5))
Insert cell
vl.markLine()
// you can use other marks such as markPoint,markBar, markCircle and more....size-->mark size
.data(earthquakes) //using cars data
.encode(vl.x().fieldT('Date').timeUnit("utcyear"),
vl.y().mean("Magnitude"),
vl.color().field("Type")
)
.title('Representation of seismic events over the years')
.width(600) // width of the chart layout
.height(400)
.render() // to visualize/draw the chart
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