Published unlisted
Edited
Dec 14, 2021
Insert cell
Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"
Insert cell
histogram = addTooltips( // imported from @mkfreeman/plot-tooltip above
Plot.rectY(
data,
Plot.binX(
{ y: "count", title: (elems) => `${elems.length} rows`},
{ x: "body_mass_g", thresholds: 20 }
)
).plot(),
// Set styles for the hovered element
{ fill: "red" }
)
Insert cell
data = FileAttachment("penguins.csv").csv({typed: true})
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