shyft.dashboard.time_series.view_time_axes¶
Functions
|
Creates a time axis with the range of the view_period, that snaps to the calendar resolution of dt. |
|
Classes
|
At the view-level, describes the visual-wanted properties of the time-series data to be presented. |
- shyft.dashboard.time_series.view_time_axes.create_view_time_axis(*, cal, view_period, clip_period, dt)[source]¶
Creates a time axis with the range of the view_period, that snaps to the calendar resolution of dt.
- An empty TimeAxis() is returned if:
no overlap
overlap period contains -oo or +oo
dt is zero
- Parameters:
cal (Calendar to use for calendar semantic trim/add if dt >= DAY)
view_period (the visual view-period)
clip_period (if a valid clip_period is specified, the time axis will clipped to this period)
dt (time step of the time axis)
- Returns:
time_axis
- Return type:
TimeAxis. Axis type is Fixed if dt < DAY (optimization), else Calendar.
- class shyft.dashboard.time_series.view_time_axes.ViewTimeAxisProperties(*, dt, cal, view_period, padded_view_period, extend_mode)[source]¶
Bases:
objectAt the view-level, describes the visual-wanted properties of the time-series data to be presented. The class have no logic, just group together properties that give a consistent view of current ‘view-port’.
The data-source can use this information to adapt it’s call to the underlying TsAdapter(time-axis,unit)->tsvector so that it is optimal with respect to performance, as well as visualization.
- Parameters:
- cal¶
- Type:
calendar for calendar semantic steps, so the time-steps dt are in multiple of dt, rounded to calendar
- view_period¶
- Type:
the current entire view-period (usually also rounded to whole calendar/dt)
- padded_view_period¶
- Type:
a period greater/equal to the view-period, to allow for smooth pan/scrolling
- extend_mode¶
- Type:
if True, the data-source should ensure to include its own min/max range using the extend_time_axis method