shyft.dashboard.time_series.axes

Classes

FigureYAxis(*, axis, unit_registry[, ...])

This Object represents actual y axis for a Figure class

YAxis(*, label, unit[, color, side, ...])

This object represents the y axis definition

YAxisSide(value[, names, module, qualname, ...])

Exceptions

YAxisError

exception shyft.dashboard.time_series.axes.YAxisError[source]

Bases: RuntimeError

class shyft.dashboard.time_series.axes.YAxisSide(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

LEFT = 'left'
RIGHT = 'right'
class shyft.dashboard.time_series.axes.YAxis(*, label: str, unit: str | Unit, color: str = 'black', side: YAxisSide = YAxisSide.LEFT, default_y_range: Tuple[float, float] | None = None, dynamic_unit_prefix: bool = False, auto_unit_change: bool = True)[source]

Bases: Hashable, Bindable, AttributeCallbackManager

This object represents the y axis definition

__init__(*, label: str, unit: str | Unit, color: str = 'black', side: YAxisSide = YAxisSide.LEFT, default_y_range: Tuple[float, float] | None = None, dynamic_unit_prefix: bool = False, auto_unit_change: bool = True) None[source]

Representation of a y-axis for a figure.

Parameters:
  • label (y axis lable)

  • unit (unit of the axis)

  • color (color of the axis incl. tixs and numbers)

  • side (YAxisSide either YAxisSide.LEFT or YAxisSide.RIGHT)

  • default_y_range (set the default range to use if no renderer on axis)

  • dynamic_unit_prefix (NOT IN USE, used dynamic axis scaling)

  • auto_unit_change (allow that the figure changes the axis units if the axis is empty)

property side: YAxisSide
property default_y_range: Tuple[float, float]
property dynamic_unit_prefix: bool
class shyft.dashboard.time_series.axes.FigureYAxis(*, axis: YAxis, unit_registry: UnitRegistry, bokeh_axis: LinearAxis | None = None, y_axis_format: str | None = None, logger: Logger | None = None)[source]

Bases: Bindable

This Object represents actual y axis for a Figure class

__init__(*, axis: YAxis, unit_registry: UnitRegistry, bokeh_axis: LinearAxis | None = None, y_axis_format: str | None = None, logger: Logger | None = None) None[source]

Figure Y Axis for the figure view container

Parameters:
  • axis (YAxis object which to represent)

  • unit_registry (unit registry to use for unit converison)

  • bokeh_axis (bokeh axis to use)

label_callback(obj, attr, old_value, new_value) None[source]

Sets the label for the bokeh Axis

unit_callback(obj, attr, old_value, new_value) None[source]

Sets the color for the bokeh axis

color_callback(obj, attr, old_value, new_value) None[source]

This function sets the color for the bokeh axis

static axis_format(unit: str | Unit) str[source]

This functions sets the y axis number format

static unit_view_format(unit: str | Unit) str[source]

This function converts the Unit of the y axis

property uid: str

This function returns the uid of the axis_view, used to identify this axis

property side: str

This function returns the side of the axis

set_y_range(start: float, end: float) None[source]

This function sets the axis range to start and end

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

This function checks if y range has changed enough order of magnitude to trigger unit change

get_dynamic_axis_unit(start: float, end: float) Tuple[float, float, str][source]

This function checks if the order of magnitude of the axis should change and returns the changes

reset_y_range() None[source]

This function resets the y range to the default y range defined by YAxis