shyft.dashboard.time_series.axes¶
Classes
|
This Object represents actual y axis for a Figure class |
|
This object represents the y axis definition |
|
Exceptions
- class shyft.dashboard.time_series.axes.YAxisSide(*values)[source]¶
Bases:
Enum- LEFT = 'left'¶
- RIGHT = 'right'¶
- class shyft.dashboard.time_series.axes.YAxis(*, label, unit, color='black', side=YAxisSide.LEFT, default_y_range=None, dynamic_unit_prefix=False, auto_unit_change=True)[source]¶
Bases:
Hashable,Bindable,AttributeCallbackManagerThis object represents the y axis definition
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)
- __init__(*, label, unit, color='black', side=YAxisSide.LEFT, default_y_range=None, dynamic_unit_prefix=False, auto_unit_change=True)[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)
- Return type:
None
- property default_y_range: Tuple[float, float]¶
- property dynamic_unit_prefix: bool¶
- class shyft.dashboard.time_series.axes.FigureYAxis(*, axis, unit_registry, bokeh_axis=None, y_axis_format=None, logger=None)[source]¶
Bases:
BindableThis Object represents actual y axis for a Figure class
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)
y_axis_format (str | None)
logger (logging.Logger | None)
- __init__(*, axis, unit_registry, bokeh_axis=None, y_axis_format=None, logger=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)
y_axis_format (str | None)
logger (Logger | None)
- Return type:
None
- label_callback(obj, attr, old_value, new_value)[source]¶
Sets the label for the bokeh Axis
- Return type:
None
- unit_callback(obj, attr, old_value, new_value)[source]¶
Sets the color for the bokeh axis
- Return type:
None
- color_callback(obj, attr, old_value, new_value)[source]¶
This function sets the color for the bokeh axis
- Return type:
None
- static axis_format(unit)[source]¶
This functions sets the y axis number format
- Parameters:
unit (str | Unit)
- Return type:
str
- static unit_view_format(unit)[source]¶
This function converts the Unit of the y axis
- Parameters:
unit (str | Unit)
- Return type:
str
- 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, end)[source]¶
This function sets the axis range to start and end
- Parameters:
start (float)
end (float)
- Return type:
None
- check_axis_dimensions(attr, old, new)[source]¶
This function checks if y range has changed enough order of magnitude to trigger unit change
- Return type:
None