This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
72 lines (63 loc) · 1.33 KB
/
app.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
69
70
71
72
library(shiny)
library(readr)
library(dplyr)
library(lubridate)
library(ggplot2)
library(scales)
library(zoo)
library(r2d3)
options(
shiny.autoreload = TRUE,
shiny.reactlog = TRUE
)
source("./r/uncumulate.R")
source("./r/load_data.R")
total_cases <- d3Output("total_cases", height = "100%")
new_cases <- d3Output("new_cases", height = "100%")
total_deaths <- d3Output("total_deaths", height = "100%")
new_deaths <- d3Output("new_deaths", height = "100%")
summmary <- tableOutput("summary")
server <- function(input, output) {
output$total_cases <- renderD3({
r2d3(
data = cases,
script = "www/assets/totalCases.js",
d3_version = "5"
)
})
output$new_cases <- renderD3({
r2d3(
data = cases,
script = "www/assets/newCases.js",
d3_version = "5"
)
})
output$total_deaths <- renderD3({
r2d3(
data = cases,
script = "www/assets/totalDeaths.js",
d3_version = "5"
)
})
output$new_deaths <- renderD3({
r2d3(
data = cases,
script = "www/assets/newDeaths.js",
d3_version = "5"
)
})
output$summary <- renderTable({
cases_summary
})
}
shinyApp(
ui =
htmlTemplate(
"www/index.html",
total_cases = total_cases,
new_cases = new_cases,
total_deaths = total_deaths,
new_deaths = new_deaths
),
server
)