Deprecations and breaking changes
This page lists Vizro features that are now deprecated and forthcoming breaking changes for Vizro 1.0.0.
Layout model
The Layout model has been renamed Grid. Replace your references to Layout with Grid.
# Before:
vm.Layout(grid=[[0, 1], [2, 3]])
# After:
vm.Grid(grid=[[0, 1], [2, 3]])
RangeSlider model
The RangeSlider model is deprecated. Use Slider with range=True, which is functionally identical.
# Before:
vm.RangeSlider(min=0, max=10)
# After:
vm.Slider(min=0, max=10, range=True)
In YAML or JSON configuration, replace type: range_slider with type: slider and add range: true.
See the user guide on selectors for more information.
filter_interaction
filter_interaction is deprecated. Use the more powerful and flexible set_controls.
# Before:
components = [
vm.Table(..., actions=va.filter_interaction(targets=["target_chart"])),
vm.Graph(id="target_chart", ...)
]
# After:
components = [
vm.Table(..., actions=va.set_controls(controls=["my_filter"], value="species")),
vm.Graph(id="target_chart", ...)
]
# You must now explicitly specify a Filter in controls:
controls = [vm.Filter(id="my_filter", targets=["target_chart"], column="species")]
See the user guide on how to interact with graphs and tables for more information.
set_control action
The set_control action is deprecated. Use set_controls, which takes one or more control ids via controls (a single id or a list) and is otherwise identical.
# Before:
va.set_control(control="my_filter", value="species")
va.set_control(control=["filter_1", "filter_2"], value="species")
# After:
va.set_controls(controls="my_filter", value="species") # a single id
va.set_controls(controls=["filter_1", "filter_2"], value="species") # or a list of ids
See the user guide on how to interact with graphs and tables for more information.
Action model inputs argument
The inputs argument of the Action model is deprecated. Pass references to runtime inputs directly as arguments of function.
# Before:
vm.Action(function=my_action(), inputs=["dropdown.value"], outputs=["text.children"])
# After:
vm.Action(function=my_action("dropdown.value"), outputs=["text.children"])
# In fact, just this would work and is preferred:
vm.Action(function=my_action("dropdown"), outputs="text")
See the user guide on custom actions for more information.
Static argument for custom action
Passing a static argument to a custom action is deprecated. All arguments must instead be runtime inputs. For example, in Vizro 1.0.0, the following will no longer be possible:
@capture("action")
def my_action(static_argument):
...
vm.Action(function=my_action(static_argument=1), ...)
Does this cause you a problem? Please let us know!
Action model for built-in action
Using the Action model for built-in actions is deprecated.
Call the action directly:
# Before:
vm.Action(function=va.export_data(file_format="xlsx"))
# After:
va.export_data(file_format="xlsx")
See the user guide on built-in actions for more information.
Cascader full_path default
The default of Cascader's full_path argument will change from False to True in Vizro 1.0.0. To keep the current behavior, set full_path=False explicitly.
# Before (relies on the default, which will change in Vizro 1.0.0):
vm.Cascader(options=...)
# After (keeps the current behavior):
vm.Cascader(options=..., full_path=False)
See the user guide on selectors for more information.
AgGrid model
The AgGrid model is deprecated. Use Table with a dash_ag_grid figure, which is functionally identical.
# Before:
vm.AgGrid(figure=dash_ag_grid(data_frame=df))
# After:
vm.Table(figure=dash_ag_grid(data_frame=df))
In YAML or JSON configuration, replace type: ag_grid with type: table (keeping the dash_ag_grid figure).
See the user guide on how to use tables for more information.
Dash DataTable backing
Backing a Table with a Dash DataTable (via dash_data_table) is deprecated. From Vizro 1.0.0, Table supports only a dash_ag_grid figure, which renders an interactive AG Grid.
# Before:
vm.Table(figure=dash_data_table(data_frame=df))
# After:
vm.Table(figure=dash_ag_grid(data_frame=df))
See the user guide on how to use tables for more information.