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": "c934b7ba-d653-4168-949d-49c55aff1f2d",
  "js_callbacks": {},
  "name": null,
  "placeholder": "",
  "sizing_mode": "fixed",
  "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": "f0d3f111-15c8-4639-a637-cf3300014238",
  "js_callbacks": {},
  "max_date": null,
  "min_date": null,
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": 1483920000000.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": "0fcf6d2e-5564-4668-98ae-08e274c9b36b",
  "js_callbacks": {},
  "name": null,
  "range": null,
  "sizing_mode": "fixed",
  "step": {},
  "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. InputWidget` is not generally 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": "a658348e-4af6-4595-ac80-d8221fab7235",
  "js_callbacks": {},
  "name": null,
  "sizing_mode": "fixed",
  "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": "7e5e5bf6-4ed0-4fc2-bb3b-43c998b01b74",
  "js_callbacks": {},
  "name": null,
  "options": [],
  "size": 4,
  "sizing_mode": "fixed",
  "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": "33615095-aead-4502-8648-a3aeeb63fa67",
  "js_callbacks": {},
  "name": null,
  "orientation": "horizontal",
  "range": [
    0.1,
    0.9
  ],
  "sizing_mode": "fixed",
  "start": 0,
  "step": 0.1,
  "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": "9f413e37-eef8-4645-b770-2203f15eae5f",
  "js_callbacks": {},
  "name": null,
  "options": [],
  "sizing_mode": "fixed",
  "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": "1bcbd64c-ef7d-436b-b23f-84373761eee5",
  "js_callbacks": {},
  "name": null,
  "orientation": "horizontal",
  "sizing_mode": "fixed",
  "start": 0,
  "step": 0.1,
  "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": "322d7f19-3f14-4d44-bc36-337d9edd48ce",
  "js_callbacks": {},
  "name": null,
  "placeholder": "",
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}