Package 'shinyfullscreen'

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

Help Index


Enable fullscreen for the whole page

Description

Enable fullscreen for the whole page

Usage

fullscreen_all(click_id = NULL, bg_color = "#fff")

Arguments

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.

Value

Enables the whole page to be displayed in fullscreen mode.

Examples

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

Description

Enable fullscreen for a specific item

Usage

fullscreen_this(ui_element, click_id = NULL, bg_color = "#fff")

Arguments

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 ui_element, i.e clicking on the element shows it on fullscreen. You can specify the id of a button for instance, so that clicking on this button triggers the fullscreen view of ui_element.

bg_color

Background color when item is displayed fullscreen. Default is white.

Value

Enables the selected element to be displayed in fullscreen mode.

Examples

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

Description

Enable fullscreen for a list of items

Usage

fullscreen_those(items = list(), bg_color = "#fff")

Arguments

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.

Details

This function has to be placed AFTER the call of inputs. See Examples.

Value

Enables the selected elements to be displayed in fullscreen mode.

Examples

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))
}