andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
563 stars 85 forks source link

Problem with new customizable layouts #23

Closed rjtavares closed 3 years ago

rjtavares commented 3 years ago

The component seems to not work with the new customizable layouts. This reproduced the problem:

import streamlit as st
from streamlit_drawable_canvas import st_canvas

col1, col2 = st.beta_columns(2)

with col1:
    canvas_image = st_canvas(
        fill_color = "rgba(255, 165, 0, 0.3)", 
        stroke_width = 2,
        stroke_color = '#e00',
        drawing_mode = "line",
        key = "canvas",
    )

with col2:
    options = ['U','D','R', 'L']
    lines = [st.selectbox('Select', options, key=x) for x in range(4)]

The page appears correctly, but keeps refreshing constantly.

andfanilo commented 3 years ago

Thanks for the bug report. Am pretty sure it worked during the beta something must have changed :thinking: will checkout with the team.

Best, Fanilo

andfanilo commented 3 years ago

@rjtavares this should be solved in Streamlit 0.69.x. Let me know if it works on your side ;)

rjtavares commented 3 years ago

Perfect! Also love the new undo/redo buttons, really useful for my use case 👍