Growraf (pronounced grow-rough) is a plugin for flot charts, that produces smooth animations using requestAnimationFrame wherever possible.
Its a fork of the Growing plugin for flot, from Jürgen Marsch.
The API is the same with Growing plugin except from the steps & stepDelay combination. There is a new option named "duration" (in ms) that simplifies the rAF implementation and provides greater control.
Growraf ReAnimate animating a plot between redraws.
Added the ability to reanimate a plot to new datapoints, by using setData() & draw().
Added a 'growFinished' event that is triggered on the plot's placeholder.
var $placeholder = ;$placeholder;$;
Read the Documentation here.
0.5.0 Add support for horizontal bar charts.
0.4.6 Lint source with JSHint and release a bower package.
0.4.5 Introduced reanimate feature. Code restructuring, cleanups & performance improvements.
0.4.0 Initial version implementing rAF. Used for several unrecorded bug fixes and performance improvements.
Does it work on browsers not supporting requestAnimationFrame?
Yes, Growraf checks if the current browser supports requestAnimationFrame (prefixed or not) and (if there is no support) fallbacks to setTimeout.
Some of the browsers that the setTimeout polyfill is used include:
- IE <= 8
- Safari <= 5.1
- Opera (12.1 as of writing this)
- Firefox < 4.0
- Chrome < 10.0
- Based on paulirish's gist for the setTimeout polyfill.
- Does not polyfill requestAnimationFrame for the rest of page, just for growraf.
Does it work in oldIE?
Yes, as long as exCanvas is provided, it should work.
BUT instead of delivering a choppy animation, I strongly suggest you to disable animations for those browsers by checking if window.G_vmlCanvasManager is defined and setting the series.grow.active property to false.