Hey there!
It seems like something happened to the Streamlit Drawable Canvas code today. I use streamlit-drawable-canvas for educational purposes.
Earlier today, the canvas was working for my program (it’s been working perfectly fine for the past several months). I define the canvas as follows:
canvas_result = st_canvas(
fill_color="rgba(255, 165, 0, 0.3)", # Fixed fill color with some opacity
stroke_width=stroke_width,
stroke_color=stroke_color,
background_color= bg_color,
# background_image=Image.open(bg_image) if bg_image else None,
update_streamlit=realtime_update,
width = 500,
height= 500,
drawing_mode=drawing_mode,
key="canvas",
)
and then this afternoon, I get this error:
2021-07-01 23:00:34.341 Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/streamlit/script_runner.py", line 349, in _run_script
exec(code, module.__dict__)
File "/content/app.py", line 37, in <module>
key="canvas"
File "/usr/local/lib/python3.7/dist-packages/streamlit_drawable_canvas/__init__.py", line 138, in st_canvas
w = component_value["width"]
TypeError: string indices must be integers
Do you know if any updates might have caused this? I haven’t touched this code in a while and then it broke.