Package Exports
- paper-select-tool
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (paper-select-tool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
paper-select-tool
A Paper.js 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.
npm i @jmatt/paper-select-tool
Usage
To use it, import it and use one of the selection tools.
import * as pst from 'paper-select-tool';
var core = document.getElementById('core');
var project;
window.onload = function() {
pst.lasso(core);
}
// ...
var things = [{ point: new paper.Point(100, 100),
id: 'big bada boom' }];
var inSelection = pst.hitFilter(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.