The below Gif is a result of the placeholder being applied. The issue is when I select a new option from the available options, the graph goes ‘off’ and then re-appears. Is there a way to make this more smooth?
Code is here
The below Gif is a result of the placeholder being applied. The issue is when I select a new option from the available options, the graph goes ‘off’ and then re-appears. Is there a way to make this more smooth?
Code is here
Based on your code, I think this is less about using st.empty()
as a placeholder, but the fact that matplotlib/seaborn re-draw the entire scene each time the graph changes. For the original use case, where people created publication-quality graphics, the render time was acceptable, but for web, it can be a bit broken.
The best solution I can suggest for now would be to use one of the web-based plotting libraries if you can: plotly, altair, bokeh. All of these are built with the web use case in mind, and as such, as much more selective about which elements are common between runs and which ones need to be re-drawn.
Best,
Randy
Thanks for your response, will try this later today.
Sorry this took a while to get to. O_o
So I was able to figure out the first part which was why the chart flashes. I had saved the inputs as st.beta_columns() whilst the chart was not saved in one. Saving the chart in its own st.beta_columns pretty much solves this issue.
With regards to the select box that does not reset or resets only for a second, I am still figuring this one out.
Thanks!
Hi,
I think streamlit form might help you.
Thanks, I just noticed its update. Will have a try this weekend
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.
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.
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.
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.