Published
Edited
May 11, 2021
Importers
3 stars
Insert cell
Insert cell
Insert cell
sketchWithP5((sketch) => {
// Setup
sketch.setup = function () {
sketch.createCanvas(600, 400);
sketch.background(255);
sketch.rectMode(sketch.CENTER);

sketch.noLoop(); // Remove this line if you need to animate
};

// Draw
sketch.draw = function () {
sketch.background(223, 0, 0);

sketch.translate(sketch.width / 2, sketch.height / 2);
sketch.strokeWeight(10);
sketch.stroke(255, 255, 0);
sketch.rect(0, 0, 200, 200);
};
})
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