This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
80 lines (58 loc) · 2.18 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
library(shiny)
library(shinyWidgets)
library(leaflet)
library(leaflet.extras)
library(jsonlite)
library(tidyverse)
# Data Handling
Yelp_SLO <- as.data.frame(fromJSON("data/businesses_SLO.json")) %>%
filter(!businesses.is_closed)
categories <- Yelp_SLO %>%
select(businesses.id, businesses.categories) %>%
unnest() %>%
select(title) %>%
rbind("All") %>%
unique() %>%
arrange(title)
max_reviews <- Yelp_SLO %>% select(businesses.review_count) %>% max()
# UI
navbarPage("Yelp Leaflet App",
# Map Panel for Map Stuff
tabPanel("Map",
tags$head(tags$style(HTML('#legend {background-color: rgba(255, 255, 255, 0.5);}'))),
# display general map
leafletOutput("map", height = 800),
absolutePanel(id="legend", top = 100, right = 50,
# select category
selectizeInput("category", "Search By Category", categories, selected = "All", multiple = FALSE, options = NULL),
# slide for price range
sliderTextInput("price","Select Price" ,
choices = c("0", "$", "$$", "$$$", "$$$$"),
animate = FALSE, grid = FALSE,
hide_min_max = FALSE, from_fixed = FALSE,
to_fixed = FALSE, from_min = NULL, from_max = NULL, to_min = NULL,
to_max = NULL, force_edges = FALSE, width = NULL, pre = NULL,
post = NULL, dragRange = TRUE),
# range of review counts
sliderInput("review_counts", "Review Counts",
min = 1, max = max_reviews,
value = c(1, max_reviews)),
# range of review counts
sliderInput("review_number", "Review Score",
min = 1, max = 5,
value = c(1, max_reviews)),
# checkbox for clustering
checkboxInput("cluster", "Enable Clustering", FALSE),
#checkbox for heatmap
checkboxInput("heatmap", "Enable Heat Map", FALSE)
)
),
# An Overview of Our Data
tabPanel("Data",
dataTableOutput("table")
),
# About Page
tabPanel("About",
uiOutput("about")
)
)