Model Objects

One of the central design principals of Bokeh is that, regardless of how the plot creation code is spelled in Python (or other languages), the result is an object graph of that encompass all the visual and data aspects of the scene. Furthermore, this scene graph is to be serialized, and it is this serialized graph that the client library BokehJS uses to render the plot. The low-level objects that comprise a Bokeh scene graph are called Models.

This reference documents all the Bokeh models, together with their property attributes, as well as a JSON prototype illustrating what a serialized version of the model looks like.

bokeh.models.axes

Guide renderers for various kinds of axes that can be added to Bokeh plots

class Axis(**kwargs)

Bases: bokeh.models.renderers.GuideRenderer

A base class that defines common properties for all axis types. Axis is not generally useful to instantiate on its own.

axis_label

property type: String

A text label for the axis, displayed parallel to the axis rule.

Note

LaTeX notation is not currently supported; please see issue 647 to track progress or contribute.

axis_label_standoff

property type: Int

The distance in pixels that the axis labels should be offset from the tick labels.

axis_label_text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align of the axis label.

axis_label_text_alpha

property type: DataSpec

The text alpha of the axis label.

axis_label_text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline of the axis label.

axis_label_text_color

property type: ColorSpec

The text color of the axis label.

axis_label_text_font

property type: String

The text font of the axis label.

axis_label_text_font_size

property type: String

The text font size of the axis label.

axis_label_text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style of the axis label.

axis_line_alpha

property type: DataSpec

The line alpha of the axis line.

axis_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap of the axis line.

axis_line_color

property type: ColorSpec

The line color of the axis line.

axis_line_dash

property type: DashPattern

The line dash of the axis line.

axis_line_dash_offset

property type: Int

The line dash offset of the axis line.

axis_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the axis line.

axis_line_width

property type: DataSpec

The line width of the axis line.

bounds

property type: Either(Auto, Tuple(Float, Float), Tuple(Datetime, Datetime))

Bounds for the rendered axis. If unset, the axis will span the entire plot in the given dimension.

formatter

property type: Instance(TickFormatter)

A TickFormatter to use for formatting the visual appearance of ticks.

location

property type: Either(Auto, Enum(‘above’, ‘below’, ‘left’, ‘right’))

Where should labels and ticks be located in relation to the axis rule.

major_label_orientation

property type: Either(Enum(‘horizontal’, ‘vertical’), Float)

What direction the major label text should be oriented. If a i number is supplied, the angle of the text is measured from horizontal.

major_label_standoff

property type: Int

The distance in pixels that the major tick labels should be offset from the associated ticks.

major_label_text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align of the major tick labels.

major_label_text_alpha

property type: DataSpec

The text alpha of the major tick labels.

major_label_text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline of the major tick labels.

major_label_text_color

property type: ColorSpec

The text color of the major tick labels.

major_label_text_font

property type: String

The text font of the major tick labels.

major_label_text_font_size

property type: String

The text font size of the major tick labels.

major_label_text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style of the major tick labels.

major_tick_in

property type: Int

The distance in pixels that major ticks should extend into the main plot area.

major_tick_line_alpha

property type: DataSpec

The line alpha of the major ticks.

major_tick_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap of the major ticks.

major_tick_line_color

property type: ColorSpec

The line color of the major ticks.

major_tick_line_dash

property type: DashPattern

The line dash of the major ticks.

major_tick_line_dash_offset

property type: Int

The line dash offset of the major ticks.

major_tick_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the major ticks.

major_tick_line_width

property type: DataSpec

The line width of the major ticks.

major_tick_out

property type: Int

The distance in pixels that major ticks should extend out of the main plot area.

minor_tick_in

property type: Int

The distance in pixels that minor ticks should extend into the main plot area.

minor_tick_line_alpha

property type: DataSpec

The line alpha of the minor ticks.

minor_tick_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap of the minor ticks.

minor_tick_line_color

property type: ColorSpec

The line color of the minor ticks.

minor_tick_line_dash

property type: DashPattern

The line dash of the minor ticks.

minor_tick_line_dash_offset

property type: Int

The line dash offset of the minor ticks.

minor_tick_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the minor ticks.

minor_tick_line_width

property type: DataSpec

The line width of the minor ticks.

minor_tick_out

property type: Int

The distance in pixels that major ticks should extend out of the main plot area.

ticker

property type: Instance(Ticker)

A Ticker to use for computing locations of axis components.

visible

property type: Bool

Ability to hide the entire axis from the plot.

x_range_name

property type: String

A particular (named) x-range to use for computing screen locations when rendering an axis on the plot. If unset, use the default x-range.

y_range_name

property type: String

A particular (named) y-range to use for computing screen locations when rendering an axis on the plot. If unset, use the default y-range.

[
  {
    "attributes": {
      "axis_label": null,
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "doc": null,
      "formatter": null,
      "id": "fb71d5e9-8cdf-4885-be91-279942978f3f",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": null,
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "fb71d5e9-8cdf-4885-be91-279942978f3f",
    "type": "Axis"
  }
]
class CategoricalAxis(ticker=None, formatter=None, **kwargs)

Bases: bokeh.models.axes.Axis

An axis that picks evenly spaced tick locations for a collection of categories/factors.

[
  {
    "attributes": {
      "doc": null,
      "id": "8a40646d-53ce-4bca-a3f7-86cbb8843dae",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "8a40646d-53ce-4bca-a3f7-86cbb8843dae",
    "type": "CategoricalTicker"
  },
  {
    "attributes": {
      "doc": null,
      "id": "b5ff76eb-6268-4582-b5e9-88589fe2e70e",
      "name": null,
      "tags": []
    },
    "id": "b5ff76eb-6268-4582-b5e9-88589fe2e70e",
    "type": "CategoricalTickFormatter"
  },
  {
    "attributes": {
      "axis_label": null,
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "doc": null,
      "formatter": {
        "id": "b5ff76eb-6268-4582-b5e9-88589fe2e70e",
        "type": "CategoricalTickFormatter"
      },
      "id": "48b1ae68-9792-4c02-af1d-41eea782c24e",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": {
        "id": "8a40646d-53ce-4bca-a3f7-86cbb8843dae",
        "type": "CategoricalTicker"
      },
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "48b1ae68-9792-4c02-af1d-41eea782c24e",
    "type": "CategoricalAxis"
  }
]
class ContinuousAxis(**kwargs)

Bases: bokeh.models.axes.Axis

A base class for all numeric, non-categorica axes types. ContinuousAxis is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "axis_label": null,
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "doc": null,
      "formatter": null,
      "id": "16494125-28c1-459b-b927-827a05065ba0",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": null,
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "16494125-28c1-459b-b927-827a05065ba0",
    "type": "ContinuousAxis"
  }
]
class DatetimeAxis(ticker=None, formatter=None, **kwargs)

Bases: bokeh.models.axes.LinearAxis

An LinearAxis that picks nice numbers for tick locations on a datetime scale. Configured with a DatetimeTickFormatter by default.

axis_label

property type: String

DateTime axis_label defaults to “date”.

char_width

property type: Int

fill_ratio

property type: Float

num_labels

property type: Int

scale

property type: String

