I wrote a html5 drag-and-draw canvas for creating some design diagrams.
The drag and draw part is in fact controlling objects that have very detailed positions or rendering info and every time draw on the canvas of all the managing objects, this is the same with gaming graphics, then keep interacting with the mouse cursor and calculate scope or layer that each object takes up in the canvas, and the canvas has 2d or 3d spaces and collision detection or all physics formulas could be applied to it.
Html5 has a new API other than in the past using timers to operate dom, window.requireAnimation in the recursion loop can be taken advantage of.