plotly / dash-canvas

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

Switching between images to annotate #21

Open emmanuelle opened 5 years ago

emmanuelle commented 5 years ago

From @mprostock:

My main question, which I can't seem to figure out: How do you envision switching between images to annotate, what is the correct process for that? In all use cases I know, this is one of the main processes: annotate -> next image -> annotate ->next image etc. All of the portal use-cases only demonstrate usage with a single image though.

By design, dash-canvas ALWAYS triggers the canvas.json-data callback if anything is changed. So using the "go_button" (renamed to "next") within the component practically makes it impossible to trigger image changes. The following things I have tried:

What am I missing? Is there a way, short of NOT using the dash_canvas internal buttons (which seems kind of beside the point and I also can't find a way to hide the go-button, it seems mandatory?)

One additional observation: The json-data always includes the actual image itself in base64 encoding. Considering that in all "normal" usecases, the image will be provided by the backend anyways, this is really inefficient and wasteful for the amount of data permanently send between backend and client, it would be better to just include the annotations. I imagine that the react component, which was designed to sketch, does that by default, but for the annotation usecase that is really unneccessary, maybe it could be made optional?