Inspired by:
This Demo is based on Previous One and add interactive feature on canvas.
Moving mouse on canvas hovered circle will be highlighed. I create an offscreen canvas that has the same dimmension as the presentation canvas. Offscreen canvas will be rendered ahead of the presentation one so that we can detect which circle the mouse hovered by ctx.getImageData(mouseX, mouseY, 1, 1).
Click on canvasImg will reveal the current offscreen canvas in an <img> node.
Once count is changed that will generate new circles and update canvas. The performance monitor will show the rendering frequency.
https://cdnjs.cloudflare.com/ajax/libs/d3/5.12.0/d3.min.js
https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.6/dat.gui.min.js