[cljsjs/p5 "1.7.0-0"] ;; latest release
[cljsjs/p5 "1.7.0-0"] ;; latest release
This jar comes with deps.cljs
as used by the Foreign Libs feature
of the ClojureScript compiler. After adding the above dependency to your project
you can require the packaged library like so:
(ns application.core
(:require cljsjs.p5))
The externs
were auto-generated by the Javascript Externs Generator and then hand edited. Mainly adding the functions defined nested in the main p5
class to the prototype of the appropriate classes. I'm not sure how necessary it was to do that because I discovered the error I was receiving during advanced compilation was actually related to a clash with a namespace, but it works!
For the 1.4.0 to the 1.7.0 update, any additions detected by the javascript externs generator were merged into the existing externs file. However, the generator tries to incorrectly remove quite a number of classes like p5.Vector, p5.Matrix that are present in the source, so this update manually accepted any additional externs that were added but ignored any removals.
This library is particularly tricky to generate externs for as it goes through it's own custom type checking/error checking pass and dynamically generates every method and class at runtime. The externs generator does not appear to understand this and excludes many classes and methods from it's output.
Learn about p5.js at https://p5js.org/ and lots of tutorials on The Coding Train
A wrapper library, p5-cljs, is in early development.