0
JavaScript, ES6, 788 bytes
Not at all golfed, but finally came around to get this done. A lot of todos.
I am only counting the two canvas tags and the function f from the snippet below as part of the byte count. Rest of the stuff is for live demo
To watch it in action, just run the snippet bel...