Hej everyone,
My apps are deployed on shinyapps.io.
The upload works just fine in IE, but in Opera & Firefox there is exactly the same issue that @kvothe described. Here´s a repex of a test app.
library(shiny)
library(dygraphs)
ui <- fluidPage(
titlePanel("Stats Test"),
tabsetPanel(
tabPanel("Upload File",
titlePanel("Uploading Files"),sidebarLayout(
sidebarPanel(
fileInput('mfiles', 'Choose many Files',
accept=c('text/csv',
'text/comma-separated-values,text/plain',
'.csv', ".s*", ".l*", ".m*", '*,*'),
multiple = TRUE),
selectInput('sub', 'File', ""),
selectInput('col', 'Subbasin', ""),
checkboxInput('header', label = 'Header?', value = 0),
sliderInput('skip', label = 'Skip rows', value = 3, min = 0, max = 100)),
mainPanel(fluidRow(column(12, dygraphOutput(outputId = "dymany", height = "300px")),
column(12, dygraphOutput(outputId = "dyselected", height = "300px"))
))))))
server <- function(input, output, session) {
indat<-reactive({
v <- lapply(input$mfiles$datapath,function(mf){
try(fread(mf, skip = input$skip, header = input$header))
})
names(v)<-input$mfiles$name
updateSelectInput(session, inputId = 'sub', label = 'File',
choices = names(v), selected = names(v)[NCOL(v)])
return(v)
})
sel<-reactive({
req(indat())
#sel<-reactiveValues(input$col)
sel<-indat()[input$sub] %>% as.data.frame(., stringsAsFactors = F)
names(sel)<-(c((rep_len(1:NCOL(sel), length.out = NCOL(sel)-1)
%>% as.character), 'avr.'))
updateSelectInput(session, inputId = 'col', label = 'Subbasin',
choices = names(sel), selected = names(sel[NCOL(sel)]))
return(sel)
})
output$sel.table <-renderTable(
sel() [, input$col]
)
output$dymany<-renderDygraph({
req(indat())
validate(
need(input$mfiles$datapath != "", "Please Upload Time Series"))
indat() %>% data.frame() %>% dygraph(., main = 'Output of multiple Files') %>%
dySeries(colnames(.)) %>% dyLegend(width = 400) %>%
dyOptions(stackedGraph = F, fillGraph = F, fillAlpha = 0.4, logscale = T) %>%
dyRangeSelector(height = 40) %>%
dyHighlight(highlightCircleSize = 5,
highlightSeriesBackgroundAlpha = 0.3,
hideOnMouseOut = F) %>% dyUnzoom() -> d1
d1$x$css = "
.dygraph-title {color: navy; font-weight: bold; }
.dygraph-legend > span {display:none;}
.dygraph-legend > span.highlight { display: inline; }
"
d1})
output$dyselected<-renderDygraph({
req(indat())
validate(
need(input$mfiles$datapath != "", "Please Upload Time Series"))
sel() %>% as.data.frame() %>% dplyr::select(input$col) %>%
dygraph(., main = paste0('Output of ', input$sub)) %>%
dySeries(name = input$col, color = "red", label=paste0('Basin ', input$col)) %>%
dyLegend(width = 400) %>%
dyOptions(stackedGraph = F, fillGraph = T, fillAlpha = 0.4, logscale = F) %>%
dyRangeSelector(height = 40) %>%
dyHighlight(highlightCircleSize = 5,
highlightSeriesBackgroundAlpha = 0.3,
hideOnMouseOut = F) %>%
dyUnzoom() -> d2
d2$x$css = "
.dygraph-title {color: navy; font-weight: bold; }
.dygraph-legend > span {display:none;}
.dygraph-legend > span.highlight { display: inline; }
"
d2})
}
# Run the application
shinyApp(ui = ui, server = server)
#>
#> Listening on http://127.0.0.1:5326
Created on 2019-07-23 by the reprex package (v0.3.0)