Actions
vizro.actions
Built-in actions, typically aliased as va using import vizro.actions as va.
Usage documentation
export_data
Exports data of target charts, tables and figures.
Usage documentation
Parameters:
-
targets(list[ModelID]) –List of target component ids for which to download data. If none are given then download data from all components on the page.
-
file_format(Literal['csv', 'xlsx']) –Format of downloaded files. Defaults to
"csv".
Example
filter_interaction
deprecated
Deprecated
filter_interaction is deprecated and will not exist in Vizro 0.2.0. Use the more powerful and flexible set_control.
Filters targeted graph, tables and figures when a source graph or table is clicked.
Parameters:
-
targets(list[ModelID]) –Target component to be affected by filter. If none are given then target all valid components on the page.
set_control
Sets the value of a control, which then updates its targets.
Usage documentation
The following Vizro models can be a source of set_control:
AgGrid: triggersset_controlwhen user clicks on a row in the table.valueis string specifying which column in the clicked row is used to setcontrol.-
Graph: triggersset_controlwhen user clicks on data in the graph.valueis string that can be used in two ways to specify how to setcontrol:- Column from which to take the value. This requires you to set
custom_datain the graph'sfigurefunction. - String to traverse a Box that contains the
trigger data
clickData["points"][0]. This is typically useful for a positional variable, for example"x", and does not require settingcustom_data.
- Column from which to take the value. This requires you to set
-
Figure: triggersset_controlwhen user clicks on the figure.valuespecifies a literal value to setcontrolto. Button: triggersset_controlwhen user clicks on the button.valuespecifies a literal value to setcontrolto.Card: triggersset_controlwhen user clicks on the card.valuespecifies a literal value to setcontrolto.
Parameters:
-
control(ModelID) –Control whose value is set. If this is on a different page from the trigger then it must have
show_in_url=True. The control's selector must be categorical (e.g. Dropdown, RadioItems, Checklist). -
value(JsonValue) –Value taken from trigger to set
control. Format depends on the source model that triggersset_control.