https://github.com/advancedclimatesystems/snap.svg.rotate
Adds a rotate method to Snap.Element
https://github.com/advancedclimatesystems/snap.svg.rotate
Last synced: 9 months ago
JSON representation
Adds a rotate method to Snap.Element
- Host: GitHub
- URL: https://github.com/advancedclimatesystems/snap.svg.rotate
- Owner: AdvancedClimateSystems
- License: mpl-2.0
- Created: 2015-09-07T10:59:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-12T13:54:37.000Z (over 9 years ago)
- Last Synced: 2025-06-16T06:50:47.118Z (10 months ago)
- Language: JavaScript
- Homepage: https://github.com/AdvancedClimateSystems/snap.svg.rotate
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snap.svg.rotate
Adds a `rotate` method to `Snap.Element`. It should on any element, scaled or
transformed in any way. If it does not: please report an issue.
## Usage
A `rotate` function is added to the `Snap.Element` prototype, which can be used
simply like this:
// 90 degrees clockwise
element.rotate(90);
// 90 degrees counter-clockwise
element.rotate(-90);
An event is emitted after rotating the element, which can be used like this:
// Catch-all for rotation events. If you want to only listen to the event
// for one element, replace the * with the id of the element. this in the
// of the callback is the rotated element.
eve.on('snap.rotated.*', function() {
console.log(this, 'was rotated');
});
element.rotate(20);
## Installing
Our preferred method of installing this is through `npm`:
npm install snap.svg.rotate
Although you can also install this by using `bower`:
bower install snap.svg.rotate
Or just download the source file and include it *after* Snap.svg.
## License
This plugin is licensed under the Mozilla Public License v2.0.