-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
244 lines (213 loc) · 14.8 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
require(shiny)
require(shinydashboard)
require(raster)
require(ape)
require(spdep)
require(leaflet)
require(RColorBrewer)
r_colors <- rgb(t(col2rgb(colors()) / 255))
names(r_colors) <- colors()
shinyUI(dashboardPage( skin="black",
dashboardHeader(title = "D-place visualizer"),
dashboardSidebar(
sidebarMenu(disable=TRUE,
menuItem("Traits as binary", tabName = "leaflet", icon = icon("book"))
)
),
dashboardBody(
mainPanel(tags$h4("This app works best in full screen."),
tags$h4("Click on points to view language names and trait lists.")),
tabItems(
tabItem(tabName ="leaflet",
fluidRow(
tags$style(type = "text/css", "html, body {width:100%;height:100%}"),
column(6,box(leafletOutput("mymap_1", width="100%", height=300),
#plotOutput("Traits_on_trees_1", width = "100%", height = "300px"),
#plotOutput("trait_binary_bar_1", width = "100%", height = "300px")
width=12)),
column(6,box(leafletOutput("mymap_2", width="100%", height=300),
#plotOutput("Traits_on_trees_2", width = "100%", height = "300px"),
#plotOutput("trait_binary_bar_2", width = "100%", height = "300px")
width=12))
),
fluidRow(
tags$style(type = "text/css", "html, body {width:100%;height:150%}"),
column(6, column(4, selectInput("trait_choose_1", label=h3("Choose a trait"), choices = list(
"no points" = 48,
" " = 49,
"Subsistence on Hunting and Gathering" = 19,
"Subsistence on Fish" = 20,
"Subsistence on Husbandry" = 21,
"Subsistence Agriculture" = 22,
"Marriage Exchange" = 23,
"Extended Family" = 24,
"Polygyny Common" = 25,
"Patrilocal" = 26,
"Exogamy" = 27,
"Kin Terms" = 28,
"Intensity of Agriculture" = 29,
"Cereals" = 30,
"Mobility" = 31,
"Community Size" = 32,
"Political Complexity" = 33,
"High Moral Gods" = 34,
"Domesticates" = 35,
"Patrilineal Descent" = 36,
"Matrilineal Descent" = 37,
"Cognatic Descent" = 38,
"Female Biased Pottery" = 39,
"Male Biased House Construction" = 40,
"Egalitarian" = 41,
"Complex Stratification" = 42,
"Slavery" = 43,
"Land Inheritance" = 44,
"Movable Property inheritance" =45,
"House Shape" = 46
), selected=49),
selectInput("raster_layer_1", label=h3("Choose an overlay"), choices = list(
"no layer" = 1,
" " = 2,
"Biomes" = 3 ,
"EcoRegions" = 4 ,
"Olson Ecoregions" = 5,
"Amphibian diversity" = 6,
"Bird diversity" = 7 ,
"Mammal Diversiy" = 8 ,
"Vascular Plant diversity from Kreft and Jetz 2007"= 9,
"Potential domesticable speciess" = 10,
"Elevation" = 11,
"Slope" = 12,
"Glaciation" = 13 ,
"Sand type" = 14,
"Local Heterogeneity" = 15 ,
"Mean NPP" = 16,
"Mean Precipitation" = 17 ,
"Mean P_1950" = 18 ,
"Mean T" = 19,
"Mean T_1950" = 20 ,
"Variance NPP" = 21,
"Variance precipitation" = 22,
"Variance precipitation 1950" = 23,
"Variance temperature" = 24 ,
"Variance temperature 1950" = 25 ,
"Temperature Harshness" = 26 ,
"Xero Harshness" = 27 ,
"Predicability NPP" = 28 ,
"Predicability precipitation" = 29,
"Predicability precipitation 1950" = 30,
"Predicability temperature" = 31,
"Predicability temperature 1950" = 32,
"Constancy NPP" = 33,
"Constancy precipitation" =34 ,
"Constancy precipitation 1950" =35 ,
"Constancy temperature" = 36,
"Constancy temperature 1950" = 37 ,
"Contingency NPP" = 38,
"Contingency precipitation" = 39 ,
"Contingency precipitation 1950" = 40,
"Contingency temperature" = 41,
"Contingency temperature 1950" = 42
), selected=2),
selectInput("tree_choose_1", label=h3("Choose a tree"), choices = list(
"Full",
"Bantu",
"Austronesian",
"Uto"
), selected="Full")
),
column(8, plotOutput("Traits_on_trees_1", width = "100%", height = "350px"),
plotOutput("trait_binary_bar_1", width = "100%", height = "150px"))
) ,
# plotOutput("trait_binary_bar_2", width = "100%", height = "300px")
column(6, column(8, plotOutput("Traits_on_trees_2", width = "100%", height = "350px"),
plotOutput("trait_binary_bar_2", width = "100%", height = "150px")),
column(4, selectInput("trait_choose_2", label=h3("Choose a trait"), choices = list(
"no points" = 48,
" " = 49,
"Subsistence on Hunting and Gathering" = 19,
"Subsistence on Fish" = 20,
"Subsistence on Husbandry" = 21,
"Subsistence Agriculture" = 22,
"Marriage Exchange" = 23,
"Extended Family" = 24,
"Polygyny Common" = 25,
"Patrilocal" = 26,
"Exogamy" = 27,
"Kin Terms" = 28,
"Intensity of Agriculture" = 29,
"Cereals" = 30,
"Mobility" = 31,
"Community Size" = 32,
"Political Complexity" = 33,
"High Moral Gods" = 34,
"Domesticates" = 35,
"Patrilineal Descent" = 36,
"Matrilineal Descent" = 37,
"Cognatic Descent" = 38,
"Female Biased Pottery" = 39,
"Male Biased House Construction" = 40,
"Egalitarian" = 41,
"Complex Stratification" = 42,
"Slavery" = 43,
"Land Inheritance" = 44,
"Movable Property inheritance" =45,
"House Shape" = 46
), selected=49),
selectInput("raster_layer_2", label=h3("Choose an overlay"), choices = list(
"no layer" = 1,
" " = 2,
"Biomes" = 3 ,
"EcoRegions" = 4 ,
"Olson Ecoregions" = 5,
"Amphibian diversity" = 6,
"Bird diversity" = 7 ,
"Mammal Diversiy" = 8 ,
"Vascular Plant diversity from Kreft and Jetz 2007"= 9,
"Potential domesticable speciess" = 10,
"Elevation" = 11,
"Slope" = 12,
"Glaciation" = 13 ,
"Sand type" = 14,
"Local Heterogeneity" = 15 ,
"Mean NPP" = 16,
"Mean Precipitation" = 17 ,
"Mean P_1950" = 18 ,
"Mean T" = 19,
"Mean T_1950" = 20 ,
"Variance NPP" = 21,
"Variance precipitation" = 22,
"Variance precipitation 1950" = 23,
"Variance temperature" = 24 ,
"Variance temperature 1950" = 25 ,
"Temperature Harshness" = 26 ,
"Xero Harshness" = 27 ,
"Predicability NPP" = 28 ,
"Predicability precipitation" = 29,
"Predicability precipitation 1950" = 30,
"Predicability temperature" = 31,
"Predicability temperature 1950" = 32,
"Constancy NPP" = 33,
"Constancy precipitation" =34 ,
"Constancy precipitation 1950" =35 ,
"Constancy temperature" = 36,
"Constancy temperature 1950" = 37 ,
"Contingency NPP" = 38,
"Contingency precipitation" = 39 ,
"Contingency precipitation 1950" = 40,
"Contingency temperature" = 41,
"Contingency temperature 1950" = 42
), selected=2),
selectInput("tree_choose_2", label=h3("Choose a tree"), choices = list(
"Full",
"Bantu",
"Austronesian",
"Uto"
), selected="Full")
)
)
)
)
) # end tab items
) # end dashboard body
) # end dashboard page
) # end shiny UI