Skip to content

Commit c68baa1

Browse files
committed
Closes plotly#2298: geom_point with fill and colour
1 parent 9983a5a commit c68baa1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/layers2traces.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,12 @@ geom2trace.GeomPoint <- function(data, params, p) {
767767
# fill is only relevant for pch %in% 21:25
768768
pch <- uniq(data$shape) %||% params$shape %||% GeomPoint$default_aes$shape
769769
if (any(idx <- pch %in% 21:25) || any(idx <- !is.null(data[["fill_plotlyDomain"]]))) {
770-
L$marker$color[idx] <- aes2plotly(data, params, "fill")[idx]
770+
fill_value <- aes2plotly(data, params, "fill")
771+
if (length(idx) == 1) {
772+
L$marker$color <- fill_value
773+
} else {
774+
L$marker$color[idx] <- fill_value[idx]
775+
}
771776
}
772777
compact(L)
773778
}

0 commit comments

Comments
 (0)