Public
Edited
Apr 7, 2024
Insert cell
Insert cell
import {pizzaorders} from "@observablehq/data-vis-course-assignment"
Insert cell
pizzaorders
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
marks: [
Plot.areaY(pizzaorders, {x: "Type of Pizza", y: "Day of the Week"}),
Plot.ruleY([0])
]
})
Insert cell
ratio = pizzaorders.map(d => (d["orders"]/ d["total"])*100)
Insert cell
Plot.plot({
marks: [
Plot.barY(pizzaorders.filter(d => d.state === "CA"), {x: "day_of_week", y: "orders", fill: "red", sort: {x: "y", reverse: true}}),
Plot.barY(pizzaorders.filter(d => d.state === "NV"), {x: "day_of_week", y: "orders", fill: "blue", sort: {x: "y", reverse: 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