After trying Streamlit for building a quick prototype to present some analytics results internally, I decided to spend more time with the library
A year ago I built a little interactive regression using ipywidgets inside a Jupyter notebook. The goal was to show in a ML introductory talk how we could manually search for the best parameters to fit a function/decision tree/etc… to data.
I thought this would be a good app to port to Streamlit, so I quickly made a first draft with sliders in the sidebar updating the Altair chart for the function with selected parameters, so far so good !
then realized that unlike ipywidgets, we can’t restrict updating the execution to mouse release events, at least at first glance of the API reference.
I think the pros & cons for continuous update are well documented in the ipywidgets disabling continuous update doc, so I think it could be interesting to provide the user with the choice between continuous update, no update and have another button rerun the script, and restrict execution to mouse release events.
It is something in the works, or maybe others have encountered this and found other solutions ?
Streamlit is great in many ways but your example is something where I think it could be improved. Due to Streamlits execution model the whole script is rerun whenever the user changes the value of a widget. And that update is not as fast as what you get from Panel or Voila.
You can add a “pause” checkbox to your application and only run your code if the checkbox is not checked.
If you feel these issues don’t accurately or comprehensively describe your desired behavior of
provide the user with the choice between continuous update, no update and have another button rerun the script, and restrict execution to mouse release events.
I read your issues and related issues, and have compilted my thoughts in a new issue.
It seems like the no update and have another button rerun the script has been discussed a lot already, and I figured a quick snippet that could work, but the restrict execution to mouse release events is not as visible so I figure I’d give it a go.
I’ll try to spin a VM and compile the source code now so I can try to edit the React part and see what happens .
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.