4

I have a shiny app that uses the 'rintrojs' package to create guide modals that take people through features of the app. There are a number of data steps that link to elements on different tabPanels. I have found a way to make the app switch to the corresponding tabPanels for each of the datasteps which works when I run the app locally however this functionality fails (without generating any warnings) when I try to deploy the app to shinyapps.io.

My app is complex so I created a simple reprex below which recreates the issue.

library(shiny)
library(rintrojs)

# Define ui logic
ui <-navbarPage(id = "intabset", 
                introjsUI(),
                tabPanel(title = "Tab1",
                         mainPanel(
                           introBox(
                             data.step = 1,
                             data.intro ="test",
                             actionButton("intro_button", "Launch introJS")),
                           introBox(
                             data.step=3,
                             data.intro="Final box back to Tab1",
                             div("Text in 1st tab")))),

                tabPanel(title = "Tab2",
                         mainPanel(
                           introBox(
                             data.step=2,
                             data.intro="Text in a different tab",
                             div("some text"))))                
)

# Define server logic 
server <- function(input, output, session) {

  ## IntroJS allow switching between tabs----
  observeEvent(input$intro_button, {
    introjs(session,
            events = list(onbeforechange = readCallback("switchTabs")))
  })

}

# Run the application 
shinyApp(ui = ui, server = server)

The app contains 2 tab panels, in Tab1 the action button “Launch introJS” should open a series of 3 modal popup windows. Step 1 contains a description of an element on tab1, step 2 shows text associated with an element on tab2 and finally step 3 links back to an element on tab 1 again. The app runs as described locally but when deployed to shinyapps.io the rintrojs modal windows will not load beyond datastep 2 and if the modal is then closed it cannot be reopened.

A deployed version of the app showing the failing rintrojs is available here: https://scotland.shinyapps.io/scotpho-bug-test/

There are no errors or any useful information relating this problem shown in the shinyapps.io logs. This is my session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS: /opt/R/3.5.1/lib64/R/lib/libRblas.so
LAPACK: /opt/R/3.5.1/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_GB.UTF-8      
 [2] LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8       
 [4] LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8   
 [6] LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8      
 [8] LC_NAME=C                 
 [9] LC_ADDRESS=C              
[10] LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8
[12] LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

other attached packages:
[1] rintrojs_0.2.2 shiny_1.3.2   

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1       packrat_0.5.0   
 [3] digest_0.6.19    later_0.8.0     
 [5] bitops_1.0-6     mime_0.6        
 [7] R6_2.4.0         xtable_1.8-4    
 [9] jsonlite_1.6     magrittr_1.5    
[11] rlang_0.4.0      promises_1.0.1  
[13] tools_3.5.1      RCurl_1.95-4.12 
[15] httpuv_1.5.1     yaml_2.2.0      
[17] rsconnect_0.8.13 compiler_3.5.1  
[19] askpass_1.1      htmltools_0.3.6 
[21] openssl_1.4    
victoe
  • 41
  • 3

0 Answers0