Hi, I have built a streamlit app which visualizes some data, based on various settings the user can make in the sidebar.
The visualization itself can be switched between different modes (I built a form of multi page app with a select box on top of the page)
Now it is often interesting to compare different views of the same filter settings with each other. The best solution for this in my current setup is to open a new browser window and to carefully set all the filter settings on the sidebar to the same values as they are in the first window. Then one can select a different mode and compare both.
Since the visualization modes can be a bit complex, I would like to avoid having one giant compare mode with two visualizations on one page.
Copying of the settings is a bit tedious, so ideally this would be encoded into the url for example, which can then be copied to get a second session with the same input widget state.
I don’t think it is possible, but maybe somebody knows a way to get something like that?
Mhm is there an elegant way to save the current widget state in a file to be able to restore it in a new window?
Manually writing the logic to save and restore the content of 13 input elements seems a bit tedious and error prone to maintain if I forget to add a new element to the save/restore logic.
I use it all the time with experimental_set/get_query_params. It works pretty well. If you have a multi-page app, and therefore session state, you need to pay particular attention to the interaction between the URL and the widget state from the session.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.