diff --git a/R/helpers.R b/R/helpers.R index 8018ce0db9..2b7a80f3de 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -162,6 +162,13 @@ hide_legend <- function(p) { toWebGL <- function(p) { if (ggplot2::is.ggplot(p)) { p <- plotly_build(p) + traces_without_hoveron <- glTypes() + trace_idx <- vapply( + p$x$data, + function(trace) trace$type %in% traces_without_hoveron, + logical(1) + ) + p <- style(p, hoveron = NULL, traces = which(trace_idx)) } p$x$.plotlyWebGl <- TRUE p