强制闪亮的应用在移动设备上显示桌面视图

cee*_*fel 1 deployment mobile r shiny

我正在将闪亮的应用程序部署到Shinyapps.io。它设计用于桌面浏览器,但是在移动设备上访问应用程序时,它会更改为移动视图(这很酷,但在这种情况下没有用)。

任何想法如何强制闪亮的应用程序的桌面视图?

我尝试了以下答案:如何在移动设备上强制桌面视图-Bootstrap?但没有成功。

(很遗憾,没有使用javascript的经验...)

mle*_*gge 5

该问题满足您的需求,将<meta>标签包括在中HTML

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(

   HTML('<meta name="viewport" content="width=1024">'),

   # Application title
   titlePanel("Old Faithful Geyser Data"),

   # Sidebar with a slider input for number of bins
   sidebarLayout(
      sidebarPanel(
         sliderInput("bins",
                     "Number of bins:",
                     min = 1,
                     max = 50,
                     value = 30)
      ),

      # Show a plot of the generated distribution
      mainPanel(
         plotOutput("distPlot")
      )
   )
)

# Define server logic required to draw a histogram
server <- function(input, output) {

   output$distPlot <- renderPlot({
      # generate bins based on input$bins from ui.R
      x    <- faithful[, 2]
      bins <- seq(min(x), max(x), length.out = input$bins + 1)

      # draw the histogram with the specified number of bins
      hist(x, breaks = bins, col = 'darkgray', border = 'white')
   })
}

# Run the application
shinyApp(ui = ui, server = server)
Run Code Online (Sandbox Code Playgroud)

没有标签:

在此处输入图片说明

后标记:

在此处输入图片说明