dash-canvas icon indicating copy to clipboard operation
dash-canvas copied to clipboard

Zoomed image moves away upon Save

Open mkcor opened this issue 6 years ago • 9 comments

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: draw_separator
  • Save... which results in the following view: after_save

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

mkcor avatar Dec 31 '18 22:12 mkcor

Thank you @mkcor ! I need to find a way to expose / persist the zoom and position of the image. Will look into this!

emmanuelle avatar Jan 02 '19 14:01 emmanuelle

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.

emmanuelle avatar Jan 12 '19 15:01 emmanuelle

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/!

mkcor avatar Jan 17 '19 17:01 mkcor

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)

emmanuelle avatar Jan 17 '19 20:01 emmanuelle

I'm now running the app locally (http://localhost:8050/app2) and experiencing the same behaviour...

mkcor avatar Jan 25 '19 16:01 mkcor

Maybe because I just did pip install dash-canvas instead of pip install -e .?

mkcor avatar Jan 25 '19 16:01 mkcor

@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...

emmanuelle avatar Feb 10 '19 21:02 emmanuelle

I have made several releases since then, so it should be OK now if you pip install -U :-)

emmanuelle avatar Feb 27 '19 13:02 emmanuelle

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): before_seg_update Drew red line with pencil there. after_seg_update

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.

mkcor avatar Feb 28 '19 11:02 mkcor