I have a dash app that hosts a model with an interactive interface. As part of development I need to tweak parameters often, and there are a lot of them. The problem is that each time I change an aspect of the model I need to reload the webpage and all of my options reset to default. This is a pain. Is there any way I can save the state of the app and reload this state on refresh? (i.e. with all the options I’ve just configured last time around)?
You can save your state in the URL. Here is an example gist https://github.com/plotly/dash/issues/188#issuecomment-360313359
Additional tweaking can be on the
persistence props to change the persisted props, the type of persistence and to allow multiple persisted sets of values per component as described in components props reference (e.g. https://dash.plot.ly/datatable/reference)
In the table:
Hope this helps!
Here’s an example of how you can save the state of the app in a querystring: https://github.com/oegedijk/dash_querystrings
This makes the state of the app not only persistent but also shareable. Although if you have a lot of querystring parameters I would suggest implementing a tinyurl shortener in your app. (example also shown in the above github repo)