shyft.dashboard.time_series.ds_view_handle¶
Classes
|
A basic implementation of a DsViewHandleCreator which uses BasicTsAdapters and supports labels and units. |
|
This Object combines the data_source with views. |
|
This abstract class should be implemented in applications that need automated creation of DsViewHandles. |
Exceptions
- class shyft.dashboard.time_series.ds_view_handle.DsViewHandle(*, data_source, views, tag=None, unit_registry=None)[source]¶
Bases:
HashableThis Object combines the data_source with views. It is used to show data in ts_viewer
Initializes an immutable, hashable ds_view_handle.
- Parameters:
data_source (unbound data source to combine with views)
views (list of unbound views to view the data)
tag (optional uid to identify the ds view handle later)
unit_registry (optional unit_registry, is used to verify if units in data_source and views are compatible,) – should be used provided if custom defined units are used
- __init__(*, data_source, views, tag=None, unit_registry=None)[source]¶
Initializes an immutable, hashable ds_view_handle.
- Parameters:
data_source (unbound data source to combine with views)
views (list of unbound views to view the data)
tag (optional uid to identify the ds view handle later)
unit_registry (optional unit_registry, is used to verify if units in data_source and views are compatible,) – should be used provided if custom defined units are used
- property data_source¶
This property returns the data source
- property views¶
This property returns the list with all defiend views
- class shyft.dashboard.time_series.ds_view_handle.DsViewHandleCreator(unit_registry=None, figure_container=None, legend_container=None, table_container=None, logger=None)[source]¶
Bases:
ABCThis abstract class should be implemented in applications that need automated creation of DsViewHandles. This class should receive a data structure and create DsViewHandles to all TimeSeries contained in it. These DsViewHamndles are then sent forward, i.e. to a TsViewer or DsViewHandleRegistry.
- Parameters:
- __init__(unit_registry=None, figure_container=None, legend_container=None, table_container=None, logger=None)[source]¶
- abstractmethod create_ds_view_handles(data)[source]¶
- Parameters:
data (Any)
- Return type:
List[DsViewHandle]
- get_views(unit, label, visible=True, y_axis_label=None, line_width=None, line_style=None, percentiles=None, table_label=None, color=None)[source]¶
Auxiliary function for the creation of BaseViews for the DsViewHandles
- Parameters:
unit (str)
label (str)
y_axis_label (str | None)
line_width (float | None)
line_style (str | None)
percentiles (List[float | statistics_property] | None)
table_label (str | None)
color (str | None)
- Return type:
List[BaseView]
- get_y_axis_by_label(label)[source]¶
Auxiliary function for the management of YAxis by label.
- Parameters:
label (str)
- get_y_axis_by_unit(unit)[source]¶
Auxiliary function for the management of YAxis by unit.
- Parameters:
unit (str | Unit)
- Return type:
YAxis | None
- static get_percentiles_views(percentiles, view_container, color, label, unit, visible=True, y_axis=None)[source]¶
Auxiliary function for the creation of FillInBetweens
- Parameters:
- Return type:
List[FillInBetween]
- static get_time_range(tso)[source]¶
- Parameters:
tso (Quantity | TsVector | TimeSeries)
- class shyft.dashboard.time_series.ds_view_handle.BasicDsViewHandleCreator(unit_registry=None, figure_container=None, legend_container=None, table_container=None, logger=None)[source]¶
Bases:
DsViewHandleCreatorA basic implementation of a DsViewHandleCreator which uses BasicTsAdapters and supports labels and units.
- Parameters:
- __init__(unit_registry=None, figure_container=None, legend_container=None, table_container=None, logger=None)[source]¶
- create_ds_view_handles(data_container)[source]¶
- Parameters:
data_container (List[Quantity | TsVector | TimeSeries | Tuple[Quantity | TsVector | TimeSeries, str]]) – A list of TimeSeries, TsVector, or tuples containing data and label
- Returns:
A list of DsViewHandles for the data
- Return type:
List[DsViewHandle]