Can the Dash frontend's URL be used in input in its callback functions?
Opened this issue · 1 comments
URLs can use ?
and #
as "messages" to the server.
Can Dash accept URL customisations like this to dynamically alter its behaviour? A simple case would be for a user to specify dark vs light mode in the URL after a ?
. More advanced applications might include doing this to specify which repository to visualise, trigger actions, or return a smaller "card" version of the dashboard to embed in other pages or even Markdown documents.
I wrestled with this for a while and discovered that it will, as Dash is currently implemented, create a circular dependency:
- User-supplied URL initialises menu options
- Those menu options then updates the URL which "becomes" the user-supplied URL
- Loop back to 1.
This issue is being discussed in the repository plotly/dash-core-components
issue #44, but with no solution yet...
A compromise for now would be to only do 1., meaning a user can access specific repositories from the URL, but that URL wouldn't change as the users start changing the menu selections. This will need to be explained in the documentation, otherwise a user might get confused.