emulate_resolution: View a Shiny app with different resolution

Description Usage Arguments Examples

View source: R/emulate_resolution.R

Description

When developing applications, the display may be different depending on the screen on which the application is displayed. This application allows you to simulate different resolutions to verify that the display is correct.

Usage

1
2
3
4
5
6
7
8
9
emulate_resolution(
  appDir = NULL,
  urls = NULL,
  width = 800,
  height = 600,
  controls = TRUE,
  host = getOption("shiny.host", "127.0.0.1"),
  port = getOption("shiny.port")
)

Arguments

appDir

The application to run, same as in runApp.

urls

A vector with URLs to simulate resolution.

width

Original width for the iframe containing the application.

height

Original height for the iframe containing the application.

controls

Display controls widgets to manipulate width/height, URL. Default to TRUE.

host

The TCP port that the application should listen on. See runApp.

port

The IPv4 address that the application should listen on. See runApp.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
if (interactive()) {
  library(shiny)
  library(resizer)
  
  # From app directory :
  emulate_resolution(
    system.file("examples", "01_hello", package = "shiny")
  )
  
  
  # From shiny obj
  ui <- fluidPage(
    tags$h1("My application")
  )
  server <- function(input, output, session) {
    
  }
  
  emulate_resolution(
    shinyApp(ui, server)
  )
}

dreamRs/resizer documentation built on April 21, 2021, 3:08 p.m.