Hi All,
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 Input
, State
, and Output
in callback dependency objects.
To clarify things we decided to make the following changes:
- The
_input
and_output
suffixes on the template component constructor methods have been removed, and anew_
prefix has been added. Sotpl.button_input(...)
is nowtpl.new_button(...)
. - 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
DbcSidebar
template, the use oftpl.new_slider(..., role="input")
has been replaced withtpl.new_slider(..., location="sidebar")
. For theDbcRow
template, this would now betpl.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.
Thanks!
-Jon