Skip to content

lsst-epo/paper-select-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Paper.js based selection tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published