This also required some performance improvements, which resolves #59, since the animation requests were really bogging down the page when the sliders were moved. It also led to a better understanding of the animation frame requests.
Changes:
Redraw canvases on change event rather than input event (only redraw after a value is selected on the slider, not while sliding)
Stop animations when video is paused
Separate redraw behavior from animation callback
The performance improvement is very obvious when clicking around on the trace and moving the brightness/contrast sliders. There isn't any more lag on the chart animations, slider animations, videos, etc, which occurred when moving the sliders a lot. Previously my computer also ran really hot due to all the animation requests when doing this, which also no longer occurs. If you examine the animationFrameId in the console, you'll see that it no longer increments unless the video is playing.
This also required some performance improvements, which resolves #59, since the animation requests were really bogging down the page when the sliders were moved. It also led to a better understanding of the animation frame requests.
Changes:
The performance improvement is very obvious when clicking around on the trace and moving the brightness/contrast sliders. There isn't any more lag on the chart animations, slider animations, videos, etc, which occurred when moving the sliders a lot. Previously my computer also ran really hot due to all the animation requests when doing this, which also no longer occurs. If you examine the animationFrameId in the console, you'll see that it no longer increments unless the video is playing.