forked from danmalter/Movielense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
105 lines (92 loc) · 5.89 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
## ui.R
library(shiny)
library(shinydashboard)
library(proxy)
library(recommenderlab)
library(reshape2)
library(plyr)
library(dplyr)
library(DT)
library(RCurl)
movies <- read.csv("movies.csv", header = TRUE, stringsAsFactors=FALSE)
movies <- movies[with(movies, order(title)), ]
ratings <- read.csv("ratings100k.csv", header = TRUE)
shinyUI(dashboardPage(skin="blue",
dashboardHeader(title = "Movie Recommenders"),
dashboardSidebar(
sidebarMenu(
menuItem("Movies", tabName = "movies", icon = icon("star-o")),
menuItem("About", tabName = "about", icon = icon("question-circle")),
menuItem("Source code", icon = icon("file-code-o"),
href = "https://github.com/danmalter/Movielense"),
menuItem(
list(
selectInput("select", label = h5("Select 3 Movies That You Like"),
choices = as.character(movies$title[1:length(unique(movies$movieId))]),
selectize = FALSE,
selected = "Shawshank Redemption, The (1994)"),
selectInput("select2", label = NA,
choices = as.character(movies$title[1:length(unique(movies$movieId))]),
selectize = FALSE,
selected = "Forrest Gump (1994)"),
selectInput("select3", label = NA,
choices = as.character(movies$title[1:length(unique(movies$movieId))]),
selectize = FALSE,
selected = "Silence of the Lambs, The (1991)"),
submitButton("Submit")
)
)
# menuItem(
# checkboxGroupInput("genre", label = h5("Genre of Recommendations:"),
# c("Action", "Adventure", "Animation", "Childrens",
# "Comedy", "Crime", "Documentary", "Drama",
# "Fantasy", "Film-Noir", "Horror", "Musical",
# "Mystery", "Romance", "Sci-Fi", "Thriller",
# "War", "Western"),
# selected = c("Action", "Adventure", "Comedy", "Crime",
# "Documentary", "Drama", "Romance", "Thriller"),
# inline = FALSE))
)
),
dashboardBody(
tags$head(
tags$style(type="text/css", "select { max-width: 360px; }"),
tags$style(type="text/css", ".span4 { max-width: 360px; }"),
tags$style(type="text/css", ".well { max-width: 360px; }")
),
tabItems(
tabItem(tabName = "about",
h2("About this App"),
HTML('<br/>'),
fluidRow(
box(title = "Author: Danny Malter", background = "black", width=7, collapsible = TRUE,
helpText(p(strong("This application a movie reccomnder using the movielense dataset."))),
helpText(p("Please contact",
a(href ="https://twitter.com/danmalter", "Danny on twitter",target = "_blank"),
" or at my",
a(href ="http://danmalter.github.io/", "personal page", target = "_blank"),
", for more information, to suggest improvements or report errors.")),
helpText(p("All code and data is available at ",
a(href ="https://github.com/danmalter/", "my GitHub page",target = "_blank"),
"or click the 'source code' link on the sidebar on the left."
))
)
)
),
tabItem(tabName = "movies",
fluidRow(
box(
width = 6, status = "info", solidHead = TRUE,
title = "Other Movies You Might Like",
tableOutput("table")),
valueBoxOutput("tableRatings1"),
valueBoxOutput("tableRatings2"),
valueBoxOutput("tableRatings3"),
HTML('<br/>'),
box(DT::dataTableOutput("myTable"), title = "Table of All Movies", width=12, collapsible = TRUE)
)
)
)
)
)
)