We just published a new version of Dash Lab (0.3.0) to PyPI that contains a few API updates to the template system. Special thanks to @adamschroeder, @AnnMarieW, and @Emil for their feedback over in 📣 Dash Labs 0.2.0. Here is a summary of the discussion and changes.
The key observation was that using the words “input” and “output” to denote where components should be placed in a template was confusing, because of the overlap with the existing use of
Output in callback dependency objects.
To clarify things we decided to make the following changes:
_outputsuffixes on the template component constructor methods have been removed, and a
new_prefix has been added. So
- The term “role” has been replaced by “location”. And templates now define a set of descriptive location values where components can be positioned. So, when using the
DbcSidebartemplate, the use of
tpl.new_slider(..., role="input")has been replaced with
tpl.new_slider(..., location="sidebar"). For the
DbcRowtemplate, this would now be
tpl.new_slider(..., location="left"). Templates document all of their supported locations in their constructor docstring.
For more information, see the updated versions of chapters 3 and 4 in the documentation at dash-labs/docs at main · plotly/dash-labs · GitHub. Or, see the PR at Rename "role" to "location" throughout Dash Labs and rename component builder methods by jonmmease · Pull Request #25 · plotly/dash-labs · GitHub.