Public
Edited
Apr 21, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(factors, { x: "num", y: "prod", fill: "fill"}),
Plot.frame()
],
y: {
domain: [...Array(yMax).keys()].map((y, _) => y + 2),
grid: false,
label: null
},
x: {
domain: [...Array(xMax).keys()].map((x, _) => x + 2),
grid: false,
axis: "top",
label: null
},
height: 600,
weight: 100
})
Insert cell
factors = [...Array(max).keys()].map((x, _) => x + 2).flatMap((x, _) =>
[...Array(max).keys()].map((y, _) => y + 1).map((y, _) => {
return { num: x, fill: x % 10, prod: x*y };
})
)
Insert cell
max = 100
Insert cell
xmax = 50
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