☰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

Best Way to Have CustomJS Work With Variable Quantity of Bokeh Objects?

Community Support
Kyle_Marcroft
Kyle_Marcroft

Hello,

I love Bokeh’s ability to make standalone html files! However, I have not figured out how to send a list/collection/dictionary/whatever of Bokeh objects to a CustomJS method.

I recently had a Python project where I would create a simple line-and-marker plot for a set of 4 dimensional data. I had controls to allow you to set the vertical and horizontal axis to any of the 4 supported by the data. However, I sent each line-and-marker object to each CustomJS seperately with a hard coded name. As more data became available, I had to add in the code to deal with those additional sets by hand. It isn’t scalable.

I am contemplating writing a system in Python to write Python code with the appropriate CustomJS calls written out with all the necessary single bokeh objects referenced individually, along with the needed Javascript code needed. I am not looking forward to such a project.

Questions:

  1. Is there a better way than automating writing Python code to deal with a variable number of Bokeh objects being passed to CustomJS?

  2. Is there a maximum limit to the number of Bokeh objects that can be passed in a CustomJS call?

⌁   Link to post
Bryan
Bryan

What exactly have you tried? Offhand I might expect lists to work but not dicts, though AFAIK it’s never been officially supported as in, put under CI testing.

Otherwise, we hope to have this completed for 2.0:

⌁   Link to post

End of archived discussion · Replies are disabled