-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
130 lines (103 loc) · 2.79 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
library(shiny)
library(dplyr)
library(tidyr)
library(rgdal)
library(data.table)
library(googleway)
library(geosphere)
library(getopt)
library(jsonlite)
library(httr)
library(lubridate)
library(RCurl)
library(shinythemes)
source("./R/getCrime.R")
source("./R/getRoute.R")
source("./R/wrapper.R")
source('./R/pubFinder.R')
source('./R/hospitalData.R')
source('./server.R')
# Define API key
key <- 'AIzaSyD_maC35oOQZLKU_pqh-HTZiMESqUSwkJs'
set_key(key)
# Get stations
stations <- getStations()
# Define possible saftey choices
safety.choices <- data_frame(id = c('unsafe', 'safe', 'carefree'),
type = c('Come at me mate', 'Nah, play it safe', "Whatever I'm easy"))
ui <- fluidPage(
theme = shinytheme("united"),
fluidRow(
column(12, align="center",
tags$head(
tags$style(HTML("
@import url('https://fonts.googleapis.com/css?family=Lobster');
h1 {
font-family: 'Lobster', Arial, cursive;
font-size: 48;
font-weight: 300;
line-height: 1.1;
color: #08589e;
text-align: center;
}
p {
font-family: Roboto, sans-serif;
font-size:16pt;
font-weight:600;
color: #08589e;
text-align: center;
}
body {
background-color: #fef0d9;
}
"))
),
headerPanel("PubBrawl"),
br(),
br(),
fluidRow(
column(width = 4,
tags$div(
tags$p("How many stops?")
),
sliderInput("number_pints", "",
min = 2, max = 11,
value = 5)
),
column(width = 4,
tags$div(
tags$p("Do you want to get into a fight?")
),
selectizeInput('safety', '', safety.choices$type,
selected = safety.choices$type[2])
),
column(width= 4,
tags$div(
tags$p("Palaces or gutters?")
),
sliderInput("google_review", "",
min = 0, max = 5,
value = 3, step = 0.1)
)
),
# Text input box
selectizeInput('start', 'Pub crawl start location', stations$Name, selected = 'Camden Town Station'),
selectizeInput('end', 'Pub crawl end location', stations$Name, selected = 'Holborn Station'),
br(),
br(),
# Define submit buttom
actionButton('go', "Let's GO!"),
# Google map
br(),
br(),
google_mapOutput(outputId = "map", height = "600px", width="80%"),
# Hospital string
br(),
br(),
textOutput("hospital_str"),
br(),
br()
)
)
)
shinyApp(ui, server)