Hey,
Just released 0.9.3 with the issues you mentioned solved by Yuichiro, could you try again?
I still have an issue with background-image on streamlit-cloud, but it does seem to work on HF Spaces. Will probably revert a functionality about background-image so it works again for every deployment…
Sorry for the late merges, life is a bit busy thank you for the comprehension
Thanks very much for that hint.
I confirm that streamlit v1.23.1 works seamlessly with streamlit-drawable-canvas v0.9.3 and st-pages v0.4.1. I think that topic (and issues) can be closed now.
PS: We all know how time flows away, so no need to apologize. Isn’t it also the purpose of that forum to fresh up knowledge?
Hey Fanilo,
I am having the same issue of keyError even on my local machine (M1 macbook) with streamlit-drawable-canvas v0.9.3 and streamlit v1.23.1. After commenting out the canvas code, everything works fine
@andfanilo - Is it possible to reset / delete the drawings on the canvas automatically as part of some button click?
In my app, I’m letting users to submit series of their drawings. Currently the only way is to press the delete icon on the canvas toolbar inorder to reset the canvas before next drawing. Instead I want the users to automatically present a empty canvas whenever they submit their previous drawing.
Hello fellas and @andfanilo. Does anyone know is it possible to set the canvas to read only and unlock by another streamlit component (like a toggle button)?
Hello, I encountered two issues while using Streamlit Canvas.
The first problem arises when I create a canvas with an “initial_drawing” (rectangle) and choose “drawing_mode = transform.” Everything works well, but unfortunately, the rectangle disappears when double-clicked.
The second issue occurs when I display two canvases on my page, each with “initial_drawing” and “background_image.” Sometimes, when I load the page, the background image fails to appear, and I find the following message in my terminal: “2024-01-31 17:15:18.764 MediaFileHandler: Missing file 37c72c177e97f32f2e5ac9d010ef6341661b73a1726a1dbc35827e25.png.”
Do you have any ideas on how to fix these bugs? Thank you in advance.
Hi and thanks for this awesome component!
I am using the canvas to load existing annotations and add new ones. Is there a way to incorporate custom keys into the json_data, like e.g. a label or unique id for an annotation?
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.