Hacker News new | ask | show | jobs
by kreetx 363 days ago
SnapDOM can capture HTML elements as SVG - what are use cases for this?
2 comments

Yes, the default capture output is a svg dataurl. But there many other export options. This lib was made as an internal tool for another project called Zumly that is zoomable engine and the svg format was the faster output I found. But then I realized that could be an independent tool like html2canvas
Zumly seems to be really interesting idea - are there any real world examples?
I really hope there will be, but it's still experimental. If it works well, I think there could be use cases such as dashboards, home automation UIs, charts, or even industrial line control.

Zumly is actually a spinoff of ZircleUI, the first project I ever worked on. Zircle eventually split into Zumly (which is still a work in progress) and Orbit, a CSS tool that makes it easy to create any kind of radial design.

It seems like it would be a lot more efficient to use SVG for screenshot testing design system components rather than raster images.
The SVG in question contains HTML elements as <foreignObject> nodes and thus still depends on the browser to render them. A bitmap has zero dependencies, and can be processed and compared fully outside a browser.
Oh wow, I didn’t realise that. That means SVG output is way less useful than I expected.