Como obter resolução de tela do JavaScript no R Shiny?
Quero obter a resolução da tela do JavaScript, armazenada no diretórioGetScreenWidth
variável no Shiny Server.
Eu tentei a referência:
Recebendo dados de .js no server.R brilhantehttps://ryouready.wordpress.com/2013/11/20/sending-data-from-client-to-server-and-back-using-shiny/Então eu tenho:
ui.R
shinyUI(
bootstrapPage(
verbatimTextOutput("results")
,tags$script('
var jsWidth = screen.width;
Shiny.onInputChange("GetScreenWidth",jsWidth);
')
)
)
server.R
shinyServer(function(input,output){
output$results=renderPrint({
input$GetScreenWidth
})
})
Vai voltarNULL
porverbatimTextOutput
.
Como devo modificar o código? Obrigado!