Description
Now that we have multiple regl-based traces sharing the same gl canvases and relying on the same global src/lib/clear_gl_canvases.js
routine, we'll need a better way to redraw things on updates (e.g. on selections but also restyle and relayout calls).
Here's an example from #2505, style
here is called during selections:
plotly.js/src/traces/splom/index.js
Lines 416 to 441 in a7b08b3
Here, we clear the canvases and redraw splom things with new selected/unselected batches, but then ooops we also need to add logic for scattergl traces in the splom method so that they don't disappear on splom updates.
So, I propose (and I'm sure @dy will find a way to improve this proposal) to store a graph-wide queue of regl module draw calls (e.g. fullLayout._reglDrawQueue
) that we could call everything we clear the canvases to update something. The new update sequence will (1) clear the canvases (or only parts of it if we can) (2) update selected buffers (3) call reglDrawQueue
to redraw all things.