-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
46 lines (41 loc) · 1.4 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
library(shiny)
require(visNetwork)
require(igraph)
library(reshape2)
library(plotly)
### Prepare Data Input
# data: binding2, attributes (prop.attributes), categoryProp
attributes1 <- read.csv("data/attributes.csv", stringsAsFactors = F)
attributes <- attributes[-1]
binding2 <- read.csv("data/binding2.csv", stringsAsFactors = F)
binding2 <- binding2[-1]
country <- colnames(attributes)[3:length(attributes)]
category.Prop <- read.csv("data/category.Prop.csv", stringsAsFactors = F)
category.Prop <- category.Prop[-1]
Num <- read.csv("data/Number-of-recipes.csv", stringsAsFactors=FALSE)
Num <- Num[, 2:3]
shinyUI(
fluidPage(
# Application title
titlePanel("Food Corner"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
helpText("This app visualizes how each cuisine combines ingredients."),
helpText("Our dataset includes 50K recipes all over the world "),
selectizeInput('cuisine',
label = "Choose one cuisine of your preference:",
choices = country,
multiple = FALSE)
)
,
# Show a plot of the generated distribution
mainPanel(
fluidPage(
visNetworkOutput("network", height = "400px"),
helpText("Average Distribution of Food Categories in 1 Recipe of This Cuisine"),
textOutput("text1"),
plotlyOutput("category", height = "300px")
)
)
)))