tonyketcham / p5-svelte

Easily add p5 sketches to a Svelte project 🍛 🌱
https://p5-svelte.netlify.app
MIT License
176 stars 7 forks source link

Add docs example with p5.SVG #125

Open tonyketcham opened 2 years ago

tonyketcham commented 2 years ago

Pen plotters + p5 + Svelte would be a great example that some may find inspiring. That was one of the founding pieces of inspiration for starting this project and I was disappointed that p5.SVG didn't support ESM/instance mode so I couldn't get an SVG runtime for p5 working w/ p5-svelte.

In a recent release, p5.SVG added support for those pieces 🥳

tonyketcham commented 2 years ago

Turns out that the instance mode does the thing where it's trying to mod p5 via accessing the window which Svelte no likey. This may not work or may need a custom shim within p5-svelte in order to support

Experimenting with this on https://github.com/tonyketcham/p5-svelte-svg