-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
193 lines (187 loc) · 10.2 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
##
## Application: NFL Team and QB Performance in the Super Bowl Era
## Author: Joseph T. Gamber
## Course: CMPINF 2130: The Art of Data Visualization
## Submitted for Final Project Consideration
######
library(shiny)
shinyUI(
navbarPage("NFL Performanace Visualization",
tabPanel("Home",
includeMarkdown('welcome_page.md')),
tabPanel("Teams by Season",
sidebarLayout(
sidebarPanel(
selectInput('panel1_season',
"Select Season of Interest",
choices = nfl_seasons,
selected = tail(nfl_seasons, 1)),
selectInput('panel1_team',
"Select Team of Interest",
choices = nfl_teams,
selected = nfl_teams[1]),
h3("Quarterback(s)"),
htmlOutput('panel1_qbs'),
h3("Team Record"),
h4("Overall:"),
textOutput('panel1_record'),
h4("Home:"),
textOutput('panel1_record_home'),
h4("Away:"),
textOutput('panel1_record_away'),
h4("As the Favorite:"),
textOutput('panel1_record_fav'),
h4("As the Underdog:"),
textOutput('panel1_record_dog'),
h4("With Higher-Rated QB:"),
textOutput('panel1_record_higher'),
h4("With Lower-Rated QB:"),
textOutput('panel1_record_lower'),
),
mainPanel(
plotlyOutput('panel1_team_trend', height = "500px"),
radioButtons('panel1_elo_type',
label = "Select Base Elo Rating or QB-Adjusted Elo Rating",
choices = c("Base Elo" = 'elo',
"QB-Adjusted Elo" = 'qbelo'),
inline = TRUE),
checkboxGroupInput('panel1_rsp',
"Choose Timeframe:",
choices = c("Regular Season" = 'reg_season',
"Playoffs" = 'playoff'),
selected = 'reg_season',
inline = TRUE),
includeMarkdown('panel1_description.md')
)
)),
tabPanel("QBs by Season",
sidebarLayout(
sidebarPanel(
selectInput('panel2_season',
"Select Season of Interest",
choices = nfl_seasons,
selected = tail(nfl_seasons, 1)),
selectInput('panel2_qb',
"Select QB of Interest",
choices = list_qb,
selected = list_qb[1]),
h3("Team(s) Played For:"),
textOutput('panel2_teamsplayedfor'),
h3("QB Record"),
h4("Overall:"),
textOutput('panel2_qb_record'),
h4("Home:"),
textOutput('panel2_qb_record_home'),
h4("Away"),
textOutput('panel2_qb_record_away'),
h4("With Team Favored:"),
textOutput('panel2_qb_record_fav'),
h4("With Team as Underdog:"),
textOutput('panel2_qb_record_dog'),
h4("As Higher Rated QB:"),
textOutput('panel2_qb_record_higher'),
h4("As Lower Rated QB:"),
textOutput('panel2_qb_record_lower')
),
mainPanel(
plotlyOutput('panel2_qb_season', height = "500px"),
checkboxGroupInput('panel2_rsp',
"Choose Timeframe:",
choices = c("Regular Season" = 'reg_season',
"Playoffs" = 'playoff'),
selected = 'reg_season',
inline = TRUE),
includeMarkdown('panel2_description.md')
)
)),
tabPanel("Teams All-Time",
sidebarLayout(
sidebarPanel(
selectInput('panel3_team',
"Select Team of Interest",
choices = nfl_teams,
selected = nfl_teams[1]),
h3("Career Record"),
h4("Overall:"),
textOutput('panel3_record'),
h4("At Home:"),
textOutput('panel3_record_home'),
h4("Away"),
textOutput('panel3_record_away'),
h4("With Team Favored:"),
textOutput('panel3_record_fav'),
h4("With Team as Underdog:"),
textOutput('panel3_record_dog'),
h4("All-Time Elo Rating Range"),
plotOutput('panel3_team_elo_mini')
),
mainPanel(
plotlyOutput('panel3_team_alltime'),
radioButtons('panel3_stat',
label = "Select the Statistic to Visualize",
choices = c("Team Base Elo Rating" = 'elo_post',
"QB-Adjusted Team Elo Rating" = 'qbelo_post',
"Team Win Probability" = 'elo_prob',
"QB-Adjusted Win Probability" = 'qbelo_prob',
"Team Score" = 'score'),
selected = 'elo_post',
inline = TRUE),
checkboxGroupInput('panel3_rsp',
"Choose Timeframe:",
choices = c("Regular Season" = 'reg_season',
"Playoffs" = 'playoff'),
selected = 'reg_season',
inline = TRUE),
includeMarkdown('panel3_description.md')
)
)),
tabPanel("QBs All-Time",
sidebarLayout(
sidebarPanel(
selectInput('panel4_qb',
"Select QB of Interest",
choices = list_qb,
selected = 'Bart Starr'),
h4("Teams Appeared For"),
textOutput('panel4_teams'),
h3("Career Record"),
h4("Overall:"),
textOutput('panel4_record'),
h4("At Home:"),
textOutput('panel4_record_home'),
h4("Away"),
textOutput('panel4_record_away'),
h4("With Team Favored:"),
textOutput('panel4_record_fav'),
h4("With Team as Underdog:"),
textOutput('panel4_record_dog'),
h4("As Higher Rated QB:"),
textOutput('panel4_record_higher'),
h4("As Lower Rated QB:"),
textOutput('panel4_record_lower'),
h4("Career Elo Rating Range"),
plotOutput('panel4_qb_elo_mini')
),
mainPanel(
plotlyOutput('panel4_qb_career'),
radioButtons('panel4_stat',
label = "Select the Statistic to Visualize",
choices = c("QB Elo Rating" = 'qb_value_post',
"Team Base Elo Rating" = 'elo_post',
"QB-Adjusted Team Elo Rating" = 'qbelo_post',
"Team Win Probability" = 'elo_prob',
"QB-Adjusted Win Probability" = 'qbelo_prob',
"Team Score" = 'score'),
selected = 'qb_value_post',
inline = TRUE),
checkboxGroupInput('panel4_rsp',
"Choose Timeframe:",
choices = c("Regular Season" = 'reg_season',
"Playoffs" = 'playoff'),
selected = 'reg_season',
inline = TRUE),
includeMarkdown('panel4_description.md')
)
))
)
)