Live data from Hacker News

Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

konvajs.org

11–20 of 76 posts

Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

#11
post #6

For folks who have used this, why would you choose this instead of SVG inside React, Svelte, etc?

Main advantage of canvas is performance. If you have thousands of elements or if you are doing some complex animations SVG may become a performance bottleneck but in general it is a simpler solution that does the job.

Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

#15
post #10

Is this a community-driven project, or is there a company behind the project?

It is mostly community-driven.

Recently, I started to use a bit of my company resources to improve the konva project. Currently, I am playing with AI tools for docs, so I have to pay for API usage.

Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

#16

Is this the successor library for KineticJS and ConcreteJS? Kinetic was amazing back in it's day, but lacked SVG export. I wonder if that's built-in now

It is a fork of KineticJS. SVG export isn't implemented and I don't think it will be. I, personally, see it as out of the focus of the project.

Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

#17
post #6

For folks who have used this, why would you choose this instead of SVG inside React, Svelte, etc?

Take react / svelte/ etc out of the equation. The important question is why would you use canvas vs svg?

As a sibling comment noted, number of elements can be a big performance drag, since they all add weight in the DOM. Other considerations are animations- it's been a few years, but I recall a number of animations in SVG that would utterly destroy browser performance (I think it was animating a stroke with CSS but I could be wrong here).

There's a sibling trend of animation editors exporting to wasm/canvas as well; see for example Lottie and Rive.

Having settled on SVG vs canvas, and presuming you chose canvas, if you're already in react / svelte / etc, this library gives you a way to do so that fits in with what you're already doing.

Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

#19

Is this the successor library for KineticJS and ConcreteJS? Kinetic was amazing back in it's day, but lacked SVG export. I wonder if that's built-in now

SVG export feels like it would be borderline impossible. Raster graphics to vector?
Post reply on HN