Skip to content

Commit fa511b8

Browse files
committed
fix #551
1 parent 11bc3a8 commit fa511b8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ 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+
dat$alpha <- dat$alpha %||% params$alpha %||% 1
145145
if (!identical(params$se, FALSE)) {
146146
dat2 <- prefix_class(ribbon_dat(data), c("GeomPolygon", "GeomSmooth"))
147147
dat2$colour <- NULL

0 commit comments

Comments
 (0)