added save_csv button
This commit is contained in:
parent
e9dfdbd67b
commit
6d891c2d02
@ -63,25 +63,42 @@ airplane_crashes$btwn_6PM_6AM <- if_else
|
||||
ui <- fluidPage(
|
||||
id = "main_content",
|
||||
navbarPage("Airplane crashes from 1908 to 2020",
|
||||
# tabPanel("General overview",
|
||||
# sidebarLayout(
|
||||
# sidebarPanel(
|
||||
# # wybór daty
|
||||
# dateRangeInput('dates',
|
||||
# 'Date range:',
|
||||
# min(airplane_crashes$Date),
|
||||
# max(airplane_crashes$Date)),
|
||||
# # wybor godziny
|
||||
# timeInput("time", "Time (local):", seconds = FALSE)
|
||||
# ),
|
||||
# mainPanel(
|
||||
# # wykresiki
|
||||
# plotlyOutput("weekdayCrashes"),
|
||||
# fixedRow(
|
||||
# column(3, plotlyOutput("hourCrashes")),
|
||||
# column(3, plotlyOutput("monthCrashes"))
|
||||
# )
|
||||
# )
|
||||
# )
|
||||
# ),
|
||||
tabPanel("General overview",
|
||||
sidebarLayout(
|
||||
sidebarPanel(
|
||||
# wybór daty
|
||||
dateRangeInput('dates',
|
||||
'Date range:',
|
||||
min(airplane_crashes$Date),
|
||||
max(airplane_crashes$Date)),
|
||||
# wybor godziny
|
||||
timeInput("time", "Time (local):", seconds = FALSE)
|
||||
),
|
||||
mainPanel(
|
||||
# wykresiki
|
||||
plotlyOutput("weekdayCrashes"),
|
||||
plotlyOutput("hourCrashes"),
|
||||
plotlyOutput("monthCrashes")
|
||||
)
|
||||
)
|
||||
),
|
||||
fixedRow(
|
||||
column(3,
|
||||
dateRangeInput('dates',
|
||||
'Date range:',
|
||||
min(airplane_crashes$Date),
|
||||
max(airplane_crashes$Date)),
|
||||
# wybor godziny
|
||||
timeInput("time", "Time (local):", seconds = FALSE)),
|
||||
column(6, plotlyOutput("weekdayCrashes"))
|
||||
),
|
||||
fixedRow(
|
||||
column(3, plotlyOutput("hourCrashes")),
|
||||
column(3, plotlyOutput("monthCrashes"))
|
||||
)),
|
||||
tabPanel("Streamgraph",
|
||||
mainPanel(
|
||||
streamgraphOutput("operatorCrashes")
|
||||
@ -100,10 +117,12 @@ ui <- fluidPage(
|
||||
dateRangeInput('dataDates',
|
||||
'Date range:',
|
||||
min(airplane_crashes$Date),
|
||||
max(airplane_crashes$Date))
|
||||
max(airplane_crashes$Date)),
|
||||
downloadButton('downloadData', 'Download')
|
||||
),
|
||||
mainPanel(
|
||||
DT::dataTableOutput('allData')
|
||||
|
||||
))
|
||||
)
|
||||
)
|
||||
@ -324,7 +343,15 @@ server <- function(input, output, session) {
|
||||
)
|
||||
})
|
||||
|
||||
# poprawic szerkosc wierszy
|
||||
output$downloadData <- downloadHandler(
|
||||
filename = function() {
|
||||
paste('airplane_crashes', '.csv', sep='')
|
||||
},
|
||||
content = function(file) {
|
||||
write.csv(airplane_crashes, file)
|
||||
}
|
||||
)
|
||||
|
||||
output$allData <- DT::renderDataTable({
|
||||
airplane_crashes %>%
|
||||
# filter(Year == input$dataDates) %>%
|
||||
|
Loading…
Reference in New Issue
Block a user