☰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

Interactivity between different inputs elements in Bokeh

Community Support
Veenit_Shah
Veenit_Shah

Hi,

I have the following test data =

{

“prd” : [“a”, “b”, “c”]

“code” : [“1”, “2”, “3”]

}

I have 2 dropdown select elements in my bokeh app. For simplicity sake, let’s call them d1 and d2. d1 shows the all the keys in the above dictionary (prd, code) and d2 should be dynamically reflect what gets selected in d1. For eg. If I select “code” in d1, then d2 dropdown should give me options as (1,2,3)

Is this possible in bokeh? I couldn’t find an example in the repo. Any code examples would be appreciated.

Thank you in advance.

Regards,

V

⌁   Link to post
George_Skolianos
George_Skolianos

Try using a callback function. something like that should work

def change_d2(attr,old, new):

d2.options=data[d1.value]

d1.on_change(‘value’,change_d2)

···

On Wed, Jul 27, 2016 at 12:24 PM, Veenit Shah veenitgshah@gmail.com wrote:

Hi,

I have the following test data =

{

“prd” : [“a”, “b”, “c”]

“code” : [“1”, “2”, “3”]

}

I have 2 dropdown select elements in my bokeh app. For simplicity sake, let’s call them d1 and d2. d1 shows the all the keys in the above dictionary (prd, code) and d2 should be dynamically reflect what gets selected in d1. For eg. If I select “code” in d1, then d2 dropdown should give me options as (1,2,3)

Is this possible in bokeh? I couldn’t find an example in the repo. Any code examples would be appreciated.

Thank you in advance.

Regards,

V

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7e241120-7a6e-42aa-9614-88b6858f13ad%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post
Veenit_Shah
Veenit_Shah

Thank you, George! That really helped

I was missing d2.options=data[d1.value]. I was assigning data[d1.value] to a variable rather than d2.options.

Regards,

V

···

On Wednesday, July 27, 2016 at 3:10:05 PM UTC-5, George Skolianos wrote:

Try using a callback function. something like that should work

def change_d2(attr,old, new):

d2.options=data[d1.value]

d1.on_change(‘value’,change_d2)

On Wed, Jul 27, 2016 at 12:24 PM, Veenit Shah veeni...@gmail.com wrote:

Hi,

I have the following test data =

{

“prd” : [“a”, “b”, “c”]

“code” : [“1”, “2”, “3”]

}

I have 2 dropdown select elements in my bokeh app. For simplicity sake, let’s call them d1 and d2. d1 shows the all the keys in the above dictionary (prd, code) and d2 should be dynamically reflect what gets selected in d1. For eg. If I select “code” in d1, then d2 dropdown should give me options as (1,2,3)

Is this possible in bokeh? I couldn’t find an example in the repo. Any code examples would be appreciated.

Thank you in advance.

Regards,

V

–

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7e241120-7a6e-42aa-9614-88b6858f13ad%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

⌁   Link to post

End of archived discussion · Replies are disabled