Public
Edited
Oct 20, 2023
1 fork
Importers
13 stars
Insert cell
Insert cell
Insert cell
Insert cell
p5((sketch) => {
sketch.setup = () => {
const c = sketch.createCanvas(width, 400, sketch.WEBGL)
}
sketch.draw = () => {
   sketch.background(0)
sketch.rotateX(sketch.frameCount * 0.01)
sketch.rotateY(sketch.frameCount * 0.01)
sketch.noFill()
sketch.stroke(255)
sketch.torus(100, 50)

// sketch.noLoop()
 }
})
Insert cell
Insert cell
function* p5(sketch) {
 const element = DOM.element('div')
yield element
const instance = new P5(sketch, element, true)

return element
}
Insert cell
Insert cell
P5 = require('https://unpkg.com/p5/lib/p5.js')
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