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

geom_ribbon_interactive hover not selecting both ymin and ymax #268

Open
glaroc opened this issue Jun 2, 2023 · 0 comments
Open

geom_ribbon_interactive hover not selecting both ymin and ymax #268

glaroc opened this issue Jun 2, 2023 · 0 comments
Assignees
Labels

Comments

@glaroc
Copy link

glaroc commented Jun 2, 2023

When adding hover interactivity to a geom_ribbon_interactive, it does not apply the same interaction to the lower and upper envelope.

For example, with this:

library(ggiraph)
tt <- data.frame(y=sort(rnorm(100)),z=rep(c(1,2),50))
tt[tt$z==2,'y']<-tt[tt$z==2,'y']*2
gg<-ggplot(data=tt,aes(x=1:100,y=y,group=z,color=z,data_id=z))+
  geom_line_interactive()+
  geom_ribbon_interactive(aes(ymin=y-0.4,ymax=y+0.4), alpha = 0.2)

g<-girafe(ggobj = gg,  width_svg = 9,  height_svg = 5, options = list(
  opts_hover_inv(css = "opacity:0.1;"),
  opts_hover(css = "stroke-width:2;")
))
g

when hovering over one of center line or the upper lines, the associated bottom line is not selected.

R version 4.3.0 (2023-04-21)
ggiraph_0.8.7

@davidgohel davidgohel added the bug label Sep 3, 2023
@sigmapi sigmapi self-assigned this Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants