-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
executable file
·40 lines (32 loc) · 1.52 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
## Gregory Janesch, last modified 2020-07-26
## Description: UI code for the Spotify Shiny app.
library(shinydashboard)
library(plotly)
library(DT)
### Info for the prediction tab ###################################################################
playlist_box = box(width=7,
HTML("<h3>Scatterplot of Track Principal Components</h3>"),
uiOutput("reference_playlist_name"),
uiOutput("target_playlist_name"),
plotlyOutput("tracks_plot", width="auto"),
HTML("<br><h3>Recommended Tracks</h3>"),
DTOutput("recommendations"))
pc_box = box(width=5,
HTML("<h3>Breakdown of Principal Components</h3>"),
plotOutput("pc_plot", width = "auto"),
uiOutput("explained_variance"))
###################################################################################################
# Define UI; use two of the playlists from the example script as defaults for the playlist inputs.
dashboardPage(
title="Spotify Cross-Playlist Predictions",
skin="green",
dashboardHeader(title = "Playlist Predictions"),
dashboardSidebar(
textInput("reference_id", "Reference Playlist ID", value="37i9dQZF1DWVx3vT1QCKCV"),
textInput("target_id", "Target Playlist ID", value="37i9dQZF1DZ06evO2wKKgo"),
actionButton("predict_button", "Make Recommendations"),
HTML("<br><br><br><br>"),
actionButton("about", "About This App")
),
dashboardBody(playlist_box, pc_box)
)