p5.js Jupyter Widget
:warning: Disclaimer: this is a work in progress! :warning:
p5.js in the Jupyter Notebook using the Jupyter Widgets.
This project aims to be a follow-up of p5-jupyter-notebook, so that p5 can be used in JupyterLab (and in the classic Notebook) as a proper package.
p
in the sample sketch.The ideal goal (disclaimer: not implemented yet) would be to write code like this in a notebook cell:
class MySketch(BaseSketch):
W, H = 400, 400
def setup(s):
s.createCanvas(s.W, s.H)
s.rectMode(s.CENTER)
def draw(s):
s.background('#ddd')
s.translate(200, 200)
for i in range(4):
s.push()
s.rotate(s.frameCount / 200 * (i + 1))
s.fill(i * 5, i * 100, i * 150)
s.rect(0, 0, 200, 200)
s.pop()
sketch = MySketch()
sketch
See CONTRIBUTING.md