Very good question. Ayman suggestion is good.
I've just installed calysto_processing
and noticed 3 things are necessary:
- installing the
calysto_processing
package via pip,
- running install on the
calysto_processing
package.
- installing Processing.
First point should be easy with requirements.txt
.
I'm unsure what the best option is for the second step (maybe a custom setup.py ?).
Step 3 feels the trickiest.
Installing Processing currently isn't supported with apt-get
so Dockerfile
might be way forward (even through mybinder
recommend that only as a last resort).
Let's assume a Dockerfile would contain all the steps to manually download/install processing (and I'm not super experienced with Docker at the moment btw), it will need to be executed which will require a windowing system to render the Processing window.
I don't know how well that plays with Docker, sounds like it's getting into virtual machine territory.
That being said, looking at the source code right here:
- Processing is used only to validate the sketch, and pull syntax errors to display them otherwise.
- ProcessingJS is used to actually render the processing code in a
<canvas/>
element within the Jupyter Notebook
I'm not sure what the easiest way to run the current calysto_processing
in mybinder
as is.
My pragmatic (even hacky if you will) suggestion is to:
- fork the project and remove the
processing-java
dependency (which means might loose error checking)
- install the cloned/tweaked version via pip/requirements.txt (pip can install a package from a github repo)
Update I have tried the above: you can run test kernel here

The source is here and the module is installed from this fork which simply comments out the processing-java
part.
In terms of the mybinder
configuration it boils down to:
- create a binder folder in the repo containing the notebook
- add requirements.txt which points to the tweaked version of
calysto_processing
stripped off the processing-java
dependency: git+https://github.com/orgicus/calysto_processing.git@hotfix/PJS-only-test
- add postBuild file which runs install on the
calysto_processing
module: python -m calysto_processing install --user
Notes
- With this workaround java error checking is gone
- Although Processing syntax is used it's execute as javascript and rendered in
<canvas/>
using ProcessingJS: this means no processing-java libraries, no threads or other java specific features,(buggy or no 3D),etc. just basic Processing drawing sketches
- It might be worth looking at replacing ProcessingJS with p5.js and checking out other JS notebooks ? (e.g. Observable or IJavascript)