News for hackers. Stuff that matters.
Re:Konva.js - Declarative 2D Canvas for React, Vue, and Svelte by afavour on Wednesday March 19, 2025 @11:23AM (#43413230)
SVG export feels like it would be borderline impossible. Raster graphics to vector?
Re:Konva.js - Declarative 2D Canvas for React, Vue, and Svelte by solardev on Wednesday March 19, 2025 @12:16PM (#43413981)
The underlying shapes are defined by geometries (so vectors) and then rasterized to canvas. So the SVG export could happen before the rasterization.

There are other libs that are native SVG though, so why even use Konva? The benefit of Canvas is that it can be a lot, LOT faster than having multiple complex SVGs. SVG is especially slow on Firefox IIRC.

Re:Konva.js - Declarative 2D Canvas for React, Vue, and Svelte by tetris11 on Wednesday March 19, 2025 @01:22PM (#43414817)
SVG purely for image export, I'm not talking about animation features.

Konva to set the scene, SVG for final touches before you publish the image somewhere

Re:Konva.js - Declarative 2D Canvas for React, Vue, and Svelte by solardev on Wednesday March 19, 2025 @04:48PM (#43417173)
Seems like you could just use Figma if you want to build a static SVG for export. Konva is more for building interactive apps.
Re:Konva.js - Declarative 2D Canvas for React, Vue, and Svelte by simonsarris on Wednesday March 19, 2025 @11:16PM (#43419614)
I make a canvas-based diagramming library (GoJS) and implemented SVG export, and then a whole SVG renderer if you want the same scene in real-time. Generally if you're using HTML Canvas commands, you can engineer a perfect SVG equivalent. There are some really really really annoying edge cases with transforms, clipping, gradients, etc. But nothing is impossible :D