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(
|
ui <- fluidPage(
|
||||||
id = "main_content",
|
id = "main_content",
|
||||||
navbarPage("Airplane crashes from 1908 to 2020",
|
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",
|
tabPanel("General overview",
|
||||||
sidebarLayout(
|
fixedRow(
|
||||||
sidebarPanel(
|
column(3,
|
||||||
# wybór daty
|
dateRangeInput('dates',
|
||||||
dateRangeInput('dates',
|
'Date range:',
|
||||||
'Date range:',
|
min(airplane_crashes$Date),
|
||||||
min(airplane_crashes$Date),
|
max(airplane_crashes$Date)),
|
||||||
max(airplane_crashes$Date)),
|
# wybor godziny
|
||||||
# wybor godziny
|
timeInput("time", "Time (local):", seconds = FALSE)),
|
||||||
timeInput("time", "Time (local):", seconds = FALSE)
|
column(6, plotlyOutput("weekdayCrashes"))
|
||||||
),
|
),
|
||||||
mainPanel(
|
fixedRow(
|
||||||
# wykresiki
|
column(3, plotlyOutput("hourCrashes")),
|
||||||
plotlyOutput("weekdayCrashes"),
|
column(3, plotlyOutput("monthCrashes"))
|
||||||
plotlyOutput("hourCrashes"),
|
)),
|
||||||
plotlyOutput("monthCrashes")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
tabPanel("Streamgraph",
|
tabPanel("Streamgraph",
|
||||||
mainPanel(
|
mainPanel(
|
||||||
streamgraphOutput("operatorCrashes")
|
streamgraphOutput("operatorCrashes")
|
||||||
@ -100,10 +117,12 @@ ui <- fluidPage(
|
|||||||
dateRangeInput('dataDates',
|
dateRangeInput('dataDates',
|
||||||
'Date range:',
|
'Date range:',
|
||||||
min(airplane_crashes$Date),
|
min(airplane_crashes$Date),
|
||||||
max(airplane_crashes$Date))
|
max(airplane_crashes$Date)),
|
||||||
|
downloadButton('downloadData', 'Download')
|
||||||
),
|
),
|
||||||
mainPanel(
|
mainPanel(
|
||||||
DT::dataTableOutput('allData')
|
DT::dataTableOutput('allData')
|
||||||
|
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -323,8 +342,16 @@ server <- function(input, output, session) {
|
|||||||
originalData = TRUE
|
originalData = TRUE
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
# 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({
|
output$allData <- DT::renderDataTable({
|
||||||
airplane_crashes %>%
|
airplane_crashes %>%
|
||||||
# filter(Year == input$dataDates) %>%
|
# filter(Year == input$dataDates) %>%
|
||||||
|
Loading…
Reference in New Issue
Block a user