Anaconda Enterprise: Documentation

# bokeh.models.layouts

Various kinds of layout components.

class `bokeh.models.layouts.``Box`(*args, **kwargs)

  Bases: `bokeh.models.layouts.LayoutDOM`

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

  Note

  This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

  `children`

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

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

JSON Prototype

    {
      "children": [],
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "2bd1d7d2-a3b9-4bb2-88c5-21c05f5168c4",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }

class `bokeh.models.layouts.``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": [],
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "71993010-7f51-4663-b4a8-35c02b2a5b64",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }

class `bokeh.models.layouts.``LayoutDOM`(**kwargs)

  Bases: `bokeh.model.Model`

  An abstract base class for layout components.

  Note

  This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

  `css_classes`

    property type: `Seq` ( `String` )

    A list of css class names to add to this DOM element. Note: the class names are simply added as-is, no other guarantees are provided.

  `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.

  `height`

    property type: `Int`

    An optional height for the component (in pixels).

  `sizing_mode`

    property type: `Enum` ( `SizingMode` )

    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 for both the width and height available, while maintaining the original aspect ratio.

  `width`

    property type: `Int`

    An optional width for the component (in pixels).

  `html`

JSON Prototype

    {
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "f2c2fafc-35b6-459f-8bba-b3d9dcb31879",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }

class `bokeh.models.layouts.``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": [],
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "48288585-de7b-4c99-a943-53d3398b0ca3",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }

class `bokeh.models.layouts.``Spacer`(**kwargs)

  Bases: `bokeh.models.layouts.LayoutDOM`

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

JSON Prototype

    {
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "6ce05a30-803d-42d4-b210-db8215246429",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }

class `bokeh.models.layouts.``WidgetBox`(*args, **kwargs)

  Bases: `bokeh.models.layouts.LayoutDOM`

  A container for widgets that are part of a layout.

  `children`

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

    The list of widgets to put in the layout box.

JSON Prototype

    {
      "children": [],
      "css_classes": null,
      "disabled": false,
      "height": null,
      "id": "fec6b7d4-352c-49a6-b3b8-3bd15a572c17",
      "js_event_callbacks": {},
      "js_property_callbacks": {},
      "name": null,
      "sizing_mode": "fixed",
      "subscribed_events": [],
      "tags": [],
      "width": null
    }