Various kinds of button widgets.
AbstractButton
Bases: bokeh.models.widgets.widget.Widget, bokeh.models.widgets.buttons.ButtonLike
bokeh.models.widgets.widget.Widget
bokeh.models.widgets.buttons.ButtonLike
A base class that defines common properties for all button types.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.
callback
property type: Instance ( Callback )
Instance
Callback
A callback to run in the browser whenever the button is activated.
icon
property type: Instance ( AbstractIcon )
AbstractIcon
An optional image appearing to the left of button’s text.
label
property type: String
String
The text label for the button to display.
{ "align": "start", "aspect_ratio": null, "background": null, "button_type": "default", "callback": null, "css_classes": [], "default_size": 300, "disabled": false, "height": null, "height_policy": "auto", "icon": null, "id": "14613", "js_event_callbacks": {}, "js_property_callbacks": {}, "label": "", "margin": [ 5, 5, 5, 5 ], "max_height": null, "max_width": null, "min_height": null, "min_width": null, "name": null, "orientation": "horizontal", "sizing_mode": null, "subscribed_events": [], "tags": [], "visible": true, "width": null, "width_policy": "auto" }
Button
Bases: bokeh.models.widgets.buttons.AbstractButton
bokeh.models.widgets.buttons.AbstractButton
A click button.
clicks
property type: Int
Int
A private property that used to trigger on_click event handler.
on_click
js_on_click
Set up a JavaScript handler for button clicks.
Set up a handler for button clicks.
handler (func) – handler function to call when button is clicked.
None
{ "align": "start", "aspect_ratio": null, "background": null, "button_type": "default", "callback": null, "clicks": 0, "css_classes": [], "default_size": 300, "disabled": false, "height": null, "height_policy": "auto", "icon": null, "id": "14617", "js_event_callbacks": {}, "js_property_callbacks": {}, "label": "Button", "margin": [ 5, 5, 5, 5 ], "max_height": null, "max_width": null, "min_height": null, "min_width": null, "name": null, "orientation": "horizontal", "sizing_mode": null, "subscribed_events": [], "tags": [], "visible": true, "width": null, "width_policy": "auto" }
ButtonLike
Shared properties for button-like widgets.
button_type
property type: Enum ( ButtonType )
Enum
ButtonType
A style for the button, signifying it’s role.
Dropdown
A dropdown button.
default_value
A default value to set when a split Dropdown’s top button is clicked.
Setting this property will cause the Dropdown to be rendered as split.
menu
property type: List ( Either ( String , Tuple ( String , Either ( String , Instance ( Callback ) ) ) ) )
List
Either
Tuple
Button’s dropdown menu consisting of entries containing item’s text and value name. Use None as a menu separator.
split
property type: Bool
Bool
value
Set up a JavaScript handler for button or menu item clicks.
Set up a handler for button or menu item clicks.
handler (func) – handler function to call when button is activated.
{ "align": "start", "aspect_ratio": null, "background": null, "button_type": "default", "callback": null, "css_classes": [], "default_size": 300, "default_value": null, "disabled": false, "height": null, "height_policy": "auto", "icon": null, "id": "14619", "js_event_callbacks": {}, "js_property_callbacks": {}, "label": "Dropdown", "margin": [ 5, 5, 5, 5 ], "max_height": null, "max_width": null, "menu": [], "min_height": null, "min_width": null, "name": null, "orientation": "horizontal", "sizing_mode": null, "split": false, "subscribed_events": [], "tags": [], "value": null, "visible": true, "width": null, "width_policy": "auto" }
Toggle
A two-state toggle button.
active
The initial state of a button. Also used to trigger on_click event handler.
Set up a JavaScript handler for button state changes (clicks).
Set up a handler for button state changes (clicks).
handler (func) – handler function to call when button is toggled.
{ "active": false, "align": "start", "aspect_ratio": null, "background": null, "button_type": "default", "callback": null, "css_classes": [], "default_size": 300, "disabled": false, "height": null, "height_policy": "auto", "icon": null, "id": "14624", "js_event_callbacks": {}, "js_property_callbacks": {}, "label": "Toggle", "margin": [ 5, 5, 5, 5 ], "max_height": null, "max_width": null, "min_height": null, "min_width": null, "name": null, "orientation": "horizontal", "sizing_mode": null, "subscribed_events": [], "tags": [], "visible": true, "width": null, "width_policy": "auto" }