3 ms·
SnapDOM can capture HTML elements as SVG - what are use cases for this?
by kreetx 1y ago
SnapDOM can capture HTML elements as SVG - what are use cases for this?
- jmm77 1y agoYes, 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
- postepowanieadm 1y agoZumly seems to be really interesting idea - are there any real world examples?
- jmm77 1y agoI 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.
- JimDabell 1y agoIt seems like it would be a lot more efficient to use SVG for screenshot testing design system components rather than raster images.
- nine_k 1y agoThe 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.
- JimDabell 1y agoOh wow, I didn’t realise that. That means SVG output is way less useful than I expected.