Public
Edited
Feb 15, 2024
6 forks
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Inputs.table(athletes)
Insert cell
Insert cell
Insert cell
dotplot = Plot.dot(athletes, { x: "weight", y: "height", stroke: "sex" }).plot()
Insert cell
Insert cell
Insert cell
Insert cell
data = FileAttachment("titanic3.csv").csv({ typed: true })
Insert cell
filteredData = data.filter((d) => {
if (passengerClass && d.pclass !== passengerClass) {
return false;
}
return true;
})
Insert cell
viewof passengerClass = Inputs.select(
new Map([
["All classes", null],
["1st class", 1],
["2nd class", 2],
["3rd class", 3]
]),
{ label: "Passenger Class" }
)
Insert cell
Plot.plot({
marks: [Plot.rectY(filteredData, Plot.binX({ y: "sum" }, { x: "age", fill: "steelblue" }))],
})
Insert cell
Insert cell
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