bokeh.models.layouts

Various kinds of layout components.

class Box(*args, **kwargs)

Bases: bokeh.models.layouts.LayoutDOM

Abstract base class for Row and Column. Do not use directly.

children

property type: children:List(Instance(LayoutDOM))

The list of children, which can be other components including plots, rows, columns, and widgets.

JSON Prototype
{
  "children": [],
  "disabled": false,
  "height": null,
  "id": "3f8e03b6-c71c-4ee5-86d9-c861e02dded4",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
class Column(*args, **kwargs)

Bases: bokeh.models.layouts.Box

Lay out child components 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.

JSON Prototype
{
  "children": [],
  "disabled": false,
  "height": null,
  "id": "7d90ed2a-12df-4785-9565-74cb3c69fe4b",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
class LayoutDOM(**kwargs)

Bases: bokeh.model.Model

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

disabled

property type: disabled:Bool

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

height

property type: height:Int

An optional height for the component (in pixels).

html
sizing_mode

property type: sizing_mode:Enum(‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, ‘fixed’)

How the item being displayed should size itself. Possible values are "fixed", "scale_width", "scale_height", "scale_both", and "stretch_both".

"stretch_both" elements are completely responsive (independently in width and height) and will resize to occupy all available space, even if this changes the aspect ratio of the element. This is sometimes called outside-in, and is a typical behavior for desktop applications.

"fixed" elements are not responsive. They will retain their original width and height regardless of any subsequent browser window resize events.

"scale_width" elements will responsively resize to fit to the width available, while maintaining the original aspect ratio. This is a typical behavior for modern websites. For a Plot, the aspect ratio plot_width/plot_height is maintained.

"scale_height" elements will responsively resize to fit to the height available, while maintaining the original aspect ratio. For a Plot, the aspect ratio plot_width/plot_height is maintained. A plot with "scale_height" mode needs to be wrapped in a Row or Column to be responsive.

"scale_both" elements will responsively resize to fir both the width and height available, while maintaining the original aspect ratio.

width

property type: width:Int

An optional width for the component (in pixels).

JSON Prototype
{
  "disabled": false,
  "height": null,
  "id": "6b35b692-2d21-460d-bfe9-f1f82603b2ca",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
class Row(*args, **kwargs)

Bases: bokeh.models.layouts.Box

Lay out child components 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.

JSON Prototype
{
  "children": [],
  "disabled": false,
  "height": null,
  "id": "89d8ef3f-7206-478e-90f6-361a6c32cd44",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
class Spacer(**kwargs)

Bases: bokeh.models.layouts.LayoutDOM

A container for space used to fill an empty spot in a row or column.

JSON Prototype
{
  "disabled": false,
  "height": null,
  "id": "edbf01c9-8bb6-47da-9f81-97842c8d05b8",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
class WidgetBox(*args, **kwargs)

Bases: bokeh.models.layouts.LayoutDOM

A container for widgets that are part of a layout.

children

property type: children:List(Instance(Widget))

The list of widgets to put in the layout box.

JSON Prototype
{
  "children": [],
  "disabled": false,
  "height": null,
  "id": "29589dcb-2346-4b06-a2bf-210f7da5f4ce",
  "name": null,
  "sizing_mode": "fixed",
  "tags": [],
  "width": null
}
GridPlot(*args, **kwargs)

Deprecated in Bokeh 0.12.0; please use bokeh.layouts.gridplot instead.

HBox(*args, **kwargs)

Lay out child components 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.

Returns a Row instance.

VBox(*args, **kwargs)

Lay out child components 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.

Returns a Column instance.

VBoxForm(*args, **kwargs)

Deprecated in Bokeh 0.12.0; please use bokeh.models.layouts.WidgetBox instead.