☰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

callbacks on gridplot datasources

Community Support
Schaun_Wheeler
Schaun_Wheeler

I have a Bokeh app that includes a gridplot. The ColumnDataSource for each plot within the gridplot has a column named ‘id’. When any glyph in any plot within the gridplot is selected, I want to collect all of the values of the ‘id’ column for any selected records across all plots so I can use those later.

Can anyone suggest how to do this?

I’ve tried setting up on_change('selected', self, handler) on the source itself when creating the plot, as well as setting it up on the gridplot object as a whole, as well as setting it up within the setup_events method in the app class. I set up a break point within the handler itself as a sanity check, and that breakpoint never gets triggered when I select points (although if I run the python code manually and set a list of integers to the .selected attribute the handler it called and the break point triggered).

Thank you in advance for any suggestions you can offer.

⌁   Link to post
Fabio_Pliger
Fabio_Pliger

Hi Schaun,

Are you able to post some code that we can look at and try to help you? From what you describe (something similar to https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/selection_histogram.py) it should be working.

Cheers

Fabio

···

On Friday, May 1, 2015 at 3:15:17 AM UTC+2, Schaun Wheeler wrote:

I have a Bokeh app that includes a gridplot. The ColumnDataSource for each plot within the gridplot has a column named ‘id’. When any glyph in any plot within the gridplot is selected, I want to collect all of the values of the ‘id’ column for any selected records across all plots so I can use those later.

Can anyone suggest how to do this?

I’ve tried setting up on_change('selected', self, handler) on the source itself when creating the plot, as well as setting it up on the gridplot object as a whole, as well as setting it up within the setup_events method in the app class. I set up a break point within the handler itself as a sanity check, and that breakpoint never gets triggered when I select points (although if I run the python code manually and set a list of integers to the .selected attribute the handler it called and the break point triggered).

Thank you in advance for any suggestions you can offer.

⌁   Link to post
Schaun_Wheeler
Schaun_Wheeler

As of Bokeh 0.9.0 this no longer seems to be a problem. The callbacks work as expected.

···

On Thursday, May 7, 2015 at 11:46:40 AM UTC-4, Fabio Pliger wrote:

Hi Schaun,

Are you able to post some code that we can look at and try to help you? From what you describe (something similar to https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/selection_histogram.py) it should be working.

Cheers

Fabio

On Friday, May 1, 2015 at 3:15:17 AM UTC+2, Schaun Wheeler wrote:

I have a Bokeh app that includes a gridplot. The ColumnDataSource for each plot within the gridplot has a column named ‘id’. When any glyph in any plot within the gridplot is selected, I want to collect all of the values of the ‘id’ column for any selected records across all plots so I can use those later.

Can anyone suggest how to do this?

I’ve tried setting up on_change('selected', self, handler) on the source itself when creating the plot, as well as setting it up on the gridplot object as a whole, as well as setting it up within the setup_events method in the app class. I set up a break point within the handler itself as a sanity check, and that breakpoint never gets triggered when I select points (although if I run the python code manually and set a list of integers to the .selected attribute the handler it called and the break point triggered).

Thank you in advance for any suggestions you can offer.

⌁   Link to post

End of archived discussion · Replies are disabled