Title: | Display 'HTML' Elements on Full Screen in 'Shiny' Apps |
---|---|
Description: | In 'Shiny' apps, it is sometimes useful to see a plot or a table in full screen. Using 'Shinyfullscreen', you can easily designate the 'HTML' elements that can be displayed on fullscreen and use buttons to trigger the fullscreen view. |
Authors: | Etienne Bacher [aut, cre, cph] |
Maintainer: | Etienne Bacher <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-11-01 04:09:17 UTC |
Source: | https://github.com/etiennebacher/shinyfullscreen |
Enable fullscreen for the whole page
fullscreen_all(click_id = NULL, bg_color = "#fff")
fullscreen_all(click_id = NULL, bg_color = "#fff")
click_id |
Id of the item that triggers the fullscreen view. This is a mandatory argument. You can specify the id of a button for instance, so that clicking on this button triggers the fullscreen view for the whole page. |
bg_color |
Background color when item is displayed fullscreen. Default is white. |
Enables the whole page to be displayed in fullscreen mode.
if (interactive()) { ### Only works in browser library(shiny) ui <- fluidPage( actionButton("test", "test"), plotOutput("plot"), fullscreen_all(click_id = "test") ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }
if (interactive()) { ### Only works in browser library(shiny) ui <- fluidPage( actionButton("test", "test"), plotOutput("plot"), fullscreen_all(click_id = "test") ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }
Enable fullscreen for a specific item
fullscreen_this(ui_element, click_id = NULL, bg_color = "#fff")
fullscreen_this(ui_element, click_id = NULL, bg_color = "#fff")
ui_element |
A UI element that should be displayed fullscreen. |
click_id |
Id of the item that triggers the fullscreen view. By default, it is the id of |
bg_color |
Background color when item is displayed fullscreen. Default is white. |
Enables the selected element to be displayed in fullscreen mode.
if (interactive()) { ### Only works in browser library(shiny) ui <- fluidPage( actionButton("test", "test"), fullscreen_this(plotOutput("plot")) ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }
if (interactive()) { ### Only works in browser library(shiny) ui <- fluidPage( actionButton("test", "test"), fullscreen_this(plotOutput("plot")) ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }
Enable fullscreen for a list of items
fullscreen_those(items = list(), bg_color = "#fff")
fullscreen_those(items = list(), bg_color = "#fff")
items |
A list containing the ids of the items for which fullscreen is enabled. |
bg_color |
Background color when item is displayed full screen. Default is white. |
This function has to be placed AFTER the call of inputs. See Examples.
Enables the selected elements to be displayed in fullscreen mode.
if (interactive()) { ### Only works in browser library(shiny) library(shinyfullscreen) ui <- fluidPage( plotOutput("plot"), plotOutput("plot2"), # Has to be placed after plot and plot2 fullscreen_those(items = list("plot", "plot2")) ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) output$plot2 <- renderPlot(plot(AirPassengers)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }
if (interactive()) { ### Only works in browser library(shiny) library(shinyfullscreen) ui <- fluidPage( plotOutput("plot"), plotOutput("plot2"), # Has to be placed after plot and plot2 fullscreen_those(items = list("plot", "plot2")) ) server <- function(input, output, session) { output$plot <- renderPlot(plot(mtcars)) output$plot2 <- renderPlot(plot(AirPassengers)) } shinyApp(ui, server, options = list(launch.browser = TRUE)) }