plotly / dash-canvas

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

Structure of dash-canvas, integration with the dash ecosystem #3

Open emmanuelle opened 5 years ago

emmanuelle commented 5 years ago

At the moment, dash-canvas is a crude wrapper around react-sketch. Its main feature is the ability to draw on an image and to retrieve the location of annotations for futher image processing operations. The javascript React component is minimal, exposing an image_content property for the background image and a json_data property for storing (among other things) the geometry of annotations.

Thanks to callbacks and python helper functions (exposed in image_processing_utils.py or plot_utils.py, pare_json.py etc.) it is possible to use annotations as

These two parts (the minimal component and the set of python utils + apps) are in the same github repo for now. Should they be separated in two different python packages for more modularity? Could be dash-canvas and dash-canvas-utils. in the long term, the DashCanvas component could also be part of dash-core-components but I guess it's too early to decide.

I also wonder whether it would of interest to have dash-canvas as a trace of a dcc.Graph component? It could be interesting for example to re-use the mode bar (with the zoom in/ zoom out buttons, etc.).

rpkyle commented 4 years ago

I had the opportunity to discuss dash-canvas support in Dash for R with @dan-seol, who's been working on the image processing app. Some of his feedback:

Currently, there is no package which provides features analogous to those in scikit-image, though there exists a collection of package which each provide some of the features; I will try to identify which are not currently supported in an existing R package and summarize here. The packages include

In the meantime, I plan to check out this book, it looks fairly topical: https://www.springer.com/gp/book/9781447149491