Controls
Vizro supports controls to perform common business intelligence (BI) operations. This guide gives an overview of the different ways you can configure controls.
The following components are reactive to controls:
- built-in graphs and custom graphs
- built-in tables and custom tables
- built-in figures and custom figures
It is possible to add controls to a page or container. Both the Page model and the Container model have an optional controls argument where you can configure any number of controls.
Vizro has two types of control:
-
Filter controls the data of reactive components. It filters the
data_frameof thefigurefunction of a target component model such asGraph. -
Parameter controls the configuration of a reactive component. It sets any argument other than
data_framein thefigurefunction of the target component model such asGraph. It can also be used to set dynamic data parameters.
All controls have an argument selector that configures the visual interface for the control, for example a checklist or a range slider. The same selectors are available for all controls.
Set a control
When the dashboard is running there are two ways for a user to set a control:
- Direct user interaction with the underlying selector. For example, the user selects values from a checklist.
- User interaction with a graph or table via the
set_controlaction. This enables functionality such as cross-filtering and cross-highlighting. To achieve a visually cleaner dashboard you might like to hide the control's underlying selector by setting the control's argumentvisible=False.
Tip
The state of any control that has show_in_url=True is included when you share the URL of your app.
Reset controls
You can reset all controls on the page to their original values with the "Reset controls" button at the bottom of the control panel on the left side of the page. This applies to all controls on the page, regardless of whether they are visible. When all controls on a page have visible=False and hence no control panel is shown, the "Reset controls" button appears next to the theme switch on the top right of the page.