-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
123 lines (109 loc) · 2.69 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
## ui.R
library(shiny)
library(shinydashboard)
library(recommenderlab)
library(data.table)
library(ShinyRatingInput)
library(shinyjs)
library(dplyr)
library(tidyr)
source('functions/helpers.R')
genre.tab = tabItem(
tabName = "genreTab",
h2("Recommendations by Genre"),
fluidRow(
# box(width = 12, title = "Step 1: Select movies that you like for the chosen Genre", status = "info", solidHeader = TRUE, collapsible = TRUE,
# div(class = "rateitems",
# uiOutput('genre')
box(
width = 12,
title = "Step 1: Select your favourite Genre:",
status = "info",
solidHeader = TRUE,
collapsible = TRUE,
selectInput(
"selectedGenre",
"Select any Genre:",
choices = c(
"Action",
"Adventure",
"Animation",
"Children's",
"Comedy",
"Crime",
"Documentary",
"Drama",
"Fantasy",
"Film-Noir",
"Horror",
"Musical",
"Mystery",
"Romance",
"Sci-Fi",
"Thriller",
"War",
"Western"
)
)
)
),
fluidRow(
useShinyjs(),
box(
width = 12,
status = "info",
solidHeader = TRUE,
title = "Step 2: Discover movies you might like",
br(),
# withBusyIndicatorUI(
# actionButton("btn1", "Click here to get your recommendations", class = "btn-warning")
# ),
# br(),
tableOutput("genreresults")
)
)
)
rating.tab = tabItem(
tabName = "ratingsTab",
h2("Recommendations by Ratings"),
fluidRow(
box(
width = 12,
title = "Step 1: Rate as many movies as possible",
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("btn2", "Click here to get your recommendations", class = "btn-warning")
),
br(),
tableOutput("ratingresults")
)
)
)
shinyUI(dashboardPage(
skin = "blue",
dashboardHeader(title = "Movie Recommendations", titleWidth = 280),
dashboardSidebar(width = 280,
sidebarMenu(
menuItem("By User Ratings", tabName = "ratingsTab", icon = icon("film")),
menuItem("By Genre", tabName = "genreTab", icon = icon("star"))
)),
dashboardBody(
includeCSS("css/movies.css"),
tabItems(rating.tab,
genre.tab),
)
))