Skip to content

Commit 1659ad5

Browse files
committed
warn if a promise is passed to renderPlotly(), but htmlwidgets is out-of-date, closes #1297
1 parent a245f20 commit 1659ad5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/shiny.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) {
4545
# Converts a plot, OR a promise of a plot, to plotly
4646
prepareWidget <- function(x) {
4747
if (promises::is.promising(x)) {
48+
if (utils::packageVersion("htmlwidgets") < "1.2.1") {
49+
warning("Async rendering of htmlwidgets requires v1.2.1 (or higher) of the htmlwidgets package.")
50+
}
4851
promises::then(x, ggplotly)
4952
} else {
5053
ggplotly(x)

0 commit comments

Comments
 (0)