dashboard¶
- class virtualitics_sdk.elements.dashboard.Column(elements, ratio=None)¶
Bases:
object
A Column vertically contains elements within a
Row
. A column can also contain inner rows.- Parameters:
elements (list[Element | ‘virtualitics_sdk.elements.dashboard.Row’]) – The Elements or
Column
.ratio (Optional[list[int | float]]) – The relative heights of all of the elements in the
Column
, defaults to equal heights.
- Raises:
ValueError – If the given ratio array is not equal the number of elements.
ValueError – If all rows in that column do not have the same width.
- to_json()¶
- Return type:
dict
- class virtualitics_sdk.elements.dashboard.Dashboard(content, title='', description='', orientation=None, show_title=True, show_description=True, filters=None, updater=None)¶
Bases:
Element
NOTICE: As of version 1.23.0 the Dashboard element is depreciated. It is recommended to use
Card
elements in place of Dashboard elements.A Dashboard is a way to lay out certain elements on a page. This can be done by placing those elements in rows or columns. Only Plots, Images, Infographics, and Tables can be put into Dashboards.
- Parameters:
content (
list
[Row
|Column
|Plot
|PlotlyPlot
|Image
|Table
|Infographic
|RichText
]) – The list or Rows or elements that makes up a dashboard. Any lone elements in this list will be put into their own row.title (
str
) – The title of the dashboard, defaults to “”.description (
str
) – The description of the dashboard, defaults to “”.orientation (
Optional
[DashboardOrientation
]) – (deprecated) the Dashboard’s orientation, defaults to None.show_title (
bool
) – whether to show the title of the dashboard, defaults to True.show_description (
bool
) – Whether or now to show the description of a dashboard, defaults to True.filters (
Optional
[list
[InputElement
]]) – A list of input elements that can be used as input to the dashboard’s updater function, defaults to None.updater (
Optional
[Callable
]) – A function to provide dynamic updates to the dashboard which can use inputs from the dashboard filters, defaults to None.
- Raises:
ValueError – If the dashboard has no content.
ValueError – If all rows do not have the same width.
- get_elements()¶
- Return type:
Iterator
[Plot
|PlotlyPlot
|Image
|Table
|Infographic
|RichText
]
- get_filters()¶
- Return type:
Iterator
[InputElement
]
- to_json()¶
Convert the element to a JSON.
- Return type:
dict
- Returns:
A JSON dictionary of the element.
- update_item(element_title, new_element)¶
This function updates an element of the dashboard, which can be used in conjunction with the dashboard’s updater function to provide dynamic page updates.
- Parameters:
element_title (
str
) – The title of the element to be updated.new_element (
Plot
|PlotlyPlot
|Image
|Table
|Infographic
|RichText
) – The new element that will replace currently existing element.
- class virtualitics_sdk.elements.dashboard.DashboardOrientation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- COLUMN = 'column'¶
- ROW = 'row'¶
- class virtualitics_sdk.elements.dashboard.Row(elements, ratio=None)¶
Bases:
object
A Row in a
Dashboard
. ADashboard
is fundamentally a list ofRow
s.- Parameters:
elements (list[Element | ‘virtualitics_sdk.elements.dashboard.Column’]) – A list of elements in the row. This can be any element like a
Dropdown
element or an innerColumn
inside of that Row.ratio (Optional[list[int | float]]) – The relative widths of the elements inside the
Row
, defaults to all elements having the same width.
- Raises:
ValueError – If the given ratio array is not equal the number of elements.
ValueError – If all columns in that row do not have the same height.
- to_json()¶
- virtualitics_sdk.elements.dashboard.simplify(elements)¶
Simplifies a Dashboard representation by replacing Row/Columns with only one element and no special ratios
- Parameters:
elements (
list
[TypeVar
(ListType
)]) – The list of elements to enter a Row or Column- Return type:
list
[TypeVar
(ListType
)]- Returns:
A simplified list that may replace an inner row or colum with the encapsulated dashboard element
- virtualitics_sdk.elements.dashboard.valid_dashboard_element(elem_row_or_col)¶