# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
fluidRow(
column(6, dq_gallery(id = "myGallery",
Plot1 = plotOutput("plot1"), Plot2 = plotOutput("plot2"),
plotOutput("plot3"), plotOutput("plot4"),
content_style = "padding: 10px 30px;", arrows = list(
dq_icon("chevron-circle-left"), dq_icon("chevron-circle-right")
)
)),
column(6,
actionButton("show3", "Show plot 3"),
actionButton("anim", "Animate Plots")
)
)
),
server = function(input, output) {
output$plot1 <- renderPlot(plot(mtcars$mpg, mtcars$cyl))
output$plot2 <- renderPlot(plot(mtcars$disp, mtcars$hp))
output$plot3 <- renderPlot(plot(mtcars$drat, mtcars$wt))
output$plot4 <- renderPlot(plot(mtcars$qsec, mtcars$vs))
observeEvent(input$show3, update_dq_gallery("myGallery", set = 3))
observeEvent(input$anim, {
for(i in 1:30) {update_dq_gallery("myGallery", add = .1);Sys.sleep(.2)}
})
}
)
}
# }
Run the code above in your browser using DataLab