This docs on this page refers to a PREVIOUS VERSION. For the latest stable release, go to https://docs.bokeh.org/

Archived docs for versions <= 1.0.4 have had to be modified from their original published configuration, and may be missing some features (e.g. source listing)

All users are encourage to update to version 1.1 or later, as soon as they are able.

Bokeh Docs

bokeh.models.widgets.inputs

Various kinds of input widgets and form controls.

class AutocompleteInput(**kwargs)

Bases: bokeh.models.widgets.inputs.TextInput

Single-line input widget with auto-completion.

completions

property type: completions: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": [],
  "disabled": false,
  "height": null,
  "id": "5bdda60f-5322-4468-b542-2a66b38b3fe1",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}
class DatePicker(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Calendar-based date picker widget.

callback

property type: callback:Instance(Callback)

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

max_date

property type: max_date:Date

Optional latest allowable date.

min_date

property type: min_date:Date

Optional earliest allowable date.

value

property type: value:Date

The initial or picked date.

JSON Prototype
{
  "callback": null,
  "disabled": false,
  "height": null,
  "id": "b6f5caee-0782-474e-9939-d7dc342609fd",
  "max_date": null,
  "min_date": null,
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": 1467072000000.0,
  "width": null
}
class DateRangeSlider(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Slider-based date range selection widget.

arrows

property type: arrows:Bool

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

bounds

property type: bounds:Tuple(Date, Date)

The earliest and latest allowable dates.

callback

property type: callback:Instance(Callback)

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

enabled

property type: enabled:Bool

Enable or disable this widget.

range

property type: range:Tuple(RelativeDelta, RelativeDelta)

[TDB]

step

property type: step:RelativeDelta

The step between consecutive dates.

value

property type: value:Tuple(Date, Date)

The initial or selected date range.

value_labels

property type: value_labels:Enum(‘show’, ‘hide’, ‘change’)

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

wheel_mode

property type: wheel_mode:Enum(‘scroll’, ‘zoom’)

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

JSON Prototype
{
  "arrows": true,
  "bounds": null,
  "callback": null,
  "disabled": false,
  "enabled": true,
  "height": null,
  "id": "4600d12c-47d1-4724-99c9-dae97f912e35",
  "name": null,
  "range": null,
  "sizing_mode": "fixed",
  "step": {},
  "tags": [],
  "title": "",
  "value": null,
  "value_labels": "show",
  "wheel_mode": null,
  "width": null
}
class InputWidget(**kwargs)

Bases: bokeh.models.widgets.widget.Widget

Abstract base class for input widgets. InputWidget` is not generally useful to instantiate on its own.

classmethod coerce_value(val)
classmethod create(*args, **kwargs)

Only called the first time we make an object, whereas __init__ is called every time it’s loaded

title

property type: title:String

Widget’s label.

JSON Prototype
{
  "disabled": false,
  "height": null,
  "id": "ceadd4ba-8c99-4b7c-a47e-384ef1335894",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "width": null
}
class MultiSelect(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Multi-select widget.

classmethod create(*args, **kwargs)
callback

property type: callback:Instance(Callback)

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

options

property type: options:List(Either(String, Dict(String, String)))

Available selection options.

value

property type: value:List(String)

Initial or selected values.

JSON Prototype
{
  "callback": null,
  "disabled": false,
  "height": null,
  "id": "1f6cb1ce-e3f6-4653-a41e-3dd4da7d3c93",
  "name": null,
  "options": [],
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": [],
  "width": null
}
class Select(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Single-select widget.

classmethod create(*args, **kwargs)
callback

property type: callback:Instance(Callback)

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

options

property type: options:List(Either(String, Dict(String, String)))

Available selection options.

value

property type: value:String

Initial or selected value.

JSON Prototype
{
  "callback": null,
  "disabled": false,
  "height": null,
  "id": "47517ccc-6303-416f-ab69-817608e54ed7",
  "name": null,
  "options": [],
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}
class Slider(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Slider-based number selection widget.

callback

property type: callback:Instance(Callback)

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

callback_policy

property type: callback_policy:Enum(‘continuous’, ‘throttle’, ‘mouseup’)

An enumeration which controls the method by which the callback is initated. This parameter can take on only one of three options.

“continuous”: Implies that the callback will be initiated immediatly for each movement of the slider “throttle”: Implies that the callback will be executed while the slider is being moved but not more often than what is specified in the callback_throttle time in miliseconds. “mouseup”: Implies that 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: callback_throttle:Float

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

end

property type: end:Float

The maximum allowable value.

orientation

property type: orientation:Enum(‘horizontal’, ‘vertical’)

Orient the slider either horizontally (default) or vertically.

start

property type: start:Float

The minimum allowable value.

step

property type: step:Float

The step between consecutive values.

value

property type: value:Float

Initial or selected value.

JSON Prototype
{
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "disabled": false,
  "end": 1,
  "height": null,
  "id": "56d756d4-44c8-49e0-9378-f831e7400249",
  "name": null,
  "orientation": "horizontal",
  "sizing_mode": "fixed",
  "start": 0,
  "step": 0.1,
  "tags": [],
  "title": "",
  "value": 0.5,
  "width": null
}
class TextInput(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Single-line input widget.

callback

property type: callback: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.

value

property type: value:String

Initial or entered text value.

JSON Prototype
{
  "callback": null,
  "disabled": false,
  "height": null,
  "id": "4a6cf51e-dc75-47c8-8462-978249a34356",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "title": "",
  "value": "",
  "width": null
}