shyft.dashboard.time_series.layouts

Classes

ViewContainerTabs(panels, ...)

Object is a helper layout, creating a bokeh Tabs layout from provided Panels, as the bokeh Tabs does.

Exceptions

ViewContainerTabsError

exception shyft.dashboard.time_series.layouts.ViewContainerTabsError[source]

Bases: RuntimeError

class shyft.dashboard.time_series.layouts.ViewContainerTabs(panels: List[TabPanel], visibility_view_containers: List[List[BaseViewContainer]], width: int, height: int, active: int)[source]

Bases: object

Object is a helper layout, creating a bokeh Tabs layout from provided Panels, as the bokeh Tabs does. Additional to bokeh tabs, a callback is implemented which can trigger the visibilty of view_container in the panels provided. Whenever a panel is activated all view_container in the Panel will be set to visible.

Since the bokeh.panels can take a big layouts with buttons etc. we need to provide the view_container for which the visibility should be changed in a separate argument. This is the visibility_view_containers list. It should be as long as panels. The elements of visibility_view_containers should be of type List, they may view_container or be empty.

Exemplified:

If a Panel is activated, lets say the second panel (with index 1), all view_container in visibility_view_containers[1] will be set to visible=True, all other view_container will be set to visible = False

__init__(panels: List[TabPanel], visibility_view_containers: List[List[BaseViewContainer]], width: int, height: int, active: int) None[source]

Bokeh Tabs layout controlling the visibility of the view_container inside the tabs

Parameters:
  • panels (List of bokeh.models.Panel which we want to show in the tables)

  • visibility_view_containers (List of Lists with view_container matching with panels)

  • width (width of the Tabs widget)

  • height (height of the Tabs widget)

  • active (active Panel to start with)

on_active_tabs(attr, old, new) None[source]

Callback to change on activating a tab

property layout: Tabs

Layout, returns the bokeh.models.tabs LayoutDom