Skip to content

use hoverinfo skip instead of none for invisible ggplotly() colorbar trace, closes #1381 #1382

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

Merged
merged 2 commits into from
Nov 1, 2018

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Oct 31, 2018

See #1381

@cpsievert cpsievert requested a review from schloerke October 31, 2018 17:08
@schloerke
Copy link
Contributor

So the grid lines were taking the hover info first, even though they are underneath the tile?

@cpsievert
Copy link
Collaborator Author

cpsievert commented Nov 1, 2018

So the grid lines were taking the hover info first, even though they are underneath the tile?

No. In plotly.js, colorbars are per trace, but in ggplot2 they are per plot, so when ggplotly() draws a colorbar, it's connected to an invisible trace that is tied to the scales domain (created by this gdef2trace() function). Since that invisible trace's is on top of the heatmap, it's hover properties are overriding the hover for that (1,1) cell (fyi, you can run plotly_json() on that example to see all the attributes for the invisible trace).

@cpsievert cpsievert merged commit 288c86e into master Nov 1, 2018
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

Successfully merging this pull request may close these issues.

2 participants