☰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't seem to figure out how to use dropdown to highlight data across multiple plots?

Community Support
RR_Turing
RR_Turing

I am plotting a number of trials for condition A on a single plot. I am also plotting the same number of trials for condition B on another plot on the same page. I’d like to set up a dropdown widget that contains the number of trials which, when a certain trial is selected from said dropdown, will highlight that trial number across both plots.

Every tutorial and guide I’ve encountered focuses on using dropdowns to change the plots themselves, not to simply select data within multiple plots. I’m a little lost.

You can view my code snippet here.

⌁   Link to post
Bryan
Bryan

You are the only person who could know what that mapping is. When multiple glyphs share a common ColumnDataSource it’s easy for Bokeh to have a reasonable default, namely all the glyphs share the same selection indices. But if they don’t share a CDS, then there is some arbitrary mapping between the indices of first and second data sources, and you are the only person who knows what that mapping is. The outline of a JS callback would look something like this:

cb = CustomJS(args=dict(s1=source1, s2=source2), code="""
    const s1_inds = s1.selected.indices

    const s2_inds = ..... // you have to compute this from s1_inds

    s2.selected.indices = s2_inds
""")

source1.selected.js_on_change("indices", cb)
⌁   Link to post

End of archived discussion · Replies are disabled