In Pd-l2ork, I've added [draw] commands to data structures which implement a subset of SVG functionality. (Essentially its the same functionality most 2d APIs offer-- affine transformations, paths, and grouping.) I also have the usual mouse events which can be associated with each shape in the drawing. In fact, I just found out HTML5 has some touch events, so I'm going to test them out with my new RPI touchscreen. :)
As far as d3 and friends-- I think the thing to do is just load whatever framework along with webpd (or use that framework in my gui port), then send messages back and forth between the two.
In my port I'm just using the DOM fairly directly, but it's pretty easy to leverage any of the various frameworks under the hood to get more efficiency/expressivity in rendering the patch. The one danger I'd point out is adding features inside Pd proper. Even the very simple bbox calculation for Pd-Vanilla's scalars can quickly eat up cpu time and interrupt audio. The complexity it takes to get everything to "just work" from the same programming environment is evident from the number of processes running in a modern browser.
-Jonathan
On Sunday, September 13, 2015 10:49 AM, patrice colet <colet.patrice@free.fr> wrote:
Hello,
Le 13/09/2015 11:44, s p a écrit :
Hi Py,
I think WebPd core could definitely be used for that, and thus
the refactoring I am doing these days is a good thing as it
will create a good base to start these kind of projects.
Personally, I am not very familiar with graphics on the web
(especially when it comes to WebGL), but I am sure that for
anyone with a good experience in this, it should be pretty
straightforward, for example using one of the many good
libraries that make WebGL, SVG or canvas easier (d3.js,
three.js, ...), to replicate some GEM objects in WebPd. And
would be nice indeed! But I see this as something more in the
future ...
replicating datastructure might be a good start.
I've found out that gpointers provide a nice environment for
storing/interfacing Gem objects parameters, it's fast, easily
reliable for hardware storing, or streaming, one inconvenient might
be complexity of implementing.