bokeh.models.widgets.inputs

Various kinds of input widgets and form controls.

class AutocompleteInput(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.TextInput

Single-line input widget with auto-completion.

completions

property type: List ( String )

A list of completion strings. This will be used to guide the user upon typing the beginning of a desired value.

JSON Prototype
{
  "callback": null,
  "completions": [],
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "42e5c40f-81e0-4a37-9ca4-87eb007b637d",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "placeholder": "",
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}
class DatePicker(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Calendar-based date picker widget.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the current date value changes.

max_date

property type: Date

Optional latest allowable date.

min_date

property type: Date

Optional earliest allowable date.

value

property type: Date

The initial or picked date.

JSON Prototype
{
  "callback": null,
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "c960ae97-9b78-4541-b344-71f4d8a2b20c",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "max_date": null,
  "min_date": null,
  "name": null,
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": 1491350400000.0,
  "width": null
}
class DateRangeSlider(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Slider-based date range selection widget.

arrows

property type: Bool

Whether to show clickable arrows on both ends of the slider.

bounds

property type: Tuple ( Date , Date )

The earliest and latest allowable dates.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever either slider’s value changes.

enabled

property type: Bool

Enable or disable this widget.

range

property type: Tuple ( RelativeDelta ( Enum ( Enumeration(years, months, days, hours, minutes, seconds, microseconds) ), Int ), RelativeDelta ( Enum ( Enumeration(years, months, days, hours, minutes, seconds, microseconds) ), Int ) )

[TDB]

step

property type: RelativeDelta ( Enum ( Enumeration(years, months, days, hours, minutes, seconds, microseconds) ), Int )

The step between consecutive dates.

value

property type: Tuple ( Date , Date )

The initial or selected date range.

value_labels

property type: Enum ( Enumeration(show, hide, change) )

Show or hide value labels on both sides of the slider.

wheel_mode

property type: Enum ( Enumeration(scroll, zoom) )

Whether mouse zoom should scroll or zoom selected range (or do nothing).

JSON Prototype
{
  "arrows": true,
  "bounds": null,
  "callback": null,
  "css_classes": null,
  "disabled": false,
  "enabled": true,
  "height": null,
  "id": "7cb7a2ad-398a-4a74-9fb1-e6dfc10107e5",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "range": null,
  "sizing_mode": "fixed",
  "step": {},
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": null,
  "value_labels": "show",
  "wheel_mode": null,
  "width": null
}
class InputWidget(**kwargs)[source]

Bases: bokeh.models.widgets.widget.Widget

Abstract base class for input widgets.

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.

title

property type: String

Widget’s label.

classmethod coerce_value(val)[source]
JSON Prototype
{
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "12560871-5f6c-4b90-a78e-3f6af9f1eb4b",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "width": null
}
class MultiSelect(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Multi-select widget.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the current selection value changes.

options

property type: List ( Either ( String , Tuple ( String , String ) ) )

Available selection options. Options may be provided either as a list of possible string values, or as a list of tuples, each of the form (value, label). In the latter case, the visible widget text for each value will be corresponding given label.

size

property type: Int

The number of visible options in the dropdown list. (This uses the select HTML element’s size attribute. Some browsers might not show less than 3 options.)

value

property type: List ( String )

Initial or selected values.

JSON Prototype
{
  "callback": null,
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "46c506f2-a9b4-4763-9da1-c5a5f92f7810",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "options": [],
  "size": 4,
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": [],
  "width": null
}
class RangeSlider(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Range-slider based range selection widget

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the current Slider value changes.

callback_policy

property type: Enum ( SliderCallbackPolicy )

When the callback is initiated. This parameter can take on only one of three options:

  • “continuous”: the callback will be executed immediately for each movement of the slider
  • “throttle”: the callback will be executed at most every callback_throttle milliseconds.
  • “mouseup”: the callback will be executed only once when the slider is released.

The “mouseup” policy is intended for scenarios in which the callback is expensive in time.

callback_throttle

property type: Float

Number of microseconds to pause between callback calls as the slider is moved.

end

property type: Float

The maximum allowable value.

orientation

property type: Enum ( Enumeration(horizontal, vertical) )

Orient the slider either horizontally (default) or vertically.

range

property type: Tuple ( Float , Float )

Initial or selected range.

start

property type: Float

The minimum allowable value.

step

property type: Float

The step between consecutive values.

JSON Prototype
{
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": null,
  "disabled": false,
  "end": 1,
  "height": null,
  "id": "ea8d2c5e-de3d-443c-9e4b-e2fa52be3d56",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "orientation": "horizontal",
  "range": [
    0.1,
    0.9
  ],
  "sizing_mode": "fixed",
  "start": 0,
  "step": 0.1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "width": null
}
class Select(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Single-select widget.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the current Select dropdown value changes.

options

property type: List ( Either ( String , Tuple ( String , String ) ) )

Available selection options. Options may be provided either as a list of possible string values, or as a list of tuples, each of the form (value, label). In the latter case, the visible widget text for each value will be corresponding given label.

value

property type: String

Initial or selected value.

JSON Prototype
{
  "callback": null,
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "3baa7ceb-b347-4e5e-968f-ab6eed113381",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "options": [],
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}
class Slider(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Slider-based number selection widget.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the current Slider value changes.

callback_policy

property type: Enum ( SliderCallbackPolicy )

When the callback is initiated. This parameter can take on only one of three options:

  • “continuous”: the callback will be executed immediately for each movement of the slider
  • “throttle”: the callback will be executed at most every callback_throttle milliseconds.
  • “mouseup”: the callback will be executed only once when the slider is released.

The “mouseup” policy is intended for scenarios in which the callback is expensive in time.

callback_throttle

property type: Float

Number of microseconds to pause between callback calls as the slider is moved.

end

property type: Float

The maximum allowable value.

orientation

property type: Enum ( Enumeration(horizontal, vertical) )

Orient the slider either horizontally (default) or vertically.

start

property type: Float

The minimum allowable value.

step

property type: Float

The step between consecutive values.

value

property type: Float

Initial or selected value.

JSON Prototype
{
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": null,
  "disabled": false,
  "end": 1,
  "height": null,
  "id": "b59a2f2f-652a-4904-945a-38e50b726d75",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "orientation": "horizontal",
  "sizing_mode": "fixed",
  "start": 0,
  "step": 0.1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": 0.5,
  "width": null
}
class TextInput(**kwargs)[source]

Bases: bokeh.models.widgets.inputs.InputWidget

Single-line input widget.

callback

property type: Instance ( Callback )

A callback to run in the browser whenever the user unfocuses the TextInput widget by hitting Enter or clicking outside of the text box area.

placeholder

property type: String

Placeholder for empty input field

value

property type: String

Initial or entered text value.

JSON Prototype
{
  "callback": null,
  "css_classes": null,
  "disabled": false,
  "height": null,
  "id": "63a22ca9-b7f9-467a-a683-a1f30fbff82f",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "placeholder": "",
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}