plotly / dash-canvas

An interactive image editing component for Dash
https://dash.plot.ly/canvas
Other
84 stars 26 forks source link

setting a value for 'tool' parameter does not set that tool by default #35

Open sstripps1 opened 4 years ago

sstripps1 commented 4 years ago
dash_canvas.DashCanvas(
                    id='canvas',
                    width=800,
                    height=445,
                    tool='rectangle',
                    lineWidth=2,
                    filename=filename,
                    hide_buttons=['pencil', 'line', 'pan', 'select', 'zoom'],
                    goButtonTitle='Get coordinates'
                ),

Setting the tool parameter equal to 'rectangle' is supposed to set the tool to rectangle by default when the app is opened, but instead, the 'pan' tool is selected.

jackparmer commented 4 years ago

Hey @emmanuelle , what's the level of effort on this one? It makes this demo a bit funky: https://dash-demo.plotly.host/annotation-bounding-box/ https://github.com/plotly/dash-customer-success/issues/254#issuecomment-583447075

emmanuelle commented 4 years ago

@jackparmer don't know but probably one or two days to figure out what's going on (maybe less if I get help from Will or Marc-André), plus a new release.

ycaokris commented 4 years ago

Just to clarify: the code snippet above activates both pan and rectangle behavior for the image loaded into canvas (as shown below in the screencast).

app

electron-microscopist commented 4 years ago

had the same issue with one of my apps. Managed to fix it by installing the previous release of dash pip install dash==1.10.0

Need to figure out why that is...

GeorgeVJose commented 3 years ago

Hi... Any updates on this issue? I'm still struggling with this problem. If I press the Save button initially, the correct tool gets selected. And nothing shows in the coordinates. But still, this is not good.. :)