I joined a project last year which uses Konva inside an Angular application. It was my first time doing any kind of canvas programming, but the ergonomics of konva can be picked up quite rapidly and I've been enjoying quite a lot. We're working on performance-sensitive project, so one lesson we learned is that all shapes listen to all mouse events by default. We didn't even have lots of shapes, but this was enough to…
"We're working on performance-sensitive project" Konva looks awesome, but canvas based. For more performance I switched from canvas to pixi, which is webgl/webgpu based. Drawing can be also expensive there(in some cases even more so), but if you can manage to put it in a texture in time, you can have looooots of moving animated shapes even on mediocre mobile phones. https://www.goodboydigital.com/pixijs/bunnymark/
Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
71–76 of 76 posts
Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
#72Earlier quoted context omitted.
"We're working on performance-sensitive project" Konva looks awesome, but canvas based. For more performance I switched from canvas to pixi, which is webgl/webgpu based. Drawing can be also expensive there(in some cases even more so), but if you can manage to put it in a texture in time, you can have looooots of moving animated shapes even on mediocre mobile phones. https://www.goodboydigital.com/pixijs/bunnymark/
true, also declarative approach is amazing for wegbl, you need to draw many lines - pass start/end points in a buffer at once.
Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
#73Earlier quoted context omitted.
"We're working on performance-sensitive project" Konva looks awesome, but canvas based. For more performance I switched from canvas to pixi, which is webgl/webgpu based. Drawing can be also expensive there(in some cases even more so), but if you can manage to put it in a texture in time, you can have looooots of moving animated shapes even on mediocre mobile phones. https://www.goodboydigital.com/pixijs/bunnymark/
Impressive, it took me 113K bunnies for a single frame drop on an iPhone 14pro
Is this the new benchmark? “The new iPad can handle 200k bunnies”
Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
#74It's not a fork, just a different way to build the same project.
ES2015 module is more efficient than the other formats and can facilitate the creation of smaller bundle size through tree-shaking technique.
Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
#75Earlier quoted context omitted.
true, also declarative approach is amazing for wegbl, you need to draw many lines - pass start/end points in a buffer at once.
I wanted to do something like this, but have not found a nice way, yet. You do this by hand? Meaning writing the shader code yourself?
Re: Konva.js - Declarative 2D Canvas for React, Vue, and Svelte
#76Earlier quoted context omitted.
I wanted to do something like this, but have not found a nice way, yet. You do this by hand? Meaning writing the shader code yourself?
By hand or regl library (almost by hand). I tried THREE, but it feels it gives me more pain than benefits (and you still end up tweaking their shaders sometimes). AI is pretty good at small tasks like tweaking shaders. I needed to draw a spectroscope, like a line connecting all pixels on the image one by one on the colorspace projection. Ended up 100 times more efficient in webgl comparing to browser API. But it is p…