English | 简体中文
Free-Draw
Free draw with canvas! Rectangle, circle, ellipse and polygon. Support zoom and offset!
Installation
Using npm:
$ npm i -g npm$ npm i free-draw
Usage
HTML:
JS:
API Document
Class - FreeDraw(options)
-
options {Object}:
- canvas: DOM Element
required
- eventsCallBack: {Function} Events hook function
- eventsReceive: {Array} <
mouseenter
|mouseleave
|mousemove
|keydown
|drag
>
- canvas: DOM Element
-
Returns: FreeDraw {Object}
-
Usage:
const freeDraw = canvas: document
Object - freeDraw
- Attributes
- canvas: DOM Element
required
- eventsCallBack: {Function} Events hook function
- eventsReceive: {Array} <
mouseenter
|mouseleave
|mousemove
|keydown
|drag
> - model: {String} Current model <
view
|edit
> - editingId: {String} Current editing shape id
- shapeInCanvas: {Object} Shapes in cavas
- canvas: DOM Element