-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserver.R
68 lines (55 loc) · 2.45 KB
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
require('shiny', quietly = TRUE, warn.conflicts = FALSE)
require('lubridate', quietly = TRUE, warn.conflicts = FALSE)
function(input, output) {
output$plot.all.earthquakes.mag.in.timeline <- renderPlot({
plot.earthquake.mag.in.timeline(earthquakes)
}, width = 960, height = 540)
output$plot.all.earthquakes.mag.vs.datetime <- renderPlot({
plot.earthquake.mag.vs.datetime(earthquakes)
}, width = 960, height = 540)
output$plot.gorkha.earthquake.mag.in.timeline <- renderPlot({
plot.earthquake.mag.in.timeline(earthquakes.from.2015.4.25)
}, width = 960, height = 540)
output$plot.gorkha.earthquakes.mag.vs.datetime <- renderPlot({
plot.earthquake.mag.vs.datetime(earthquakes.from.2015.4.25)
}, width = 960, height = 540)
output$plot.inter.earthquake.time.from.2015.4.25.to.2015.5.12 <- renderPlot({
plot.inter.earthquake.time.from.2015.4.25.to.2015.5.12()
}, width = 640, height = 360)
output$plot.inter.earthquake.time.from.2015.5.13 <- renderPlot({
plot.inter.earthquake.time.from.2015.5.13()
}, width = 640, height = 360)
# output$plot.gorkha.quakes.quakes.on.map <- renderPlot({
# plot.gorkha.quakes.quakes.on.map()
# }, width = 640, height = 360)
output$leaflet.plot.gorkha.quakes.quakes.on.map <-
renderLeaflet(leaflet.plot.gorkha.quakes.quakes.on.map())
animate.map.day.slider.data <- reactive({
ifelse(is.integer(input$animate.map.day.slider),
input$animate.map.day.slider,
0)
})
output$animate.map.date.to <- renderText({
(lubridate::ymd("2015-04-25", tz = "Asia/Kathmandu") +
lubridate::days(animate.map.day.slider.data())) %>%
as.character()
})
output$ui.animate.map.day.slider <- renderUI({
sliderInput(inputId = "animate.map.day.slider",
label = "Days: ",
min = 0, max = difftime(time1 = Sys.Date() %>%
as.POSIXct(),
time2 = lubridate::ymd("2015-04-25"),
units = "days") %>%
ceiling() %>%
as.integer(),
value = 0, step = 1,
animate = animationOptions(interval = 500, loop = TRUE))
})
output$animate.map.plot <- renderPlot({
(lubridate::ymd("2015-04-25", tz = "Asia/Kathmandu") +
lubridate::days(animate.map.day.slider.data()) +
lubridate::hms("23:59:59")) %>%
plot.gorkha.quakes.to.date()
})
}