bokeh.models.widgets.sliders

Various kinds of slider widgets.

class AbstractSlider(**kwargs)[source]

Bases: bokeh.models.widgets.widget.Widget

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.

bar_color

property type: Color

callback

property type: Instance ( Callback )

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

DEPRECATED: use .js_on_change or .on_change with “value” or “value_throttled”

callback_policy

property type: Enum ( SliderCallbackPolicy )

When the value_throttled property is updated.

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.

Both Python and JS callbacks on “value_throttled” will respect this policy setting.

callback_throttle

property type: Float

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

direction

property type: Enum ( Enumeration(ltr, rtl) )

format

property type: String

show_value

property type: Bool

Whether or not show slider’s value.

title

property type: String

Slider’s label.

tooltips

property type: Bool

JSON Prototype
{
  "align": "start",
  "aspect_ratio": null,
  "background": null,
  "bar_color": "#e6e6e6",
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": [],
  "default_size": 300,
  "direction": "ltr",
  "disabled": false,
  "format": null,
  "height": null,
  "height_policy": "auto",
  "id": "14510",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "margin": [
    5,
    5,
    5,
    5
  ],
  "max_height": null,
  "max_width": null,
  "min_height": null,
  "min_width": null,
  "name": null,
  "orientation": "horizontal",
  "show_value": true,
  "sizing_mode": null,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "tooltips": true,
  "visible": true,
  "width": null,
  "width_policy": "auto"
}
class Slider(**kwargs)[source]

Bases: bokeh.models.widgets.sliders.AbstractSlider

Slider-based number selection widget.

end

property type: Float

The maximum allowable value.

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.

value_throttled

property type: Float

Initial or selected value, throttled according to callback_policy.

JSON Prototype
{
  "align": "start",
  "aspect_ratio": null,
  "background": null,
  "bar_color": "#e6e6e6",
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": [],
  "default_size": 300,
  "direction": "ltr",
  "disabled": false,
  "end": null,
  "format": "0[.]00",
  "height": null,
  "height_policy": "auto",
  "id": "14520",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "margin": [
    5,
    5,
    5,
    5
  ],
  "max_height": null,
  "max_width": null,
  "min_height": null,
  "min_width": null,
  "name": null,
  "orientation": "horizontal",
  "show_value": true,
  "sizing_mode": null,
  "start": null,
  "step": 1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "tooltips": true,
  "value": null,
  "value_throttled": null,
  "visible": true,
  "width": null,
  "width_policy": "auto"
}
class RangeSlider(**kwargs)[source]

Bases: bokeh.models.widgets.sliders.AbstractSlider

Range-slider based number range selection widget.

end

property type: Float

The maximum allowable value.

start

property type: Float

The minimum allowable value.

step

property type: Float

The step between consecutive values.

value

property type: Tuple ( Float , Float )

Initial or selected range.

value_throttled

property type: Tuple ( Float , Float )

Initial or selected value, throttled according to callback_policy.

JSON Prototype
{
  "align": "start",
  "aspect_ratio": null,
  "background": null,
  "bar_color": "#e6e6e6",
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": [],
  "default_size": 300,
  "direction": "ltr",
  "disabled": false,
  "end": null,
  "format": "0[.]00",
  "height": null,
  "height_policy": "auto",
  "id": "14526",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "margin": [
    5,
    5,
    5,
    5
  ],
  "max_height": null,
  "max_width": null,
  "min_height": null,
  "min_width": null,
  "name": null,
  "orientation": "horizontal",
  "show_value": true,
  "sizing_mode": null,
  "start": null,
  "step": 1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "tooltips": true,
  "value": null,
  "value_throttled": null,
  "visible": true,
  "width": null,
  "width_policy": "auto"
}
class DateSlider(**kwargs)[source]

Bases: bokeh.models.widgets.sliders.AbstractSlider

Slider-based date selection widget.

end

property type: Date

The maximum allowable value.

start

property type: Date

The minimum allowable value.

step

property type: Int

The step between consecutive values.

value

property type: Date

Initial or selected value.

value_throttled

property type: Date

Initial or selected value, throttled according to callback_policy.

JSON Prototype
{
  "align": "start",
  "aspect_ratio": null,
  "background": null,
  "bar_color": "#e6e6e6",
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": [],
  "default_size": 300,
  "direction": "ltr",
  "disabled": false,
  "end": null,
  "format": "%d %b %Y",
  "height": null,
  "height_policy": "auto",
  "id": "14532",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "margin": [
    5,
    5,
    5,
    5
  ],
  "max_height": null,
  "max_width": null,
  "min_height": null,
  "min_width": null,
  "name": null,
  "orientation": "horizontal",
  "show_value": true,
  "sizing_mode": null,
  "start": null,
  "step": 1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "tooltips": true,
  "value": null,
  "value_throttled": null,
  "visible": true,
  "width": null,
  "width_policy": "auto"
}
class DateRangeSlider(**kwargs)[source]

Bases: bokeh.models.widgets.sliders.AbstractSlider

Slider-based date range selection widget.

end

property type: Date

The maximum allowable value.

start

property type: Date

The minimum allowable value.

step

property type: Int

The step between consecutive values.

value

property type: Tuple ( Date , Date )

Initial or selected range.

value_throttled

property type: Tuple ( Date , Date )

Initial or selected value, throttled according to callback_policy.

property value_as_date

Convenience property to retrieve the value tuple as a tuple of date objects.

Added in version 1.1

property value_as_datetime

Convenience property to retrieve the value tuple as a tuple of datetime objects.

JSON Prototype
{
  "align": "start",
  "aspect_ratio": null,
  "background": null,
  "bar_color": "#e6e6e6",
  "callback": null,
  "callback_policy": "throttle",
  "callback_throttle": 200,
  "css_classes": [],
  "default_size": 300,
  "direction": "ltr",
  "disabled": false,
  "end": null,
  "format": "%d %b %Y",
  "height": null,
  "height_policy": "auto",
  "id": "14538",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "margin": [
    5,
    5,
    5,
    5
  ],
  "max_height": null,
  "max_width": null,
  "min_height": null,
  "min_width": null,
  "name": null,
  "orientation": "horizontal",
  "show_value": true,
  "sizing_mode": null,
  "start": null,
  "step": 1,
  "subscribed_events": [],
  "tags": [],
  "title": "",
  "tooltips": true,
  "value": null,
  "value_throttled": null,
  "visible": true,
  "width": null,
  "width_policy": "auto"
}