☰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

Can a CustomJS modify a bokeh layout (column, row, etc...)?

Community Support
jnava
jnava

I’m trying to create a standalone report and add some kind of filtering/organization functionality, the report has a collection of figures/datatables assign to multiple column layouts. I tried implementing a CustomJS callback like the snippet below in order to change the children of a column layout. by inspecting the console, the change seems to take place however it is not rendered. Is something like this even possible? I don’t know what I’m missing.

Any help, pointers would be much appreciated.

cjs[i] = CustomJS(args=dict(column_layout=col[i], select=index, all_figures=figcol), code="""
// try to replace with appropiate figure?
column_layout.children[1] = all_figures.children[index]
""")
⌁   Link to post
Bryan
Bryan

I missed that you were updating the list in place up above. I think mateusz answered in the other topic, but to have an answer here in both places: Bokeh can only automatically detect changes “inside” containters on the Python side.

⌁   Link to post
jnava
jnava

Just to update on the solution of this thread. Per mateuz suggestion (on this thread CustomJS Callback), after modifying the callback

cjs[i] = CustomJS(args=dict(column_layout=col[i], select=index, all_figures=figcol), code="""
// Replace with appropriate figure
var children = [...column_layout.children]
children[1] = allfigs.children[index]
column_layout.children = children
""")

It now works as intended.

Thank you guys.

⌁   Link to post

End of archived discussion · Replies are disabled