-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
372 lines (349 loc) · 17.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(dplyr)
library(stringr)
library(png)
library(shinyjs)
library(DT)
library(visNetwork)
library(rintrojs)
library(shiny)
library(shinyWidgets)
library(readxl)
library(tidyverse)
library(shinydashboard)
library(shinythemes)
library(bslib)
library(DT)
library(htmlwidgets)
thematic::thematic_shiny(font = "auto")
source("carouselPanel.R")
## Setting the page theme ##
theme <- bs_theme(
version = version_default(),
bootswatch = "yeti",
bg = "#ffffff",
fg = "#054266",
primary = "#00548b",
secondary = "#0071BB",
base_font = font_google("Karla"),
heading_font = font_google("Karla"),
font_scale = 1
)
# Panel div for visualization
# override the currently broken definition in shinyLP version 1.1.0
panel_div <- function(class_type, content) {
div(class = sprintf("panel panel-%s", class_type),
div(class = "panel-body", content)
)
}
shinyUI(
navbarPage(
title = img(src="AR_logo.svg", height = "40px"), id = "navBar",
theme = theme,
collapsible = TRUE,
inverse = TRUE,
windowTitle = "Arkansas Education and Workforce Pathways",
position = "fixed-top",
#footer = includeHTML("./www/include_footer.html"),
header = tags$style(
".navbar-right {
float: right !important;
}",
"body {padding-top: 35px;}"),
tabPanel("HOME", value = "home",
shinyjs::useShinyjs(),
tags$head(tags$script(HTML('
var fakeClick = function(tabName) {
var dropdownList = document.getElementsByTagName("a");
for (var i = 0; i < dropdownList.length; i++) {
var link = dropdownList[i];
if(link.getAttribute("data-value") == tabName) {
link.click();
};
}
};
'))),
fluidRow(
style = "background-color:#347fc4; padding-bottom:10px;padding-top:10px; color:white;",
shiny::HTML("<center> <h1>Discover Your Arkansas Pathway</h1></center>")
),
# WHAT
fluidRow(
column(3),
column(6,
shiny::HTML("<br><br><center> <h2>What you'll find here</h2> </center><br>"),
shiny::HTML("<h5>An interactive tool to help you explore the actual paths Arkansas
residents have taken during their education and workforce training. With information about the
popularity of certain paths, employment outcomes, wage growth, and more, you can
build your own path based on what is meaningful to you.</h5>")
),
column(3)
),
fluidRow(
style = "height:50px;"),
# PAGE BREAK
tags$hr(),
# HOW
fluidRow(
column(3),
column(6,
shiny::HTML("<br><br><center> <h2>How it can help you</h2> </center><br>"),
shiny::HTML("<h5>With most things, the more you know, the better your decisions
will be. Arkansas Pathways empowers you to make better decisions
about your career and education by providing transparant information on workforce
training and education program outcomes.</h5>")
),
column(3)
),
fluidRow(
style = "height:50px;"),
# PAGE BREAK
tags$hr(),
# WHERE
fluidRow(
column(3),
column(6,
shiny::HTML("<br><br><center> <h2>Where it came from</h2> </center><br>"),
shiny::HTML("<h5>Our team analyzed the workforce and education pathways of
Arkansas residents over the past 8 years.</h5>")
),
column(3)
),
fluidRow(
style = "height:50px;"),
# PAGE BREAK
tags$hr(),
# HOW TO START
fluidRow(
column(3),
column(6,
shiny::HTML("<br><br><center> <h2>How to get started</h2> </center><br>"),
),
column(3)
),
fluidRow(
column(3),
column(2,
div(class="panel panel-default",
div(class="panel-body", width = "600px",
align = "center",
div(
tags$img(src = "one.svg",
width = "50px", height = "50px")
),
div(
h5(
"Pick a workforce training or education program
to start your path. You may use a program you are currently enrolled in,
a program you were previously enrolled in, or a program you're interested in exploring."
)
)
)
)
),
column(2,
div(class="panel panel-default",
div(class="panel-body", width = "600px",
align = "center",
div(
tags$img(src = "two.svg",
width = "50px", height = "50px")
),
div(
h5(
"Then from that program, review the set of next programs that people have moved
into during their careers. Review information about these choices and select your next step."
)
)
)
)
),
column(2,
div(class="panel panel-default",
div(class="panel-body", width = "600px",
align = "center",
div(
tags$img(src = "three.svg",
width = "50px", height = "50px")),
div(h5(
"Plan up to five steps out in your pathway. When you're ready, you may save or print out your personalized report."
)
)
)
)
),
column(3)
),
fluidRow(
style = "height:50px;"),
# PAGE BREAK
tags$hr(),
# AFTERWARD
fluidRow(
column(3),
column(6,
shiny::HTML("<br><br><center> <h2>How does it fit in the big picture?</h2> </center><br>"),
shiny::HTML("<h5>Building a career path is just one part of effective career
planning and development. You should also establish a career plan
to outline <i>how</i> you will achieve your professional goals.</h5>")
),
column(3)
),
fluidRow(
style = "height:50px;"),
# PAGE BREAK
tags$hr(),
fluidRow(
shiny::HTML("<br><br><center> <h2>Ready to Get Started?</h2> </center>
<br>"
)
),
fluidRow(
column(3),
column(6,
tags$div(align = "center",
tags$a("Start",
onclick="fakeClick('careerPF')",
class="btn btn-primary btn-lg")
)
),
column(3)
),
fluidRow(style = "height:10px;"
)
), # Closes the first tabPanel called "Home"
tabPanel("ARKANSAS PATHWAYS", value = "careerPF",
fluidRow(
style = "padding-top:20px;"
),
sidebarLayout(
sidebarPanel(width = 3,
introjsUI(),
tags$div(
actionButton("help", "Take a Quick Tour"),
style = "height:50px;"
),
useShinyjs(),
tags$div(
style = "height:50px;",
introBox(
tags$div(
style = "height:75px;",
actionLink("settings", "Settings",
icon = icon("sliders", class = "fa-2x"))),
data.step = 6,
data.intro = "Settings is where you can set options that affect the graph."
),
# radioButtons("selectData",
# label = "How many years of data do you want to include?",
# choices = c("30 Years",
# "15 Years"),
# inline = TRUE,
# width = "100%"
# ),
selectizeInput("changeAvatar", "Change Icon:",
choices = c(
# "Traveler" = "traveler", # not compatible with new FA
"Map Marker" = "map-marker",
"Rocket" = "rocket",
# "Paper Plane" = "paper-plane", # not compatible with new FA
"Leaf" = "leaf"),
selected = "rocket"
),
textInput("userName", "Add your name:", value = ""),
tags$div(
style = "height:50px;",
uiOutput("printInput1"),
uiOutput("printInput2"),
uiOutput("printInput3"),
uiOutput("printInput4"),
uiOutput("printInput5")
)
)
), # Closes sidebarPanel
mainPanel( width = 8,
fluidRow(
tags$style(type="text/css",
".shiny-output-error { visibility: hidden; }",
".shiny-output-error:before { visibility: hidden; }"
),
introBox(
panel_div(class_type = "default",
content = tags$div(
uiOutput("displayName"),
visNetwork::visNetworkOutput("visTest", height = "200px")
)
),
data.step = 4,
data.intro = "Your selections will be displayed here in a graph."
)
),
fluidRow(
div(class="panel panel-default",
div(class="panel-body",
width = "600px",
tags$div(class = "wrap",
div(class = "left",
style="display: inline-block;vertical-align:top; width: 150px;",
uiOutput("stepNo")
),
div(class = "right",
style="display: inline-block;vertical-align:top; width: 150px;",
introBox(checkboxInput('returnpdf', 'Save as PDF?', FALSE),
data.step = 5, data.intro = "Stay on track with your plans by downloading your path."
),
uiOutput("download")
),
div(class = "center",
style="display: inline-block;vertical-align:top; width: 150px;",
introBox(
actionButton("goBack",
label = "Back",
icon = icon("arrow-circle-left", class = "fa-2x"),
width= "100px", height= "40px"),
data.step = 3,
data.intro = "Go back a step to edit your selection anytime."
)
),
# div(style="display: inline-block;vertical-align:top; width: 150px;",
# uiOutput("clearBtns")
# ),
# actionButton("resetBtn", "Reset All", icon = icon("refresh", class = "fa-2x")),
div(class = "center",
style="display: inline-block;vertical-align:top; width: 150px;",
introBox(
actionButton("btn1",
label = "Add",
icon = icon("arrow-circle-right", class = "fa-2x"),
width= "100px", height= "40px"),
data.step = 2,
data.intro = "Confirm your selection by clicking here."
)
)
),
selectizeInput("item_name",
label = "",
choices = NULL,
selected = NULL,
width = "100%"
),
div(
introBox(
uiOutput("btns"),
data.step = 1,
data.intro = "Start by selecting your first choice from our list of Arkansas Postsecondary and Workforce Training programs."
)
)
)
),
plotOutput("myplot")
)
) # Closes the mainPanel
) # Closes the sidebarLayout
) # Closes the second tabPanel called "Career PathFinder"
)
)