Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clemmy/wanda
Simple Javascript Gesture Recognition.
https://github.com/clemmy/wanda
gesture-recognizer javascript
Last synced: 4 months ago
JSON representation
Simple Javascript Gesture Recognition.
- Host: GitHub
- URL: https://github.com/clemmy/wanda
- Owner: clemmy
- Created: 2016-10-03T21:51:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-03T22:05:11.000Z (over 8 years ago)
- Last Synced: 2024-09-16T10:40:35.897Z (5 months ago)
- Topics: gesture-recognizer, javascript
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wanda
Wanda is a Javascript gesture recognition library based on the [$P recognizer](http://depts.washington.edu/aimgroup/proj/dollar/pdollar.html). It's written with the UMD pattern, so it can be used anywhere.
## Usage
```
npm install --save wanda
```Then, in your codebase,
```
import Wanda from 'wanda';const wanda = new Wanda();
wanda.train(id, data);
const result = wanda.recognize(data);
```### API
#### Wanda.train(id, data)
Add training data to wanda. ```id``` is a string identifier for the data. ```data``` is an array of strokes, where a stroke is an array of points. It will look something like this:
```
[
[{x: 30, y: 146}, {x: 106, y: 222}], // stroke 1
[{x: 30, y: 225}, {x: 106, y: 146}] // stroke 2
]
```#### Wanda.recognize(data)
Recognize a gesture. ```data``` is an array of strokes, where a stroke is an array of points, the same as described above. This method will return a result that looks like the following:
```
{
id: '',
score:
}
```## Development
Install the dependencies with
```
npm install
```## Running the tests
Testing for Wanda is done using [Ava](https://github.com/avajs/ava).
```
npm run test
```## Built With
* Javascript
* :heart:## License
This project is licensed under the MIT License.
## Acknowledgments
* Radu-Daniel Vatavu, University Stefan cel Mare of Suceava
* Lisa Anthony, University of Maryland—Baltimore County
* Jacob O. Wobbrock, University of Washington