Skip to content

Commit f247d3f

Browse files
committed
avoid some silly warnings caused by supply_defaults()
1 parent dc512ac commit f247d3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/utils.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ supply_defaults <- function(p) {
118118

119119
p$x$data <- lapply(p$x$data, function(tr) {
120120
for (i in seq_along(anchors)) {
121-
nm <- names(anchors)[[i]]
122-
tr[[nm]] <- sub("^y1$", "y", sub("^x1$", "x", tr[[nm]][1])) %||% anchors[[i]]
121+
key <- names(anchors)[[i]]
122+
if (!has_attr(tr[["type"]] %||% "scatter", key)) next
123+
tr[[key]] <- sub("^y1$", "y", sub("^x1$", "x", tr[[key]][1])) %||% anchors[[i]]
123124
}
124125
tr
125126
})

0 commit comments

Comments
 (0)