Double canvases #12140
-
Just noticed in both 2.4 and 3.0 docs that gallery examples seem to have a second blank canvas under the canvas that is drawn on: These are "autoload" embeds but also seems the case in bokeh server apps and |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
A quick look through the code shows that there are indeed 2 canvases: bokeh/bokehjs/src/lib/models/canvas/canvas.ts Lines 97 to 98 in 530c735 A relevant PR is #9948. |
Beta Was this translation helpful? Give feedback.
-
Historically we used single canvas and HTML based annotations for overlays, but that was cumbersome at best (e.g. keeping canvas and HTML versions of those annotations in line with each other, if possible at all). Currently there are two canvases, the primary one for everything except overlays and one for overlays. This way, rapidly changing overlays (e.g. crosshair tool's spans) don't require expensive repaint of glyphs, etc. We could keep offscreen canvases and then paint those on a single canvas, but that would result in flickering if simple overpaint algorithm is used. Implementing anything more sophisticated seems to be more trouble than it's worth, given how well the current setup works. Also it's worth to note that |
Beta Was this translation helpful? Give feedback.
A quick look through the code shows that there are indeed 2 canvases:
bokeh/bokehjs/src/lib/models/canvas/canvas.ts
Lines 97 to 98 in 530c735
A relevant PR is #9948.