The combination of both discussions triggered my brain somehow ...
I'm far from a canvas specialist, but I experienced in the past that it is not straightforward to draw on a canvas in server-side NodeJs. Most canvas related modules in npm have low level node.js libs written in c/c++ or are dependent on native modules (ImageMagick, Cairo, ...). The advantage is that those work very fast, but can be a real nightmare to install (as I already experienced myself).
When we would have a DOM tree on the server, you can e.g. compose an SVG drawing on the server. Or it becomes even cooler like in this gist where they use the d3.js library (in combination with jsdom) to draw a pie chart in the server side DOM tree:
But I have a bunch of questions:
I don't see any disadvantages? Perhaps anybody else sees a major issue...
[EDIT] Although I have no clue at all about the performance!
First thought that this should be added to our current SVG ui node (since I want to introduce there also a server side DOM tree), however it is also useful for people that don't use the dashboard. So I propose to create a new node.
Should the node be focussed on SVG drawings, or should it be a general DOM node?
- A general DOM node could offer non-SVG DOM related functionality. But I cannot think of any use cases at the moment? Perhaps others can find one?
- An SVG specific node on the other hand could offer D3 functionality out-of-the box.
Of course it could be a general dom node, which a.o. offers specific drawing functionality...
Thanks for thinking out loud !!