Considering weisJ/jsvg instead of batik ?
Hi there, I was wondering if an alternative to batik could be considered ? In particular JSVG.
IntelliJ moved away from batik for SVG support and due to vulnerabilities. Maybe this project could make a similar switch ? I'm quite unfamiliar with this code base yet. And if JSVG would allow the same interactivity.
- https://youtrack.jetbrains.com/issue/IDEA-230850/SVG-viewer-based-on-CEF-instead-of-Apache-Batik
- https://youtrack.jetbrains.com/issue/IJPL-81/Switch-to-JSVG-for-SVG-icon-rendering
- https://github.com/weisJ/jsvg
Hi @bric3 , thanks for suggestion. We didn't consider JSVG for SVG rendering but it might be worth it to take a look. Our crucial requirement to such a framework is its reactiveness. I.e. any model property update should automatically update view. To your knowledge, does JSVG meet that req.?
That's a good question. I haven't played with such aspects of this library, I don't believe JSVG works that way but I may have missed something. Maybe @weisJ (sorry to ping you) can remove the doubt.
JSVG doesn't own the painting context the way Batik does, hence there is nothing on the library side to repaint if a property changes. An implementation would have to manually issue a repaint of a property is changed.
A different story is changing properties altogether. I have made some comments on how to achieve it for colours here and here. Other properties are a bit trickier but at least length should be able to be supported with only a few adaptions.
As I am not familiar with lets-plot what properties are we speaking of here. A handful selection or possible all properties. Are animations a requirement? What about interactivity?
This is about interactivity yes. Batik observes/reacts to any change in SVG: all properties and adding/removing of elements. We use this stuff to update content in tooltips and move them around.