shinyjs

R Shiny: Use Onclick Option of Actionbutton on the Server Side

瘦欲@ 提交于 2019-12-07 03:27:22
问题 I want to make a Shiny App in which the user can press an actionbutton which would then trigger some code on the server side creating a file in the www folder and then opens/downloads the file. Suppose the file is test.txt (in my case it would be a variety of R, Excel, and exe files which will be copied from different folders on a drive to the www folder). My first try was to use the actionbutton with the onclick option as shown below ui <- fluidPage( actionButton("showtxt", "Show/Download

Hide main header toggle in R Shiny App

旧巷老猫 提交于 2019-12-06 23:00:30
I am looking for a way to hide main header toggle icon as we do for side bar in R Shiny App using ShinyJS Package. Attaching the Image for the reference. Code library(shiny) library(shinydashboard) library(shinyjs) ui <- shinyUI(dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( useShinyjs() ) )) server <- shinyServer(function(input, output, session) { addClass(selector = "body", class = "sidebar-collapse") # Hide Side Bar }) shinyApp(ui = ui, server = server) One way to hide the sidebar toggle when the app starts is using the JS() function from htmlwidgets : library(shiny)

R shinydashboard - show/hide multiple menuItems based on user input

≡放荡痞女 提交于 2019-12-06 14:47:22
问题 The idea is to have a user input (access code), based on which different menuItems can be accessed. So basically we have a custom version of app available based on user's requirement. A working example for 3 menuItems is as follow: library(shiny) library(shinydashboard) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "SHOW/HIDE MULTIPLE MENU ITEMS"), dashboardSidebar( useShinyjs(), sidebarMenu( id = "tabs", hidden( menuItem("MENU ITEM 1", tabName = "mi1"), menuItem("MENU ITEM 2"

R Shiny - Automatically hide the sidebar when you navigate into tab items

时间秒杀一切 提交于 2019-12-06 02:24:43
问题 I have a Shiny app - simplified example here - and I want the sidebar to hide dynamically when I navigate into tab items. Indeed users will connect to the app mainly with their mobile. With the help of the post Hide sidebar in default in shinydashboard, I know how to hide by default the sidebar when you arrive on the app, but after the sidebar is always displayed. Here is my actual code : ### Load librairies library(shiny) ; library(shinydashboard) ; library(shinyjs) library(dplyr) ### Load

Loading screen and navbarPage

强颜欢笑 提交于 2019-12-05 21:47:48
I try to make a loading screen as in this nice example http://daattali.com:3838/loading-screen/ . Unfortunately I cannot figure out how to do exactly the same effect with 'navbarPage'. In this slightly modified app below there are two tab panels called "start" and "end". When the app starts none of the tab panels are active. One have to quickly click on the first tab to see the loading screen but this is not what I would like. Is there a way to make it so quick and easy as in the mentioned example? Thank you for the help! library(shinyjs) appCSS <- " #loading-content { position: absolute;

Shiny: Using enter key with action button on login screen

孤街浪徒 提交于 2019-12-05 18:23:07
I created a login screen for my Shiny app and would like users to be able to use the Enter key instead of having to use the mouse to click the OK button. I found an example that looks like it solves it for an input form but unfortunately, it does not work for my example. I am imagining it has something to do with the modal dialog. (have seen a lot of duplicate questions for this topic, this is a new parameter and none of those solutions have solved it) SO Reference: Using enter key with action button in R Shiny Example Code: library(shiny) library(shinydashboard) Logged = FALSE my_username <-

R Shiny: Use Onclick Option of Actionbutton on the Server Side

冷暖自知 提交于 2019-12-05 06:34:26
I want to make a Shiny App in which the user can press an actionbutton which would then trigger some code on the server side creating a file in the www folder and then opens/downloads the file. Suppose the file is test.txt (in my case it would be a variety of R, Excel, and exe files which will be copied from different folders on a drive to the www folder). My first try was to use the actionbutton with the onclick option as shown below ui <- fluidPage( actionButton("showtxt", "Show/Download File", onclick = "window.open('test.txt')") ) server <- function(input, output, session){ observeEvent

capturing cat output periodically for R shiny output (renderPrint)

半世苍凉 提交于 2019-12-05 03:29:37
Hope someone can help me with this. Let's say there is a function "example" which is something like ##function from a package example<-function(f){ #does something cat("step 1 done....") # etc etc cat("step 2 done....") return(some_data_frame) } ##server ui code example2<-reactive({ if(input$some_action_button==0) return() result<-isolate(example(input$f1)) return(result) }) output$f2<-renderPrint({ example2() }) Is there some way to capture the "cat" outputs from the function into renderPrint, periodically? Assuming that this is a long function to process and it would be nice for the user to

R shinydashboard - show/hide multiple menuItems based on user input

筅森魡賤 提交于 2019-12-04 21:57:10
The idea is to have a user input (access code), based on which different menuItems can be accessed. So basically we have a custom version of app available based on user's requirement. A working example for 3 menuItems is as follow: library(shiny) library(shinydashboard) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "SHOW/HIDE MULTIPLE MENU ITEMS"), dashboardSidebar( useShinyjs(), sidebarMenu( id = "tabs", hidden( menuItem("MENU ITEM 1", tabName = "mi1"), menuItem("MENU ITEM 2", tabName = "mi2"), menuItem("MENU ITEM 3", tabName = "mi3") ), textInput(inputId = "accessToken",

shiny app : disable downloadbutton

北慕城南 提交于 2019-12-03 19:38:19
问题 My shiny app produces some files that user can download. I have put downloadbutton in the ui for this purpose. However, when the page launches and before any calculation is done, there is nothing to download. I want to prevent user from downloading empty pages. For this, I'm thinking to disable the downloadButton before the output is ready. But I don't know how to do that. I have found ways to disable ActionButton (such as ShinyBS package and other JS codes), but nothing for downloadButton.