Public
Edited
May 2
1 star
Insert cell
Insert cell
import {vl} from "@vega/vega-lite-api-v5"
Insert cell
import {printTable} from "@uwdata/data-utilities"
Insert cell
eqtn-output-transformed.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
populationData = FileAttachment("eqtn-output-transformed.csv").csv()
Insert cell
printTable(populationData.slice(0, 10))
Insert cell
vl.markLine()
.data(populationData)
.encode(
vl.x().fieldQ("time").title("Time"),
vl.y().fieldQ("val").title("Population"),
vl.color().fieldN("c").title("Constant (c)"),
vl.tooltip([
{ field: "time", type: "quantitative" },
{ field: "c", type: "nominal" },
{ field: "val", type: "quantitative" }
])
)
.width(500)
.height(300)
.render()

Insert cell
// Scatter plot
vl.markPoint({filled: true, size: 80})
.data(populationData)
.encode(
vl.x().fieldQ("time").title("Time"),
vl.y().fieldQ("val").title("Population"),
vl.color().fieldN("c").title("Constant (c)"),
vl.tooltip([
{ field: "time", type: "quantitative" },
{ field: "c", type: "nominal" },
{ field: "val", type: "quantitative" }
])
)
.width(500)
.height(300)
.render()


Insert cell
vl.markPoint({filled: true, size: 80})
.data(populationData)
.encode(
vl.x().fieldQ("time").title("Time"),
vl.y().fieldQ("val").title("Population"),
vl.column().field("c").sort(["1", "2", "5", "10", "20"]),
vl.color().fieldN("c").title("Constant (c)"),
vl.tooltip([
{ field: "time", type: "quantitative" },
{ field: "c", type: "nominal" },
{ field: "val", type: "quantitative" }
])
)
.width(400)
.height(250)
.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