setvalue#

A visualization of buttons in bokeh.models. This example demonstrates changing the value of an object when a certain event (like clicking of a button) happens.

Details

Bokeh APIs:

bokeh.io.show, bokeh.models.Button, Bokeh.models.SetValue

More info:

SetValue callbacks

Keywords:

js callbacks

from bokeh.io import show
from bokeh.models import Button, SetValue

button = Button(label="Foo", button_type="primary")
callback = SetValue(obj=button, attr="label", value="Bar")
button.js_on_event("button_click", callback)

show(button)