nvd3-community/nvd3 — pull request #5 by petersondrew (2014-12-26 23:09:54+00:00)
Title: Bring non-webkit performance up to par

I've created a series of changes that bring non-webkit (FF, IE 10+) performance up to bar with webkit browsers. This was done mainly through the use of requestAnimationFrame, and batching DOM reads and writes into groups to prevent DOM thrashing. This was done using the [fastdom](https://github.com/wilsonpage/fastdom) library. It does bring fastdom in as a dependency, but I really do feel that the benefits outweigh the downsides to adding another dependency.

In my testing, which includes ~1000 x values for 4 series, I brought IE 11 up from a dismal 5-10 FPS to 50-60 FPS. This can be made nearly a solid 60 FPS if you swap out the content generator function with a React component. This was made possible by checking the return value of the content generator function for a falsey value, thus if you return false or null in your overridden content generator it will allow you to use something like React in your app to generate your tooltip content.

I also eliminated unnecessary creating/destroying of elements, such as the tooltip container, where possible. Further optimizations are possible by caching certain CSS values that trigger a style calculation (offsetwidth/height, innerwidth/height, [etc.](http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html)), but I didn't take it that far as simply reducing thrashing was more or less sufficient to achieve acceptable framerates.

**I did break a test for the line chart guideline** which I plan on fixing shortly (a race condition due to using fastdom I'm sure), but I wanted to get this out there for discussion and review in the meantime.

Please share your thoughts, not expecting this to be merged without some discussion first mainly due to the added dependency on fastdom.