Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsst-epo/paper-select-tool
Paper.js based selection tool.
https://github.com/lsst-epo/paper-select-tool
Last synced: 4 days ago
JSON representation
Paper.js based selection tool.
- Host: GitHub
- URL: https://github.com/lsst-epo/paper-select-tool
- Owner: lsst-epo
- License: mit
- Created: 2018-05-08T22:59:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-12T05:48:42.000Z (over 6 years ago)
- Last Synced: 2024-08-09T20:43:37.096Z (3 months ago)
- Language: JavaScript
- Size: 582 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# paper-select-tool
[![npm version](https://badge.fury.io/js/paper-select-tool.svg)](https://badge.fury.io/js/paper-select-tool)
A [Paper.js](http://paperjs.org/) based selection tool.
Adds a Paper.js based tool to a canvas. Currently a lasso, rectangle and circle selection tool are implemented.
Install
-------The paper-select-tool library is available on npm.
```bash
npm i @jmatt/paper-select-tool
```Usage
-----To use it, import it and use one of the selection tools.
```javascript
import * as pst from 'paper-select-tool';var core = document.getElementById('core'),
settings;
window.onload = function() {
settings = Settings();
pst.lasso(settings, core);
}
// ...
var things = [{ point: new paper.Point(100, 100),
id: 'big bada boom' }];
var inSelection = pst.pointsFilter(settings, things);
// returns the filtered collection of objects with points in the selection.
```Examples
--------Examples can be found in the `examples` directory.
License
-------The MIT License. See the [LICENSE file](https://github.com/lsst-epo/paper-select-tool/blob/master/LICENSE).