Animated line drawing with HTML5, Canvas, and JavaScript

I am a math professor and would like to be able to produce graphs of mathematics functions (equations) as done in DESMOS.
I would also like to be able to animate them as demonstrated here (may not workin IE) (written in SVG)
I would like to do this with HTML5, Canvas, and JavaScript.
Please point me to appropriate tutorial or give me hints.