-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add support for clickable hover text or a per pt onclick attribute #998
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
Comments
We definitely would have use for a hover label that the user can interact with. There is quite a bit of information in our hover labels (5-6 lines of text), and users would often like to copy and paste some text from the hover label, or potentially click a link. |
@john-soklaski what do you think the right interaction is for allowing a user to select copy paste what is in a hover tag? |
@jackparmer I think persisting the hover label if a user moves the mouse cursor along the arrow to the hoverlabel makes sense (with |
@jackparmer I will second this feature request in the python API. Our clients would like to be able to interact with content related to a particular data point so ss far as interaction goes, the text should persist, and a hyperlink placed in the text should be clickable. |
+1 |
1 similar comment
+1 |
@john-soklaski , @maresk , @latorrefabian , @maierbenedikt - you may be interested in discussion here, Annotations that show & hide on clicking data: #1266 |
And see the implementation of |
Hello all! |
We support text in a lot of different contexts, and in most of the other contexts the links are clickable. So it would require special code to disable link creation within the unclickable contexts, and that extra complexity seemed unnecessary since really, is there a purpose to adding hyperlinks that you can't click? 😉 |
That makes sense! |
@jackparmer I think clicking on the marker itself would be ideal to toggle the stickiness of the hover tag.
+1 for utility |
+1 for this. This would enable users to dig into the data by linking other related charts. I like the simple solution proposed by @pdanese |
It seems as if there may already a solution in community.plot.ly To me it seems that if you knew which datum was clicked, then you could window.open(datum.uri). It's probably not that easy.. but the fiddle is compelling. I can't quite read tease it out of the docs what it's actually saying :( |
Hello, has this been completed yet? Currently working on a project where I want users to be able to click the annotations and copy them to the clipboard. |
I would love to have this feature as well! |
looks like this is still open? any updates? |
+1 |
1 similar comment
+1 |
+1 need stickiness |
This is not a large project but obviously hasn't found its way to the top of the priority queue for a while. If any company would like to partner with us on this, we'd be interested in discussing! |
+1 |
+1 This would be very useful for data analysis. And unfortunately the hack suggested by @AniWar doesn't seem to work anymore. |
+1 |
1 similar comment
+1 |
Hi - stumbled upon this when looking for a way to follow a URL that's in the hover text. The workaround proposed by @keseldude looks like it could work for me, but I don't understand how to use it. Could anyone please elaborate? |
Any update on this? |
+1, I am also in need of this feature |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
I managed to find a workaround to make every hoverbox sticky. Just click on the datapoint to make the hoverbox sticky. Remove it by clicking the hoverbox or the datapoint again. The trick was to make a copy of the hoverlayer I generate the plot in Python and send it via POST to my HTML template. But the code should work for other implementations as well. Add this function inside your
You need to call the function after the plot was generated:
This might not be the best practice solution (and I'm not a webdev ;) ) but it works! EDIT: |
The solution by @npinter works like a charm for my use case. Thank you 🙏❤️ |
has anyone figured out how to do this in python? |
Saw this was closed as completed? Do we have a PR/version we can integrate? |
Also wondering why this was closed, |
My best guess is that @gvwilson considered the workaround from this comment as a proper user side "solution". In my opinion, the workaround on user side should not be considered as solution of this issue, because
I'd strongly vote for reopening this issue, but the bare minimum would be stating a reason for closing it. @gvwilson , could you please comment on this? |
Thanks for reopening! ❤️ |
Defining what sticky means will be tricky. It probably doesn't apply to every situation. Maybe we could add it as a new
layout.hovermode
e.g.'hovermode: 'sticky'
.So, maybe instead we could define a
linkonclick
attribute e.g.linkonclick: ['https://plot.ly/~empet/101', 'https://plot.ly', /* ... one link per data pt */]
that way clicking on a data pt would open the link instead of hovering on the data pt -> move mouse over link in hover label -> click on it.cc @jackparmer
The text was updated successfully, but these errors were encountered: