I'm looking for a HTML5 canvas library to make an app like those, which one do you guys think would be the best for something like this?
None, figma is built with wasm + complex canvas manipulations, you won't find the advanced snapping feature in any js library
Answer has not changed from the past. Still pixijs.
There are a bunch of other libraries, but none as performant.
Canviskit is interesting, but the documentation is questionable at best.
Might also look into Flutter (or just Dart UI) which is using Dart and built on canvaskit.
javascript - HTML5: Framework/Library for Drag-and-Drop on Canvas - Stack Overflow
Favorite Canvas libraries?
Learning it from scratch right now. shudders at the math, the maaaaaath
More on reddit.comAn open-source lightweight JavaScript library to draw graphs, using the HTML canvas element
Very nice. r/visualization would love this.
More on reddit.comHow to implement different Javascript Canvas libraries in React
I've done a guide on how to use the Scrawl-canvas library in a React project here: https://scrawl-v8.rikweb.org.uk/how-do-i/add-to-a-react-project
More on reddit.comVideos
A great library that emulates objects with drag/drop, resize, rotate. It can also import SVG data which can help you with importing vector graphics.
The library is called fabric.js: https://github.com/kangax/fabric.js
You can see some demos and feel how it can suit you: http://kangax.github.com/fabric.js/demos/index.html
I don't have a library to suggest, but a technique that I've used is to add an invisible imagemap over the canvas. I then added area elements that correspond with the objects on the canvas.
Area tags react to all of the browser's native mouse events. This let you provide rich user interaction. Imagemaps are also supported by every mobile and desktop browser and performs better than any point-in-polygon algorithm implemented in javascript.
Ensuring that the area elements in the imagemap always line up with the objects show in the canvas does add some code complexity, but in practice it's not too difficult to overcome. Note, in Chrome you might run into some issues if you to change the coordinates of an area tag that's already in the DOM.
Here's a working example of this techinque: http://xavi.co/drag-shapes
And here's the code: https://github.com/Xavi-/Drag-Shapes
Hope this help.