Shinyapp runing in Window/view Pane but not in external


#1

Hello ! I am a beginner in Shiny. My shiny app is correctly runing in Window/view Pane but not in in external (Firefox / Chrome). My Local browsers only show app title and selectInput default content. I am not able to use drop down menu and datatable not rendering.

Here is my piece of code :

library(dplyr)
library(shiny)
library(DT)
# reading data
communes_Cassini3 <- read.csv("designation_communes0001.csv")

 dataset <- sort(unique(communes_Cassini3$source))

# UI
ui <- fluidPage(
# App title ----
titlePanel("mon appli"),
sidebarLayout(
 # Input(s)
sidebarPanel(
  selectInput(inputId = "commune",  
              label = "commune",
              choices = dataset,
              selected = "")
   ),

    # datatable output
    mainPanel(
    DT::dataTableOutput(outputId = "table_de_donnees")
    )
  )
  )
  # Server
  server <- function(input, output) {

  # Create data table
  output$table_de_donnees <- DT::renderDataTable({
 fiche_commune <- communes_Cassini3 %>%
  filter(source == input$commune) %>%
  select(insee:designation_actuelle)
  DT::datatable(data = fiche_commune, 
              options = list(pageLength = 10), 
              rownames = FALSE)
 })

}

# Create a Shiny app object
shinyApp(ui = ui, server = server)

#2

Hi, is this a work computer? It sounds like javascript is disabled for your browsers.


#3

Hi ! Thank you for helping.
It s a personnal computer. Here’s a link to my shinyapp : https://infohhaaun.shinyapps.io/select_commune/ with the same issue.


#4

Interesting, and just to make sure, can you confirm that the designation_communes0001.csv file was uploaded as part of you publication process to shinyapps.io?


#5

designation_communes0001.csv file was uploaded as part of my publication process to shinyapps.io.
The app runs after 2 or 3 minutes.
designation_communes0001.csv includes 82709 obs. of 5 variables.


#6

Ok, I would start by creating a second csv file with the results of dataset so that R doesn’t have to do that every time the app is loaded


#7

Hi ! I move my data from csv to Rdata to update speed.
Very slow initial page-load on shiny can belong to :

      selectInput(inputId = "commune",  
          label = "commune",
          choices = dataset,
          selected = "")
     ),

Dataset contains 68917 factor’s levels

I moved my project to github if you want to tried it with my data . https://github.com/wilcar/communes_cassini


#8

Ok, I’d suggest trying out the profvis package to figure out where is the app spending the most time.