1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
context("is.dynamic")
library(shiny)
test_that("regular plot is not dynamic", {
p <- mtcars %>% ggvis(x = ~wt, y = ~cyl) %>% layer_points()
expect_false(is.dynamic(p))
})
test_that("plot with reactive data source is dynamic", {
p <- shiny::reactive(mtcars) %>% ggvis(x = ~wt, y = ~cyl) %>% layer_points()
expect_true(is.dynamic(p))
})
test_that("plot with reactive transform param is dynamic", {
p <- mtcars %>% ggvis(~mpg, ~wt) %>% layer_smooths(span = input_slider(0, 1))
expect_true(is.dynamic(p))
})
|