Skip to content
Paper.js based selection tool.
JavaScript
Branch: master
Clone or download
jmatt Merge pull request #2 from lsst-epo/tickets/EPO-973
[EPO-973] Support multipe skyviewer widgets.
Latest commit 671f7c2 Jul 12, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
examples [EPO-973] Support multipe skyviewer widgets. Jul 11, 2018
src [EPO-973] Support multipe skyviewer widgets. Jul 11, 2018
.gitignore Add .gitignore. May 15, 2018
LICENSE Initial commit May 8, 2018
README.md [EPO-973] Support multipe skyviewer widgets. Jul 11, 2018
package-lock.json
package.json [EPO-973] Support multipe skyviewer widgets. Jul 11, 2018
webpack.config.js [EPO-662] Create JavaScript library for selection tool. May 17, 2018
yarn.lock [EPO-973] Support multipe skyviewer widgets. Jul 11, 2018

README.md

paper-select-tool

npm version

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'),
    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.

You can’t perform that action at this time.