shyft.dashboard.maps.map_axes

Classes

MapAxesRanges(width, height[, xmin, ymin, ...])

Class handling axes ranges for map figures.

class shyft.dashboard.maps.map_axes.MapAxesRanges(width, height, xmin=0, ymin=0, xmax=1, ymax=1, padding=0)[source]

Bases: Bindable

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

Parameters:
  • width (int)

  • height (int)

  • xmin (float)

  • ymin (float)

  • xmax (float)

  • ymax (float)

  • padding (float)

__init__(width, height, xmin=0, ymin=0, xmax=1, ymax=1, padding=0)[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

Parameters:
  • width (int)

  • height (int)

  • xmin (float)

  • ymin (float)

  • xmax (float)

  • ymax (float)

  • padding (float)

Return type:

None

on_bind(*, parent)[source]

Function which is call when bound to a figure

Parameters:

parent (shyft.dashboard.maps.map_viewer.MapViewer)

Return type:

None

set_axes_bounds(x_min, y_min, x_max, y_max)[source]

Sets the ranges from Tuples[x_min, y_min, x_max, y_max], i.e. defined as bbox coordinates

Return type:

None

set_axes_bounds_from_bounds_list(bounds_list)[source]

Updates the ranges from a List[Tuples[x_min, y_min, x_max, y_max]], i.e. defined as bbox coordinates

Parameters:

bounds_list (List[Tuple[float, float, float, float]])

Return type:

None

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

update_ranges()[source]

This function triggers the update of the data ranges

Return type:

None