【HTML】Canvasを使用するのに良さそうなライブラリを探したい
候補
Fabric.js
const canvas = new fabric.Canvas('canvas'); canvas.add( new fabric.Rect({ width: 100, height: 200, left: 100, top: 100, fill: 'red' }) );
こうするとオブジェクトをドラッグして移動できる。
Konva.js
const box = new Konva.Rect({ x: 50, y: 50, width: 100, height: 100, fill: "#4169e1", // 塗りつぶし stroke: "#000", // 枠線の色 strokeWidth: 1, // 枠線の太さ draggable: true, // ドラッグ移動可否 });
draggable:true
とすることでオブジェクトの移動が可能となる。
うーんどれがいいのだか。