diff --git a/DESCRIPTION b/DESCRIPTION index d4b6d729ff..fb055cbdde 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via 'plotly.js' -Version: 3.4.14 +Version: 3.4.15 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), email = "cpsievert1@gmail.com"), person("Chris", "Parmer", role = c("aut", "cph"), diff --git a/NEWS b/NEWS index 1b72caa9fe..4bacc828a3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +3.4.15 -- 18 Apr 2016 + +BUGFIX: + +The alpha in geom_smooth was incorrectly inheriting from other layers. See #551. + 3.4.14 -- 15 Apr 2016 CHANGES: diff --git a/R/ggplotly.R b/R/ggplotly.R index 7670ec5489..ef99c243c3 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -209,6 +209,7 @@ gg2list <- function(p, width = NULL, height = NULL, tooltip = "all", source = "A # attach a new column (hovertext) to each layer of data that should get mapped # to the text trace property data <- Map(function(x, y) { + if (nrow(x) == 0) return(x) # make sure the relevant aes exists in the data for (i in seq_along(y)) { aesName <- names(y)[[i]] diff --git a/R/layers2traces.R b/R/layers2traces.R index c53a06126e..febe2935fc 100644 --- a/R/layers2traces.R +++ b/R/layers2traces.R @@ -141,7 +141,8 @@ to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) { #' @export to_basic.GeomSmooth <- function(data, prestats_data, layout, params, p, ...) { dat <- prefix_class(data, "GeomPath") - dat$alpha <- NULL + # alpha for the path is always 1 (see GeomSmooth$draw_key) + dat$alpha <- 1 if (!identical(params$se, FALSE)) { dat2 <- prefix_class(ribbon_dat(data), c("GeomPolygon", "GeomSmooth")) dat2$colour <- NULL