@fabwcie/free-drawing
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

free-drawing

image

Inspired from drawer is totally rewritting and rethinking for better use to more complexe context. For simply use, i recommend to you to use drawer

📝 Check documentation here

Check demo here

Dependencies

Contribute

See Contribute guide

Install

yarn add @fabwcie/free-drawing

Use it

import { Drawer } from '@fabwcie/free-drawing';

const $el = document.getElementById('drawer-container');
const drawer = new Drawer($el, {
  /** optional options */
});

Available options

{
  id: 'drawer-' + Date.now(), // id for drawer
  tool: 'brush', // activate tool on init
  width: window.innerWidth, // width of drawer
  height: window.innerHeight, // height of drawer
  strokeWidth: 5, // width for drawing stroke
  strokeColor: '#000', // color for drawing stroke
  zoom: true, // enable/disable zoom on draw
  zoomWidget: true, // enable/disable zoom ui widget
  scaling: 1.11, // scaling on zoom
  autoSave: true, // for save draw state on localStorage automatically
  localStorageKey: 'free-drawing', // localStorage key used for store data
  opacity: 1, // opacity of draw
};

Readme

Keywords

Package Sidebar

Install

npm i @fabwcie/free-drawing

Weekly Downloads

4

Version

2.0.1

License

Apache-2.0

Unpacked Size

908 kB

Total Files

10

Last publish

Collaborators

  • fabwinkler