Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Implement plotly backend or new Class wrapping plotly #48

Open
emmanuelle opened this issue Apr 7, 2020 · 0 comments
Open

Implement plotly backend or new Class wrapping plotly #48

emmanuelle opened this issue Apr 7, 2020 · 0 comments

Comments

@emmanuelle
Copy link
Contributor

Since plotly.js will soon have drawing capabilities we should implement either a new Canvas class with a high-level API for a plotly.js figure + annotations, or reuse the existing DashCanvas class with a plotly backend.

What can be done out of the box with plotly.js + dcc.Graph

  • define a figure with a given image either as layout image, or trace, and parameters for the newshape layout attribute as well as dragmode (which can be changed from the modebar)
  • define adcc.Storeto store the geometry of annotations and update it with a callback listening torelayoutData`
  • modify newshape parameters with other Dash components such as slider etc. However doing this will require to replot the whole figure. This problem can be mitigated by using clientside callbacks.

What we can do on top on dcc.Graph:

  • add a dcc.Store to save the geometry of annotations, which will be updated on relayout (this could also be part of a Python "combination class" with an internal callback but probably better to implement everything in JS). This store should we read and write, ie it should be possible to load annotations programmatically. The structure of this object would be a list of objects, ie using the same syntax as plotly.
  • have another dcc.Store where to store newshape parameters, which could trigger relayout events for the figure without replotting the whole figure. Same syntax as plotly.
  • have an image parameter which can be an array in the case where the figure attribute is not given, then it is built automatically

Other thoughts:

  • hiding buttons from the modebar can be done in the config attribute
  • future directions: add slider to slice through 3D volume, interaction with datashader.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant