# ember-signature-pad

> Ember-cli addon component that allows for users to draw their own signature in a canvas element.

Latest version **0.3.4** (published 2020-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-signature-pad
pnpm add ember-signature-pad
yarn add ember-signature-pad
bun add ember-signature-pad
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2020-02-06 |
| First published | 2015-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 8.* \|\| >= 10.* |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matthew Bennett |
| Maintainers | mtbennett |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-signature-pad
- Repository: https://github.com/practicefusion/ember-signature-pad
- Homepage: https://github.com/practicefusion/ember-signature-pad#readme
- Issues: https://github.com/practicefusion/ember-signature-pad/issues
- npm.io page: https://npm.io/package/ember-signature-pad

## Dependencies (1)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^7.7.3

## Recent versions

- 0.3.4 (latest) — 2020-02-06
- 0.3.3 — 2018-10-09
- 0.3.2 — 2018-10-09
- 0.3.1 — 2018-10-09
- 0.3.0 — 2018-10-09
- 0.2.0 — 2017-04-28
- 0.1.1 — 2016-01-26
- 0.1.0 — 2015-11-19
- 1.0.0 — 2015-11-18

## README

# ember-signature-pad

This is an ember-cli addon component that allows for users to draw their own signature in a canvas element.


Compatibility
------------------------------------------------------------------------------

* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Node.js v8 or above


Installation
------------------------------------------------------------------------------

```
ember install ember-signature-pad
```


Usage
------------------------------------------------------------------------------

```javascript
import { A } from '@ember/array';
import { computed } from '@ember/object';
import Controller from '@ember/controller';

export default Controller.extend({
    color: '#0000ff',
    height: 68,
    weight: 1,
    width: 386,
    signature: computed(function () {
        return A();
    }),
    stringifiedSignature: computed('signature.[]', function() {
        return JSON.stringify(this.get('signature'));
    }),
    actions: {
        reset() {
            this.set('signature', A());
        },
        undo() {
            let lastNewLine;
            this.get('signature').forEach((item, index) => {
                if (item[0] === 1) {
                    lastNewLine = index;
                }
            });
            this.set('signature', A(this.get('signature').slice(0, lastNewLine)));
        }
    }
});

```

```handlebars
{{signature-pad
    color=color
    weight=weight
    value=signature
    height=height
    width=width
}}
{{input type="color" value=color}}
{{input type="number" value=weight}}
<button {{action "reset"}}>Reset</button>
<button {{action "undo"}}>Undo</button>
<div><code>{{stringifiedSignature}}</code></div>
```

Contributing
------------------------------------------------------------------------------

See the [Contributing](CONTRIBUTING.md) guide for details.


License
------------------------------------------------------------------------------

This project is licensed under the [MIT License](LICENSE.md).

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