Skip to content

Commit 2748789

Browse files
committed
Merge pull request #552 from ropensci/fix/smoothAlpha
Fix/smooth alpha
2 parents 11bc3a8 + 9172ccb commit 2748789

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via 'plotly.js'
3-
Version: 3.4.14
3+
Version: 3.4.15
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "cpsievert1@gmail.com"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.4.15 -- 18 Apr 2016
2+
3+
BUGFIX:
4+
5+
The alpha in geom_smooth was incorrectly inheriting from other layers. See #551.
6+
17
3.4.14 -- 15 Apr 2016
28

39
CHANGES:

R/ggplotly.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ gg2list <- function(p, width = NULL, height = NULL, tooltip = "all", source = "A
209209
# attach a new column (hovertext) to each layer of data that should get mapped
210210
# to the text trace property
211211
data <- Map(function(x, y) {
212+
if (nrow(x) == 0) return(x)
212213
# make sure the relevant aes exists in the data
213214
for (i in seq_along(y)) {
214215
aesName <- names(y)[[i]]

R/layers2traces.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) {
141141
#' @export
142142
to_basic.GeomSmooth <- function(data, prestats_data, layout, params, p, ...) {
143143
dat <- prefix_class(data, "GeomPath")
144-
dat$alpha <- NULL
144+
# alpha for the path is always 1 (see GeomSmooth$draw_key)
145+
dat$alpha <- 1
145146
if (!identical(params$se, FALSE)) {
146147
dat2 <- prefix_class(ribbon_dat(data), c("GeomPolygon", "GeomSmooth"))
147148
dat2$colour <- NULL

0 commit comments

Comments
 (0)