Skip to content

Commit c4147af

Browse files
committed
More careful handling of font when expanding annotation arrays. Fixes #738.
1 parent 06f7654 commit c4147af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/plotly_build.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ plotly_build.plotly <- function(p) {
4343

4444
# if an annotation attribute is an array, expand into multiple annotations
4545
nAnnotations <- max(lengths(x$annotations) %||% 0)
46+
# font is the only list object, so store it, and attach after transposing
47+
font <- x$annotations[["font"]]
4648
x$annotations <- purrr::transpose(lapply(x$annotations, function(x) {
4749
as.list(rep(x, length.out = nAnnotations))
4850
}))
51+
for (i in seq_len(nAnnotations)) {
52+
x$annotations[[i]][["font"]] <- font
53+
}
4954

5055
x[lengths(x) > 0]
5156

0 commit comments

Comments
 (0)