I would like to implement a custom component that can update many values efficiently (e.g. counter 1 and counter 2 but not simultaneously). If possible with websockets to make it faster.
I have typescript and python code implementing a webapp for interactive image segmentation that currently uses websockets. What I would like is to:
set the config of the component from streamlit (e.g. tool number)
send from frontend to backend:
click location
binary mask
layout coordinates (to allow for zoom-in, etc.)
send from backend to frontend:
binary mask
current image
Is this possible and how should I send things from frontend to backend? (ps pure ts, won’t use react)
That was helpful but I still need more documentation and help
For instance, if I call my_component(slider_value=slider_value) where slider_value comes from a slider and my_component includes a console.log command, I would expect to see different values logged to the console when I move the slider, but the rendering function is never re-run. This is different behavior than the one native streamlit components have.
My second question would be about bidirectional communication: say I make a click on my custom component, I want to compute a value on the backend and send it to the frontend. However, the provided example is triggered from the backend and doesn’t show how to create such custom callbacks.
I know my ambitions are high, but if it’s possible, I would like to create this component. I need a little help, is there a chat where I can ask?
We don’t have a live chat for questions about the open-source library, unfortunately, but if you share a code snippet that allows us to better understand the question you’re asking, hopefully, we can help.
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.