MyNixOS website logo
Description

Display 'HTML' Elements on Full Screen in 'Shiny' Apps.

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.

shinyfullscreen

Codecov.io test coverage R build status CRAN status

The goal of {shinyfullscreen} is to enable users to put some items on fullscreen. This package is the adaptation in R of screenfull.js.

Table of contents

Demos

  • Two plots can be displayed on full screen

  • Interactive graphs and custom background color on fullscreen only

Installation

Install the CRAN version with:

install.packages("shinyfullscreen")

Install the development version with:

# install.packages("devtools")
devtools::install_github("etiennebacher/shinyfullscreen")

How to use

Note that {shinyfullscreen} only works when the Shiny app is launched in the browser. It won't work in an RStudio window.

This package provides three functions that are very similar:

  • fullscreen_this() is useful if you want to enable fullscreen for few elements. Simply wrap this function around the element for which you want to enable fullscreen, and then click on this element when the app runs to display it on fullscreen:
### Only works in browser

library(shiny)
library(shinyfullscreen)

ui <- fluidPage(

  fullscreen_this(plotOutput("plot"))
  
  # Also works with magrittr's pipe
  # plotOutput("plot") %>%
  #   fullscreen_this()
)

server <- function(input, output, session) {
  
  output$plot <- renderPlot(plot(mtcars))
  
}

shinyApp(ui, server, options = list(launch.browser = TRUE))
  • fullscreen_those() is useful if you want to enable fullscreen view for several items without rewriting the same code again and again. Simply write your UI as usual, and then call this function with a list of ids corresponding to the items for which you want to enable fullscreen view. Note that this function has to be called after having created these items:
### 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))
  • fullscreen_all() allows you to put the whole page in fullscreen mode. Note however that this requires clicking on an HTML element.
### Only works in browser

library(shiny)
library(shinyfullscreen)

ui <- fluidPage(
  actionButton("page_full", "Show page in fullscreen"),
  plotOutput("plot"),
  fullscreen_all(click_id = "page_full")
)

server <- function(input, output, session) {

  output$plot <- renderPlot(plot(mtcars))

}

shinyApp(ui, server, options = list(launch.browser = TRUE))

Code of Conduct

Please note that the shinyfullscreen project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

1.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows