shyft.dashboard.maps.map_axes
Classes
|
- class shyft.dashboard.maps.map_axes.MapAxesRanges(width: int, height: int, xmin: float = 0, ymin: float = 0, xmax: float = 1, ymax: float = 1, padding: float = 0)[source]
Bases:
Bindable
- __init__(width: int, height: int, xmin: float = 0, ymin: float = 0, xmax: float = 1, ymax: float = 1, padding: float = 0) None [source]
Class handling axes ranges for map figures. Padding is an extra distance in map units added outside the calculated axes range.
Note: All axes bounds are defined as Tuples with x_min, y_min, x_max, y_max, i.e. defined as bbox coordinates
- on_bind(*, parent: shyft.dashboard.maps.map_viewer.MapViewer) None [source]
Function which is call when bound to a figure
- set_axes_bounds(x_min, y_min, x_max, y_max) None [source]
Sets the ranges from Tuples[x_min, y_min, x_max, y_max], i.e. defined as bbox coordinates
- set_axes_bounds_from_bounds_list(bounds_list: List[Tuple[float, float, float, float]]) None [source]
Updates the ranges from a List[Tuples[x_min, y_min, x_max, y_max]], i.e. defined as bbox coordinates
- adjust_aspect_ratio()[source]
This function adjusts y and x ranges to get an 1:1 plot axis ratio also dependent on the plot width and height
- property padding: float
This property of the extra padding
- property x_min: float
This property returns the padded x_min bound
- property y_min: float
This property returns the padded y_min bound
- property x_max: float
This property returns the padded x_max bound
- property y_max: float
This property returns the padded y_max bound
- property axes_bounds: Tuple[float, float, float, float]
This function returns the axes bounds as Tuples[x_min, y_min, x_max, y_max], i.e. defined as bbox coordinates