bokeh 1.4.0
>>> import bokeh
>>> bokeh.__version__
\'1.4.0\'
>>> from bokeh.models import Dropdown
>>> Dropd
Dropdown.value
was an implementation detail that was not meant to be used by Bokeh users, according to its docstring. Apart from that, Dropdown
semantically is just a collection of buttons. It should not have any sort of state, it should just dispatch the on_click
event as a regular button, just as it does in 2.0. And that's why the value
attribute has been removed in 2.0.0.
In order to trigger Python code on a dropdown button click, you can use something like
from bokeh.models import Dropdown
d = Dropdown(label='Click me', menu=['a', 'b', 'c'])
def handler(event):
print(event.item)
d.on_click(handler)
event.item
will contain the menu item that you have clicked.