-
Notifications
You must be signed in to change notification settings - Fork 9
/
ui.R
181 lines (154 loc) · 12.6 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
shinyUI(bootstrapPage(useShinyjs(),
tagList(
tags$head(
tags$link(rel="stylesheet", type="text/css",href="style.css"),
tags$script(type="text/javascript", src = "busy.js"),
tags$script(src = "message-handler.js"),
includeScript("google-analytics.js")
)
),
dashboardPage(skin = 'yellow',
title = "HomebrewR",
dashboardHeader(title = HTML(paste(icon('beer'),'HomebrewR'))),
dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "tabs",
menuItem("Style", tabName = "Style", icon = icon("angle-right")),
menuItem("Character", tabName = "Character", icon = icon("angle-right")),
menuItem("Ingredients", icon = icon("angle-right"), tabName = "Ingredients")
),
# hr(),
# fluidRow(
checkboxGroupInput('chk_type',label = 'Brew Type',
selected = 'all-grain',
choices = c('all-grain',
'extract',
'other',
'partial mash')),
# fluidRow(hr()),
# fluidRow(column(width=12,
hr(),
div(class='info',
p('Recipes by',a('beerrecipes.org',href='http://beerrecipes.org')),
# p('Developed by',a('@davesteps',href='https://twitter.com/davesteps')),
# a(icon('twitter fa-2x'),href='https://twitter.com/davesteps'),
p(
HTML("<div style='float:center'>
<a href='https://twitter.com/share'
class='twitter-share-button'
align='middle'
data-url='www.davesteps.com/homebrewR/'
data-text='created by @davesteps using #rstats and #shiny: davesteps.com/homebrewR/'
data-size='large'>Tweet
</a>
<script>!function(d,s,id){
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+'://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js,fjs);
}
}(document, 'script', 'twitter-wjs');
</script>
</div>")),
p(a(icon('github fa-2x'),href='https://github.com/davesteps/homebrewR',target='_blank'))
)
#
# # fluidRow(
# div(class='user',
# hr(),
# textOutput('username')
# )
# # )
),
dashboardBody(#div(tags$head(includeCSS("styles.css")),
tabItems(
tabItem("Style",
box(width=3,status = 'primary',
selectInput('slt_styles',
label = h3('Choose beer styles to compare:'),
choices = styles,
selected=c('American Pale Ale','Imperial IPA','Weizenbock',
'Weizen/Weissbier','Baltic Porter'),
multiple = T),
uiOutput('style_config')
),
tabBox(width=9,id = 'style_main',
# tabsetPanel(type = 'pills',
tabPanel('Bitterness&Colour',
h5("This plot shows the bitterness and colour 'signature' of each beer style"),
plotOutput('IBUSRMplot',height = 600,click = "plot1_click"
),
uiOutput('points')
),
tabPanel('Grains',
h5('% of recipes containing each grain type'),
plotOutput('maltPlot',height = 650)),
tabPanel('Hops',
h5('% of recipes containing each hop type'),
plotOutput('hopsPlot',height = 650)),
tabPanel('%ABV',
h5('Distribution of %abv values'),
plotOutput('ABVplot')),
tabPanel('Gravity',
h5('Original and final Specific Gravity'),
plotOutput('GravityPlot',height = 600)),
tabPanel('%ABV~OG',
h5('ABV ~ Orignial Gravity'),
plotOutput('OGplot',height = 600)),
tabPanel('Bitterness',
h5('IBU Bitterness values by style'),
plotOutput('IBUplot')),
tabPanel('Colour',
h5('SRM colour values by beer style'),
plotOutput('SRMplot',height = 600)),
tabPanel('Summary',
tableOutput('summaryTble')),
tabPanel('3d',
plotlyOutput('d3'))
)
),
tabItem("Character",
box(width=3,
sliderInput(inputId = "sld_ABV",min = 2,
step = 0.1,max = 20,value = 4,
label = '%Alcohol by Volume'),
sliderInput(inputId = "sld_SRM",min = 0,
step = 0.5,max = 110,value = 10,
label = 'Colour (SRM)'),
sliderInput(inputId = "sld_IBU",min = 0,
step = 0.5,max = 280,value = 100,
label = 'Bitterness (IBU)')),
box(width=9,
plotOutput('ABVdensplot',height = 300),
uiOutput('nearest')#,
# tableOutput('summaryTble2')
)
),
tabItem("Ingredients",
box(
selectInput('slt_malts',
label = 'Malt/Grain/Extract',
choices = malts,multiple = T),
selectInput('slt_hops',
label = 'Hops',
choices = hops,multiple = T)
),
box(h5('Number of recipes containing all specified ingredients'),
plotOutput("ingPlot")#)#,
)
)
)
)
),
div(class = "busy",
h4("working..."),
h2(HTML('<i class="fa fa-cog fa-spin"></i>'))#,
# singleton(
# tags$head(tags$script(src = "message-handler.js"))
# )
)
)
)