I am trying to find out if d3 uses requestAnimationFrame animation by default for a callback or if I need to do it myself. For example, I defined a custom animation that repeatedly calls the redraw function to animate the transition from one domain to another on the chart (this is in coffeescript):
rd = @redraw
In all my other redraw calls, I plan it with requestAnimationFrame :
scheduleRedraw: =>
However, I wonder if I need to do the same here. I look at the source of d3 and see that the only reference to requestAnimationFrame is in the d3 timer class. Hope someone with some knowledge of d3 can answer the following questions:
- Is the d3 timer used worldwide for all d3 animations and transitions?
- Do I need to manually use
requestAnimationFrame here? If not, is there a case when I will ever need to use it when using d3?
Andrew Mao
source share