Published
Edited
Aug 4, 2022
1 fork
14 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = {
reset;
const xs = [1, 3, 5].map(d => w * d / 6);
const colors = ["#116F7C", "#4F5AB1", "#B9275B"];
return d3.range(3).map(d => {
const x = xs[d];
return {
fill: colors[d],
x,
head: geometric.polygonRandom(headVertices, Math.PI * r ** 2, [x, height / 2]),
mouth: geometric.polygonRandom(mouthVertices, Math.PI * r ** 2 / 6, [x, height / 2 + r / 3])
}
});
}
Insert cell
r = w / 8
Insert cell
height = r * 2 + 40
Insert cell
w = Math.min(800, width)
Insert cell
geometric = require("geometric@2.3.5")
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