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.

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 for autoranging.

renderers

property type: List(Instance(Renderer))

An explicit list of renderers to autorange against. If unset, defaults to all renderers on a plot.

[
  {
    "attributes": {
      "callback": null,
      "doc": null,
      "id": "2905345c-7d1c-4de4-bc51-0be49109d275",
      "name": null,
      "names": [],
      "renderers": [],
      "tags": []
    },
    "id": "2905345c-7d1c-4de4-bc51-0be49109d275",
    "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.

range_padding

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": {
      "callback": null,
      "doc": null,
      "end": null,
      "id": "6d924914-a448-4bd0-b886-7beec2384880",
      "name": null,
      "names": [],
      "range_padding": 0.1,
      "renderers": [],
      "start": null,
      "tags": []
    },
    "id": "6d924914-a448-4bd0-b886-7beec2384880",
    "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.

offset

property type: Float

An offset to the (synthetic) range (default: 0)

Note

The primary usage of this is to support compatibility and integration with other plotting systems, and will not generally of interest to most users.

[
  {
    "attributes": {
      "callback": null,
      "doc": null,
      "factors": [],
      "id": "95e79935-2ab4-4e43-93f8-65df587876ad",
      "name": null,
      "offset": 0,
      "tags": []
    },
    "id": "95e79935-2ab4-4e43-93f8-65df587876ad",
    "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.

callback

property type: Instance(Callback)

A callback to run in the browser whenever the range is updated.

[
  {
    "attributes": {
      "callback": null,
      "doc": null,
      "id": "2d0ef229-f9af-4783-9b1b-c048521120bf",
      "name": null,
      "tags": []
    },
    "id": "2d0ef229-f9af-4783-9b1b-c048521120bf",
    "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": {
      "callback": null,
      "doc": null,
      "end": null,
      "id": "15aaf01c-9bfe-4851-b8a3-48daea8f3ab9",
      "name": null,
      "start": null,
      "tags": []
    },
    "id": "15aaf01c-9bfe-4851-b8a3-48daea8f3ab9",
    "type": "Range1d"
  }
]