-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
105 lines (86 loc) · 3 KB
/
ui.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
header <- dashboardHeader(title = "Suicide Rates")
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem(text = "Global Overview",
tabName = "overview",
icon = icon("globe")),
menuItem(text = "Country Performance",
tabName = "countries",
icon = icon("flag")),
menuItem(text = "Dataset",
tabName = "dataset",
icon = icon("table"))
)
)
body <- dashboardBody(
shinyDashboardThemes(theme = "flat_red"),
tabItems(
# PAGE 1
tabItem(
tabName = "overview",
fluidPage(
h2(tags$b("Global Suicide Rates from 1995-2015"))),
fluidPage(
tabBox(width = 12,
title = tags$b("Suicide number and ratio by country"),
id = "tabset1", side = "right",
tabPanel(tags$b("Ratio"),
plotlyOutput("plot2")),
tabPanel(tags$b("Suicide number"),
plotlyOutput("plot1")))),
fluidPage(box(width = 6, plotlyOutput("plot3")),
box(width = 6, plotlyOutput("plot_gen")))),
# PAGE 2
tabItem(
tabName = "countries",
fluidPage(
h3(tags$b("Country Performance")),
h4("Population and trends of suicide rates in each country (1995-2015)")),
fluidPage(box(width = 8, plotlyOutput("plot4")),
box(width = 4,
height = 420,
solidHeader = F,
#background = "black",
selectInput(
inputId = "country_perf1",
label = h5(tags$b("Select country:")),
choices = unique(decade$country)),
radioButtons(
inputId = "multiple_choices",
label = h5(tags$b("Select numerical variables:")),
choices = colnames(single_country[c(3,4)]))
)),
fluidPage(
h4("Suicide ratio in different age-group and sexes")
),
fluidPage(box(width = 8, plotlyOutput("plot5")),
box(width = 4,
height = 420,
solidHeader = F,
#background = "black",
selectInput(
inputId = "country_perf2",
label = h5(tags$b("Select country:")),
choices = unique(decade$country)),
selectInput(
inputId = "country_perf3",
label = h5(tags$b("Select year:")),
choices = unique(decade$year)))
)
),
# PAGE 3
tabItem(
tabName = "dataset",
fluidPage(
h3(tags$b("Suicide Ratio from 1995-2015"))),
fluidPage(box(width = 12, plotlyOutput("plot_maps"))),
fluidPage(box(width = 12, dataTableOutput(outputId = "data")))
)
)
)
dashboardPage(
skin = "black",
header = header,
body = body,
sidebar = sidebar
)