Public
Edited
Dec 7, 2023
Insert cell
Insert cell
p5((s) => {
s.setup = function () {
s.createCanvas(width, height, s.SVG);
};
s.draw = function () {
s.background(255);
s.stroke(255, 0, 0);
s.rect(100, 100, 500, 300);
s.mouseClicked = () => {
s.saveCanvas("image", "svg");
};
};
})
Insert cell
svg = import('https://cdn.skypack.dev/p5.js-svg@1.5.1?min').then(d => d.default)
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