dash-canvas
dash-canvas copied to clipboard
Zoomed image moves away upon Save
Dear @emmanuelle,
Thanks for the great prototype!
I'm trying out https://dash-canvas-separate.herokuapp.com/ and I want to separate the two elements near the bottom right corner. I'm actually not sure whether they're already separated or not.
I'm taking the following sequence of actions:
- Zoom;
- Pan;
- Pencil:
- Save... which results in the following view:
It would be more natural for me to keep the same view, where the red line I drew disappears and the new estimated border appears.
Best, Marianne
Thank you @mkcor ! I need to find a way to expose / persist the zoom and position of the image. Will look into this!
Hi @mkcor I eventually solved the issue (see https://github.com/tbolis/react-sketch/issues/53 for the record). Please check on http://dash-canvas.herokuapp.com/ that it now behaves as expected.
Oh, at the moment http://dash-canvas.herokuapp.com/ is erroring 404. And I obviously made a mistake when reporting the issue, since my screenshot shows http://dash-canvas.herokuapp.com/, not https://dash-canvas-separate.herokuapp.com/!
Oh yes, I moved the app to a multipage app, now it's http://dash-canvas.herokuapp.com/app2 Sorry about that! (the README has been updated on the github repo)
I'm now running the app locally (http://localhost:8050/app2) and experiencing the same behaviour...
Maybe because I just did pip install dash-canvas
instead of pip install -e .
?
@mkcor so sorry I missed your comment! Yes, you have to run the app using master, I haven't made a release yet with the changes...
I have made several releases since then, so it should be OK now if you pip install -U :-)
Sorry I haven't been responsive on this lately. I'm now running dash-canvas==0.0.6 but I still seem to run into the issue... :(
Here's my before/after (segmentation update):
Drew red line with pencil there.
And here's my stream when running python index.py
Possible precision loss when converting from float64 to uint8
and visiting http://localhost:8050/app2 (before doing any of the actual segmentation updating):
...
File "/home/.../dash-canvas/app2_correct_segmentation.py", line 126, in update_figure
overlay = segmentation.mark_boundaries(img, new_labels)
File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/skimage/segmentation/boundaries.py", line 226, in mark_boundaries
background=background_label)
File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/skimage/segmentation/boundaries.py", line 169, in find_boundaries
max_label = np.iinfo(label_img.dtype).max
File "/home/.../dash-canvas/venv/lib/python3.7/site-packages/numpy/core/getlimits.py", line 516, in __init__
raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.