Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annotation bug in plotly_build.R #2411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/plotly_build.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
x <- rapply(x, eval_attr, data = d, how = "list")

# if an annotation attribute is an array, expand into multiple annotations
nAnnotations <- max(lengths(x$annotations) %||% 0)

# Remove any elements from x$annotations that are of class 'list'
# this will remove the 'font' attribute list while retaining relevent attributes
x_annotations_subset <- Filter(function(x) !inherits(x, "list"), x$annotations)
nAnnotations <- max(lengths(x_annotations_subset) %||% 0)

if (!is.null(names(x$annotations))) {
# font is the only list object, so store it, and attach after transposing
font <- x$annotations[["font"]]
Expand Down