-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
98 lines (94 loc) · 3.27 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
## ui.R
library(shiny)
library(shinydashboard)
library(recommenderlab)
library(data.table)
library(ShinyRatingInput)
library(shinyjs)
source('functions/helpers.R')
genres = c(
"Action",
"Adventure",
"Animation",
"Children's",
"Comedy",
"Crime",
"Documentary",
"Drama",
"Fantasy",
"Film-Noir",
"Horror",
"Musical",
"Mystery",
"Romance",
"Sci-Fi",
"Thriller",
"War",
"Western"
)
# Display UI
shinyUI(dashboardPage(
skin = "blue",
dashboardHeader(title = "Movie Recommender"),
dashboardSidebar(sidebarMenu(
menuItem("Recommender by Genre", tabName = "system_i"),
menuItem("Recommender by Rating", tabName = "system_ii")
)),
dashboardBody(includeCSS("css/movies.css"),
tabItems(
tabItem(tabName = "system_i",
fluidRow(
box(
width = 12,
title = "Step 1: Select a genre to get recommendations",
status = "info",
solidHeader = TRUE,
collapsible = TRUE,
selectInput("genre", NULL,
genres)
)
),
fluidRow(
useShinyjs(),
box(
width = 12,
status = "info",
solidHeader = TRUE,
title = "Step 2: Discover movies you might like",
br(),
withBusyIndicatorUI(
actionButton("genre_btn", "Click here to get your recommendations", class = "btn-warning")
),
br(),
tableOutput("genre_results")
)
)),
tabItem(tabName = "system_ii",
fluidRow(
box(
width = 12,
title = "Step 1: Rate as many movies as possible (at least three)",
status = "info",
solidHeader = TRUE,
collapsible = TRUE,
div(class = "rateitems",
uiOutput('ratings'))
)
),
fluidRow(
useShinyjs(),
box(
width = 12,
status = "info",
solidHeader = TRUE,
title = "Step 2: Discover movies you might like",
br(),
withBusyIndicatorUI(
actionButton("btn", "Click here to get your recommendations", class = "btn-warning")
),
br(),
tableOutput("results")
)
))
))
))