☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Access canvas of a figure via JS

Community Support
Maxxner
Maxxner

I am trying to access the canvas of a figure via JS but that does not seem to be possible (I am probably overlooking something).
Sofar I am using const canvas_arr = document.getElementsByTagName('canvas'); which returns all canvas. However with that I can’t really match a figure and its canvas, as the canvas has no ID.
Anyone got an idea how to get the canvas elements of a figure?

⌁   Link to post
Bryan
Bryan

Not missing an anything, this is just not intended usage. The intent is that Bokeh controls the canvas. You might be able to do something like add a unique css_classes to the plot model, then find the canvas element that is contained within the div the has that class added. Really, though if you want to access the canvas, the better options are:

⌁   Link to post

End of archived discussion · Replies are disabled