-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
136 lines (128 loc) · 4.75 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
dashboardPage(
dashboardHeader(title = "Gun Violence Incidents"),
dashboardSidebar(
sidebarMenu(
menuItem("Gun Type Distribution", tabName = "partA"),
menuItem("Notes Word Cloud", tabName = "partB"),
menuItem("Gun Incidents PA Map",tabName = "partC"),
menuItem("Suspect & Victim Ages Distribution",tabName = "partD"),
menuItem("Gun Incidents Time Series",tabName = "partE"),
menuItem("Suspect & Victim Gender",tabName = "partF"),
menuItem("Gun Incidents US Map",tabName = "partG"),
menuItem("Number of Guns & Affected",tabName = "partH")
)
),
dashboardBody(
tabItems(
tabItem(tabName = "partA",
fluidRow(
box(
plotOutput(outputId = "gun_type_plot", height = 400)
),
box(
title = "Controls",
selectInput(inputId = "stateOpt",
label = "States in Graph:",
choices = state.name,
multiple = TRUE)
)
)
),
tabItem(tabName = "partB",
fluidRow(
box(
plotOutput(outputId = "text_cloud", height = 600)
),
box(
title = "Controls",
selectInput(inputId = "stateOptText",
label = "States in Word Cloud:",
choices = state.name,
multiple = TRUE),
sliderInput("maxNumWords", "Maximum Number of Words:",
1,200,100,20),
sliderInput("minFreq", "Minimum Frequency:",
1,100,10,1)
)
)
),
tabItem(tabName = "partC",
fluidRow(
box(
title = "Deadly Gun Incidents in Pennsylvania (March 2017 - March 2018)",
leafletOutput(outputId = "pennsylvania", height = 400,
width = 800),
height = 500,
width = 10
)
)
),
tabItem(tabName = "partD",
fluidRow(
box(
plotlyOutput(outputId = "age_comparison",
height = 500, width = 800),
height = 550,
width = 10
)
),
fluidRow(
box(
title = "Comparison of Age of Suspect and Age of Victim (March 2017 - March 2018)",
selectizeInput(inputId = "region",
label = "Choose Your Regions",
choices = levels(factor(age_data_region$Region)),
multiple = TRUE,
options = NULL),
sliderTextInput(inputId = "month",
label = "Select Month",
choices = c("March 2017", "April 2017", "May 2017",
"June 2017", "July 2017", "August 2017",
"September 2017", "October 2017",
"November 2017", "December 2017",
"January 2018", "February 2018",
"March 2018"))
)
)
),
tabItem(tabName = "partE",
fluidRow(
box(
dygraphOutput(outputId = "dygraph", height = "500px",
width = "700px"),
height = 550,
width = 10
)
)
),
tabItem(tabName = "partF",
fluidRow(
box(
billboarderOutput(outputId = "donut", height = "500px",
width = "500px")
)
)
),
tabItem(tabName = "partG",
fluidRow(
box(
plotlyOutput(outputId = "us_graph",
height = 500, width = 800),
height = 550,
width = 11
)
)
),
tabItem(tabName = "partH",
fluidRow(
box(
plotlyOutput(outputId = "num_guns",
height = 500, width = 800),
height = 550,
width = 11
)
)
)
)
)
)