Skip to content

Commit 0bdf044

Browse files
committed
if a trace has fillcolor, but no fill attribute, it always has fill; otherwise, the fill attribute has to be something other than 'none'
1 parent d21c4a6 commit 0bdf044

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

R/plotly_build.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,5 +1006,12 @@ supplyUserPalette <- function(default, user) {
10061006
# helper functions
10071007
array_ok <- function(attr) isTRUE(tryNULL(attr$arrayOk))
10081008
has_fill <- function(trace) {
1009-
has_attr(trace$type %||% "scatter", "fillcolor")
1009+
trace_type <- trace[["type"]] %||% "scatter"
1010+
# if trace type has fillcolor, but no fill attribute, then fill is always relevant
1011+
has_fillcolor <- has_attr(trace_type, "fillcolor")
1012+
has_fill <- has_attr(trace_type, "fill")
1013+
if (has_fillcolor && !has_fill) return(TRUE)
1014+
fill <- trace[["fill"]] %||% "none"
1015+
if (has_fillcolor && isTRUE(fill != "none")) return(TRUE)
1016+
FALSE
10101017
}

0 commit comments

Comments
 (0)