@saransh184/canvas-flow
v2.0.2
Published
A minimalistic package to draw animated lines and arcs on canvas
Downloads
10
Maintainers
Readme
A utility that lets you easily draw animations using lines and circles. This also exposes all drawing functions as promises to which you can listen to.
💁 _Note: Requires browser support for Promises and ES6
Getting Started
$ npm i --save @saransh184/canvas-flow
import { CanvasFlow } from '@saransh184/canvas-flow';
Examples
let cnv = new CanvasFlow(ctx);
cnv.drawAnimatedBelzier({ x: 200, y: 200 }, { x: 200, y: 300 }, { x: 300, y: 400 }, { x: 200, y: 400 });
cnv.drawAnimatedArc(100,100,100,0,360);
cnv.drawAnimatedLine(100,100,200,200)
.then(x=>{
cnv.drawAnimatedLine(200,200,200,100)
cnv.drawAnimatedArc(0,0,100,0,360);
})
cnv.run();