Public
Edited
Oct 6, 2023
Insert cell
Insert cell
P5 = require('p5')
Insert cell
function* p5(sketch) {
const element = DOM.element("div");
yield element;

const instance = new P5(sketch, element, true);

try {
while (true) yield element;
} finally {
instance.remove();
}
}
Insert cell
p5((s) => {
s.setup = () => {};

s.draw = () => {};
})
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