implementations module

class TabImplementation

Bases: object

A mixin class to implement a module inside a tab.

Dependencies:
  • self.label (str): The label for the tab.

  • self.module_name (str): The name of the module, used for generating unique IDs.

  • self.module_layout (html.Div): The layout to display inside the tab.

Note

  • This class should be used as a mixin in a module class.

  • If necessary, you can override the get_module_layout method to further customize the layout inside the tab.

get_module_layout()

Get the layout of the module.

Works as is, but can be overridden if needed.

Return type:

Div

label: str
layout()

Generate the layout for the module as a tab.

Returns:

The layout containing the module layout.

Return type:

html.Div

module_layout: Div
module_name: str
class TabModule(*args, **kwargs)

Bases: Protocol

A protocol that defines the expected interface for a module to be used in a tab.

label

The label for the tab.

Type:

str

module_name

The name of the module, used for generating unique IDs.

Type:

str

module_layout

The layout to display inside the tab.

Type:

html.Div

layout() dbc.Tab

Returns the layout of the module inside a tab.

Return type:

Tab

label: str
layout()

This method should return the layout of the module inside a tab.

Return type:

Tab

module_layout: Div
module_name: str
class WindowImplementation

Bases: object

A mixin class to implement a module inside a modal.

Dependencies:
  • self.label (str): The label for the modal and sidebar button.

  • self.module_name (str): The name of the module, used for generating unique IDs.

  • self.module_layout (html.Div): The layout to display inside the modal.

Note

  • This class should be used as a mixin in a module class.

  • If necessary, you can override the get_module_layout method to further customize the layout inside the modal.

get_module_layout()

Get the layout of the module.

Works as is, but can be overridden if needed.

Return type:

Div

label: str
layout()

Generate the layout for the modal window.

This method creates a modal window with a header and a body containing the module layout. It also creates a sidebar button to toggle the modal.

Returns:

The layout containing the modal and the sidebar button.

Return type:

html.Div

module_layout: Div
module_name: str
window_callbacks()

Define the callbacks for the module window.

This includes a callback to toggle the visibility of the modal window.

Return type:

None

class WindowModule(*args, **kwargs)

Bases: Protocol

A protocol that defines the expected interface for a module to be used in a window.

label

The label for the window.

Type:

str

module_name

The name of the module, used for generating unique IDs.

Type:

str

module_layout

The layout to display inside the window.

Type:

html.Div

layout() html.Div

Returns the layout of the module inside a window.

Return type:

Div

label: str
layout()

This method should return the layout of the module inside a window.

Return type:

Div

module_layout: Div
module_name: str