Home

Dave Utils for working with P5.js

This is a collection of utils I use with P5.js to make some of my sketches easier to work with.

It includes tools to work with:

How to use

Download the latest file utils.dave.p5.js or utils.dave.p5.min.js from the repository

In your index.html add library JS to your header, AFTER the p5.js library

<script src="p5.min.js"></script>
<script src="utils.dave.p5.min.js"></script>

This makes the classes in utils available to use in your sketch.js

Using a CDN:

if you prefer you can pull the library from a CDN with

<script src="https://cdn.jsdelivr.net/gh/sixhat/utils.dave.p5.js@master/lib/utils.dave.p5.min.js"></script>

Examples

  • Hilbert illustrates LSystems and Turtle graphics
  • Trails illustrates using a Menu and a Button

Documentation

The code has inline code, but you can also check the documentation online.

Note

This is a work in progress and still far from concluded (or fully documented).

In any case if you find it useful and want to contribute please create a pull-request and I'll gladly add new features/corrections to it.

Requirements

JSDoc

JSDoc should be installed in your system. Something like

npm install -g jsdoc

or

brew install jsdoc3

should do the trick

Minify

Minify is needed to make the JS lib small(ish).

brew install tdewolff/tap/minify

Prettier

Prettier for making both html and js ... well, that.

npm intall -g prettier

should do the trik.