Skip to content

Commit b506203

Browse files
committed
Get event_data() working with subplots. Fixes #663
1 parent 0600259 commit b506203

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/subplots.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ subplot <- function(..., nrows = 1, widths = NULL, heights = NULL, margin = 0.02
236236
layouts <- layouts[which_layout]
237237
}
238238
p$layout <- c(p$layout, Reduce(modify_list, layouts))
239+
sources <- unique(unlist(lapply(plots, "[[", "source")))
240+
if (length(sources) > 1) {
241+
stop("Can have multiple source values in a single subplot")
242+
}
243+
p$source <- sources[1]
239244
as_widget(p)
240245
}
241246

0 commit comments

Comments
 (0)