Published
Edited
May 27, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { data } from "@observablehq/plot-exploration-penguins"
Insert cell
import { addTooltips } from "@mkfreeman/plot-tooltip"
Insert cell
Histogram = (data, col, color = "#d3d3d3") => {
return addTooltips(
Plot.plot({
height: 100,
width: 240,
style: {
display: "inline-block"
},

marks: [
Plot.rectY(
data,
Plot.binX(
{ y: "count", title: (elems) => `${elems.length} rows` },
{ x: col, fill: "black" }
)
)
],
style: {
overflow: "visible"
}
}),
{ opacity: 1, fill: color }
);
}
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