4 ms·
Sounds like you need a library like ART, which is described as a "Retained mode vector drawing API designed for multiple output modes". https://github.com/sebm
by spicyj 13y ago
Sounds like you need a library like ART, which is described as a "Retained mode vector drawing API designed for multiple output modes".
https://github.com/sebmarkbage/art https://github.com/sebmarkbage/art
Essentially, you write your drawing code once and it can render to Canvas, SVG, or VML depending on what you need. It doesn't yet have great documentation or a ton of examples, but it's in use at Facebook in their ads management and the page insights interface.
There's even bindings to Facebook's React (http://facebook.github.io/react/ http://facebook.github.io/react/) drawing library which is a declarative library for building efficient, reusable view components: https://github.com/facebook/react-art https://github.com/facebook/react-art. I haven't had a chance to play around too much yet but it looks very promising.