# sketchpad-mod

> A simple sketchpad project for drawing, saving and recovering picture easily

Latest version **1.1.6** (published 2017-02-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install sketchpad-mod
pnpm add sketchpad-mod
yarn add sketchpad-mod
bun add sketchpad-mod
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2017-02-03 |
| First published | 2017-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Dmitry Dulin |
| Maintainers | dmitry.dulin |
| Keywords | sketchpad |

## Links

- npm: https://www.npmjs.com/package/sketchpad-mod
- Repository: https://github.com/dulin666/sketchpad-mod
- Homepage: https://github.com/dulin666/sketchpad-mod#readme
- Issues: https://github.com/dulin666/sketchpad-mod/issues
- npm.io page: https://npm.io/package/sketchpad-mod

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) 3.1.1

## Recent versions

- 1.1.6 (latest) — 2017-02-03
- 1.1.5 — 2017-02-03
- 1.1.4 — 2017-02-02
- 1.1.3 — 2017-01-24
- 1.1.2 — 2017-01-24
- 1.1.1 — 2017-01-24
- 1.1.0 — 2017-01-24
- 1.0.9 — 2017-01-24
- 1.0.8 — 2017-01-24
- 1.0.7 — 2017-01-24
- 1.0.6 — 2017-01-24
- 1.0.5 — 2017-01-24
- 1.0.4 — 2017-01-24
- 1.0.3 — 2017-01-24
- 1.0.2 — 2017-01-24
- … 2 more at https://npm.io/package/sketchpad-mod/versions

## README

# sketchpad-mod [![npm version](https://badge.fury.io/js/sketchpad-mod.svg)](http://badge.fury.io/js/sketchpad-mod)
SketchpadMod this is a simple sketchpad project for drawing, saving and recovering picture easily.
[![NPM](https://nodei.co/npm/sketchpad-mod.png?downloads=true)](https://nodei.co/npm/sketchpad-mod/)

## Installation
Use npm:
```
npm install sketchpad-mod --save
```

## Usage

Having a canvas on the DOM:
```html
<canvas id="sketchpad-mod"></canvas>
```
You should simply configure it by instantiating the SketchpadMod:
```js
import SketchpadMod from 'sketchpad-mod';

const sketchpadMod = new SketchpadMod({
  element: '#sketchpad-mod',
  width: 400,
  height: 400
});
```
After that, the API provides a variety of functionalities:
```js
// undo
sketchpadMod.undo();

// redo
sketchpadMod.redo();

// Change color
sketchpadMod.color = '#FF0000';

// Change stroke size
sketchpadMod.penSize = 10;

// Playback each sketchpad stroke (10 ms is the time between each line piece)
sketchpadMod.animate(10);

// Set size for size canvas (one size for width and height)
sketchpadMod.setCanvasSize(100);

// Set size for size canvas (one size for width and height)
sketchpadMod.readOnly = true;

// Recover sketchpad JSON or Object Settings
sketchpadMod.toJSON();
sketchpadMod.toObject();

// By recovering the sketchpad JSON or Object you can then clone the sketchpad by coding:
const settings = sketchpadMod.toObject();
settings.element = '#other-sketchpad-mod';
const otherSketchpadMod = new SketchpadMod(settings);
```

---
_Source: https://npm.io/package/sketchpad-mod · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
