shyft.dashboard.time_series.ds_view_handle_registry

Classes

DsViewHandleRegistry()

This Object helps to keep track of DsViewHandles in apps, what did we send what to remove etc.

DsViewHandleRegistryApp([policy, padding, ...])

This Object is an composable app for DsViewHandleRegistry with buttons controlling the registry

DsvhRegistryPolicy(value[, names, module, ...])

Describing policy of DsViewHandleRegistryApp

class shyft.dashboard.time_series.ds_view_handle_registry.DsViewHandleRegistry[source]

Bases: object

This Object helps to keep track of DsViewHandles in apps, what did we send what to remove etc. For the book-keeping the app relyes on the .tag attribute of a dsvh. If a dsvh is send with either replace or add method to the registry and there is another dsvh in the registry with the same tag, it does not have to be the same dsvh, it will NOT be added!

__init__()[source]

Initialize the ds view handle registry

property ds_view_handles: List[DsViewHandle]

Returns a list of registered ds view handles

property registry: Dict[str, DsViewHandle]

Returns the full registry

empty_registry() None[source]

Removes all obj from the registry

replace(ds_view_handles: List[DsViewHandle]) Tuple[List[DsViewHandle], List[DsViewHandle]][source]

This function will do 2 operations at once:

  • all dsvh in ds_view_handles are added to the registry if there is not a dsvh with the same tag already in the registry

  • remove all dsvh from the registry which tags are not equal to one of the dsvh in ds_view_handles

Returns:

where the first List[DsViewHandle] corresponds to dsvh which are added to the registry where the first List[DsViewHandle] corresponds to dsvh which are removed from the registry

Return type:

Tuple(List[DsViewHandle], List[DsViewHandle])

add(ds_view_handles: List[DsViewHandle]) Tuple[List[DsViewHandle], List[DsViewHandle]][source]

This function will do 1 operations at once:

  • all dsvh in ds_view_handles are added to the registry if there is not a dsvh with the same tag already in the registry

Returns:

where the first List[DsViewHandle] corresponds to dsvh which are added to the registry where the first List[DsViewHandle] corresponds to dsvh which are removed from the registry

Return type:

Tuple(List[DsViewHandle], List[DsViewHandle])

remove(ds_view_handles: List[DsViewHandle]) Tuple[List[DsViewHandle], List[DsViewHandle]][source]

This function will do 1 operations at once:

  • all dsvh in ds_view_handles are removed from the registry

Returns:

where the first List[DsViewHandle] corresponds to dsvh which are added to the registry where the first List[DsViewHandle] corresponds to dsvh which are removed from the registry

Return type:

Tuple(List[DsViewHandle], List[DsViewHandle])

remove_by_tag(tag_to_remove: str) Tuple[List[DsViewHandle], List[DsViewHandle]][source]

This function will do 1 operations at once:

  • all dsvh in which cointaing tag_to_remove in their tag are removed from the registry

Returns:

where the first List[DsViewHandle] corresponds to dsvh which are added to the registry where the first List[DsViewHandle] corresponds to dsvh which are removed from the registry

Return type:

Tuple(List[DsViewHandle], List[DsViewHandle])

class shyft.dashboard.time_series.ds_view_handle_registry.DsvhRegistryPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Describing policy of DsViewHandleRegistryApp

REPLACE = 0
ADD = 1
class shyft.dashboard.time_series.ds_view_handle_registry.DsViewHandleRegistryApp(policy: DsvhRegistryPolicy | None = None, padding: int | None = None, sizing_mode: str | None = None, logger: LoggerBox | None = None)[source]

Bases: object

This Object is an composable app for DsViewHandleRegistry with buttons controlling the registry

__init__(policy: DsvhRegistryPolicy | None = None, padding: int | None = None, sizing_mode: str | None = None, logger: LoggerBox | None = None) None[source]

Initialize the ds view handle registry

Parameters:

policy (decied if new dsvhs should be added or relplaced when register ports are used) –

property layout: row
property layout_components: Dict[str, List[Any]]

Returns all layout components of the app