shyft.dashboard.time_series.renderer
Functions
for datetime axies bokeh uses ms, so we scale up time with 1000. |
Classes
|
This object contains the meta-data and initialisation/update functions of the renderers with lines with filled color in between |
|
|
|
This object contains meta-data and initialisation/update functions for circle scatter renderer |
|
This object contains meta-data and initialisation/update functions for diamond scatter renderer |
|
This object contains the meta-data and initialisation/update functions of the renderers with lines with filled color in between |
|
This object contains meta-data and initialisation/update functions for the renderers of a single line |
|
This object contains meta-data and initialisation/update functions for the renderers of a MultiLine |
|
This object contains meta-data and initialisation/update functions for scatter renderers! All scatter renderer are i principle the same just the _glyph function is different! |
|
This object is the base class for single glyphs such as LineRendrer and FillInBetweenRenderer |
|
This object contains meta-data and initialisation/update functions for square scatter renderer |
|
This object contains meta-data and initialisation/update functions for triangle scatter renderer |
Exceptions
- shyft.dashboard.time_series.renderer.to_bokeh_datetime_rep(t: ndarray) ndarray [source]
for datetime axies bokeh uses ms, so we scale up time with 1000.
- class shyft.dashboard.time_series.renderer.BaseFigureRenderer(unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
-
- __init__(unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
Base renderer class for all figure renderer
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property calendar: Calendar
return Calendar of self.parent.parent, cached, side-effect self.time_zone== parent.parent.time_zone
- y_range(view_range: UtcPeriod) ndarray [source]
This function returns an np.ndarray with min, and max y values for given view period
- Parameters:
(UtcPeriod) (view_range) –
- Returns:
return_array (np.ndarray)
- Return type:
a numpy array with the minimum and maximum value
Notes
Returns np.nan if the renderer does not have a TS vector or a view or the time series is empty
- set_view(*, view: shyft.dashboard.time_series.view.FigureView, y_axis: YAxis) None [source]
Set the view for this renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- clear_view()[source]
Resets the render instance, removing the viewer instance and clears the sources
- property visible: bool | None
Returns if renderer is visible
- abstract update_bokeh_data_source() None [source]
This function updates ColumnDataSource in the bokeh document
- abstract reset_bokeh_data_source() None [source]
This function resets ColumnDataSource in the bokeh document
- abstract property glyphs: List[Tuple[ColumnDataSource, Glyph]]
This function returns a list of tuples of the glyph and the corresponding ColumnDataSource
- class shyft.dashboard.time_series.renderer.SingleGlyphRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
BaseFigureRenderer
This object is the base class for single glyphs such as LineRendrer and FillInBetweenRenderer
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- reset_bokeh_data_source()[source]
This function updates the properties of a glyph which can be dynamically set, color, fill_alpha, etc.
- abstract property bokeh_ds_keys: List[str]
This function returns a list of strings of the data source keys which are in the renderer
- property glyphs: List[Tuple[ColumnDataSource, Model]]
This function adds source data to bokeh glyphs
- class shyft.dashboard.time_series.renderer.LineRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
SingleGlyphRenderer
This object contains meta-data and initialisation/update functions for the renderers of a single line
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property bokeh_ds_keys: List[str]
This function returns the keys of the dynamically changeable properties of the renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- class shyft.dashboard.time_series.renderer.ScatterRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
SingleGlyphRenderer
This object contains meta-data and initialisation/update functions for scatter renderers! All scatter renderer are i principle the same just the _glyph function is different!
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property bokeh_ds_keys: List[str]
This function returns the keys of the dynamically changeable properties of the renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- class shyft.dashboard.time_series.renderer.DiamondScatterRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
ScatterRenderer
This object contains meta-data and initialisation/update functions for diamond scatter renderer
- class shyft.dashboard.time_series.renderer.CircleScatterRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
ScatterRenderer
This object contains meta-data and initialisation/update functions for circle scatter renderer
- class shyft.dashboard.time_series.renderer.SquareScatterRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
ScatterRenderer
This object contains meta-data and initialisation/update functions for square scatter renderer
- class shyft.dashboard.time_series.renderer.TriangleScatterRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
ScatterRenderer
This object contains meta-data and initialisation/update functions for triangle scatter renderer
- class shyft.dashboard.time_series.renderer.FillInBetweenRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
SingleGlyphRenderer
This object contains the meta-data and initialisation/update functions of the renderers with lines with filled color in between
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property bokeh_ds_keys: List[str]
This function keeps the keys of the dynamically changeable properties of the renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- class shyft.dashboard.time_series.renderer.MultiLineRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
SingleGlyphRenderer
This object contains meta-data and initialisation/update functions for the renderers of a MultiLine
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property bokeh_ds_keys: List[str]
This function returns the keys of the dynamically changeable properties of the renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- class shyft.dashboard.time_series.renderer.BackgroundDataRenderer(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None)[source]
Bases:
SingleGlyphRenderer
This object contains the meta-data and initialisation/update functions of the renderers with lines with filled color in between
- __init__(*, unit_registry: UnitRegistry, notify_figure_y_range_update: Callable, logger: Logger = None) None [source]
- Parameters:
unit_registry (unit registry to use to verify data) –
notify_figure_y_range_update (function to trigger y_range_update of the figure renderer is connected to) –
- property bokeh_ds_keys: List[str]
This function keeps the keys of the dynamically changeable properties of the renderer
- on_set_view() None [source]
optional Set view method which can be used in the Child classes for specialised behaviour
- update_bokeh_data_source() None [source]
This function updates the data source of the plot, data points, color, etc.
- y_range(view_range: UtcPeriod) ndarray [source]
This function returns an np.ndarray with min, and max y values for given view period
It is hardcoded set in the view that self.view.no_y_rescaling = False, just in case some messes with that we return self.view.y_min, self.view.y_max if the check fails