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": "dc0c021b-1032-4951-bc35-8596e844624b",
  "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": "72c397f1-9115-4cbd-a2a4-32bc2ef766f6",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "max_date": null,
  "min_date": null,
  "name": null,
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": 1497312000000.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": "46c24093-92e3-44a0-9794-abae60ab5055",
  "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": "289dd6bc-9c45-4014-bb11-f4669bf4ad75",
  "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": "68061673-079f-4c63-8266-782dbee2cf69",
  "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": "2a04268d-896e-4bf1-99b3-7bcd2888c3c4",
  "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": "db0045ea-39c6-4aea-a7df-08a9f2864d19",
  "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": "0968903f-766b-4946-842b-f183e7b86a03",
  "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": "20989a28-8b0e-4fdc-8bc9-b9d381f9beed",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "name": null,
  "placeholder": "",
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}