ember-paperjs
Ember components for using the excellent canvas SVG drawing library: PaperJS. A work in progress. Contributions welcomed.
Installation
ember install ember-paperjs
Usage
Initialise a blank Paper canvas
{{ paperjs-canvas }}
Events
onInit=(action "onBeforeEvent")
provides thecanvas
elementonInit=(action "onInitEvent")
provides thepaper
scope object
Create a Paper component that you can draw on
{{ paperjs-drawing }}
paperjs-drawing
Options for closed=true|false
// automatically close shapessmoothed=true|false
// smooth shapes when completesimplified=true|false
// simplify shapes when complete (should accept a tolerances but doesn't)compoundPaths=true|false
// Create compound shapes (like Illustrator--not like PaperJS). Drawing inside another shape creates a boolean subtraction.minDistance=5
// minimum drawing distance for each part of a pathmaxDistance=100
// maximum drawing distance for each part of a pathstrokeColor="black"
fillColor="rgba(255, 255, 244, 0.4)"
Events
onInit=(action "onBeforeEvent")
provides thecanvas
elementonInit=(action "onInitEvent")
provides thepaper
scope objectonClosed=(action "onClosedEvent")
provides the path and the scope
Contributing
Installation
git clone <repository-url>
cd ember-paperjs
npm install
Linting
npm run lint:js
npm run lint:js -- --fix
Running tests
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
Running the dummy application
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
License
This project is licensed under the MIT License.