@@ -141,7 +141,8 @@ to_basic.GeomBoxplot <- function(data, prestats_data, layout, params, p, ...) {
141141# ' @export
142142to_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
@@ -395,6 +396,7 @@ geom2trace.GeomPath <- function(data, params, p) {
395396# ' @export
396397geom2trace.GeomPoint <- function (data , params , p ) {
397398 shape <- aes2plotly(data , params , " shape" )
399+ color <- aes2plotly(data , params , " colour" )
398400 L <- list (
399401 x = data $ x ,
400402 y = data $ y ,
@@ -404,21 +406,20 @@ geom2trace.GeomPoint <- function(data, params, p) {
404406 mode = " markers" ,
405407 marker = list (
406408 autocolorscale = FALSE ,
407- color = aes2plotly( data , params , " fill " ) ,
409+ color = color ,
408410 opacity = aes2plotly(data , params , " alpha" ),
409411 size = aes2plotly(data , params , " size" ),
410412 symbol = shape ,
411413 line = list (
412414 width = aes2plotly(data , params , " stroke" ),
413- color = aes2plotly( data , params , " colour " )
415+ color = color
414416 )
415417 )
416418 )
417- # fill is irrelevant for pch %in% c(1, 15:20)
419+ # fill is only relevant for pch %in% 21:25
418420 pch <- uniq(data $ shape ) %|| % params $ shape %|| % GeomPoint $ default_aes $ shape
419- if (any(pch %in% c(1 , 15 : 20 )) ||
420- all(grepl(" open$" , shape )) && all(L $ marker $ color %in% " transparent" )) {
421- L $ marker $ color <- L $ marker $ line $ color
421+ if (any(idx <- pch %in% 21 : 25 )) {
422+ L $ marker $ color [idx ] <- aes2plotly(data , params , " fill" )[idx ]
422423 }
423424 L
424425}
@@ -538,7 +539,7 @@ geom2trace.GeomTile <- function(data, params, p) {
538539 # create the colorscale
539540 colScale <- unique(g [, c(" fill_plotlyDomain" , " fill" )])
540541 # colorscale goes crazy if there are NAs
541- colScale <- colScale [complete.cases(colScale ), ]
542+ colScale <- colScale [stats :: complete.cases(colScale ), ]
542543 colScale <- colScale [order(colScale $ fill_plotlyDomain ), ]
543544 list (
544545 x = x ,
0 commit comments