Published unlisted
Edited
Jan 25, 2022
Insert cell
Insert cell
chart4 = ("chart4",
vl
.markPoint({ opacity: 0.5, filled: true })
.data("data/penguins.json")
.encode(
vl
.x()
.fieldQ("Beak Depth (mm)")
.scale({ domain: [10, 25] }),
vl
.y()
.fieldQ("Beak Length (mm)")
.scale({ domain: [30, 65] }),
vl.size().fieldQ("Body Mass (g)"),
vl.color().fieldN("Species")
)
//.width("container")
.width(0.78 * width)
.height(0.4 * width) // fix the height to keep stability over missing data
.render())
Insert cell
import { vl } from "@vega/vega-lite-api-v5"
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