Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Plotly click/select/hover events #445

Closed
wilsongoode opened this issue Sep 21, 2022 · 2 comments
Closed

Support for Plotly click/select/hover events #445

wilsongoode opened this issue Sep 21, 2022 · 2 comments

Comments

@wilsongoode
Copy link

I have PlotlyJS.jl running in a Pluto.jl notebook. I have a graph/network plotted where each node represents an image. I'd like to be able to view a preview of each image when I hover over its node.

If there is a way to embed HTML in hover, please point me to it!

As a second option, I thought I might be able to link the hovered node to a subplot that could display the image, but I was unable to access the data of the node. I know that plotly.js fires off events with data on clicks/selects and hovers. I'd like to be able to use the data (in this case an image filename).

Attached is a screenshot of the graph in question, with one node hovered.
Screen Shot 2022-09-21 at 7 35 42 PM

After banging my head for a while against the docs of the relevant packages, I thought I might be able to use javascript to access the DOM and pull out the relevant information, but it only works in the console.

Any advice would be appreciated. Am I barking up the wrong tree?

@sglyon
Copy link
Member

sglyon commented Sep 26, 2022

Nope -- this is the right tree!

This should work in other contexts (like the standalone plot windows or vs code) as documented here http://juliaplots.org/PlotlyJS.jl/stable/syncplots/#SyncPlots

Not sure what it would take to get this working with Pluto.jl and unfortunately I don't have the time right now to try to get it working. Perhaps other community members can provide support here??

@wilsongoode
Copy link
Author

Thanks for your response @sglyon. I've decided to switch over to JS, skipping plotly.js and working directly with D3.js. This has provided the level of control I needed for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants