You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a recent update, presumably of ggiraph, the behavior of geom_path_interactive and geom_line_interactive has changed so that paths seem closed, creating an invisible fill or otherwise blocking hover on the lower, layered line.
In the minimal example below, triangle1 cannot be selected inside triangle 2 (hovering over interior of triangle 2):
library(tidyverse)
library(ggiraph)
triangle1 <- data.frame(
id = 1,
x = c(0, 1, 2, 0.2),
y = c(0, 1, 0, 0)
)
triangle2 <- mutate(
triangle1,
id = 2,
x = x + 0.5,
y = y + 0.25)
d <- bind_rows(triangle1, triangle2)
p <- ggplot(d) +
geom_path_interactive(
mapping = aes(
x, y, group = id,
data_id = id, tooltip = id),
color = 'black')
girafe(code = print(p),
width_svg = 7,
height_svg = 7,
options = list(
opts_sizing(rescale = FALSE),
opts_toolbar(saveaspng = FALSE),
opts_hover_inv(css = "stroke-opacity:0.1;fill:none;"),
opts_hover(css = "stroke-width:3;fill:none;")
))
I should add that although I don't think this warning in the help,
IMPORTANT: When applying a fill style with the css argument, be aware that the browser's CSS engine will apply it also to line elements, if there are any that use the hovering feature. This will cause an undesired effect.
To overcome this, supply the argument css using girafe_css(), in order to set the fill style only for the desired elements.
should apply, I've also tried this:
x <- girafe(ggobj = p)
x <- girafe_options(x = x,
opts_hover_inv(css = girafe_css(
css = "fill:none;",
line = 'stroke-opacity:0.1;fill:none;',
area = 'fill:none;')
),
opts_hover(css = girafe_css(
css = "fill:none;",
line = 'stroke-width:3;fill:none;',
area = 'fill:none;'),
nearest_distance = 0)
)
In a recent update, presumably of
ggiraph
, the behavior ofgeom_path_interactive
andgeom_line_interactive
has changed so that paths seem closed, creating an invisible fill or otherwise blocking hover on the lower, layered line.In the minimal example below, triangle1 cannot be selected inside triangle 2 (hovering over interior of triangle 2):
I should add that although I don't think this warning in the help,
should apply, I've also tried this:
but still doesn't behave as expected.
The session information is:
The text was updated successfully, but these errors were encountered: