wjm41 / molplotly

add-on to plotly which show molecule images on mouseover!
Apache License 2.0
242 stars 25 forks source link

Plotting in a running Dash app #15

Closed ArnaudGaudry closed 2 years ago

ArnaudGaudry commented 2 years ago

Hi! I have a small dash app that I use to explore the molecules present in different samples. It is possible to select the samples of interest and then display a plotly scatter plot generated using the structures. I tried to add the molplotly layer on the scatter plot but no molecules are displayed. Any experience on that? Thanks!

wjm41 commented 2 years ago

Hi @ArnaudGaudry! Could you give some details/example code on the issue? If my understanding is correct, the scatterplot is created within another Dash app? If so then perhaps you could copy/paste the display_hover function from the molplotly source code into your dash app for a custom display of the molecule images on mouseover.

ArnaudGaudry commented 2 years ago

Thanks for the prompt answer @wjm41 ! I could adapt the display_over function in new callback and it now works like a charm!