camoconnell/lazy-line-painter — pull request #26 by inorganik (2014-12-10 06:23:40+00:00)
Title: Lazylinepainter 1.5!

Hi Cam. I ran across your project and thought it was really cool! I wanted to use it, but found I needed to tweak it and add some functionality to do what I wanted to do, and ended up doing a major overhaul. Below is what I did:

- Refactored to use `requestAnimationFrame()` instead of setIntervals -- this allows the you to do the following 2 things:
- `pauseResume` method - toggles pausing and resuming the animation.
- Draw all paths sequentially **or** simultaneously. This is boolean in the options - `drawSequentially`. For many paths (> ~60), it gets a little choppy because with Raphael each path() is a jQuery object. (Maybe you don't need Raphael? GreenSock uses CSS attributes stroke-dashoffset and stroke-dasharray to animate strokes on svg)
- Added an option to adjust the speed - `speedMultiplier`. For instance, `2` slows to half speed, `.5` makes it twice as fast.
- Optionally use a random color on each stroke with `useRandomColors`. This was for development testing purposes, but I made it optional for fun.
- Also, I cleaned up the code a little. I tried to respect your formatting and style as much as possible.

There is only one issue you may want to look at:

- Anti-aliasing is not working on the paths. I'm not sure why, and I haven't spent a lot of time troubleshooting it yet. Maybe you know how to fix it?

Suggestion:

Please open-source the svg to lazyline converter. That way, nerds like me can get their hands on it and make it so the conversion could be done in the init() method and all the svg parsed with javascript. Then users don't have to rely on the tool on your website.

File adds, edits and deletions:

- Removed the 1.4.1 uncompressed and minified files and added 1.5.0 uncompressed and minified files
- Updated the README to use markdown and include new functionality
- Added `rAF-polyfill.js` - this is an optional include for users who want to support older browsers like IE9. If you want you could just roll it in with the other code.

If you have any questions, don't hesitate to contact me.