I would like to change my Dash app layout depending on a value that I read from a database (Firebase Realtime Database in my case) . Thus, it will look something like :
After deploying the app on Heroku and running it for the first time, the layout is set and stays the same even if the database value is changed.
Do you have any ideas?
The issue here, as I mentioned, is that the layout is set when I run the app locally or I push it to Heroku but never changes (in real time) even if the DB value does.
For the changes to be taken into consideration I should then re-run or re-push the app.
Should I use a callback? if so, what should the input/output be?
If you assign a function to the layout variable, it should. Hence if you have a function my_layout, you should do,
app.layout = my_layout
With this syntax (rather than app.layout = my_layout()), the function is evaluated each time, and your layout will thus change depending on the db value. There is some doc at the bottom of this page,