[
  {
    "attributes": {
      "doc": null,
      "id": "2befa87d-490b-42a0-b5be-b35cb10cbb5a",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "2befa87d-490b-42a0-b5be-b35cb10cbb5a",
    "type": "DatetimeTicker"
  },
  {
    "attributes": {
      "doc": null,
      "formats": {},
      "id": "ded460b1-0d1d-4d64-b4db-26fe80bff25f",
      "name": null,
      "tags": []
    },
    "id": "ded460b1-0d1d-4d64-b4db-26fe80bff25f",
    "type": "DatetimeTickFormatter"
  },
  {
    "attributes": {
      "axis_label": "date",
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "char_width": 10,
      "doc": null,
      "fill_ratio": 0.3,
      "formatter": {
        "id": "ded460b1-0d1d-4d64-b4db-26fe80bff25f",
        "type": "DatetimeTickFormatter"
      },
      "id": "e749630c-7b6c-454c-a9e8-e28670f69aab",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "num_labels": 8,
      "plot": null,
      "scale": "time",
      "tags": [],
      "ticker": {
        "id": "2befa87d-490b-42a0-b5be-b35cb10cbb5a",
        "type": "DatetimeTicker"
      },
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "e749630c-7b6c-454c-a9e8-e28670f69aab",
    "type": "DatetimeAxis"
  }
]
class LinearAxis(ticker=None, formatter=None, **kwargs)

Bases: bokeh.models.axes.ContinuousAxis

An axis that picks nice numbers for tick locations on a linear scale. Configured with a BasicTickFormatter by default.

[
  {
    "attributes": {
      "doc": null,
      "id": "509f84b8-9dd0-40da-bf9c-d1203ab78763",
      "name": null,
      "power_limit_high": 5,
      "power_limit_low": -3,
      "precision": "auto",
      "tags": [],
      "use_scientific": true
    },
    "id": "509f84b8-9dd0-40da-bf9c-d1203ab78763",
    "type": "BasicTickFormatter"
  },
  {
    "attributes": {
      "base": 10.0,
      "doc": null,
      "id": "3376902e-55e7-4805-8c1f-71626f071e63",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "3376902e-55e7-4805-8c1f-71626f071e63",
    "type": "BasicTicker"
  },
  {
    "attributes": {
      "axis_label": null,
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "doc": null,
      "formatter": {
        "id": "509f84b8-9dd0-40da-bf9c-d1203ab78763",
        "type": "BasicTickFormatter"
      },
      "id": "a92c117d-a333-407c-ba32-5f00ed6eb54e",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": {
        "id": "3376902e-55e7-4805-8c1f-71626f071e63",
        "type": "BasicTicker"
      },
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "a92c117d-a333-407c-ba32-5f00ed6eb54e",
    "type": "LinearAxis"
  }
]
class LogAxis(ticker=None, formatter=None, **kwargs)

Bases: bokeh.models.axes.ContinuousAxis

An axis that picks nice numbers for tick locations on a log scale. Configured with a LogTickFormatter by default.

[
  {
    "attributes": {
      "axis_label": null,
      "axis_label_standoff": null,
      "axis_label_text_align": "left",
      "axis_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_label_text_baseline": "bottom",
      "axis_label_text_color": {
        "value": "#444444"
      },
      "axis_label_text_font": "Helvetica",
      "axis_label_text_font_size": "12pt",
      "axis_label_text_font_style": "normal",
      "axis_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "axis_line_cap": "butt",
      "axis_line_color": {
        "value": "black"
      },
      "axis_line_dash": [],
      "axis_line_dash_offset": 0,
      "axis_line_join": "miter",
      "axis_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "bounds": "auto",
      "doc": null,
      "formatter": {
        "id": "5d0a87ff-f604-4f4b-b9af-003e58f88779",
        "type": "LogTickFormatter"
      },
      "id": "cc4623fd-e38b-482e-968a-142ed2438029",
      "location": "auto",
      "major_label_orientation": "horizontal",
      "major_label_standoff": null,
      "major_label_text_align": "left",
      "major_label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_label_text_baseline": "bottom",
      "major_label_text_color": {
        "value": "#444444"
      },
      "major_label_text_font": "Helvetica",
      "major_label_text_font_size": "12pt",
      "major_label_text_font_style": "normal",
      "major_tick_in": null,
      "major_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "major_tick_line_cap": "butt",
      "major_tick_line_color": {
        "value": "black"
      },
      "major_tick_line_dash": [],
      "major_tick_line_dash_offset": 0,
      "major_tick_line_join": "miter",
      "major_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "major_tick_out": null,
      "minor_tick_in": null,
      "minor_tick_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "minor_tick_line_cap": "butt",
      "minor_tick_line_color": {
        "value": "black"
      },
      "minor_tick_line_dash": [],
      "minor_tick_line_dash_offset": 0,
      "minor_tick_line_join": "miter",
      "minor_tick_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "minor_tick_out": null,
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": {
        "id": "404eba28-7472-4c9e-aa40-240f3765209b",
        "type": "LogTicker"
      },
      "visible": true,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "cc4623fd-e38b-482e-968a-142ed2438029",
    "type": "LogAxis"
  },
  {
    "attributes": {
      "base": 10.0,
      "doc": null,
      "id": "404eba28-7472-4c9e-aa40-240f3765209b",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 10,
      "tags": []
    },
    "id": "404eba28-7472-4c9e-aa40-240f3765209b",
    "type": "LogTicker"
  },
  {
    "attributes": {
      "doc": null,
      "id": "5d0a87ff-f604-4f4b-b9af-003e58f88779",
      "name": null,
      "tags": [],
      "ticker": {
        "id": "404eba28-7472-4c9e-aa40-240f3765209b",
        "type": "LogTicker"
      }
    },
    "id": "5d0a87ff-f604-4f4b-b9af-003e58f88779",
    "type": "LogTickFormatter"
  }
]

bokeh.models.formatters

Models for controlling the text and visual formatting of tick labels on Bokeh plot axes.

class BasicTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Display tick values from continuous ranges as “basic numbers”, using scientific notation when appropriate by default.

power_limit_high

property type: Int

Limit the use of scientific notation to when:

log(x) >= power_limit_high
power_limit_low

property type: Int

Limit the use of scientific notation to when:

log(x) <= power_limit_low
precision

property type: Either(Auto, Int)

How many digits of precision to display in tick labels.

use_scientific

property type: Bool

Whether to ever display scientific notation. If True, then when to use scientific notation is controlled by power_limit_low and power_limit_high.

[
  {
    "attributes": {
      "doc": null,
      "id": "a61ed687-d40e-4888-94fd-7d122ccdee5f",
      "name": null,
      "power_limit_high": 5,
      "power_limit_low": -3,
      "precision": "auto",
      "tags": [],
      "use_scientific": true
    },
    "id": "a61ed687-d40e-4888-94fd-7d122ccdee5f",
    "type": "BasicTickFormatter"
  }
]
class CategoricalTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Display tick values from categorical ranges as string values.

[
  {
    "attributes": {
      "doc": null,
      "id": "c4591071-d9c0-406d-afa2-99e5f7bba88b",
      "name": null,
      "tags": []
    },
    "id": "c4591071-d9c0-406d-afa2-99e5f7bba88b",
    "type": "CategoricalTickFormatter"
  }
]
class DatetimeTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Display tick values from a continuous range as formatted datetimes.

formats

property type: Dict(Enum(‘microseconds’, ‘milliseconds’, ‘seconds’, ‘minsec’, ‘minutes’, ‘hourmin’, ‘hours’, ‘days’, ‘months’, ‘years’), List(String))

User defined formats for displaying datetime values.

The enum values correspond roughly to different “time scales”. The corresponding value is a list of strftime formats to use for formatting datetime values that fall in in that “time scale”.

This list of supported strftime formats is reproduced below.

Warning

The client library BokehJS uses the timezone library to format datetimes. The inclusion of the list below is based on the claim that timezone makes to support “the full compliment of GNU date format specifiers.” However, this claim has not been tested exhaustively against this list. If you find formats that do not function as expected, please submit a github issue, so that the documentation can be updated appropriately.

%a
The abbreviated name of the day of the week according to the current locale.
%A
The full name of the day of the week according to the current locale.
%b
The abbreviated month name according to the current locale.
%B
The full month name according to the current locale.
%c
The preferred date and time representation for the current locale.
%C
The century number (year/100) as a 2-digit integer.
%d
The day of the month as a decimal number (range 01 to 31).
%D
Equivalent to %m/%d/%y. (Americans should note that in many other countries %d/%m/%y is rather common. This means that in international context this format is ambiguous and should not be used.)
%e
Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space.
%F
Equivalent to %Y-%m-%d (the ISO 8601 date format).
%G
The ISO 8601 week-based year with century as a decimal number. The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead.
%g
Like %G, but without century, that is, with a 2-digit year (00-99).
%h
Equivalent to %b.
%H
The hour as a decimal number using a 24-hour clock (range 00 to 23).
%I
The hour as a decimal number using a 12-hour clock (range 01 to 12).
%j
The day of the year as a decimal number (range 001 to 366).
%k
The hour (24-hour clock) as a decimal number (range 0 to 23). Single digits are preceded by a blank. (See also %H.)
%l
The hour (12-hour clock) as a decimal number (range 1 to 12). Single digits are preceded by a blank. (See also %I.) (TZ)
%m
The month as a decimal number (range 01 to 12).
%M
The minute as a decimal number (range 00 to 59).
%n
A newline character.
%p
Either “AM” or “PM” according to the given time value, or the corresponding strings for the current locale. Noon is treated as “PM” and midnight as “AM”.
%P
Like %p but in lowercase: “am” or “pm” or a corresponding string for the current locale.
%r
The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to %I:%M:%S %p.
%R
The time in 24-hour notation (%H:%M). For a version including the seconds, see %T below.
%s
The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
%S
The second as a decimal number (range 00 to 60). (The range is up to 60 to allow for occasional leap seconds.)
%t
A tab character.
%T
The time in 24-hour notation (%H:%M:%S).
%u
The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w.
%U
The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W.
%V
The ISO 8601 week number (see NOTES) of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the new year. See also %U and %W.
%w
The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u.
%W
The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.
%x
The preferred date representation for the current locale without the time.
%X
The preferred time representation for the current locale without the date.
%y
The year as a decimal number without a century (range 00 to 99).
%Y
The year as a decimal number including the century.
%z
The +hhmm or -hhmm numeric timezone (that is, the hour and minute offset from UTC).
%Z
The timezone name or abbreviation.
%%
A literal ‘%’ character.
[
  {
    "attributes": {
      "doc": null,
      "formats": {},
      "id": "f44c81d8-39b4-484a-ad9b-10956129ab21",
      "name": null,
      "tags": []
    },
    "id": "f44c81d8-39b4-484a-ad9b-10956129ab21",
    "type": "DatetimeTickFormatter"
  }
]
class LogTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Display tick values from continuous ranges as powers of some base.

Most often useful in conjunction with a LogTicker.

ticker

property type: Instance(Ticker)

The corresponding LogTicker, used to determine the correct base to use. If unset, the formatter will use base 10 as a default.

[
  {
    "attributes": {
      "doc": null,
      "id": "6fc470b2-e02e-4da3-9a39-b8178585bcd7",
      "name": null,
      "tags": [],
      "ticker": null
    },
    "id": "6fc470b2-e02e-4da3-9a39-b8178585bcd7",
    "type": "LogTickFormatter"
  }
]
class NumeralTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Tick formatter based on a human-readable format string.

format

property type: String

The number format, as defined in the following tables:

NUMBERS:

Number Format String
10000 ‘0,0.0000’ 10,000.0000
10000.23 ‘0,0’ 10,000
10000.23 ‘+0,0’ +10,000
-10000 ‘0,0.0’ -10,000.0
10000.1234 ‘0.000’ 10000.123
10000.1234 ‘0[.]00000’ 10000.12340
-10000 ‘(0,0.0000)’ (10,000.0000)
-0.23 ‘.00’ -.23
-0.23 ‘(.00)’ (.23)
0.23 ‘0.00000’ 0.23000
0.23 ‘0.0[0000]’ 0.23
1230974 ‘0.0a’ 1.2m
1460 ‘0 a’ 1 k
-104000 ‘0a’ -104k
1 ‘0o’ 1st
52 ‘0o’ 52nd
23 ‘0o’ 23rd
100 ‘0o’ 100th

CURRENCY:

Number Format String
1000.234 ‘$0,0.00’ $1,000.23
1000.2 ‘0,0[.]00 $’ 1,000.20 $
1001 ‘$ 0,0[.]00’ $ 1,001
-1000.234 ‘($0,0)’ ($1,000)
-1000.234 ‘$0.00’ -$1000.23
1230974 ‘($ 0.00 a)’ $ 1.23 m

BYTES:

Number Format String
100 ‘0b’ 100B
2048 ‘0 b’ 2 KB
7884486213 ‘0.0b’ 7.3GB
3467479682787 ‘0.000 b’ 3.154 TB

PERCENTAGES:

Number Format String
1 ‘0%’ 100%
0.974878234 ‘0.000%’ 97.488%
-0.43 ‘0 %’ -43 %
0.43 ‘(0.000 %)’ 43.000 %

TIME:

Number Format String
25 ‘00:00:00’ 0:00:25
238 ‘00:00:00’ 0:03:58
63846 ‘00:00:00’ 17:44:06
language

property type: Enum(‘be-nl’, ‘chs’, ‘cs’, ‘da-dk’, ‘de-ch’, ‘de’, ‘en’, ‘en-gb’, ‘es-ES’, ‘es’, ‘et’, ‘fi’, ‘fr-CA’, ‘fr-ch’, ‘fr’, ‘hu’, ‘it’, ‘ja’, ‘nl-nl’, ‘pl’, ‘pt-br’, ‘pt-pt’, ‘ru’, ‘ru-UA’, ‘sk’, ‘th’, ‘tr’, ‘uk-UA’)

The language to use for formatting language-specific features (e.g. thousands separator).

rounding

property type: Enum(‘round’, ‘nearest’, ‘floor’, ‘rounddown’, ‘ceil’, ‘roundup’)

Rounding functions (round, floor, ceil) and their synonyms (nearest, rounddown, roundup).

[
  {
    "attributes": {
      "doc": null,
      "format": "0,0",
      "id": "f7ffebbb-9bc1-486b-87d8-8cf532e336b3",
      "language": "en",
      "name": null,
      "rounding": "round",
      "tags": []
    },
    "id": "f7ffebbb-9bc1-486b-87d8-8cf532e336b3",
    "type": "NumeralTickFormatter"
  }
]
class PrintfTickFormatter(**kwargs)

Bases: bokeh.models.formatters.TickFormatter

Tick formatter based on a printf-style format string.

format

property type: String

The numer format, as defined as follows: the placeholder in the format string is marked by % and is followed by one or more of these elements, in this order:

  • An optional + sign

    Causes the result to be preceded with a plus or minus sign on numeric values. By default, only the - sign is used on negative numbers.

  • An optional padding specifier

    Specifies what (if any) character to use for padding. Possible values are 0 or any other character precedeed by a ' (single quote). The default is to pad with spaces.

  • An optional - sign

    Causes sprintf to left-align the result of this placeholder. The default is to right-align the result.

  • An optional number

    Specifies how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded.

  • An optional precision modifier

    Consists of a . (dot) followed by a number, specifies how many digits should be displayed for floating point numbers. When used on a string, it causes the result to be truncated.

  • A type specifier

    Can be any of:

    • % — yields a literal % character
    • b — yields an integer as a binary number
    • c — yields an integer as the character with that ASCII value
    • d or i — yields an integer as a signed decimal number
    • e — yields a float using scientific notation
    • u — yields an integer as an unsigned decimal number
    • f — yields a float as is
    • o — yields an integer as an octal number
    • s — yields a string as is
    • x — yields an integer as a hexadecimal number (lower-case)
    • X — yields an integer as a hexadecimal number (upper-case)
[
  {
    "attributes": {
      "doc": null,
      "format": "%s",
      "id": "f38c9edf-be02-48cf-82c1-8d9871f93ab3",
      "name": null,
      "tags": []
    },
    "id": "f38c9edf-be02-48cf-82c1-8d9871f93ab3",
    "type": "PrintfTickFormatter"
  }
]
class TickFormatter(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all tick formatter types. TickFormatter is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "doc": null,
      "id": "9ec3d98d-ea0c-49f8-ba95-478af6dde67c",
      "name": null,
      "tags": []
    },
    "id": "9ec3d98d-ea0c-49f8-ba95-478af6dde67c",
    "type": "TickFormatter"
  }
]

bokeh.models.glyphs

Models for display visual shapes whose attributes can be associated with data columns from data sources.

class AnnularWedge(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render annular wedges.

Example

source: tests/glyphs/AnnularWedge.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: DataSpec

The angles to end the annular wedges, in radians, as measured from the horizontal.

fill_alpha

property type: DataSpec

The fill alpha values for the annular wedges.

fill_color

property type: ColorSpec

The fill color values for the annular wedges.

inner_radius

property type: DataSpec

The inner radii of the annular wedges.

line_alpha

property type: DataSpec

The line alpha values for the annular wedges.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the annular wedges.

line_color

property type: ColorSpec

The line color values for the annular wedges.

line_dash

property type: DashPattern

The line dash values for the annular wedges.

line_dash_offset

property type: Int

The line dash offset values for the annular wedges.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the annular wedges.

line_width

property type: DataSpec

The line width values for the annular wedges.

outer_radius

property type: DataSpec

The outer radii of the annular wedges.

start_angle

property type: DataSpec

The angles to start the annular wedges, in radians, as measured from the horizontal.

x

property type: DataSpec

The x-coordinates of the center of the annular wedges.

y

property type: DataSpec

The y-coordinates of the center of the annular wedges.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "data"
      },
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "e595b949-fe41-472e-b976-00bbe1d6d720",
      "inner_radius": null,
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "outer_radius": null,
      "start_angle": {
        "field": "start_angle",
        "units": "data"
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "e595b949-fe41-472e-b976-00bbe1d6d720",
    "type": "AnnularWedge"
  }
]
class Annulus(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render annuli.

Example

source: tests/glyphs/Annulus.py

fill_alpha

property type: DataSpec

The fill alpha values for the annuli.

fill_color

property type: ColorSpec

The fill color values for the annuli.

inner_radius

property type: DataSpec

The inner radii of the annuli.

line_alpha

property type: DataSpec

The line alpha values for the annuli.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the annuli.

line_color

property type: ColorSpec

The line color values for the annuli.

line_dash

property type: DashPattern

The line dash values for the annuli.

line_dash_offset

property type: Int

The line dash offset values for the annuli.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the annuli.

line_width

property type: DataSpec

The line width values for the annuli.

outer_radius

property type: DataSpec

The outer radii of the annuli.

x

property type: DataSpec

The x-coordinates of the center of the annuli.

y

property type: DataSpec

The y-coordinates of the center of the annuli.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "54b8dd4d-1876-414b-84ec-05b9c60c75e6",
      "inner_radius": null,
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "outer_radius": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "54b8dd4d-1876-414b-84ec-05b9c60c75e6",
    "type": "Annulus"
  }
]
class Arc(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render arcs.

Example

source: tests/glyphs/Arc.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: DataSpec

The angles to end the arcs, in radians, as measured from the horizontal.

line_alpha

property type: DataSpec

The line alpha values for the arcs.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the arcs.

line_color

property type: ColorSpec

The line color values for the arcs.

line_dash

property type: DashPattern

The line dash values for the arcs.

line_dash_offset

property type: Int

The line dash offset values for the arcs.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the arcs.

line_width

property type: DataSpec

The line width values for the arcs.

radius

property type: DataSpec

Radius of the arc.

start_angle

property type: DataSpec

The angles to start the arcs, in radians, as measured from the horizontal.

x

property type: DataSpec

The x-coordinates of the center of the arcs.

y

property type: DataSpec

The y-coordinates of the center of the arcs.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "data"
      },
      "id": "321117ad-b938-425a-864d-bcc98f026b59",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "radius": null,
      "start_angle": {
        "field": "start_angle",
        "units": "data"
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "321117ad-b938-425a-864d-bcc98f026b59",
    "type": "Arc"
  }
]
class Bezier(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render Bézier curves.

For more information consult the Wikipedia article for Bézier curve.

Example

source: tests/glyphs/Bezier.py

cx0

property type: DataSpec

The x-coordinates of first control points.

cx1

property type: DataSpec

The x-coordinates of second control points.

cy0

property type: DataSpec

The y-coordinates of first control points.

cy1

property type: DataSpec

The y-coordinates of second control points.

line_alpha

property type: DataSpec

The line alpha values for the Bézier curves.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the Bézier curves.

line_color

property type: ColorSpec

The line color values for the Bézier curves.

line_dash

property type: DashPattern

The line dash values for the Bézier curves.

line_dash_offset

property type: Int

The line dash offset values for the Bézier curves.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the Bézier curves.

line_width

property type: DataSpec

The line width values for the Bézier curves.

x0

property type: DataSpec

The x-coordinates of the starting points.

x1

property type: DataSpec

The x-coordinates of the ending points.

y0

property type: DataSpec

The y-coordinates of the starting points.

y1

property type: DataSpec

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "cx0": {
        "field": "cx0",
        "units": "data"
      },
      "cx1": {
        "field": "cx1",
        "units": "data"
      },
      "cy0": {
        "field": "cy0",
        "units": "data"
      },
      "cy1": {
        "field": "cy1",
        "units": "data"
      },
      "doc": null,
      "id": "05e5acda-80be-4641-81b8-6e5ecf5bcfc8",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0",
        "units": "data"
      },
      "x1": {
        "field": "x1",
        "units": "data"
      },
      "y0": {
        "field": "y0",
        "units": "data"
      },
      "y1": {
        "field": "y1",
        "units": "data"
      }
    },
    "id": "05e5acda-80be-4641-81b8-6e5ecf5bcfc8",
    "type": "Bezier"
  }
]
class Gear(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render gears.

The details and nomenclature concerning gear construction can be quite involved. For more information, consult the Wikipedia article for Gear.

Example

source: tests/glyphs/Gear.py

angle

property type: DataSpec

The angle the gears are rotated from horizontal. [rad]

fill_alpha

property type: DataSpec

The fill alpha values for the gears.

fill_color

property type: ColorSpec

The fill color values for the gears.

internal

property type: DataSpec

Whether the gear teeth are internal. [bool]

line_alpha

property type: DataSpec

The line alpha values for the gears.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the gears.

line_color

property type: ColorSpec

The line color values for the gears.

line_dash

property type: DashPattern

The line dash values for the gears.

line_dash_offset

property type: Int

The line dash offset values for the gears.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the gears.

line_width

property type: DataSpec

The line width values for the gears.

module

property type: DataSpec

A scaling factor, given by:

m = p / pi

where p is the circular pitch, defined as the distance from one face of a tooth to the corresponding face of an adjacent tooth on the same gear, measured along the pitch circle. [float]

pressure_angle

property type: DataSpec

The complement of the angle between the direction that the teeth exert force on each other, and the line joining the centers of the two gears. [deg]

shaft_size

property type: DataSpec

The central gear shaft size as a percentage of the overall gear size. [float]

teeth

property type: DataSpec

How many teeth the gears have. [int]

x

property type: DataSpec

The x-coordinates of the center of the gears.

y

property type: DataSpec

The y-coordinates of the center of the gears.

[
  {
    "attributes": {
      "angle": {
        "units": "data",
        "value": 0
      },
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "08c9204d-b571-4fea-9254-2f1f0bdd6a6f",
      "internal": {
        "units": "data",
        "value": false
      },
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "module": {
        "field": "module",
        "units": "data"
      },
      "name": null,
      "pressure_angle": {
        "units": "data",
        "value": 20
      },
      "shaft_size": {
        "units": "data",
        "value": 0.3
      },
      "tags": [],
      "teeth": {
        "field": "teeth",
        "units": "data"
      },
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "08c9204d-b571-4fea-9254-2f1f0bdd6a6f",
    "type": "Gear"
  }
]
class Glyph(**kwargs)

Bases: bokeh.plot_object.PlotObject

Base class for all glyphs/marks/geoms/whatever-you-call-‘em in Bokeh.

visible

property type: Bool

Whether the glyph should render or not.

[
  {
    "attributes": {
      "doc": null,
      "id": "b0a05889-550b-4a49-a0fc-7f282221b2ff",
      "name": null,
      "tags": [],
      "visible": null
    },
    "id": "b0a05889-550b-4a49-a0fc-7f282221b2ff",
    "type": "Glyph"
  }
]
class Image(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images given as scalar data together with a color mapper.

color_mapper

property type: Instance(Linear:class:~bokeh.properties.ColorMapper)

A ColorMapper to use to map the scalar data from image into RGBA values for display.

Note

The color mapping step happens on the client.

dh

property type: DataSpec

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

dw

property type: DataSpec

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

image

property type: DataSpec

The arrays of scalar data for the images to be colormapped.

x

property type: DataSpec

The x-coordinates to locate the image anchors.

y

property type: DataSpec

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "doc": null,
      "high": null,
      "id": "6c3b5592-dbbb-40b5-b4b8-251d287b7e18",
      "low": null,
      "name": null,
      "palette": [
        "#000000",
        "#252525",
        "#525252",
        "#737373",
        "#969696",
        "#bdbdbd",
        "#d9d9d9",
        "#f0f0f0",
        "#ffffff"
      ],
      "reserve_color": "#ffffff",
      "reserve_val": null,
      "tags": []
    },
    "id": "6c3b5592-dbbb-40b5-b4b8-251d287b7e18",
    "type": "LinearColorMapper"
  },
  {
    "attributes": {
      "color_mapper": {
        "id": "6c3b5592-dbbb-40b5-b4b8-251d287b7e18",
        "type": "LinearColorMapper"
      },
      "dh": {
        "field": "dh",
        "units": "data"
      },
      "dilate": false,
      "doc": null,
      "dw": {
        "field": "dw",
        "units": "data"
      },
      "id": "eda42113-568b-48f4-b0aa-9acd5055ee70",
      "image": {
        "field": "image",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "eda42113-568b-48f4-b0aa-9acd5055ee70",
    "type": "Image"
  }
]
class ImageRGBA(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images given as RGBA data.

cols

property type: DataSpec

The numbers of columns in the images

dh

property type: DataSpec

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

dw

property type: DataSpec

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

image

property type: DataSpec

The arrays of RGBA data for the images.

rows

property type: DataSpec

The numbers of rows in the images

x

property type: DataSpec

The x-coordinates to locate the image anchors.

y

property type: DataSpec

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "cols": {
        "field": "cols",
        "units": "data"
      },
      "dh": {
        "field": "dh",
        "units": "data"
      },
      "dilate": false,
      "doc": null,
      "dw": {
        "field": "dw",
        "units": "data"
      },
      "id": "d437b731-62bd-42c5-8711-fd807c505ec5",
      "image": {
        "field": "image",
        "units": "data"
      },
      "name": null,
      "rows": {
        "field": "rows",
        "units": "data"
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "d437b731-62bd-42c5-8711-fd807c505ec5",
    "type": "ImageRGBA"
  }
]
class ImageURL(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render images loaded from given URLs.

Example

source: tests/glyphs/ImageURL.py

anchor

property type: Enum(‘top_left’, ‘top_center’, ‘top_right’, ‘right_center’, ‘bottom_right’, ‘bottom_center’, ‘bottom_left’, ‘left_center’, ‘center’)

What position of the image should be anchored at the x, y coordinates.

angle

property type: DataSpec

The angles to rotate the images, in radians as measured from the horizontal.

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the images bigger.

This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush.

h

property type: DataSpec

The height of the plot region that the image will occupy.

Note

This is not the number of pixels that an image is tall. That number is fixed by the image itself.

Note

This may be renamed to “dh” in the future.

url

property type: DataSpec

The URLs to retrieve images from.

Note

The actual retrieving and loading of the images happens on the client.

w

property type: DataSpec

The widths of the plot regions that the images will occupy.

Note

This is not the number of pixels that an image is wide. That number is fixed by the image itself.

Note

This may be renamed to “dw” in the future.

x

property type: DataSpec

The x-coordinates to locate the image anchors.

y

property type: DataSpec

The y-coordinates to locate the image anchors.

[
  {
    "attributes": {
      "anchor": "top_left",
      "angle": {
        "units": "data",
        "value": 0
      },
      "dilate": false,
      "doc": null,
      "h": {
        "field": "h",
        "units": "data"
      },
      "id": "db21f196-4660-466b-b833-55255387b0ea",
      "name": null,
      "tags": [],
      "url": {
        "field": "url",
        "units": "data"
      },
      "visible": null,
      "w": {
        "field": "w",
        "units": "data"
      },
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "db21f196-4660-466b-b833-55255387b0ea",
    "type": "ImageURL"
  }
]
class Line(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render a single line.

Note

The Line glyph is different from most other glyphs in that the vector of values only produces one glyph on the Plot.

Example

source: tests/glyphs/Line.py

line_alpha

property type: DataSpec

The line alpha values for the line.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the line.

line_color

property type: ColorSpec

The line color values for the line.

line_dash

property type: DashPattern

The line dash values for the line.

line_dash_offset

property type: Int

The line dash offset values for the line.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the line.

line_width

property type: DataSpec

The line width values for the line.

x

property type: DataSpec

The x-coordinates for the points of the line.

y

property type: DataSpec

The y-coordinates for the points of the line.

[
  {
    "attributes": {
      "doc": null,
      "id": "c3a0f568-5ed3-47a4-aca4-79dde050be64",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "c3a0f568-5ed3-47a4-aca4-79dde050be64",
    "type": "Line"
  }
]
class MultiLine(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render several lines.

Note

The data for the MultiLine glyph is different in that the vector of values is not a vector of scalars. Rather, it is a “list of lists”.

Example

source: tests/glyphs/MultiLine.py

line_alpha

property type: DataSpec

The line alpha values for the lines.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the lines.

line_color

property type: ColorSpec

The line color values for the lines.

line_dash

property type: DashPattern

The line dash values for the lines.

line_dash_offset

property type: Int

The line dash offset values for the lines.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the lines.

line_width

property type: DataSpec

The line width values for the lines.

xs

property type: DataSpec

The x-coordinates for all the lines, given as a “list of lists”.

ys

property type: DataSpec

The x-coordinates for all the lines, given as a “list of lists”.

[
  {
    "attributes": {
      "doc": null,
      "id": "64ec29c0-05c8-4530-bef6-6a47f17ca07d",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "xs": {
        "field": "xs",
        "units": "data"
      },
      "ys": {
        "field": "ys",
        "units": "data"
      }
    },
    "id": "64ec29c0-05c8-4530-bef6-6a47f17ca07d",
    "type": "MultiLine"
  }
]
class Oval(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render ovals.

Note

This glyph renders ovals using Bézier curves, which are similar, but not identical to ellipses.

Example

source: tests/glyphs/Oval.py

angle

property type: DataSpec

The angle the ovals are rotated from horizontal. [rad]

fill_alpha

property type: DataSpec

The fill alpha values for the ovals.

fill_color

property type: ColorSpec

The fill color values for the ovals.

height

property type: DataSpec

The overall height of each oval.

line_alpha

property type: DataSpec

The line alpha values for the ovals.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the ovals.

line_color

property type: ColorSpec

The line color values for the ovals.

line_dash

property type: DashPattern

The line dash values for the ovals.

line_dash_offset

property type: Int

The line dash offset values for the ovals.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the ovals.

line_width

property type: DataSpec

The line width values for the ovals.

width

property type: DataSpec

The overall widths of each oval.

x

property type: DataSpec

The x-coordinates of the centers of the ovals.

y

property type: DataSpec

The y-coordinates of the centers of the ovals.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "data"
      },
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "height": {
        "field": "height",
        "units": "data"
      },
      "id": "243adc79-7e1b-4551-a57f-7a562871aca4",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "width": {
        "field": "width",
        "units": "data"
      },
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "243adc79-7e1b-4551-a57f-7a562871aca4",
    "type": "Oval"
  }
]
class Patch(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render a single patch.

Note

The Patch glyph is different from most other glyphs in that the vector of values only produces one glyph on the Plot.

Example

source: tests/glyphs/Patch.py

fill_alpha

property type: DataSpec

The fill alpha values for the patch.

fill_color

property type: ColorSpec

The fill color values for the patch.

line_alpha

property type: DataSpec

The line alpha values for the patch.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the patch.

line_color

property type: ColorSpec

The line color values for the patch.

line_dash

property type: DashPattern

The line dash values for the patch.

line_dash_offset

property type: Int

The line dash offset values for the patch.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the patch.

line_width

property type: DataSpec

The line width values for the patch.

x

property type: DataSpec

The x-coordinates for the points of the patch.

Note

A patch may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sequence.

y

property type: DataSpec

The y-coordinates for the points of the patch.

Note

A patch may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sequence.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "c4273ec3-8596-4cac-be27-1247ae924d86",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "c4273ec3-8596-4cac-be27-1247ae924d86",
    "type": "Patch"
  }
]
class Patches(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render several patches.

Note

The data for the Patches glyph is different in that the vector of values is not a vector of scalars. Rather, it is a “list of lists”.

Example

source: tests/glyphs/Patches.py

fill_alpha

property type: DataSpec

The fill alpha values for the patches.

fill_color

property type: ColorSpec

The fill color values for the patches.

line_alpha

property type: DataSpec

The line alpha values for the patches.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the patches.

line_color

property type: ColorSpec

The line color values for the patches.

line_dash

property type: DashPattern

The line dash values for the patches.

line_dash_offset

property type: Int

The line dash offset values for the patches.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the patches.

line_width

property type: DataSpec

The line width values for the patches.

xs

property type: DataSpec

The x-coordinates for all the patches, given as a “list of lists”.

Note

Individual patches may comprise multiple polygons. In this case the x-coordinates for each polygon should be separated by NaN values in the sublists.

ys

property type: DataSpec

The y-coordinates for all the patches, given as a “list of lists”.

Note

Individual patches may comprise multiple polygons. In this case the y-coordinates for each polygon should be separated by NaN values in the sublists.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "ccf97137-7bb9-4d43-960d-32f3fb80f297",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "xs": {
        "field": "xs",
        "units": "data"
      },
      "ys": {
        "field": "ys",
        "units": "data"
      }
    },
    "id": "ccf97137-7bb9-4d43-960d-32f3fb80f297",
    "type": "Patches"
  }
]
class Quad(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render axis-aligned quads.

Example

source: tests/glyphs/Quad.py

bottom

property type: DataSpec

The y-coordinates of the bottom edges.

fill_alpha

property type: DataSpec

The fill alpha values for the quads.

fill_color

property type: ColorSpec

The fill color values for the quads.

left

property type: DataSpec

The x-coordinates of the left edges.

line_alpha

property type: DataSpec

The line alpha values for the quads.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the quads.

line_color

property type: ColorSpec

The line color values for the quads.

line_dash

property type: DashPattern

The line dash values for the quads.

line_dash_offset

property type: Int

The line dash offset values for the quads.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the quads.

line_width

property type: DataSpec

The line width values for the quads.

right

property type: DataSpec

The x-coordinates of the right edges.

top

property type: DataSpec

The y-coordinates of the top edges.

[
  {
    "attributes": {
      "bottom": {
        "field": "bottom",
        "units": "data"
      },
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "776bb575-98c6-49e5-8c0a-ac0cb320b280",
      "left": {
        "field": "left",
        "units": "data"
      },
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "right": {
        "field": "right",
        "units": "data"
      },
      "tags": [],
      "top": {
        "field": "top",
        "units": "data"
      },
      "visible": null
    },
    "id": "776bb575-98c6-49e5-8c0a-ac0cb320b280",
    "type": "Quad"
  }
]
class Quadratic(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render parabolas.

Example

source: tests/glyphs/Quadratic.py

cx

property type: DataSpec

The x-coordinates of the control points.

cy

property type: DataSpec

The y-coordinates of the control points.

line_alpha

property type: DataSpec

The line alpha values for the parabolas.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the parabolas.

line_color

property type: ColorSpec

The line color values for the parabolas.

line_dash

property type: DashPattern

The line dash values for the parabolas.

line_dash_offset

property type: Int

The line dash offset values for the parabolas.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the parabolas.

line_width

property type: DataSpec

The line width values for the parabolas.

x0

property type: DataSpec

The x-coordinates of the starting points.

x1

property type: DataSpec

The x-coordinates of the ending points.

y0

property type: DataSpec

The y-coordinates of the starting points.

y1

property type: DataSpec

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "cx": {
        "field": "cx",
        "units": "data"
      },
      "cy": {
        "field": "cy",
        "units": "data"
      },
      "doc": null,
      "id": "990f2e24-e3d1-4a6d-a14d-ed6a841fe287",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0",
        "units": "data"
      },
      "x1": {
        "field": "x1",
        "units": "data"
      },
      "y0": {
        "field": "y0",
        "units": "data"
      },
      "y1": {
        "field": "y1",
        "units": "data"
      }
    },
    "id": "990f2e24-e3d1-4a6d-a14d-ed6a841fe287",
    "type": "Quadratic"
  }
]
class Ray(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render rays.

Example

source: tests/glyphs/Ray.py

angle

property type: DataSpec

The angles in radians to extend the rays, as measured from the horizontal.

length

property type: DataSpec

The length to extend the ray. Note that this length defaults to screen units.

line_alpha

property type: DataSpec

The line alpha values for the rays.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the rays.

line_color

property type: ColorSpec

The line color values for the rays.

line_dash

property type: DashPattern

The line dash values for the rays.

line_dash_offset

property type: Int

The line dash offset values for the rays.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the rays.

line_width

property type: DataSpec

The line width values for the rays.

x

property type: DataSpec

The x-coordinates to start the rays.

y

property type: DataSpec

The y-coordinates to start the rays.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "data"
      },
      "doc": null,
      "id": "01f7a4d1-8ff1-4472-b15e-3df14119e1f4",
      "length": null,
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "01f7a4d1-8ff1-4472-b15e-3df14119e1f4",
    "type": "Ray"
  }
]
class Rect(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render rectangles.

Example

source: tests/glyphs/Rect.py

angle

property type: DataSpec

The angles to rotate the rectangles, in radians, as measured from the horizontal.

dilate

property type: Bool

Whether to always round fractional pixel locations in such a way as to make the rectangles bigger.

This setting may be useful if pixel rounding errors are causing rectangles to have a gap between them, when they should appear flush.

fill_alpha

property type: DataSpec

The fill alpha values for the rectangles.

fill_color

property type: ColorSpec

The fill color values for the rectangles.

height

property type: DataSpec

The overall heights of the rectangles.

line_alpha

property type: DataSpec

The line alpha values for the rectangles.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the rectangles.

line_color

property type: ColorSpec

The line color values for the rectangles.

line_dash

property type: DashPattern

The line dash values for the rectangles.

line_dash_offset

property type: Int

The line dash offset values for the rectangles.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the rectangles.

line_width

property type: DataSpec

The line width values for the rectangles.

width

property type: DataSpec

The overall widths of the rectangles.

x

property type: DataSpec

The x-coordinates of the centers of the rectangles.

y

property type: DataSpec

The y-coordinates of the centers of the rectangles.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "data"
      },
      "dilate": false,
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "height": {
        "field": "height",
        "units": "data"
      },
      "id": "b90068c1-7a78-43b0-ab76-fdb8924798bc",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "width": {
        "field": "width",
        "units": "data"
      },
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "b90068c1-7a78-43b0-ab76-fdb8924798bc",
    "type": "Rect"
  }
]
class Segment(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render segments.

Example

source: tests/glyphs/Segment.py

line_alpha

property type: DataSpec

The line alpha values for the segments.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the segments.

line_color

property type: ColorSpec

The line color values for the segments.

line_dash

property type: DashPattern

The line dash values for the segments.

line_dash_offset

property type: Int

The line dash offset values for the segments.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the segments.

line_width

property type: DataSpec

The line width values for the segments.

x0

property type: DataSpec

The x-coordinates of the starting points.

x1

property type: DataSpec

The x-coordinates of the ending points.

y0

property type: DataSpec

The y-coordinates of the starting points.

y1

property type: DataSpec

The y-coordinates of the ending points.

[
  {
    "attributes": {
      "doc": null,
      "id": "942177a3-f89a-4158-bf56-7ae2e64792ee",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "tags": [],
      "visible": null,
      "x0": {
        "field": "x0",
        "units": "data"
      },
      "x1": {
        "field": "x1",
        "units": "data"
      },
      "y0": {
        "field": "y0",
        "units": "data"
      },
      "y1": {
        "field": "y1",
        "units": "data"
      }
    },
    "id": "942177a3-f89a-4158-bf56-7ae2e64792ee",
    "type": "Segment"
  }
]
class Text(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render text.

Example

source: tests/glyphs/Text.py

angle

property type: DataSpec

The angles to rotate the text, in radians,, as measured from the horizontal.

text

property type: DataSpec

The text values to render.

text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align values for the text.

text_alpha

property type: DataSpec

The text alpha values for the text.

text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline values for the text.

text_color

property type: ColorSpec

The text color values for the text.

text_font

property type: String

The text font values for the text.

text_font_size

property type: String

The text font size values for the text.

text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style values for the text.

x

property type: DataSpec

The x-coordinates to locate the text anchors.

x_offset

property type: DataSpec

Offset values to apply to the x-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

y

property type: DataSpec

The y-coordinates to locate the text anchors.

y_offset

property type: DataSpec

Offset values to apply to the y-coordinates.

This is useful, for instance, if it is desired to “float” text a fixed distance in screen units from a given data position.

[
  {
    "attributes": {
      "angle": {
        "units": "data",
        "value": 0
      },
      "doc": null,
      "id": "403125c7-945a-41eb-a449-93f3367f08fc",
      "name": null,
      "tags": [],
      "text": {
        "field": "text",
        "units": "data"
      },
      "text_align": "left",
      "text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "text_baseline": "bottom",
      "text_color": {
        "value": "#444444"
      },
      "text_font": "Helvetica",
      "text_font_size": "12pt",
      "text_font_style": "normal",
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "x_offset": {
        "field": "x_offset",
        "units": "screen"
      },
      "y": {
        "field": "y",
        "units": "data"
      },
      "y_offset": {
        "field": "y_offset",
        "units": "screen"
      }
    },
    "id": "403125c7-945a-41eb-a449-93f3367f08fc",
    "type": "Text"
  }
]
class Wedge(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Render wedges.

Example

source: tests/glyphs/Wedge.py

direction

property type: Enum(‘clock’, ‘anticlock’)

Which direction to stroke between the start and end angles.

end_angle

property type: DataSpec

The angles to end the wedges, in radians as measured from the horizontal.

fill_alpha

property type: DataSpec

The fill alpha values for the wedges.

fill_color

property type: ColorSpec

The fill color values for the wedges.

line_alpha

property type: DataSpec

The line alpha values for the wedges.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the wedges.

line_color

property type: ColorSpec

The line color values for the wedges.

line_dash

property type: DashPattern

The line dash values for the wedges.

line_dash_offset

property type: Int

The line dash offset values for the wedges.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the wedges.

line_width

property type: DataSpec

The line width values for the wedges.

radius

property type: DataSpec

Radii of the wedges.

start_angle

property type: DataSpec

The angles to start the wedges, in radians, as measured from the horizontal.

x

property type: DataSpec

The x-coordinates of the points of the wedges.

y

property type: DataSpec

The y-coordinates of the points of the wedges.

[
  {
    "attributes": {
      "direction": "clock",
      "doc": null,
      "end_angle": {
        "field": "end_angle",
        "units": "data"
      },
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "263223cc-4e30-4bd8-a39b-3a09a6999495",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "radius": null,
      "start_angle": {
        "field": "start_angle",
        "units": "data"
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "263223cc-4e30-4bd8-a39b-3a09a6999495",
    "type": "Wedge"
  }
]

bokeh.models.grids

A guide renderer for displaying grid lines on Bokeh plots.

class Grid(**kwargs)

Bases: bokeh.models.renderers.GuideRenderer

Display horizontal or vertical grid lines at locations given by a supplied Ticker.

band_fill_alpha

property type: DataSpec

The fill alpha of alternating bands between Grid lines.

band_fill_color

property type: ColorSpec

The fill color of alternating bands between Grid lines.

bounds

property type: Either(Auto, Tuple(Float, Float))

Bounds for the rendered grid lines. If unset, the grid lines will span the entire plot in the given dimension.

dimension

property type: Int

Which dimension the Axis Grid lines will intersect. The x-axis is dimension 0 (vertical Grid lines) and the y-axis is dimension 1 (horizontal Grid lines).

grid_line_alpha

property type: DataSpec

The line alpha of the Grid lines.

grid_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap of the Grid lines.

grid_line_color

property type: ColorSpec

The line color of the Grid lines.

grid_line_dash

property type: DashPattern

The line dash of the Grid lines.

grid_line_dash_offset

property type: Int

The line dash offset of the Grid lines.

grid_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join of the Grid lines.

grid_line_width

property type: DataSpec

The line width of the Grid lines.

ticker

property type: Instance(Ticker)

The Ticker to use for computing locations for the Grid lines.

x_range_name

property type: String

A particular (named) x-range to use for computing screen locations when rendering a grid on the plot. If unset, use the default x-range.

y_range_name

property type: String

A particular (named) y-range to use for computing screen locations when rendering a grid on the plot. If unset, use the default y-range.

[
  {
    "attributes": {
      "band_fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "band_fill_color": {
        "value": "gray"
      },
      "bounds": "auto",
      "dimension": 0,
      "doc": null,
      "grid_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "grid_line_cap": "butt",
      "grid_line_color": {
        "value": "black"
      },
      "grid_line_dash": [],
      "grid_line_dash_offset": 0,
      "grid_line_join": "miter",
      "grid_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "id": "3c416e26-4caa-4b15-9377-f207d5e6b8b8",
      "name": null,
      "plot": null,
      "tags": [],
      "ticker": null,
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "3c416e26-4caa-4b15-9377-f207d5e6b8b8",
    "type": "Grid"
  }
]

bokeh.models.map_plots

Models for displaying maps in Bokeh plots.

class GMapOptions(**properties)

Options for GMapPlot objects.

lat

property type: Float

The latitude where the map should be centered.

lng

property type: Float

The longitude where the map should be centered.

map_type

property type: Enum(‘satellite’, ‘roadmap’, ‘terrain’, ‘hybrid’)

The map type to use for the GMapPlot.

zoom

property type: Int

The initial zoom level to use when displaying the GMapPlot.

class GMapPlot(**kwargs)

Bases: bokeh.models.plots.Plot

A Bokeh Plot with a Google Map displayed underneath.

map_options

property type: Instance(GMapOptions)

Options for displaying the plot.

[
  {
    "attributes": {
      "doc": null,
      "geometries": [],
      "id": "73b476ac-c6c0-4cf7-ba59-e1d8d8f6ce8b",
      "name": null,
      "tags": []
    },
    "id": "73b476ac-c6c0-4cf7-ba59-e1d8d8f6ce8b",
    "type": "ToolEvents"
  },
  {
    "attributes": {
      "above": [],
      "background_fill": "white",
      "below": [],
      "border_fill": "white",
      "disabled": false,
      "doc": null,
      "extra_x_ranges": {},
      "extra_y_ranges": {},
      "h_symmetry": true,
      "id": "08134441-1eee-4692-86d3-530ff79ff8bc",
      "left": [],
      "logo": "normal",
      "map_options": null,
      "min_border": 50,
      "min_border_bottom": 50,
      "min_border_left": 50,
      "min_border_right": 50,
      "min_border_top": 50,
      "name": null,
      "outline_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "outline_line_cap": "butt",
      "outline_line_color": {
        "value": "black"
      },
      "outline_line_dash": [],
      "outline_line_dash_offset": 0,
      "outline_line_join": "miter",
      "outline_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "plot_height": 600,
      "plot_width": 600,
      "renderers": [],
      "right": [],
      "tags": [],
      "title": "",
      "title_text_align": "left",
      "title_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "title_text_baseline": "bottom",
      "title_text_color": {
        "value": "#444444"
      },
      "title_text_font": "Helvetica",
      "title_text_font_size": "12pt",
      "title_text_font_style": "normal",
      "tool_events": {
        "id": "73b476ac-c6c0-4cf7-ba59-e1d8d8f6ce8b",
        "type": "ToolEvents"
      },
      "toolbar_location": "above",
      "tools": [],
      "v_symmetry": false,
      "x_mapper_type": "auto",
      "x_range": null,
      "y_mapper_type": "auto",
      "y_range": null
    },
    "id": "08134441-1eee-4692-86d3-530ff79ff8bc",
    "type": "GMapPlot"
  }
]
class GeoJSOptions(**properties)

Options for GeoJSPlot objects.

lat

property type: Float

The latitude where the map should be centered.

lng

property type: Float

The longitude where the map should be centered.

zoom

property type: Int

The initial zoom level to use when displaying the GeoJSPlot.

class GeoJSPlot(**kwargs)

Bases: bokeh.models.plots.Plot

A Bokeh Plot with a GeoJS Map displayed underneath.

Warning

GeoJSPlot support should be considered experimental, a subject to revision or removal.

map_options

property type: Instance(GeoJSOptions)

Options for displaying the plot.

[
  {
    "attributes": {
      "above": [],
      "background_fill": "white",
      "below": [],
      "border_fill": "white",
      "disabled": false,
      "doc": null,
      "extra_x_ranges": {},
      "extra_y_ranges": {},
      "h_symmetry": true,
      "id": "3f0e9349-af0e-4aa3-bf1c-de4e701d920b",
      "left": [],
      "logo": "normal",
      "map_options": null,
      "min_border": 50,
      "min_border_bottom": 50,
      "min_border_left": 50,
      "min_border_right": 50,
      "min_border_top": 50,
      "name": null,
      "outline_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "outline_line_cap": "butt",
      "outline_line_color": {
        "value": "black"
      },
      "outline_line_dash": [],
      "outline_line_dash_offset": 0,
      "outline_line_join": "miter",
      "outline_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "plot_height": 600,
      "plot_width": 600,
      "renderers": [],
      "right": [],
      "tags": [],
      "title": "",
      "title_text_align": "left",
      "title_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "title_text_baseline": "bottom",
      "title_text_color": {
        "value": "#444444"
      },
      "title_text_font": "Helvetica",
      "title_text_font_size": "12pt",
      "title_text_font_style": "normal",
      "tool_events": {
        "id": "83339742-165c-42a6-9ca5-efabf9970ef2",
        "type": "ToolEvents"
      },
      "toolbar_location": "above",
      "tools": [],
      "v_symmetry": false,
      "x_mapper_type": "auto",
      "x_range": null,
      "y_mapper_type": "auto",
      "y_range": null
    },
    "id": "3f0e9349-af0e-4aa3-bf1c-de4e701d920b",
    "type": "GeoJSPlot"
  },
  {
    "attributes": {
      "doc": null,
      "geometries": [],
      "id": "83339742-165c-42a6-9ca5-efabf9970ef2",
      "name": null,
      "tags": []
    },
    "id": "83339742-165c-42a6-9ca5-efabf9970ef2",
    "type": "ToolEvents"
  }
]

bokeh.models.mappers

Models for mapping values from one range or space to another.

class ColorMapper(**kwargs)

Bases: bokeh.plot_object.PlotObject

Base class for color mapper types. ColorMapper` is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "doc": null,
      "id": "93f3e57c-49dc-4a01-8d83-0d9fc72634a3",
      "name": null,
      "tags": []
    },
    "id": "93f3e57c-49dc-4a01-8d83-0d9fc72634a3",
    "type": "ColorMapper"
  }
]
class LinearColorMapper(palette=None, **kwargs)

Bases: bokeh.models.mappers.ColorMapper

Map numbers in a range [low, high] linearly into a sequence of colors (a palette).

For example, if the range is [0, 99] and the palette is ['red', 'green', 'blue'], the values would be mapped as follows:

      x < 0  : 'red'     # values < low are clamped
 0 >= x < 33 : 'red'
33 >= x < 66 : 'green'
66 >= x < 99 : 'blue'
99 >= x      : 'blue'    # values > high are clamped
high

property type: Float

The maximum value of the range to map into the palette. Values above this are clamped to high.

low

property type: Float

The minimum value of the range to map into the palette. Values below this are clamped to low.

palette

property type: Seq(Color)

A sequence of colors to use as the target palette for mapping.

This property can also be set as a String, to the name of any of the palettes shown in Standard Palettes.

reserve_color

property type: Color

Used by Abstract Rendering.

reserve_val

property type: Float

Used by Abstract Rendering.

[
  {
    "attributes": {
      "doc": null,
      "high": null,
      "id": "5d79897d-e89b-47ef-a062-2997c6f8b458",
      "low": null,
      "name": null,
      "palette": null,
      "reserve_color": "#ffffff",
      "reserve_val": null,
      "tags": []
    },
    "id": "5d79897d-e89b-47ef-a062-2997c6f8b458",
    "type": "LinearColorMapper"
  }
]

bokeh.models.markers

Glyph renderer models for displaying simple scatter-type markers on Bokeh plots.

class Asterisk(**kwargs)

Bases: bokeh.models.markers.Marker

Render asterisk ‘*’ markers.

Example

source: tests/glyphs/Asterisk.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "a57bd72e-20a6-4f02-b04f-de32463fc1ff",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "a57bd72e-20a6-4f02-b04f-de32463fc1ff",
    "type": "Asterisk"
  }
]
class Circle(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers.

Example

source: tests/glyphs/Circle.py

radius

property type: DataSpec

The radius values for circle markers. Interpreted in “data space” units by default.

Note

Circle markers are slightly unusual in that they support specifying a radius in addition to a size. Only one of radius or size should be given.

Warning

Note that Circle glyphs are always drawn as circles on the screen, even in cases where the data space aspect ratio is not 1-1. In all cases where radius or size units are specified as “data”, the “distance” for the radius is measured along the horizontal axis. If the aspect ratio is very large or small, the drawn circles may appear much larger or smaller than expected. See issue 626 for more information.

radius_dimension

property type: Enum(‘x’, ‘y’)

What dimension to measure circle radii along.

When the data space aspect ratio is not 1-1, then the size of the drawn circles depends on what direction is used to measure the “distance” of the radius. This property allows that direction to be controlled.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "60584c96-7f70-4ddc-8608-be504c01b7a8",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "radius": null,
      "radius_dimension": "x",
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "60584c96-7f70-4ddc-8608-be504c01b7a8",
    "type": "Circle"
  }
]
class CircleCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/CircleCross.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "c866d7cb-1111-4b2e-9141-8a0fc512ced9",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "c866d7cb-1111-4b2e-9141-8a0fc512ced9",
    "type": "CircleCross"
  }
]
class CircleX(**kwargs)

Bases: bokeh.models.markers.Marker

Render circle markers with an ‘X’ cross through the center.

Example

source: tests/glyphs/CircleX.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "4c703858-3241-44ee-b9b0-a5649d800325",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "4c703858-3241-44ee-b9b0-a5649d800325",
    "type": "CircleX"
  }
]
class Cross(**kwargs)

Bases: bokeh.models.markers.Marker

Render ‘+’ cross markers.

Example

source: tests/glyphs/Cross.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "620e9689-4080-40ab-834c-39557cbcf3a7",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "620e9689-4080-40ab-834c-39557cbcf3a7",
    "type": "Cross"
  }
]
class Diamond(**kwargs)

Bases: bokeh.models.markers.Marker

Render diamond markers.

Example

source: tests/glyphs/Diamond.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "72b3b698-e67d-4f83-ac6e-0668ddb56236",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "72b3b698-e67d-4f83-ac6e-0668ddb56236",
    "type": "Diamond"
  }
]
class DiamondCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render diamond markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/DiamondCross.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "959fbfc7-412f-44f9-96ce-1253f80b17ce",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "959fbfc7-412f-44f9-96ce-1253f80b17ce",
    "type": "DiamondCross"
  }
]
class InvertedTriangle(**kwargs)

Bases: bokeh.models.markers.Marker

Render upside-down triangle markers.

Example

source: tests/glyphs/InvertedTriangle.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "42e4a6ac-beaa-4978-9c94-e4a99844455a",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "42e4a6ac-beaa-4978-9c94-e4a99844455a",
    "type": "InvertedTriangle"
  }
]
class Marker(**kwargs)

Bases: bokeh.models.glyphs.Glyph

Base class for glyphs that are simple markers with line and fill properties, located at an (x, y) location with a specified size.

Note

For simplicity, all markers have both line and fill properties declared, however some markers (Asterisk, Cross, X) only draw lines. For these markers, the fill values are simply ignored.

fill_alpha

property type: DataSpec

The fill alpha values for the markers.

fill_color

property type: ColorSpec

The fill color values for the markers.

line_alpha

property type: DataSpec

The line alpha values for the markers.

line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap values for the markers.

line_color

property type: ColorSpec

The line color values for the markers.

line_dash

property type: DashPattern

The line dash values for the markers.

line_dash_offset

property type: Int

The line dash offset values for the markers.

line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join values for the markers.

line_width

property type: DataSpec

The line width values for the markers.

size

property type: DataSpec

The size (diameter) values for the markers. Interpreted as “screen space” units by default.

x

property type: DataSpec

The x-axis coordinates for the center of the markers.

y

property type: DataSpec

The y-axis coordinates for the center of the markers.

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "1b83c361-0475-41a4-8e0f-b44944d9fea3",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "1b83c361-0475-41a4-8e0f-b44944d9fea3",
    "type": "Marker"
  }
]
class Square(**kwargs)

Bases: bokeh.models.markers.Marker

Render a square marker, optionally rotated.

Example

source: tests/glyphs/Square.py

angle

property type: DataSpec

The angles (in radians) to rotate square markers.

[
  {
    "attributes": {
      "angle": {
        "field": "angle",
        "units": "data"
      },
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "79072dda-aaaa-455c-9416-0282958abdb3",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "79072dda-aaaa-455c-9416-0282958abdb3",
    "type": "Square"
  }
]
class SquareCross(**kwargs)

Bases: bokeh.models.markers.Marker

Render square markers with a ‘+’ cross through the center.

Example

source: tests/glyphs/SquareCross.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "f792b18d-6a59-4fde-8f84-53fa3f2b9dcc",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "f792b18d-6a59-4fde-8f84-53fa3f2b9dcc",
    "type": "SquareCross"
  }
]
class SquareX(**kwargs)

Bases: bokeh.models.markers.Marker

Render square markers with an ‘X’ cross through the center.

Example

source: tests/glyphs/SquareX.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "580961c9-287f-42d2-8251-d69808c63941",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "580961c9-287f-42d2-8251-d69808c63941",
    "type": "SquareX"
  }
]
class Triangle(**kwargs)

Bases: bokeh.models.markers.Marker

Render triangle markers.

Example

source: tests/glyphs/Triangle.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "45a3abf8-9f76-43d6-b706-65de8c9da58c",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "45a3abf8-9f76-43d6-b706-65de8c9da58c",
    "type": "Triangle"
  }
]
class X(**kwargs)

Bases: bokeh.models.markers.Marker

Render a ‘X’ cross markers.

Example

source: tests/glyphs/X.py

[
  {
    "attributes": {
      "doc": null,
      "fill_alpha": {
        "units": "data",
        "value": 1.0
      },
      "fill_color": {
        "value": "gray"
      },
      "id": "38c29357-0631-498f-9fe4-27199ce08745",
      "line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "line_cap": "butt",
      "line_color": {
        "value": "black"
      },
      "line_dash": [],
      "line_dash_offset": 0,
      "line_join": "miter",
      "line_width": {
        "field": "line_width",
        "units": "data"
      },
      "name": null,
      "size": {
        "units": "screen",
        "value": 4
      },
      "tags": [],
      "visible": null,
      "x": {
        "field": "x",
        "units": "data"
      },
      "y": {
        "field": "y",
        "units": "data"
      }
    },
    "id": "38c29357-0631-498f-9fe4-27199ce08745",
    "type": "X"
  }
]

bokeh.models.plots

Models for representing top-level plot objects.

class GridPlot(**kwargs)

Bases: bokeh.models.plots.Plot

A 2D grid of plots rendered on separate canvases in an HTML table.

column(col)

Return a given column of plots from this GridPlot.

Parameters:col (int) – index of the column to return
Returns:seq[Plot] : column of plots
row(row)

Return a given row of plots from this GridPlot.

Parameters:rwo (int) – index of the row to return
Returns:seq[Plot] : row of plots
select(selector)

Query this object and all of its references for objects that match the given selector.

Parameters:selector (JSON-like) –
Returns:seq[PlotObject]
border_space

property type: Int

Distance (in pixels) between adjacent plots.

children

property type: List(List(Instance(Plot)))

An array of plots to display in a grid, given as a list of lists of Plot objects. To leave a position in the grid empty, pass None for that position in the children list.

[
  {
    "attributes": {
      "above": [],
      "background_fill": "white",
      "below": [],
      "border_fill": "white",
      "border_space": 0,
      "children": [],
      "disabled": false,
      "doc": null,
      "extra_x_ranges": {},
      "extra_y_ranges": {},
      "h_symmetry": true,
      "id": "c68dff7e-f10b-4b5b-9023-9ab36d8dc84e",
      "left": [],
      "logo": "normal",
      "min_border": 50,
      "min_border_bottom": 50,
      "min_border_left": 50,
      "min_border_right": 50,
      "min_border_top": 50,
      "name": null,
      "outline_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "outline_line_cap": "butt",
      "outline_line_color": {
        "value": "black"
      },
      "outline_line_dash": [],
      "outline_line_dash_offset": 0,
      "outline_line_join": "miter",
      "outline_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "plot_height": 600,
      "plot_width": 600,
      "renderers": [],
      "right": [],
      "tags": [],
      "title": "",
      "title_text_align": "left",
      "title_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "title_text_baseline": "bottom",
      "title_text_color": {
        "value": "#444444"
      },
      "title_text_font": "Helvetica",
      "title_text_font_size": "12pt",
      "title_text_font_style": "normal",
      "tool_events": {
        "id": "8eee2287-be70-47a2-b552-9da578eae7f2",
        "type": "ToolEvents"
      },
      "toolbar_location": "above",
      "tools": [],
      "v_symmetry": false,
      "x_mapper_type": "auto",
      "x_range": null,
      "y_mapper_type": "auto",
      "y_range": null
    },
    "id": "c68dff7e-f10b-4b5b-9023-9ab36d8dc84e",
    "type": "GridPlot"
  },
  {
    "attributes": {
      "doc": null,
      "geometries": [],
      "id": "8eee2287-be70-47a2-b552-9da578eae7f2",
      "name": null,
      "tags": []
    },
    "id": "8eee2287-be70-47a2-b552-9da578eae7f2",
    "type": "ToolEvents"
  }
]
class Plot(**kwargs)

Bases: bokeh.models.widget.Widget

Model representing a plot, containing glyphs, guides, annotations.

add_glyph(source_or_glyph, glyph=None, **kw)

Adds a glyph to the plot with associated data sources and ranges.

This function will take care of creating and configurinf a Glyph object, and then add it to the plot’s list of renderers.

Parameters:
  • source (DataSource) – a data source for the glyphs to all use
  • glyph (Glyph) – the glyph to add to the Plot
Keyword Arguments:
 
  • Any additional keyword arguments are passed on as-is to the
  • Glyph initializer.
Returns:

Glyph

Return type:

glyph

add_layout(obj, place='center')

Adds an object to the plot in a specified place.

Parameters:
  • obj (Renderer) – the object to add to the Plot
  • place (str, optional) – where to add the object (default: ‘center’) Valid places are: ‘left’, ‘right’, ‘above’, ‘below’, ‘center’.
Returns:

None

add_tools(*tools)

Adds an tools to the plot.

Parameters:*tools (Tool) – the tools to add to the Plot
Returns:None
column(col, gridplot)

Return whether this plot is in a given column of a GridPlot.

Parameters:
  • col (int) – index of the column to test
  • gridplot (GridPlot) – the GridPlot to check
Returns:

bool

row(row, gridplot)

Return whether this plot is in a given row of a GridPlot.

Parameters:
  • row (int) – index of the row to test
  • gridplot (GridPlot) – the GridPlot to check
Returns:

bool

select(*args, **kwargs)

Query this object and all of its references for objects that match the given selector.

There are a few different ways to call the select method. The most general is to supply a JSON-like query dictionary as the single argument or as keyword arguments:

Parameters:selector (JSON-like) – some sample text
Keyword Arguments:
 kwargs – query dict key/values as keyword arguments

For convenience, queries on just names can be made by supplying the name string as the single parameter:

Parameters:name (str) – the name to query on

Also queries on just type can be made simply by supplying the PlotObject subclass as the single parameter:

Parameters:type (PlotObject) – the type to query on
Returns:seq[PlotObject]

Examples

# These two are equivalent
p.select({"type": HoverTool})
p.select(HoverTool)

# These two are also equivalent
p.select({"name": "mycircle"})
p.select("mycircle")

# Keyword arguments can be supplied in place of selector dict
p.select({"name": "foo", "type": HoverTool})
p.select(name="foo", type=HoverTool)
above

property type: List(Instance(Renderer))

A list of renderers to occupy the area above of the plot.

background_fill

property type: Color

below

property type: List(Instance(Renderer))

A list of renderers to occupy the area below of the plot.

border_fill

property type: Color

extra_x_ranges

property type: Dict(String, Instance(Range1d))

Additional named ranges to make available for mapping x-coordinates.

This is useful for adding additional axes.

extra_y_ranges

property type: Dict(String, Instance(Range))

Additional named ranges to make available for mapping y-coordinates.

This is useful for adding additional axes.

h_symmetry

property type: Bool

Whether the total horizontal padding on both sides of the plot will be made equal (the left or right padding amount, whichever is larger).

left

property type: List(Instance(Renderer))

A list of renderers to occupy the area to the left of the plot.

property type: Enum(‘normal’, ‘grey’)

What version of the Bokeh logo to display on the toolbar. If set to None, no logo will be displayed.

min_border

property type: Int

A convenience property to set all all the min_X_border properties to the same value. If an individual border property is explicitly set, it will override min_border.

min_border_bottom

property type: Int

Minimum size in pixels of the padding region below the bottom of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_left

property type: Int

Minimum size in pixels of the padding region to the left of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_right

property type: Int

Minimum size in pixels of the padding region to the right of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

min_border_top

property type: Int

Minimum size in pixels of the padding region above the top of the central plot region.

Note

This is a minimum. The padding region may expand as needed to accommodate titles or axes, etc.

outline_line_alpha

property type: DataSpec

The line alpha for the plot border outline.

outline_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap for the plot border outline.

outline_line_color

property type: ColorSpec

The line color for the plot border outline.

outline_line_dash

property type: DashPattern

The line dash for the plot border outline.

outline_line_dash_offset

property type: Int

The line dash offset for the plot border outline.

outline_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join for the plot border outline.

outline_line_width

property type: DataSpec

The line width for the plot border outline.

plot_height

property type: Int

Total height of the entire plot (including any axes, titles, border padding, etc.)

Note

This corresponds directly to the height of the HTML canvas that will be used.

plot_width

property type: Int

Total width of the entire plot (including any axes, titles, border padding, etc.)

Note

This corresponds directly to the width of the HTML canvas that will be used.

renderers

property type: List(Instance(Renderer))

A list of all renderers for this plot, including guides and annotations in addition to glyphs and markers.

This property can be manipulated by hand, but the add_glyph and add_layout methods are recommended to help make sure all necessary setup is performed.

right

property type: List(Instance(Renderer))

A list of renderers to occupy the area to the right of the plot.

title

property type: String

A title for the plot.

title_text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align for the plot title.

title_text_alpha

property type: DataSpec

The text alpha for the plot title.

title_text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline for the plot title.

title_text_color

property type: ColorSpec

The text color for the plot title.

title_text_font

property type: String

The text font for the plot title.

title_text_font_size

property type: String

The text font size for the plot title.

title_text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style for the plot title.

tool_events

property type: Instance(Tool:class:~bokeh.properties.Events)

A ToolEvents object to share and report tool events.

toolbar_location

property type: Enum(‘above’, ‘below’, ‘left’, ‘right’)

Where the toolbar will be located. If set to None, no toolbar will be attached to the plot.

tools

property type: List(Instance(Tool))

A list of tools to add to the plot.

v_symmetry

property type: Bool

Whether the total vertical padding on both sides of the plot will be made equal (the top or bottom padding amount, whichever is larger).

x_mapper_type

property type: Either(Auto, String)

What kind of mapper to use to convert x-coordinates in data space into x-coordinates in screen space.

Typically this can be determined automatically, but this property can be useful to, e.g., show datetime values as floating point “seconds since epoch” instead of formatted dates.

x_range

property type: Instance(Range)

The (default) data range of the horizontal dimension of the plot.

y_mapper_type

property type: Either(Auto, String)

What kind of mapper to use to convert y-coordinates in data space into y-coordinates in screen space.

Typically this can be determined automatically, but this property can be useful to, e.g., show datetime values as floating point “seconds since epoch” instead of formatted dates

y_range

property type: Instance(Range)

The (default) data range of the vertical dimension of the plot.

[
  {
    "attributes": {
      "above": [],
      "background_fill": "white",
      "below": [],
      "border_fill": "white",
      "disabled": false,
      "doc": null,
      "extra_x_ranges": {},
      "extra_y_ranges": {},
      "h_symmetry": true,
      "id": "b5fe4810-35ee-4492-b63e-bb52f015723a",
      "left": [],
      "logo": "normal",
      "min_border": 50,
      "min_border_bottom": 50,
      "min_border_left": 50,
      "min_border_right": 50,
      "min_border_top": 50,
      "name": null,
      "outline_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "outline_line_cap": "butt",
      "outline_line_color": {
        "value": "black"
      },
      "outline_line_dash": [],
      "outline_line_dash_offset": 0,
      "outline_line_join": "miter",
      "outline_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "plot_height": 600,
      "plot_width": 600,
      "renderers": [],
      "right": [],
      "tags": [],
      "title": "",
      "title_text_align": "left",
      "title_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "title_text_baseline": "bottom",
      "title_text_color": {
        "value": "#444444"
      },
      "title_text_font": "Helvetica",
      "title_text_font_size": "12pt",
      "title_text_font_style": "normal",
      "tool_events": {
        "id": "75bd633c-9e65-44e9-a0aa-b8cce544fe70",
        "type": "ToolEvents"
      },
      "toolbar_location": "above",
      "tools": [],
      "v_symmetry": false,
      "x_mapper_type": "auto",
      "x_range": null,
      "y_mapper_type": "auto",
      "y_range": null
    },
    "id": "b5fe4810-35ee-4492-b63e-bb52f015723a",
    "type": "Plot"
  },
  {
    "attributes": {
      "doc": null,
      "geometries": [],
      "id": "75bd633c-9e65-44e9-a0aa-b8cce544fe70",
      "name": null,
      "tags": []
    },
    "id": "75bd633c-9e65-44e9-a0aa-b8cce544fe70",
    "type": "ToolEvents"
  }
]
class PlotContext(**kwargs)

Bases: bokeh.plot_object.PlotObject

A container for multiple plot objects.

PlotContext objects are a source of confusion. Their purpose is to collect together different top-level objects (e.g., Plot or layout widgets). The reason for this is that different plots may need to share ranges or data sources between them. A PlotContext is a container in which such sharing can occur between the contained objects.

children

property type: List(Instance(PlotObject))

A list of top level objects in this PlotContext container.

[
  {
    "attributes": {
      "children": [],
      "doc": null,
      "id": "5cd40c6f-8069-4bf9-ab96-1308f5e02660",
      "name": null,
      "tags": []
    },
    "id": "5cd40c6f-8069-4bf9-ab96-1308f5e02660",
    "type": "PlotContext"
  }
]
class PlotList(**kwargs)

Bases: bokeh.models.plots.PlotContext

[
  {
    "attributes": {
      "children": [],
      "doc": null,
      "id": "523b3637-4652-431d-bea4-c6881a2d08c0",
      "name": null,
      "tags": []
    },
    "id": "523b3637-4652-431d-bea4-c6881a2d08c0",
    "type": "PlotList"
  }
]

bokeh.models.ranges

Models for describing different kinds of ranges of values in different kinds of spaces (e.g., continuous or categorical) and with options for “auto sizing”.

class DataRange(**kwargs)

Bases: bokeh.models.ranges.Range

A base class for all data range types. DataRange is not generally useful to instantiate on its own.

sources

property type: List(Instance(ColumnsRef))

A list of data source columns to compute the envelope of.

[
  {
    "attributes": {
      "doc": null,
      "id": "f72d0396-7cd5-40ee-89a2-80aae170c1c6",
      "name": null,
      "sources": [],
      "tags": []
    },
    "id": "f72d0396-7cd5-40ee-89a2-80aae170c1c6",
    "type": "DataRange"
  }
]
class DataRange1d(**kwargs)

Bases: bokeh.models.ranges.DataRange

An auto-fitting range in a continuous scalar dimension.

end

property type: Float

An explicitly supplied range end. If provided, will override automatically computed end value.

rangepadding

property type: Float

A percentage of the total range size to add as padding to the range start and end.

start

property type: Float

An explicitly supplied range start. If provided, will override automatically computed start value.

[
  {
    "attributes": {
      "doc": null,
      "end": null,
      "id": "cd1a1948-110c-43a4-94c8-cbfa7568252f",
      "name": null,
      "rangepadding": 0.1,
      "sources": [],
      "start": null,
      "tags": []
    },
    "id": "cd1a1948-110c-43a4-94c8-cbfa7568252f",
    "type": "DataRange1d"
  }
]
class FactorRange(*args, **kwargs)

Bases: bokeh.models.ranges.Range

A range in a categorical dimension.

In addition to supplying factors keyword argument to the FactorRange initializer, you can also instantiate with the convenience syntax:

FactorRange("foo", "bar") # equivalent to FactorRange(factors=["foo", "bar"])

Note

FactorRange may be renamed to CategoricalRange in the future.

factors

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

A list of string or integer factors (categories) to comprise this categorical range.

[
  {
    "attributes": {
      "doc": null,
      "factors": [],
      "id": "5a688789-8db7-4b0a-8475-183dccaf1013",
      "name": null,
      "tags": []
    },
    "id": "5a688789-8db7-4b0a-8475-183dccaf1013",
    "type": "FactorRange"
  }
]
class Range(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all range types. Range is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "doc": null,
      "id": "7fb7f845-e485-4275-8abb-18957baaae1b",
      "name": null,
      "tags": []
    },
    "id": "7fb7f845-e485-4275-8abb-18957baaae1b",
    "type": "Range"
  }
]
class Range1d(*args, **kwargs)

Bases: bokeh.models.ranges.Range

A fixed, closed range [start, end] in a continuous scalar dimension.

In addition to supplying start and end keyword arguments to the Range1d initializer, you can also instantiate with the convenience syntax:

Range(0, 10) # equivalent to Range(start=0, end=10)
end

property type: Either(Float, Datetime, Int)

The end of the range.

start

property type: Either(Float, Datetime, Int)

The start of the range.

[
  {
    "attributes": {
      "doc": null,
      "end": null,
      "id": "3f766ea5-0823-43e7-9913-58255c0a903f",
      "name": null,
      "start": null,
      "tags": []
    },
    "id": "3f766ea5-0823-43e7-9913-58255c0a903f",
    "type": "Range1d"
  }
]

bokeh.models.renderers

Models (mostly base classes) for the various kinds of renderer types that Bokeh supports.

class GlyphRenderer(**kwargs)

Bases: bokeh.models.renderers.Renderer

data_source

property type: Instance(DataSource)

Local data source to use when rendering glyphs on the plot.

glyph

property type: Instance(Glyph)

The glyph to render, in conjunction with the supplied data source and ranges.

nonselection_glyph

property type: Instance(Glyph)

An optional glyph used for explicitly non-selected points (i.e., non-selected when there are other points that are selected, but not when no points at all are selected.)

selection_glyph

property type: Instance(Glyph)

An optional glyph used for selected points.

units

property type: Enum(‘screen’, ‘data’)

x_range_name

property type: String

A particular (named) x-range to use for computing screen locations when rendering glyphs on the plot. If unset, use the default x-range.

y_range_name

property type: String

A particular (named) y-range to use for computing screen locations when rendering glyphs on the plot. If unset, use the default -range.

[
  {
    "attributes": {
      "data_source": null,
      "doc": null,
      "glyph": null,
      "id": "ae64abf5-2493-4c22-b5f3-f74ace41c7b3",
      "name": null,
      "nonselection_glyph": null,
      "selection_glyph": null,
      "tags": [],
      "units": "screen",
      "x_range_name": "default",
      "y_range_name": "default"
    },
    "id": "ae64abf5-2493-4c22-b5f3-f74ace41c7b3",
    "type": "GlyphRenderer"
  }
]
class GuideRenderer(**kwargs)

Bases: bokeh.models.renderers.Renderer

A base class for all guide renderer types. GuideRenderer is not generally useful to instantiate on its own.

plot

property type: Instance(Plot)

The plot to which this guide renderer is attached.

[
  {
    "attributes": {
      "doc": null,
      "id": "38653871-b670-4141-9fcf-a70e5e484c77",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "38653871-b670-4141-9fcf-a70e5e484c77",
    "type": "GuideRenderer"
  }
]
class Legend(**kwargs)

Bases: bokeh.models.renderers.Renderer

Render informational legends for a plot.

border_line_alpha

property type: DataSpec

The line alpha for the legend border outline.

border_line_cap

property type: Enum(‘butt’, ‘round’, ‘square’)

The line cap for the legend border outline.

border_line_color

property type: ColorSpec

The line color for the legend border outline.

border_line_dash

property type: DashPattern

The line dash for the legend border outline.

border_line_dash_offset

property type: Int

The line dash offset for the legend border outline.

border_line_join

property type: Enum(‘miter’, ‘round’, ‘bevel’)

The line join for the legend border outline.

border_line_width

property type: DataSpec

The line width for the legend border outline.

glyph_height

property type: Int

The height in pixels that the rendered legend glyph should occupy.

glyph_width

property type: Int

The width in pixels that the rendered legend glyph should occupy.

label_height

property type: Int

The height in pixels that the area that legend labels should occupy.

label_standoff

property type: Int

The distance in pixels

label_text_align

property type: Enum(‘left’, ‘right’, ‘center’)

The text align for the legend labels.

label_text_alpha

property type: DataSpec

The text alpha for the legend labels.

label_text_baseline

property type: Enum(‘top’, ‘middle’, ‘bottom’, ‘alphabetic’, ‘hanging’)

The text baseline for the legend labels.

label_text_color

property type: ColorSpec

The text color for the legend labels.

label_text_font

property type: String

The text font for the legend labels.

label_text_font_size

property type: String

The text font size for the legend labels.

label_text_font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

The text font style for the legend labels.

label_width

property type: Int

The width in pixels that the area that legend labels should occupy.

legend_padding

property type: Int

Amount of padding around the legend.

legend_spacing

property type: Int

Amount of spacing between legend entried

legends

property type: List(Tuple(String, List(Instance(GlyphRenderer))))

A list of tuples that maps text labels to the legend to corresponding renderers that should draw sample representations for those labels.

Note

The legends attribute may also be set from a dict or OrderedDict, but note that if a dict is used, the order of the legend entries is unspecified.

orientation

property type: Enum(‘top_right’, ‘top_left’, ‘bottom_left’, ‘bottom_right’)

The location where the legend should draw itself.

plot

property type: Instance(Plot)

The Plot to which this Legend is attached.

[
  {
    "attributes": {
      "border_line_alpha": {
        "units": "data",
        "value": 1.0
      },
      "border_line_cap": "butt",
      "border_line_color": {
        "value": "black"
      },
      "border_line_dash": [],
      "border_line_dash_offset": 0,
      "border_line_join": "miter",
      "border_line_width": {
        "field": "line_width",
        "units": "data"
      },
      "doc": null,
      "glyph_height": 20,
      "glyph_width": 20,
      "id": "6a96d20d-3d90-4aaf-be29-249d11826db1",
      "label_height": 20,
      "label_standoff": 15,
      "label_text_align": "left",
      "label_text_alpha": {
        "units": "data",
        "value": 1.0
      },
      "label_text_baseline": "bottom",
      "label_text_color": {
        "value": "#444444"
      },
      "label_text_font": "Helvetica",
      "label_text_font_size": "12pt",
      "label_text_font_style": "normal",
      "label_width": 50,
      "legend_padding": 10,
      "legend_spacing": 3,
      "legends": [],
      "name": null,
      "orientation": "top_right",
      "plot": null,
      "tags": []
    },
    "id": "6a96d20d-3d90-4aaf-be29-249d11826db1",
    "type": "Legend"
  }
]
class Renderer(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for renderer types. Renderer is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "doc": null,
      "id": "66aad394-4861-4026-bb8e-d799e32b046a",
      "name": null,
      "tags": []
    },
    "id": "66aad394-4861-4026-bb8e-d799e32b046a",
    "type": "Renderer"
  }
]

bokeh.models.sources

class AjaxDataSource(**kwargs)

Bases: bokeh.models.sources.RemoteSource

if_modified

property type: Bool

Whether to include an If-Modified-Since header in AJAX requests to the server. If this header is supported by the server, then only new data since the last request will be returned.

max_size

property type: Int

Maximum size of the data array being kept after each pull requests. Larger than that size, the data will be right shifted.

method

property type: Enum(‘POST’, ‘GET’)

http method - GET or POST

mode

property type: Enum(‘replace’, ‘append’)

Whether to append new data to existing data (up to max_size), or to replace existing data entirely.

[
  {
    "attributes": {
      "column_names": [],
      "data": {},
      "data_url": null,
      "doc": null,
      "id": "d3f03bce-a747-4d64-953d-8dfa0d8dbef6",
      "if_modified": false,
      "max_size": null,
      "method": "POST",
      "mode": "replace",
      "name": null,
      "polling_interval": null,
      "selected": [],
      "tags": []
    },
    "id": "d3f03bce-a747-4d64-953d-8dfa0d8dbef6",
    "type": "AjaxDataSource"
  }
]
class BlazeDataSource(**kwargs)

Bases: bokeh.models.sources.RemoteSource

from_blaze(remote_blaze_obj, local=True)
to_blaze()
expr

property type: Dict(String, Any)

blaze expression graph in json form

local

property type: Bool

Whether this data source is hosted by the bokeh server or not.

namespace

property type: Dict(String, Any)

namespace in json form for evaluating blaze expression graph

[
  {
    "attributes": {
      "column_names": [],
      "data": {},
      "data_url": null,
      "doc": null,
      "expr": {},
      "id": "c1f876fc-23a0-4617-9f69-cb3ddcd80248",
      "local": null,
      "name": null,
      "namespace": {},
      "polling_interval": null,
      "selected": [],
      "tags": []
    },
    "id": "c1f876fc-23a0-4617-9f69-cb3ddcd80248",
    "type": "BlazeDataSource"
  }
]
class ColumnDataSource(*args, **kw)

Bases: bokeh.models.sources.DataSource

Maps names of columns to sequences or arrays.

If the ColumnDataSource initializer is called with a single argument that is a dict, that argument is used as the value for the “data” attribute. For example:

ColumnDataSource(mydict) # same as ColumnDataSource(data=mydict)

Note

There is an implicit assumption that all the columns in a a given ColumnDataSource have the same length.

add(data, name=None)

Appends a new column of data to the data source.

Parameters:
  • data (seq) – new data to add
  • name (str, optional) – column name to use. If not supplied, generate a name go the form “Series ####”
Returns:

the column name used

Return type:

str

classmethod from_df(data)

Create a dict of columns from a Pandas DataFrame, suitable for creating a ColumnDataSource.

Parameters:data (DataFrame) – data to convert
Returns:dict(str, list)
push_notebook()

Update date for a plot in the IPthon notebook in place.

This function can be be used to update data in plot data sources in the IPython notebook, without having to use the Bokeh server.

Returns:None

Warning

The current implementation leaks memory in the IPython notebook, due to accumulating JS code. This function typically works well with light UI interactions, but should not be used for continuously updating data. See issue 1732 for more details and to track progress on potential fixes.

remove(name)

Remove a column of data.

Parameters:name (str) – name of the column to remove
Returns:None

Note

If the column name does not exist, a warning is issued.

to_df()

Convert this data source to pandas dataframe.

If column_names is set, use those. Otherwise let Pandas infer the column names. The column_names property can be used both to order and filter the columns.

Returns:DataFrame
data

property type: Dict(String, Any)

Mapping of column names to sequences of data. The data can be, e.g, Python lists or tuples, NumPy arrays, etc.

[
  {
    "attributes": {
      "column_names": [],
      "data": {},
      "doc": null,
      "id": "25532710-d4a2-4e02-9ef4-3d089e8bb8ed",
      "name": null,
      "selected": [],
      "tags": []
    },
    "id": "25532710-d4a2-4e02-9ef4-3d089e8bb8ed",
    "type": "ColumnDataSource"
  }
]
class ColumnsRef(**properties)

A utility object to allow referring to a collection of columns from a specified data source, all together.

columns

property type: List(String)

A list of column names to reference from source.

source

property type: Instance(DataSource)

A data source to reference.

class DataSource(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for data source types. DataSource is not generally useful to instantiate on its own.

columns(*columns)

Returns a ColumnsRef object for a column or set of columns on this data source.

Parameters:*columns
Returns:ColumnsRef
column_names

property type: List(String)

An list of names for all the columns in this DataSource.

selected

property type: List(Int)

A list of selected indices on this DataSource.

[
  {
    "attributes": {
      "column_names": [],
      "doc": null,
      "id": "7c2e0e05-dfcf-4be1-acc5-b74c57683f10",
      "name": null,
      "selected": [],
      "tags": []
    },
    "id": "7c2e0e05-dfcf-4be1-acc5-b74c57683f10",
    "type": "DataSource"
  }
]
class RemoteSource(**kwargs)

Bases: bokeh.models.sources.DataSource

data

property type: Dict(String, Any)

Additional data to include directly in this data source object. The columns provided here are merged with those from the Bokeh server.

data_url

property type: String

The URL to the endpoint for the data.

polling_interval

property type: Int

polling interval for updating data source in milliseconds

[
  {
    "attributes": {
      "column_names": [],
      "data": {},
      "data_url": null,
      "doc": null,
      "id": "91b99f27-7c84-404a-a14c-12013a1ea3d8",
      "name": null,
      "polling_interval": null,
      "selected": [],
      "tags": []
    },
    "id": "91b99f27-7c84-404a-a14c-12013a1ea3d8",
    "type": "RemoteSource"
  }
]
class ServerDataSource(**kwargs)

Bases: bokeh.models.sources.BlazeDataSource

A data source that referes to data located on a Bokeh server.

The data from the server is loaded on-demand by the client.

transform

property type: Dict(String, Either(Instance(PlotObject), Any))

Paramters of the data transformation operations.

The associated valuse is minimally a tag that says which downsample routine to use. For some downsamplers, parameters are passed this way too.

[
  {
    "attributes": {
      "column_names": [],
      "data": {},
      "data_url": null,
      "doc": null,
      "expr": {},
      "id": "5ff57b87-ad86-4430-8eca-6e4320cc6acf",
      "local": null,
      "name": null,
      "namespace": {},
      "polling_interval": null,
      "selected": [],
      "tags": [],
      "transform": {}
    },
    "id": "5ff57b87-ad86-4430-8eca-6e4320cc6acf",
    "type": "ServerDataSource"
  }
]

bokeh.models.tickers

Models for computing good tick locations on different kinds of plots.

class AdaptiveTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate “nice” round ticks at any magnitude.

Creates ticks that are “base” multiples of a set of given mantissas. For example, with base=10 and mantissas=[1, 2, 5], the ticker will generate the sequence:

..., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, ...
base

property type: Float

The multiplier to use for scaling mantissas.

mantissas

property type: List(Float)

The acceptable list numbers to generate multiples of.

max_interval

property type: Float

The largest allowable interval between two adjacent ticks.

min_interval

property type: Float

The smallest allowable interval between two adjacent ticks.

[
  {
    "attributes": {
      "base": 10.0,
      "doc": null,
      "id": "c230829d-0106-4849-b4cf-021b8a7410f7",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "c230829d-0106-4849-b4cf-021b8a7410f7",
    "type": "AdaptiveTicker"
  }
]
class BasicTicker(**kwargs)

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a linear scale.

Note

This class may be renamed to LinearTicker in the future.

[
  {
    "attributes": {
      "base": 10.0,
      "doc": null,
      "id": "edfa89e3-8c51-4521-b80c-80b3b309fa30",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "edfa89e3-8c51-4521-b80c-80b3b309fa30",
    "type": "BasicTicker"
  }
]
class CategoricalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate ticks for categorical ranges.

[
  {
    "attributes": {
      "doc": null,
      "id": "fc2a3b99-93ab-45b6-ba75-4577acbda8c3",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "fc2a3b99-93ab-45b6-ba75-4577acbda8c3",
    "type": "CategoricalTicker"
  }
]
class CompositeTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Combine different tickers at different scales.

Uses the min_interval and max_interval interval attributes of the tickers to select the appropriate ticker at different scales.

tickers

property type: List(Instance(Ticker))

A list of Ticker objects to combine at different scales in order to generate tick values. The supplied tickers should be in order. Specifically, if S comes before T, then it should be the case that:

S.get_max_interval() < T.get_min_interval()
[
  {
    "attributes": {
      "doc": null,
      "id": "e92f8db3-4183-4fe6-aacb-e705cb878fa1",
      "name": null,
      "num_minor_ticks": 5,
      "tags": [],
      "tickers": []
    },
    "id": "e92f8db3-4183-4fe6-aacb-e705cb878fa1",
    "type": "CompositeTicker"
  }
]
class DatetimeTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate nice ticks across different date and time scales.

[
  {
    "attributes": {
      "doc": null,
      "id": "49a11503-f3dc-4d41-a6ac-03dfcd0183bb",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "49a11503-f3dc-4d41-a6ac-03dfcd0183bb",
    "type": "DatetimeTicker"
  }
]
class DaysTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart by specific, even multiples of days.

days

property type: List(Int)

The intervals of days to use.

[
  {
    "attributes": {
      "days": [],
      "doc": null,
      "id": "e8fb5d36-944c-4e89-9373-53145875655c",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "e8fb5d36-944c-4e89-9373-53145875655c",
    "type": "DaysTicker"
  }
]
class LogTicker(**kwargs)

Bases: bokeh.models.tickers.AdaptiveTicker

Generate ticks on a log scale.

[
  {
    "attributes": {
      "base": 10.0,
      "doc": null,
      "id": "49359248-a91d-4dc3-aac1-85ab7226ad50",
      "mantissas": [
        2,
        5,
        10
      ],
      "max_interval": 100.0,
      "min_interval": 0.0,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "49359248-a91d-4dc3-aac1-85ab7226ad50",
    "type": "LogTicker"
  }
]
class MonthsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart by specific, even multiples of months.

months

property type: List(Int)

The intervals of months to use.

[
  {
    "attributes": {
      "doc": null,
      "id": "5ab50f94-596a-4758-baf1-f36f8ec56846",
      "interval": null,
      "months": [],
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "5ab50f94-596a-4758-baf1-f36f8ec56846",
    "type": "MonthsTicker"
  }
]
class SingleIntervalTicker(**kwargs)

Bases: bokeh.models.tickers.Ticker

Generate evenly spaced ticks at a fixed interval regardless of scale.

interval

property type: Float

The interval between adjacent ticks.

[
  {
    "attributes": {
      "doc": null,
      "id": "50da4887-7631-4daf-bc10-d9146b93c5ea",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "50da4887-7631-4daf-bc10-d9146b93c5ea",
    "type": "SingleIntervalTicker"
  }
]
class Ticker(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all ticker types. Ticker is not generally useful to instantiate on its own.

num_minor_ticks

property type: Int

The number of minor tick positions to generate between adjacent major tick values.

[
  {
    "attributes": {
      "doc": null,
      "id": "c5d929ff-a861-4305-a07a-288dd8221ca9",
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "c5d929ff-a861-4305-a07a-288dd8221ca9",
    "type": "Ticker"
  }
]
class YearsTicker(**kwargs)

Bases: bokeh.models.tickers.SingleIntervalTicker

Generate ticks spaced apart even numbers of years.

[
  {
    "attributes": {
      "doc": null,
      "id": "83a3837b-c812-4b2d-810f-9b8a4b8c5df5",
      "interval": null,
      "name": null,
      "num_minor_ticks": 5,
      "tags": []
    },
    "id": "83a3837b-c812-4b2d-810f-9b8a4b8c5df5",
    "type": "YearsTicker"
  }
]

bokeh.models.tools

Bokeh comes with a number of interactive tools.

There are five types of tool interactions:

  • Pan/Drag
  • Click/Tap
  • Scroll/Pinch
  • Actions
  • Inspectors

For the first three comprise the category of gesture tools, and only one tool for each gesture can be active at any given time. The active tool is indicated on the toolbar by a highlight next to to the tool. Actions are immediate or modal operations that are only activated when their button in the toolbar is pressed. Inspectors are passive tools that merely report information or annotate the plot in some way, and may always be active regardless of what other tools are currently active.

class BoxSelectTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: box_select_icon

The box selection tool allows users to make selections on a Plot by indicating a rectangular region by dragging the mouse or a finger over the plot region. The end of the drag event indicates the selection region is ready.

dimensions

property type: List(Enum(‘width’, ‘height’, ‘x’, ‘y’))

Which dimensions the box selection is to be free in. By default, users may freely draw selections boxes with any dimensions. If only “width” is supplied, the box will be constrained to span the entire vertical space of the plot, only the horizontal dimension can be controlled. If only “height” is supplied, the box will be constrained to span the entire horizontal space of the plot, and the vertical dimension can be controlled.

names

property type: List(String)

A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

select_every_mousemove

property type: Bool

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

[
  {
    "attributes": {
      "dimensions": [
        "width",
        "height"
      ],
      "doc": null,
      "id": "9114f740-bb8c-4de3-8a93-ae13636ace37",
      "name": null,
      "names": [],
      "plot": null,
      "renderers": [],
      "select_every_mousemove": true,
      "tags": []
    },
    "id": "9114f740-bb8c-4de3-8a93-ae13636ace37",
    "type": "BoxSelectTool"
  }
]
class BoxSelectionOverlay(**kwargs)

Bases: bokeh.models.renderers.Renderer

An overlay renderer that Tool objects can use to render a ‘rubber band’ selection box on a Plot.

tool

property type: Instance(Tool)

The tool that this overlay should respond to.

[
  {
    "attributes": {
      "doc": null,
      "id": "7dafe8f4-e91a-4cab-b701-01daa76fd2e6",
      "name": null,
      "tags": [],
      "tool": null
    },
    "id": "7dafe8f4-e91a-4cab-b701-01daa76fd2e6",
    "type": "BoxSelection"
  }
]
class BoxZoomTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: box_zoom_icon

The box zoom tool allows users to define a rectangular region of a Plot to zoom to by dragging he mouse or a finger over the plot region. The end of the drag event indicates the selection region is ready.

dimensions

property type: List(Enum(‘width’, ‘height’, ‘x’, ‘y’))

Which dimensions the zoom box is to be free in. By default, users may freely draw zoom boxes with any dimensions. If only “width” is supplied, the box will be constrained to span the entire vertical space of the plot, only the horizontal dimension can be controlled. If only “height” is supplied, the box will be constrained to span the entire horizontal space of the plot, and the vertical dimension can be controlled.

[
  {
    "attributes": {
      "dimensions": [
        "width",
        "height"
      ],
      "doc": null,
      "id": "fa4bcd11-bbd7-4edf-aa68-c339e9aebc56",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "fa4bcd11-bbd7-4edf-aa68-c339e9aebc56",
    "type": "BoxZoomTool"
  }
]
class CrosshairTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: inspector_icon

The crosshair tool is a passive inspector tool. It is generally on at all times, but can be configured in the inspector’s menu associated with the toolbar icon shown above.

The crosshair tool draws a crosshair annotation over the plot, centered on the current mouse position. The crosshair tool may be configured to draw across only one dimension by setting the dimension property to only width or height.

[
  {
    "attributes": {
      "doc": null,
      "id": "61f856f0-d2f5-455a-bb2b-ddb3eff20ee8",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "61f856f0-d2f5-455a-bb2b-ddb3eff20ee8",
    "type": "CrosshairTool"
  }
]
class HoverTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: inspector_icon

The hover tool is a passive inspector tool. It is generally on at all times, but can be configured in the inspector’s menu associated with the toolbar icon shown above.

The hover tool displays informational tooltips whenever the cursor is directly is over a glyph. The data to show comes from the glyph’s data source, and what is to be displayed is configurable through a tooltips attribute that maps display names to columns in the data source, or to special known variables.

Here is an example of how to configure and use the hover tool:

# Add tooltip (name, field) pairs to the tool. See below for a
# description of possible field values.
hover.tooltips = [
    ("index", "$index"),
    ("(x,y)", "($x, $y)"),
    ("radius", "@radius"),
    ("fill color", "$color[hex, swatch]:fill_color"),
    ("foo", "@foo"),
    ("bar", "@bar"),
]

Note

Point hit testing is not currently available on all glyphs. Hover tool currently does not work with line or image type glyphs.

always_active

property type: Bool

Whether the hover tool must be explicitly activated.

names

property type: List(String)

A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

snap_to_data

property type: Bool

Whether the tooltip position should snap to the “center” position of the associated glyph. For instance, if set to True, the tooltip will point to the center of any marker (e.g., Circle, `` Square``) regardless of the cursor position, as long as the cursor hits the glyph.

Note

Not all glyphs support this feature. Currenly all marker glyphs, the Rect and Quad glyphs are supported.

tooltips

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

The (name, field) pairs describing what the hover tool should display when there is a hit.

Field names starting with “@” are interpreted as columns on the data source. For instance, “@temp” would look up values to display from the “temp” column of the data source.

Field names starting with “$” are special, known fields:

$index:index of selected point in the data source
$x:x-coordindate under the cursor in data space
$y:y-coordindate under the cursor in data space
$sx:x-coordindate under the cursor in screen (canvas) space
$sy:y-coordindate under the cursor in screen (canvas) space
$color:color data from data source, with the syntax: $color[options]:field_name. The available options are: ‘hex’ (to display the color as a hex value), and ‘swatch’ to also display a small color swatch.

Note

The tooltips attribute can also be configured with a mapping type, e.g. dict or OrderedDict. However, if a dict is used, the visual presentation order is unpecified.

[
  {
    "attributes": {
      "always_active": true,
      "doc": null,
      "id": "bb870c8c-43d5-4bc8-8357-0c9353847104",
      "name": null,
      "names": [],
      "plot": null,
      "renderers": [],
      "snap_to_data": true,
      "tags": [],
      "tooltips": null
    },
    "id": "bb870c8c-43d5-4bc8-8357-0c9353847104",
    "type": "HoverTool"
  }
]
class LassoSelectTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: lasso_select_icon

The lasso selection tool allows users to make selections on a Plot by indicating a free-drawn “lasso” region by dragging the mouse or a finger over the plot region. The end of the drag event indicates the selection region is ready.

Note

Selections can be comprised of multiple regions, even those made by different selection tools. Hold down the <<shift>> key while making a selection to append the new selection to any previous seletion that might exist.

names

property type: List(String)

A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

select_every_mousemove

property type: Bool

Whether a selection computation should happen on every mouse event, or only once, when the selection region is completed.

[
  {
    "attributes": {
      "doc": null,
      "id": "3ec912e3-af4a-47c4-9504-d1fadfae2988",
      "name": null,
      "names": [],
      "plot": null,
      "renderers": [],
      "select_every_mousemove": true,
      "tags": []
    },
    "id": "3ec912e3-af4a-47c4-9504-d1fadfae2988",
    "type": "LassoSelectTool"
  }
]
class PanTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: pan_icon

The pan tool allows the user to pan a Plot by left-dragging a mouse, or on touch devices by dragging a finger or stylus, across the plot region.

The pan tool also activates the border regions of a Plot for “single axis” panning. For instance, dragging in the vertical border or axis will effect a pan in the vertical direction only, with the horizontal dimension kept fixed.

dimensions

property type: List(Enum(‘width’, ‘height’, ‘x’, ‘y’))

Which dimensions the pan tool is constrained to act in. By default the pan tool will pan in any dimension, but can be configured to only pan horizontally across the width of the plot, or vertically across the height of the plot.

[
  {
    "attributes": {
      "dimensions": [
        "width",
        "height"
      ],
      "doc": null,
      "id": "4947ec88-fc58-4fbf-b6e3-d4ff3d26e437",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "4947ec88-fc58-4fbf-b6e3-d4ff3d26e437",
    "type": "PanTool"
  }
]
class PolySelectTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: poly_select_icon

The polygon selection tool allows users to make selections on a Plot by indicating a polygonal region with mouse clicks. single clicks (or taps) add successive points to the definition of the polygon, and a double click (or tap) indicates the selection region is ready.

Note

Selections can be comprised of multiple regions, even those made by different selection tools. Hold down the <<shift>> key while making a selection to append the new selection to any previous seletion that might exist.

names

property type: List(String)

A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

[
  {
    "attributes": {
      "doc": null,
      "id": "261b7f18-d7d4-4074-84a2-e446167da756",
      "name": null,
      "names": [],
      "plot": null,
      "renderers": [],
      "tags": []
    },
    "id": "261b7f18-d7d4-4074-84a2-e446167da756",
    "type": "PolySelectTool"
  }
]
class PreviewSaveTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: save_icon

The preview/save tool is an action. When activated in the toolbar, the tool presents a modal dialog with an image reproduction of the Plot, which may be saved as a png image by right clicking on the image.

Note

Work is ongoing to support headless (svg, png) image creation without requireing user interaction. See issue 538 to track progress or contribute.

[
  {
    "attributes": {
      "doc": null,
      "id": "241e0c57-6275-4241-b19a-ff02a90ee445",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "241e0c57-6275-4241-b19a-ff02a90ee445",
    "type": "PreviewSaveTool"
  }
]
class ResetTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: reset_icon

The reset tool is an action. When activated in teh toolbar, the tool resets the data bounds of the plot to their values when the plot was initially created.

Note

This tool does not also reset the plot canvas size, if the plot has been resized using the ResizeTool. That feature may be added in a future release.

[
  {
    "attributes": {
      "doc": null,
      "id": "e9134da7-7e34-41ed-acd8-e40b58e25792",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "e9134da7-7e34-41ed-acd8-e40b58e25792",
    "type": "ResetTool"
  }
]
class ResizeTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: resize_icon

The resize tool allows the user to left-drag a mouse or drag a finger to resize the entire plot area on the screen.

[
  {
    "attributes": {
      "doc": null,
      "id": "70435b98-fafb-48dc-bbf1-8dc9baab55a9",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "70435b98-fafb-48dc-bbf1-8dc9baab55a9",
    "type": "ResizeTool"
  }
]
class TapTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: tap_select_icon

The tap selection tool allows the user to select at single points by left-clicking a mouse, or tapping with a finger.

Note

Selections can be comprised of multiple regions, even those made by different selection tools. Hold down the <<shift>> key while making a selection to append the new selection to any previous seletion that might exist.

action

property type: Instance(Action)

A client-side action specification, like opening a URL, showing a dialog box, etc. See bokeh.models.Action for details.

always_active

property type: Bool

Whether the hover tool must be explicitly activated.

names

property type: List(String)

A list of names to query for. If set, only renderers that have a matching value for their name attribute will be used.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to hit test again. If unset, defaults to all renderers on a plot.

[
  {
    "attributes": {
      "action": null,
      "always_active": true,
      "doc": null,
      "id": "abe93087-a08a-41d1-a4c4-6dff7806c43c",
      "name": null,
      "names": [],
      "plot": null,
      "renderers": [],
      "tags": []
    },
    "id": "abe93087-a08a-41d1-a4c4-6dff7806c43c",
    "type": "TapTool"
  }
]
class Tool(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all interactive tool types. Tool is not generally useful to instantiate on its own.

plot

property type: Instance(Plot)

The Plot that this tool will act on.

[
  {
    "attributes": {
      "doc": null,
      "id": "796b063b-f1dc-40dc-94b3-f3f66fc42e40",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "796b063b-f1dc-40dc-94b3-f3f66fc42e40",
    "type": "Tool"
  }
]
class ToolEvents(**kwargs)

Bases: bokeh.plot_object.PlotObject

geometries

property type: List(Dict(String, Any))

[
  {
    "attributes": {
      "doc": null,
      "geometries": [],
      "id": "0fe57cab-0f2b-497f-aca3-9e0aa058a372",
      "name": null,
      "tags": []
    },
    "id": "0fe57cab-0f2b-497f-aca3-9e0aa058a372",
    "type": "ToolEvents"
  }
]
class WheelZoomTool(**kwargs)

Bases: bokeh.models.tools.Tool

toolbar icon: wheel_zoom_icon

The wheel zoom tool will zoom the plot in and out, centered on the current mouse location.

The wheel zoom tool also activates the border regions of a Plot for “single axis” zooming. For instance, zooming in the vertical border or axis will effect a zoom in the vertical direction only, with the horizontal dimension kept fixed.

dimensions

property type: List(Enum(‘width’, ‘height’, ‘x’, ‘y’))

Which dimensions the wheel zoom tool is constrained to act in. By default the wheel zoom tool will zoom in any dimension, but can be configured to only zoom horizontally across the width of the plot, or vertically across the height of the plot.

[
  {
    "attributes": {
      "dimensions": [
        "width",
        "height"
      ],
      "doc": null,
      "id": "3ca3efc6-767e-4117-bb73-391e66ffca2b",
      "name": null,
      "plot": null,
      "tags": []
    },
    "id": "3ca3efc6-767e-4117-bb73-391e66ffca2b",
    "type": "WheelZoomTool"
  }
]

bokeh.models.widget

Bokeh can present many kinds of UI widgets alongside plots. When used in conjunction with the Bokeh server, it is possible to trigger events, updates, etc. based on a user’s interaction with these widgets.

class Widget(**kwargs)

Bases: bokeh.plot_object.PlotObject

A base class for all interact widget types. Widget is not generally useful to instantiate on its own.

disabled

property type: Bool

Whether the widget will be disabled when rendered. If True, the widget will be greyed-out, and not respond to UI events.

html
[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "c3e4e612-6e5c-4e40-a769-990dc8e5f072",
      "name": null,
      "tags": []
    },
    "id": "c3e4e612-6e5c-4e40-a769-990dc8e5f072",
    "type": "Widget"
  }
]

bokeh.models.widgets.buttons

Various kinds of button widgets.

class AbstractButton(**kwargs)

Bases: bokeh.models.widget.Widget

A base class that defines common properties for all button types. AbstractButton is not generally useful to instantiate on its own.

icon

property type: Instance(AbstractIcon)

An optional image appearing to the left of button’s text.

label

property type: String

The text label for the button to display.

type

property type: Enum(‘default’, ‘primary’, ‘success’, ‘warning’, ‘danger’, ‘link’)

A style for the button, signifying it’s role.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "icon": null,
      "id": "61035369-7965-4bed-b526-2d3c888b7ff5",
      "label": "Button",
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "61035369-7965-4bed-b526-2d3c888b7ff5",
    "type": "AbstractButton"
  }
]
class Button(**kwargs)

Bases: bokeh.models.widgets.buttons.AbstractButton

A click button.

on_click(handler)

Set up a handler for button clicks.

Parameters:handler (func) – handler function to call when button is clicked.
Returns:None
clicks

property type: Int

A private property used to trigger on_click event handler.

[
  {
    "attributes": {
      "clicks": 0,
      "disabled": false,
      "doc": null,
      "icon": null,
      "id": "5bd8253e-1876-448e-8c54-5cdfca4987d4",
      "label": "Button",
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "5bd8253e-1876-448e-8c54-5cdfca4987d4",
    "type": "Button"
  }
]
class Dropdown(**kwargs)

Bases: bokeh.models.widgets.buttons.AbstractButton

A dropdown button.

on_click(handler)

Set up a handler for button or menu item clicks.

Parameters:handler (func) – handler function to call when button is activated.
Returns:None
action

property type: String

A private property used to trigger on_click event handler.

default_action

property type: String

The default action, otherwise the first item in menu will be used.

menu

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

Button’s dropdown menu consisting of entries containing item’s text and action name. Use None as a menu separator.

[
  {
    "attributes": {
      "action": null,
      "default_action": null,
      "disabled": false,
      "doc": null,
      "icon": null,
      "id": "0715e993-b859-43cb-a80e-de8ed4845fc1",
      "label": "Button",
      "menu": [],
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "0715e993-b859-43cb-a80e-de8ed4845fc1",
    "type": "Dropdown"
  }
]
class Toggle(**kwargs)

Bases: bokeh.models.widgets.buttons.AbstractButton

A two-state toggle button.

on_click(handler)

Set up a handler for button state changes (clicks).

Parameters:handler (func) – handler function to call when button is toggled.
Returns:None
active

property type: Bool

The initial state of a button. Also used to trigger on_click event handler.

[
  {
    "attributes": {
      "active": false,
      "disabled": false,
      "doc": null,
      "icon": null,
      "id": "b3a19a82-2494-4724-a9cc-506b65613e15",
      "label": "Button",
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "b3a19a82-2494-4724-a9cc-506b65613e15",
    "type": "Toggle"
  }
]

bokeh.models.widgets.dialogs

Various kinds of dialog and message box widgets.

class Dialog(**kwargs)

Bases: bokeh.models.widget.Widget

Simple dialog box with string message.

buttons

property type: List(String)

A list of button labels.

closable

property type: Bool

Whether this dialog is closable or not.

content

property type: String

The message displayed by this dialog.

title

property type: String

The title of the dialog widget.

visible

property type: Bool

Whether this dialog is visible or not.

[
  {
    "attributes": {
      "buttons": [],
      "closable": true,
      "content": null,
      "disabled": false,
      "doc": null,
      "id": "393a59b2-2d4e-4093-bb81-b006f96a1db2",
      "name": null,
      "tags": [],
      "title": null,
      "visible": false
    },
    "id": "393a59b2-2d4e-4093-bb81-b006f96a1db2",
    "type": "Dialog"
  }
]

bokeh.models.widgets.groups

class AbstractGroup(**kwargs)

Bases: bokeh.models.widget.Widget

Abstract base class for all kinds of groups. AbstractGroup is not generally useful to instantiate on its own.

on_click(handler)

Set up a handler for button check/radio box clicks including the selected indices.

Parameters:handler (func) – handler function to call when button is clicked.
Returns:None
labels

property type: List(String)

List of text labels contained in this group.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "40192e78-7c7a-456d-86d9-cb686de6dc86",
      "labels": [],
      "name": null,
      "tags": []
    },
    "id": "40192e78-7c7a-456d-86d9-cb686de6dc86",
    "type": "AbstractGroup"
  }
]
class ButtonGroup(**kwargs)

Bases: bokeh.models.widgets.groups.AbstractGroup

Abstract base class for groups with items rendered as buttons. ButtonGroup is not generally useful to instantiate on its own.

type

property type: Enum(‘default’, ‘primary’, ‘success’, ‘warning’, ‘danger’, ‘link’)

A style for the button, signifying it’s role.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "42984353-b65c-4399-96ee-95fa7510a59b",
      "labels": [],
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "42984353-b65c-4399-96ee-95fa7510a59b",
    "type": "ButtonGroup"
  }
]
class CheckboxButtonGroup(**kwargs)

Bases: bokeh.models.widgets.groups.ButtonGroup

A group of check boxes rendered as toggle buttons.

active

property type: List(Int)

The list of indices of selected check boxes.

[
  {
    "attributes": {
      "active": [],
      "disabled": false,
      "doc": null,
      "id": "dff5453b-dc26-4a22-9dbc-420bf3a19789",
      "labels": [],
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "dff5453b-dc26-4a22-9dbc-420bf3a19789",
    "type": "CheckboxButtonGroup"
  }
]
class CheckboxGroup(**kwargs)

Bases: bokeh.models.widgets.groups.Group

A group of check boxes.

active

property type: List(Int)

The list of indices of selected check boxes.

[
  {
    "attributes": {
      "active": [],
      "disabled": false,
      "doc": null,
      "id": "a3f0a8f2-e2df-438a-a319-e84e853e8edd",
      "inline": false,
      "labels": [],
      "name": null,
      "tags": []
    },
    "id": "a3f0a8f2-e2df-438a-a319-e84e853e8edd",
    "type": "CheckboxGroup"
  }
]
class Group(**kwargs)

Bases: bokeh.models.widgets.groups.AbstractGroup

Abstract base class for groups with items rendered as check/radio boxes.

inline

property type: Bool

Should items be arrange vertically (False) or horizontally in-line (True).

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "07cd1026-c1de-4a69-af06-e40ad62b0bfc",
      "inline": false,
      "labels": [],
      "name": null,
      "tags": []
    },
    "id": "07cd1026-c1de-4a69-af06-e40ad62b0bfc",
    "type": "Group"
  }
]
class RadioButtonGroup(**kwargs)

Bases: bokeh.models.widgets.groups.ButtonGroup

A group of radio boxes rendered as toggle buttons.

active

property type: Int

The index of the selected radio box, or None if nothing is selected.

[
  {
    "attributes": {
      "active": null,
      "disabled": false,
      "doc": null,
      "id": "436bee69-3f3c-411f-890e-08888d96f5f7",
      "labels": [],
      "name": null,
      "tags": [],
      "type": "default"
    },
    "id": "436bee69-3f3c-411f-890e-08888d96f5f7",
    "type": "RadioButtonGroup"
  }
]
class RadioGroup(**kwargs)

Bases: bokeh.models.widgets.groups.Group

A group of radio boxes.

active

property type: Int

The index of the selected radio box, or None if nothing is selected.

[
  {
    "attributes": {
      "active": null,
      "disabled": false,
      "doc": null,
      "id": "5850bdab-52bf-4c3f-bdc7-83ac60f06800",
      "inline": false,
      "labels": [],
      "name": null,
      "tags": []
    },
    "id": "5850bdab-52bf-4c3f-bdc7-83ac60f06800",
    "type": "RadioGroup"
  }
]

bokeh.models.widgets.icons

Various kinds of icon widgets.

class AbstractIcon(**kwargs)

Bases: bokeh.models.widget.Widget

An abstract base class for icon widgets. AbstractIcon is not generally useful to instantiate on its own.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "5790a8e3-5dc6-47d1-87b3-c1a54d7e73eb",
      "name": null,
      "tags": []
    },
    "id": "5790a8e3-5dc6-47d1-87b3-c1a54d7e73eb",
    "type": "AbstractIcon"
  }
]
class Icon(**kwargs)

Bases: bokeh.models.widgets.icons.AbstractIcon

A “stock” icon based on FontAwesome.

flip

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

Optionally flip the icon horizontally or vertically.

name

property type: Enum(‘adjust’, ‘adn’, ‘align-center’, ‘align-justify’, ‘align-left’, ‘align-right’, ‘ambulance’, ‘anchor’, ‘android’, ‘angellist’, ‘angle-double-down’, ‘angle-double-left’, ‘angle-double-right’, ‘angle-double-up’, ‘angle-down’, ‘angle-left’, ‘angle-right’, ‘angle-up’, ‘apple’, ‘archive’, ‘area-chart’, ‘arrow-circle-down’, ‘arrow-circle-left’, ‘arrow-circle-o-down’, ‘arrow-circle-o-left’, ‘arrow-circle-o-right’, ‘arrow-circle-o-up’, ‘arrow-circle-right’, ‘arrow-circle-up’, ‘arrow-down’, ‘arrow-left’, ‘arrow-right’, ‘arrow-up’, ‘arrows’, ‘arrows-alt’, ‘arrows-h’, ‘arrows-v’, ‘asterisk’, ‘at’, ‘automobile’, ‘backward’, ‘ban’, ‘bank’, ‘bar-chart’, ‘bar-chart-o’, ‘barcode’, ‘bars’, ‘beer’, ‘behance’, ‘behance-square’, ‘bell’, ‘bell-o’, ‘bell-slash’, ‘bell-slash-o’, ‘bicycle’, ‘binoculars’, ‘birthday-cake’, ‘bitbucket’, ‘bitbucket-square’, ‘bitcoin’, ‘bold’, ‘bolt’, ‘bomb’, ‘book’, ‘bookmark’, ‘bookmark-o’, ‘briefcase’, ‘btc’, ‘bug’, ‘building’, ‘building-o’, ‘bullhorn’, ‘bullseye’, ‘bus’, ‘cab’, ‘calculator’, ‘calendar’, ‘calendar-o’, ‘camera’, ‘camera-retro’, ‘car’, ‘caret-down’, ‘caret-left’, ‘caret-right’, ‘caret-square-o-down’, ‘caret-square-o-left’, ‘caret-square-o-right’, ‘caret-square-o-up’, ‘caret-up’, ‘cc’, ‘cc-amex’, ‘cc-discover’, ‘cc-mastercard’, ‘cc-paypal’, ‘cc-stripe’, ‘cc-visa’, ‘certificate’, ‘chain’, ‘chain-broken’, ‘check’, ‘check-circle’, ‘check-circle-o’, ‘check-square’, ‘check-square-o’, ‘chevron-circle-down’, ‘chevron-circle-left’, ‘chevron-circle-right’, ‘chevron-circle-up’, ‘chevron-down’, ‘chevron-left’, ‘chevron-right’, ‘chevron-up’, ‘child’, ‘circle’, ‘circle-o’, ‘circle-o-notch’, ‘circle-thin’, ‘clipboard’, ‘clock-o’, ‘close’, ‘cloud’, ‘cloud-download’, ‘cloud-upload’, ‘cny’, ‘code’, ‘code-fork’, ‘codepen’, ‘coffee’, ‘cog’, ‘cogs’, ‘columns’, ‘comment’, ‘comment-o’, ‘comments’, ‘comments-o’, ‘compass’, ‘compress’, ‘copy’, ‘copyright’, ‘credit-card’, ‘crop’, ‘crosshairs’, ‘css3’, ‘cube’, ‘cubes’, ‘cut’, ‘cutlery’, ‘dashboard’, ‘database’, ‘dedent’, ‘delicious’, ‘desktop’, ‘deviantart’, ‘digg’, ‘dollar’, ‘dot-circle-o’, ‘download’, ‘dribbble’, ‘dropbox’, ‘drupal’, ‘edit’, ‘eject’, ‘ellipsis-h’, ‘ellipsis-v’, ‘empire’, ‘envelope’, ‘envelope-o’, ‘envelope-square’, ‘eraser’, ‘eur’, ‘euro’, ‘exchange’, ‘exclamation’, ‘exclamation-circle’, ‘exclamation-triangle’, ‘expand’, ‘external-link’, ‘external-link-square’, ‘eye’, ‘eye-slash’, ‘eyedropper’, ‘facebook’, ‘facebook-square’, ‘fast-backward’, ‘fast-forward’, ‘fax’, ‘female’, ‘fighter-jet’, ‘file’, ‘file-archive-o’, ‘file-audio-o’, ‘file-code-o’, ‘file-excel-o’, ‘file-image-o’, ‘file-movie-o’, ‘file-o’, ‘file-pdf-o’, ‘file-photo-o’, ‘file-picture-o’, ‘file-powerpoint-o’, ‘file-sound-o’, ‘file-text’, ‘file-text-o’, ‘file-video-o’, ‘file-word-o’, ‘file-zip-o’, ‘files-o’, ‘film’, ‘filter’, ‘fire’, ‘fire-extinguisher’, ‘flag’, ‘flag-checkered’, ‘flag-o’, ‘flash’, ‘flask’, ‘flickr’, ‘floppy-o’, ‘folder’, ‘folder-o’, ‘folder-open’, ‘folder-open-o’, ‘font’, ‘forward’, ‘foursquare’, ‘frown-o’, ‘futbol-o’, ‘gamepad’, ‘gavel’, ‘gbp’, ‘ge’, ‘gear’, ‘gears’, ‘gift’, ‘git’, ‘git-square’, ‘github’, ‘github-alt’, ‘github-square’, ‘gittip’, ‘glass’, ‘globe’, ‘google’, ‘google-plus’, ‘google-plus-square’, ‘google-wallet’, ‘graduation-cap’, ‘group’, ‘h-square’, ‘hacker-news’, ‘hand-o-down’, ‘hand-o-left’, ‘hand-o-right’, ‘hand-o-up’, ‘hdd-o’, ‘header’, ‘headphones’, ‘heart’, ‘heart-o’, ‘history’, ‘home’, ‘hospital-o’, ‘html5’, ‘ils’, ‘image’, ‘inbox’, ‘indent’, ‘info’, ‘info-circle’, ‘inr’, ‘instagram’, ‘institution’, ‘ioxhost’, ‘italic’, ‘joomla’, ‘jpy’, ‘jsfiddle’, ‘key’, ‘keyboard-o’, ‘krw’, ‘language’, ‘laptop’, ‘lastfm’, ‘lastfm-square’, ‘leaf’, ‘legal’, ‘lemon-o’, ‘level-down’, ‘level-up’, ‘life-bouy’, ‘life-buoy’, ‘life-ring’, ‘life-saver’, ‘lightbulb-o’, ‘line-chart’, ‘link’, ‘linkedin’, ‘linkedin-square’, ‘linux’, ‘list’, ‘list-alt’, ‘list-ol’, ‘list-ul’, ‘location-arrow’, ‘lock’, ‘long-arrow-down’, ‘long-arrow-left’, ‘long-arrow-right’, ‘long-arrow-up’, ‘magic’, ‘magnet’, ‘mail-forward’, ‘mail-reply’, ‘mail-reply-all’, ‘male’, ‘map-marker’, ‘maxcdn’, ‘meanpath’, ‘medkit’, ‘meh-o’, ‘microphone’, ‘microphone-slash’, ‘minus’, ‘minus-circle’, ‘minus-square’, ‘minus-square-o’, ‘mobile’, ‘mobile-phone’, ‘money’, ‘moon-o’, ‘mortar-board’, ‘music’, ‘navicon’, ‘newspaper-o’, ‘openid’, ‘outdent’, ‘pagelines’, ‘paint-brush’, ‘paper-plane’, ‘paper-plane-o’, ‘paperclip’, ‘paragraph’, ‘paste’, ‘pause’, ‘paw’, ‘paypal’, ‘pencil’, ‘pencil-square’, ‘pencil-square-o’, ‘phone’, ‘phone-square’, ‘photo’, ‘picture-o’, ‘pie-chart’, ‘pied-piper’, ‘pied-piper-alt’, ‘pinterest’, ‘pinterest-square’, ‘plane’, ‘play’, ‘play-circle’, ‘play-circle-o’, ‘plug’, ‘plus’, ‘plus-circle’, ‘plus-square’, ‘plus-square-o’, ‘power-off’, ‘print’, ‘puzzle-piece’, ‘qq’, ‘qrcode’, ‘question’, ‘question-circle’, ‘quote-left’, ‘quote-right’, ‘ra’, ‘random’, ‘rebel’, ‘recycle’, ‘reddit’, ‘reddit-square’, ‘refresh’, ‘remove’, ‘renren’, ‘reorder’, ‘repeat’, ‘reply’, ‘reply-all’, ‘retweet’, ‘rmb’, ‘road’, ‘rocket’, ‘rotate-left’, ‘rotate-right’, ‘rouble’, ‘rss’, ‘rss-square’, ‘rub’, ‘ruble’, ‘rupee’, ‘save’, ‘scissors’, ‘search’, ‘search-minus’, ‘search-plus’, ‘send’, ‘send-o’, ‘share’, ‘share-alt’, ‘share-alt-square’, ‘share-square’, ‘share-square-o’, ‘shekel’, ‘sheqel’, ‘shield’, ‘shopping-cart’, ‘sign-in’, ‘sign-out’, ‘signal’, ‘sitemap’, ‘skype’, ‘slack’, ‘sliders’, ‘slideshare’, ‘smile-o’, ‘soccer-ball-o’, ‘sort’, ‘sort-alpha-asc’, ‘sort-alpha-desc’, ‘sort-amount-asc’, ‘sort-amount-desc’, ‘sort-asc’, ‘sort-desc’, ‘sort-down’, ‘sort-numeric-asc’, ‘sort-numeric-desc’, ‘sort-up’, ‘soundcloud’, ‘space-shuttle’, ‘spinner’, ‘spoon’, ‘spotify’, ‘square’, ‘square-o’, ‘stack-exchange’, ‘stack-overflow’, ‘star’, ‘star-half’, ‘star-half-empty’, ‘star-half-full’, ‘star-half-o’, ‘star-o’, ‘steam’, ‘steam-square’, ‘step-backward’, ‘step-forward’, ‘stethoscope’, ‘stop’, ‘strikethrough’, ‘stumbleupon’, ‘stumbleupon-circle’, ‘subscript’, ‘suitcase’, ‘sun-o’, ‘superscript’, ‘support’, ‘table’, ‘tablet’, ‘tachometer’, ‘tag’, ‘tags’, ‘tasks’, ‘taxi’, ‘tencent-weibo’, ‘terminal’, ‘text-height’, ‘text-width’, ‘th’, ‘th-large’, ‘th-list’, ‘thumb-tack’, ‘thumbs-down’, ‘thumbs-o-down’, ‘thumbs-o-up’, ‘thumbs-up’, ‘ticket’, ‘times’, ‘times-circle’, ‘times-circle-o’, ‘tint’, ‘toggle-down’, ‘toggle-left’, ‘toggle-off’, ‘toggle-on’, ‘toggle-right’, ‘toggle-up’, ‘trash’, ‘trash-o’, ‘tree’, ‘trello’, ‘trophy’, ‘truck’, ‘try’, ‘tty’, ‘tumblr’, ‘tumblr-square’, ‘turkish-lira’, ‘twitch’, ‘twitter’, ‘twitter-square’, ‘umbrella’, ‘underline’, ‘undo’, ‘university’, ‘unlink’, ‘unlock’, ‘unlock-alt’, ‘unsorted’, ‘upload’, ‘usd’, ‘user’, ‘user-md’, ‘users’, ‘video-camera’, ‘vimeo-square’, ‘vine’, ‘vk’, ‘volume-down’, ‘volume-off’, ‘volume-up’, ‘warning’, ‘wechat’, ‘weibo’, ‘weixin’, ‘wheelchair’, ‘wifi’, ‘windows’, ‘won’, ‘wordpress’, ‘wrench’, ‘xing’, ‘xing-square’, ‘yahoo’, ‘yelp’, ‘yen’, ‘youtube’, ‘youtube-play’, ‘youtube-square’)

What icon to use. See http://fortawesome.github.io/Font-Awesome/icons/ for the list of available icons.

size

property type: Float

The size multiplier (1x, 2x, ..., 5x).

spin

property type: Bool

Indicates a spinning (animated) icon. This value is ignored for icons that do not support spinning.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "flip": null,
      "id": "39be9245-ad3c-4a65-83b3-d18ae85c690a",
      "name": "adjust",
      "size": null,
      "spin": false,
      "tags": []
    },
    "id": "39be9245-ad3c-4a65-83b3-d18ae85c690a",
    "type": "Icon"
  }
]

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: List(String)

A list of completion strings. This will be used to guide the user when he types-in a value.

[
  {
    "attributes": {
      "completions": [],
      "disabled": false,
      "doc": null,
      "id": "7efb642d-cb06-48a3-a645-3d5cf25c17e0",
      "name": null,
      "tags": [],
      "title": null,
      "value": null
    },
    "id": "7efb642d-cb06-48a3-a645-3d5cf25c17e0",
    "type": "AutocompleteInput"
  }
]
class DatePicker(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Calendar-based date picker widget.

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.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "b31a319c-f09a-411a-a2ce-65cf258c0bb0",
      "max_date": null,
      "min_date": null,
      "name": null,
      "tags": [],
      "title": null,
      "value": 1427241600000.0
    },
    "id": "b31a319c-f09a-411a-a2ce-65cf258c0bb0",
    "type": "DatePicker"
  }
]
class DateRangeSlider(**kwargs)

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.

enabled

property type: Bool

Enable or disable this widget.

range

property type: Tuple(RelativeDelta, RelativeDelta)

[TDB]

step

property type: RelativeDelta

The step between consecutive dates.

value

property type: Tuple(Date, Date)

The initial or selected date range.

value_labels

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

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

wheel_mode

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

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

[
  {
    "attributes": {
      "arrows": true,
      "bounds": null,
      "disabled": false,
      "doc": null,
      "enabled": true,
      "id": "00e272d6-6ad0-4f78-90a3-2fd73d1c2153",
      "name": null,
      "range": null,
      "step": {},
      "tags": [],
      "title": null,
      "value": null,
      "value_labels": "show",
      "wheel_mode": null
    },
    "id": "00e272d6-6ad0-4f78-90a3-2fd73d1c2153",
    "type": "DateRangeSlider"
  }
]
class InputWidget(**kwargs)

Bases: bokeh.models.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

name

property type: String

Widget’s name.

title

property type: String

Widget’s label.

value

property type: String

Initial or input value.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "4beff75a-0c85-4d44-abcb-6694e274b0a7",
      "name": null,
      "tags": [],
      "title": null,
      "value": null
    },
    "id": "4beff75a-0c85-4d44-abcb-6694e274b0a7",
    "type": "InputWidget"
  }
]
class MultiSelect(**kwargs)

Bases: bokeh.models.widgets.inputs.Select

Multi-select widget.

classmethod create(*args, **kwargs)
value

property type: List(String)

Initial or selected values.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "46e94847-9a6d-4524-a6ff-62438fcb41f6",
      "name": null,
      "options": [],
      "tags": [],
      "title": null,
      "value": []
    },
    "id": "46e94847-9a6d-4524-a6ff-62438fcb41f6",
    "type": "MultiSelect"
  }
]
class Select(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Single-select widget.

classmethod create(*args, **kwargs)
options

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

Available selection options.

value

property type: String

Initial or selected value.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "aded92a2-9b03-450a-8bbc-1e544f16d031",
      "name": null,
      "options": [],
      "tags": [],
      "title": null,
      "value": null
    },
    "id": "aded92a2-9b03-450a-8bbc-1e544f16d031",
    "type": "Select"
  }
]
class Slider(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Slider-based number selection widget.

end

property type: Float

The maximum allowable value.

orientation

property type: Enum(‘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.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "end": null,
      "id": "98933dad-f97f-4c99-bf89-2225dffe7df6",
      "name": null,
      "orientation": "horizontal",
      "start": null,
      "step": null,
      "tags": [],
      "title": null,
      "value": null
    },
    "id": "98933dad-f97f-4c99-bf89-2225dffe7df6",
    "type": "Slider"
  }
]
class TextInput(**kwargs)

Bases: bokeh.models.widgets.inputs.InputWidget

Single-line input widget.

value

property type: String

Initial or entered text value.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "9fec9bb5-f949-4aee-b075-7ea827950089",
      "name": null,
      "tags": [],
      "title": null,
      "value": null
    },
    "id": "9fec9bb5-f949-4aee-b075-7ea827950089",
    "type": "TextInput"
  }
]

bokeh.models.widgets.layouts

Various kinds of lyaout widgets.

class AppHBox(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.HBox, bokeh.models.widgets.layouts.AppLayout

VBox, except children can be other plot objects, as well as strings (which are then evaluated in an app namespace for de-referencing

children

property type: List(Either(Instance(Widget), String))

The list of children, which can be other widgets (including layouts) and plots - or strings. If strings, there must be a corresponding app which contains the widget/plot matching that string

[
  {
    "attributes": {
      "app": null,
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "f07ce172-a05d-4782-a596-be75fa225233",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "f07ce172-a05d-4782-a596-be75fa225233",
    "type": "AppHBox"
  }
]
class AppLayout(**kwargs)

Bases: bokeh.models.widgets.layouts.Layout

app

property type: Instance(SimpleApp)

[
  {
    "attributes": {
      "app": null,
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "ef9f17db-a10d-4764-a15b-a85ece7118e9",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "ef9f17db-a10d-4764-a15b-a85ece7118e9",
    "type": "AppLayout"
  }
]
class AppVBox(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.VBox, bokeh.models.widgets.layouts.AppLayout

VBox, except children can be other plot objects, as well as strings (which are then evaluated in an app namespace for de-referencing

children

property type: List(Either(Instance(Widget), String))

The list of children, which can be other widgets (including layouts) and plots - or strings. If strings, there must be a corresponding app which contains the widget/plot matching that string

[
  {
    "attributes": {
      "app": null,
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "9f8173bc-2201-498f-ba14-830124067970",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "9f8173bc-2201-498f-ba14-830124067970",
    "type": "AppVBox"
  }
]
class AppVBoxForm(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.VBox, bokeh.models.widgets.layouts.AppLayout

VBox, except children can be other plot objects, as well as strings (which are then evaluated in an app namespace for de-referencing

children

property type: List(Either(Instance(Widget), String))

The list of children, which can be other widgets (including layouts) and plots - or strings. If strings, there must be a corresponding app which contains the widget/plot matching that string

[
  {
    "attributes": {
      "app": null,
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "a544777b-e653-453a-85fa-f0f1ef01da7d",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "a544777b-e653-453a-85fa-f0f1ef01da7d",
    "type": "AppVBoxForm"
  }
]
class BaseBox(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.Layout

Abstract base class for HBox and VBox. Do not use directly.

children

property type: List(Instance(Widget))

The list of children, which can be other widgets (including layouts) and plots.

[
  {
    "attributes": {
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "d66aa00e-5563-4945-b545-60b2922af8ea",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "d66aa00e-5563-4945-b545-60b2922af8ea",
    "type": "BaseBox"
  }
]
class HBox(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.BaseBox

Lay out child widgets in a single horizontal row.

Children can be specified as positional arguments, as a single argument that is a sequence, or using the children keyword argument.

[
  {
    "attributes": {
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "1f6407bc-54e7-448e-aee0-8577b7ac86c4",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "1f6407bc-54e7-448e-aee0-8577b7ac86c4",
    "type": "HBox"
  }
]
class Layout(**kwargs)

Bases: bokeh.models.widget.Widget

An abstract base class for layout widgets. Layout is not generally useful to instantiate on its own.

height

property type: Int

An optional height for the widget (in pixels).

width

property type: Int

An optional width for the widget (in pixels).

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "a3613d03-47ee-4a6c-82d8-e1e2e3abcb56",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "a3613d03-47ee-4a6c-82d8-e1e2e3abcb56",
    "type": "Layout"
  }
]
class SimpleApp(**kwargs)

Bases: bokeh.models.widget.Widget

args_for_func(func)
callback(func)
clear_debounce()
classmethod create(name, widgets)
default_layout()
process_user_result(result)
set_debounce()
set_output()
setup_events()
create_registry = {}
layout

property type: Instance(Widget)

layout_registry = {}
name

property type: String

objects

property type: Dict(String, Either(String, Instance(Widget)))

update_registry = {}
widget_dict
widget_list

property type: List(String)

list of widgets, for ordering

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "7e064ae6-2234-4d86-b2b3-650deb0ba052",
      "layout": null,
      "name": null,
      "objects": {},
      "tags": [],
      "widget_list": []
    },
    "id": "7e064ae6-2234-4d86-b2b3-650deb0ba052",
    "type": "SimpleApp"
  }
]
class VBox(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.BaseBox

Lay out child widgets in a single vertical row.

Children can be specified as positional arguments, as a single argument that is a sequence, or using the children keyword argument.

[
  {
    "attributes": {
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "13379e90-d847-4e3e-ba67-78d02853b6bd",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "13379e90-d847-4e3e-ba67-78d02853b6bd",
    "type": "VBox"
  }
]
class VBoxForm(*args, **kwargs)

Bases: bokeh.models.widgets.layouts.VBox

Basically, a VBox, where all components(generally form stuff) is wrapped in a <form> tag - important for bootstrap css

[
  {
    "attributes": {
      "children": [],
      "disabled": false,
      "doc": null,
      "height": null,
      "id": "36e232ef-0322-47ad-acee-3a2b78aa3ab3",
      "name": null,
      "tags": [],
      "width": null
    },
    "id": "36e232ef-0322-47ad-acee-3a2b78aa3ab3",
    "type": "VBoxForm"
  }
]

bokeh.models.widgets.markups

Various kinds of markup (static content) widgets.

class Paragraph(**kwargs)

Bases: bokeh.models.widget.Widget

A block (paragraph) of text.

height

property type: Int

The height of the block in pixels.

text

property type: String

The contents of the widget.

width

property type: Int

The width of the block in pixels.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "height": 400,
      "id": "e8828197-6bfa-42b0-b977-9ce7a41cd6f1",
      "name": null,
      "tags": [],
      "text": null,
      "width": 500
    },
    "id": "e8828197-6bfa-42b0-b977-9ce7a41cd6f1",
    "type": "Paragraph"
  }
]
class PreText(**kwargs)

Bases: bokeh.models.widgets.markups.Paragraph

A block (paragraph) of pre-formatted text.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "height": 400,
      "id": "14d93a6d-bd9f-4c7d-99e2-6812c76cb646",
      "name": null,
      "tags": [],
      "text": null,
      "width": 500
    },
    "id": "14d93a6d-bd9f-4c7d-99e2-6812c76cb646",
    "type": "PreText"
  }
]

bokeh.models.widgets.panels

Various kinds of panel widgets.

class Panel(**kwargs)

Bases: bokeh.models.widget.Widget

A single-widget container with title bar and controls.

child

property type: Instance(Widget)

The child widget. If you need more children, use a layout widget, e.g. HBox or VBox.

closable

property type: Bool

Whether this panel is closeable or not. If True, an “x” button will appear.

title

property type: String

An optional text title of the panel.

[
  {
    "attributes": {
      "child": null,
      "closable": false,
      "disabled": false,
      "doc": null,
      "id": "f5881caa-0641-4f9d-a343-31510b003e8a",
      "name": null,
      "tags": [],
      "title": null
    },
    "id": "f5881caa-0641-4f9d-a343-31510b003e8a",
    "type": "Panel"
  }
]
class Tabs(**kwargs)

Bases: bokeh.models.widget.Widget

A panel widget with navigation tabs.

active

property type: Int

The index of the active tab.

tabs

property type: List(Instance(Panel))

The list of child panel widgets.

[
  {
    "attributes": {
      "active": 0,
      "disabled": false,
      "doc": null,
      "id": "ee6f3c2a-8e1e-47a5-a056-3cd7242394e6",
      "name": null,
      "tabs": [],
      "tags": []
    },
    "id": "ee6f3c2a-8e1e-47a5-a056-3cd7242394e6",
    "type": "Tabs"
  }
]

bokeh.models.widgets.tables

Various kinds of data table (data grid) widgets.

class BooleanFormatter(**kwargs)

Bases: bokeh.models.widgets.tables.CellFormatter

Boolean (check mark) cell formatter.

icon

property type: Enum(‘check’, ‘check-circle’, ‘check-circle-o’, ‘check-square’, ‘check-square-o’)

The icon visualizing the check mark.

[
  {
    "attributes": {
      "doc": null,
      "icon": "check",
      "id": "4203cb52-ec03-4572-8a57-e040bd54f169",
      "name": null,
      "tags": []
    },
    "id": "4203cb52-ec03-4572-8a57-e040bd54f169",
    "type": "BooleanFormatter"
  }
]
class CellEditor(**kwargs)

Bases: bokeh.plot_object.PlotObject

Abstract base class for data table’s cell editors.

[
  {
    "attributes": {
      "doc": null,
      "id": "6bc477f4-0d5d-48e1-854e-7722ceccf875",
      "name": null,
      "tags": []
    },
    "id": "6bc477f4-0d5d-48e1-854e-7722ceccf875",
    "type": "CellEditor"
  }
]
class CellFormatter(**kwargs)

Bases: bokeh.plot_object.PlotObject

Abstract base class for data table’s cell formatters.

[
  {
    "attributes": {
      "doc": null,
      "id": "0767d8eb-7ac9-4d7a-9861-25d94b626d0d",
      "name": null,
      "tags": []
    },
    "id": "0767d8eb-7ac9-4d7a-9861-25d94b626d0d",
    "type": "CellFormatter"
  }
]
class CheckboxEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Boolean value cell editor.

[
  {
    "attributes": {
      "doc": null,
      "id": "68788c55-1483-4d55-bea4-2791822dcf71",
      "name": null,
      "tags": []
    },
    "id": "68788c55-1483-4d55-bea4-2791822dcf71",
    "type": "CheckboxEditor"
  }
]
class DataTable(**kwargs)

Bases: bokeh.models.widgets.tables.TableWidget

Two dimensional grid for visualisation and editing large amounts of data.

columns

property type: List(Instance(TableColumn))

The list of child column widgets.

editable

property type: Bool

Allows to edit table’s contents. Needs cell editors to be configured on columns that are required to be editable.

fit_columns

property type: Bool

Whether columns should be fit to the available width. This results in no horizontal scrollbar showing up, but data can get unreadable if there is no enough space available. If set to True, columns’ width is understood as maximum width.

height

property type: Either(Int, Auto)

Height in pixels of the table widget. Use Auto to make the widget adjust its height automatically. Note that Auto is inefficient for large amounts of data, so should be used with care.

row_headers

property type: Bool

Enable or disable row headers, i.e. the index column.

selectable

property type: Either(Bool, Enum(‘checkbox’))

Whether a table’s rows can be selected or not. Using checkbox is equivalent to True, but makes selection visible through a checkbox for each row, instead of highlighting rows. Multiple selection is allowed and can be achieved by either clicking multiple checkboxes (if enabled) or using Shift + click on rows.

sortable

property type: Bool

Allows to sort table’s contents. By default natural order is preserved. To sort a column, click on it’s header. Clicking one more time changes sort direction. Use Ctrl + click to return to natural order. Use Shift + click to sort multiple columns simultaneously.

width

property type: Int

Optional width in pixels of the table widget. By default, uses all horizontal space available.

[
  {
    "attributes": {
      "columns": [],
      "disabled": false,
      "doc": null,
      "editable": false,
      "fit_columns": true,
      "height": 400,
      "id": "280a30cb-5c38-404d-9ec9-165dd6c8d681",
      "name": null,
      "row_headers": true,
      "selectable": true,
      "sortable": true,
      "source": null,
      "tags": [],
      "width": null
    },
    "id": "280a30cb-5c38-404d-9ec9-165dd6c8d681",
    "type": "DataTable"
  }
]
class DateEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Calendar-based date cell editor.

[
  {
    "attributes": {
      "doc": null,
      "id": "a1e563e7-ed63-4491-91d0-fda396aea415",
      "name": null,
      "tags": []
    },
    "id": "a1e563e7-ed63-4491-91d0-fda396aea415",
    "type": "DateEditor"
  }
]
class DateFormatter(**kwargs)

Bases: bokeh.models.widgets.tables.CellFormatter

Date cell formatter.

format

property type: Either(Enum(‘ATOM’, ‘W3C’, ‘RFC-3339’, ‘ISO-8601’, ‘COOKIE’, ‘RFC-822’, ‘RFC-850’, ‘RFC-1036’, ‘RFC-1123’, ‘RFC-2822’, ‘RSS’, ‘TICKS’, ‘TIMESTAMP’), String)

The date format can be combinations of the following:

d
day of month (no leading zero)
dd
day of month (two digit)
o
day of year (no leading zeros)
oo
day of year (three digit)
D
day name short
DD
day name long
m
month of year (no leading zero)
mm
month of year (two digit)
M
month name short
MM
month name long
y
year (two digit)
yy
year (four digit)
@
Unix timestamp (ms since 01/01/1970)
!
Windows ticks (100ns since 01/01/0001)
”...”
literal text
‘’
single quote
[
  {
    "attributes": {
      "doc": null,
      "format": "yy M d",
      "id": "13201796-4e36-4aa3-ab34-e37afd5d3c34",
      "name": null,
      "tags": []
    },
    "id": "13201796-4e36-4aa3-ab34-e37afd5d3c34",
    "type": "DateFormatter"
  }
]
class IntEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Spinner-based integer cell editor.

step

property type: Int

The major step value.

[
  {
    "attributes": {
      "doc": null,
      "id": "d6aaf8c4-6411-478f-beea-772ae8190c57",
      "name": null,
      "step": 1,
      "tags": []
    },
    "id": "d6aaf8c4-6411-478f-beea-772ae8190c57",
    "type": "IntEditor"
  }
]
class NumberEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Spinner-based number cell editor.

step

property type: Float

The major step value.

[
  {
    "attributes": {
      "doc": null,
      "id": "a256a833-c6f3-4b31-adb3-f72f336afceb",
      "name": null,
      "step": 0.01,
      "tags": []
    },
    "id": "a256a833-c6f3-4b31-adb3-f72f336afceb",
    "type": "NumberEditor"
  }
]
class NumberFormatter(**kwargs)

Bases: bokeh.models.widgets.tables.StringFormatter

Number cell formatter.

format

property type: String

The number format, as defined in the following tables:

NUMBERS:

Number Format String
10000 ‘0,0.0000’ 10,000.0000
10000.23 ‘0,0’ 10,000
10000.23 ‘+0,0’ +10,000
-10000 ‘0,0.0’ -10,000.0
10000.1234 ‘0.000’ 10000.123
10000.1234 ‘0[.]00000’ 10000.12340
-10000 ‘(0,0.0000)’ (10,000.0000)
-0.23 ‘.00’ -.23
-0.23 ‘(.00)’ (.23)
0.23 ‘0.00000’ 0.23000
0.23 ‘0.0[0000]’ 0.23
1230974 ‘0.0a’ 1.2m
1460 ‘0 a’ 1 k
-104000 ‘0a’ -104k
1 ‘0o’ 1st
52 ‘0o’ 52nd
23 ‘0o’ 23rd
100 ‘0o’ 100th

CURRENCY:

Number Format String
1000.234 ‘$0,0.00’ $1,000.23
1000.2 ‘0,0[.]00 $’ 1,000.20 $
1001 ‘$ 0,0[.]00’ $ 1,001
-1000.234 ‘($0,0)’ ($1,000)
-1000.234 ‘$0.00’ -$1000.23
1230974 ‘($ 0.00 a)’ $ 1.23 m

BYTES:

Number Format String
100 ‘0b’ 100B
2048 ‘0 b’ 2 KB
7884486213 ‘0.0b’ 7.3GB
3467479682787 ‘0.000 b’ 3.154 TB

PERCENTAGES:

Number Format String
1 ‘0%’ 100%
0.974878234 ‘0.000%’ 97.488%
-0.43 ‘0 %’ -43 %
0.43 ‘(0.000 %)’ 43.000 %

TIME:

Number Format String
25 ‘00:00:00’ 0:00:25
238 ‘00:00:00’ 0:03:58
63846 ‘00:00:00’ 17:44:06
language

property type: Enum(‘be-nl’, ‘chs’, ‘cs’, ‘da-dk’, ‘de-ch’, ‘de’, ‘en’, ‘en-gb’, ‘es-ES’, ‘es’, ‘et’, ‘fi’, ‘fr-CA’, ‘fr-ch’, ‘fr’, ‘hu’, ‘it’, ‘ja’, ‘nl-nl’, ‘pl’, ‘pt-br’, ‘pt-pt’, ‘ru’, ‘ru-UA’, ‘sk’, ‘th’, ‘tr’, ‘uk-UA’)

The language to use for formatting language-specific features (e.g. thousands separator).

rounding

property type: Enum(‘round’, ‘nearest’, ‘floor’, ‘rounddown’, ‘ceil’, ‘roundup’)

Rounding functions (round, floor, ceil) and their synonyms (nearest, rounddown, roundup).

[
  {
    "attributes": {
      "doc": null,
      "font_style": "normal",
      "format": "0,0",
      "id": "c397ebe1-c8d0-4a59-8e9c-9058e06b8178",
      "language": "en",
      "name": null,
      "rounding": "round",
      "tags": [],
      "text_align": "left",
      "text_color": null
    },
    "id": "c397ebe1-c8d0-4a59-8e9c-9058e06b8178",
    "type": "NumberFormatter"
  }
]
class PercentEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

IntEditor optimized for editing percentages.

[
  {
    "attributes": {
      "doc": null,
      "id": "ebbd7028-6193-405d-ba04-f678402298fa",
      "name": null,
      "tags": []
    },
    "id": "ebbd7028-6193-405d-ba04-f678402298fa",
    "type": "PercentEditor"
  }
]
class SelectEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Select cell editor.

options

property type: List(String)

The list of options to select from.

[
  {
    "attributes": {
      "doc": null,
      "id": "c8276209-f4db-461a-a443-ec1b476483d4",
      "name": null,
      "options": [],
      "tags": []
    },
    "id": "c8276209-f4db-461a-a443-ec1b476483d4",
    "type": "SelectEditor"
  }
]
class StringEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Basic string cell editor with auto-completion.

completions

property type: List(String)

An optional list of completion strings.

[
  {
    "attributes": {
      "completions": [],
      "doc": null,
      "id": "61fff461-a041-4e93-9ba8-48e8c20dfc9c",
      "name": null,
      "tags": []
    },
    "id": "61fff461-a041-4e93-9ba8-48e8c20dfc9c",
    "type": "StringEditor"
  }
]
class StringFormatter(**kwargs)

Bases: bokeh.models.widgets.tables.CellFormatter

Basic string cell formatter.

font_style

property type: Enum(‘normal’, ‘italic’, ‘bold’)

An optional text font style, e.g. bold, italic.

text_align

property type: Enum(‘left’, ‘right’, ‘center’)

An optional text align, i.e. left, center or right.

text_color

property type: Color

An optional text color. See bokeh.properties.Color for details.

[
  {
    "attributes": {
      "doc": null,
      "font_style": "normal",
      "id": "5de99c08-2988-4614-bcbd-7449f79b1472",
      "name": null,
      "tags": [],
      "text_align": "left",
      "text_color": null
    },
    "id": "5de99c08-2988-4614-bcbd-7449f79b1472",
    "type": "StringFormatter"
  }
]
class TableColumn(**kwargs)

Bases: bokeh.plot_object.PlotObject

Table column widget.

default_sort

property type: Enum(‘ascending’, ‘descending’)

The default sorting order. By default ascending order is used.

editor

property type: Instance(CellEditor)

The cell editor for this column. By default, a simple string editor is used.

field

property type: String

The name of the field mapping to a column in the data source.

formatter

property type: Instance(CellFormatter)

The cell formatter for this column. By default, a simple string formatter is used.

sortable

property type: Bool

Whether this column is sortable or not. Note that data table has to have sorting enabled to allow sorting in general.

title

property type: String

The title of this column. If not set, column’s data field is used instead.

width

property type: Int

The width or maximum width (depending on data table’s configuration) in pixels of this column.

[
  {
    "attributes": {
      "default_sort": "ascending",
      "doc": null,
      "editor": {
        "id": "962590a3-623b-4d73-acf9-1cb8c6c5ece4",
        "type": "StringEditor"
      },
      "field": null,
      "formatter": {
        "id": "7a887297-7461-4448-8d22-1acc1e68eada",
        "type": "StringFormatter"
      },
      "id": "5b465e44-e528-4053-9d1c-756ecbfc4b78",
      "name": null,
      "sortable": true,
      "tags": [],
      "title": null,
      "width": 300
    },
    "id": "5b465e44-e528-4053-9d1c-756ecbfc4b78",
    "type": "TableColumn"
  },
  {
    "attributes": {
      "doc": null,
      "font_style": "normal",
      "id": "7a887297-7461-4448-8d22-1acc1e68eada",
      "name": null,
      "tags": [],
      "text_align": "left",
      "text_color": null
    },
    "id": "7a887297-7461-4448-8d22-1acc1e68eada",
    "type": "StringFormatter"
  },
  {
    "attributes": {
      "completions": [],
      "doc": null,
      "id": "962590a3-623b-4d73-acf9-1cb8c6c5ece4",
      "name": null,
      "tags": []
    },
    "id": "962590a3-623b-4d73-acf9-1cb8c6c5ece4",
    "type": "StringEditor"
  }
]
class TableWidget(**kwargs)

Bases: bokeh.models.widget.Widget

Abstract base class for data table (data grid) widgets.

source

property type: Instance(DataSource)

The source of data for the widget.

[
  {
    "attributes": {
      "disabled": false,
      "doc": null,
      "id": "8415045d-3864-4aae-aab7-90cd1c4e0ab5",
      "name": null,
      "source": null,
      "tags": []
    },
    "id": "8415045d-3864-4aae-aab7-90cd1c4e0ab5",
    "type": "TableWidget"
  }
]
class TextEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Multi-line string cell editor.

[
  {
    "attributes": {
      "doc": null,
      "id": "38efaa0a-a354-449f-b99d-52d4929b6f9b",
      "name": null,
      "tags": []
    },
    "id": "38efaa0a-a354-449f-b99d-52d4929b6f9b",
    "type": "TextEditor"
  }
]
class TimeEditor(**kwargs)

Bases: bokeh.models.widgets.tables.CellEditor

Spinner-based time cell editor.

[
  {
    "attributes": {
      "doc": null,
      "id": "9a92f85a-208b-4579-9619-0512049dd823",
      "name": null,
      "tags": []
    },
    "id": "9a92f85a-208b-4579-9619-0512049dd823",
    "type": "TimeEditor"
  }
]