This is just a proof of concept. It probably would need working on to fit you full needs.
But it is to show a way of adding plots at the mouse click point.
When we clone within Hype. Hype is not aware of the cloned elements. Which means there can be some adverse results. I have hopefully countered two of these in this example.
1, You must always remove any Hype class names inherited from a cloned Hype element. If you do not the Hype js will at some point have it's brains exit sideways which is not pretty. One example will be if you try and go to a new scene , you will crash and burn with errors. Because hype is trying to account for the extra named class element and cannot.
2, Clicking on a cloned element with a click event added works fine. But although what ever click function you use should work. Hype will register the event as a click on the layer below the clone also. But will not get the position correct.
if you click on an existing plot it is removed correctly but because Hype does not know about the plots, it will think we have clicked some where on the plotter and add a new plot on the plotter in the region of the top left. To avoid this we do not create any plots that are going to be in the region that hype wants to then create these errant plots. see the JS for creating the plots
plot.hypetemplate.zip (44.1 KB)