-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathui.R
More file actions
336 lines (333 loc) · 10.7 KB
/
ui.R
File metadata and controls
336 lines (333 loc) · 10.7 KB
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
library(shiny)
library(eulerr)
shinyUI(
navbarPage(
"eulerr",
inverse = TRUE,
tabPanel(
"App",
fluidPage(
fluidRow(
column(
3,
wellPanel(
p(
"String together combinations by joining them
with an ampersand (&)."
),
splitLayout(
cellWidths = c("70%", "30%"),
textInput("combo_1", NULL, "A"),
numericInput("size_1", NULL, 5, min = 0)
),
splitLayout(
cellWidths = c("70%", "30%"),
textInput("combo_2", NULL, "B"),
numericInput("size_2", NULL, 3, min = 0)
),
splitLayout(
cellWidths = c("70%", "30%"),
textInput("combo_3", NULL, "A&B"),
numericInput("size_3", NULL, 2, min = 0)
),
tags$div(id = "placeholder"),
splitLayout(
actionButton("insert_set", "Insert", width = "100%"),
actionButton("remove_set", "Remove", width = "100%")
),
br(),
radioButtons(
"input_type",
"Type of Relationships",
c("Disjoint combinations" = "disjoint", "Unions" = "union"),
inline = TRUE
),
radioButtons(
"shape",
"Shape",
c("Circle" = "circle", "Ellipse" = "ellipse"),
inline = TRUE
),
numericInput(
"seed",
"Random Seed",
value = 1,
min = 1
),
),
wellPanel(
fluidRow(
column(6, strong("stress"), textOutput("stress")),
column(6, strong("diagError"), textOutput("diagError"))
)
)
),
column(
6,
tabsetPanel(
type = "tabs",
tabPanel(
"Plot",
plotOutput("euler_diagram", height = "500px")
),
tabPanel(
"Fit",
tableOutput("table")
)
)
),
column(
3,
strong("Colors"),
em(p(
"A comma-separated list of ",
a(
href = "https://stat.columbia.edu/~tzheng/files/Rcolor.pdf",
"x11"
),
"or",
a(
href = "https://en.wikipedia.org/wiki/Web_colors#Hex_triplet",
"hex colors."
)
)),
textInput(
inputId = "fill",
label = NULL,
value = "",
placeholder = "grey70, white, steelblue4",
width = "100%"
),
fluidRow(
column(
4,
checkboxInput("legend", "Legend")
),
column(
8,
conditionalPanel(
condition = "input.legend == true",
selectInput(
"legend_side",
NULL,
width = "100%",
list("right", "left", "top", "bottom")
)
)
)
),
radioButtons(
"font",
"Font",
list("Plain", "Bold", "Italic", "Bold italic"),
selected = "Bold",
inline = TRUE
),
radioButtons(
"borders",
"Borders",
list("Solid", "Varying", "None"),
inline = TRUE
),
numericInput(
inputId = "pointsize",
label = "Pointsize",
value = 12,
min = 1,
max = 100,
step = 1,
width = "100%"
),
checkboxInput("quantities", "Show quantities"),
sliderInput(
"alpha",
"Opacity",
min = 0,
max = 1,
value = 1,
width = "100%"
),
hr(),
fluidRow(
column(
6,
numericInput(
inputId = "width",
label = "Width (inches)",
value = 6,
width = "100%"
)
),
column(
6,
numericInput(
inputId = "height",
label = "Height (inches)",
value = 4,
width = "100%"
)
)
),
fluidRow(
column(
6,
downloadButton("download_plot", "Save plot")
),
column(
6,
radioButtons(
"savetype",
NULL,
list("pdf", "png"),
inline = TRUE
)
)
)
)
)
)
),
tabPanel(
"About",
fluidPage(
fluidRow(
column(
6,
offset = 3,
h1("About"),
h2("Area-Proportional Diagrams with eulerr"),
p(
"This",
a(href = "https://shiny.rstudio.com/", "shiny"),
"app is based on an",
a(href = "www.r-project.org", "R"),
"package that I have developed called eulerr.",
"It generates area-proportional euler diagrams using numerical",
"optimization routines."
),
p(
a(
href = "https://en.wikipedia.org/wiki/Euler_diagram",
"Euler diagrams"
),
"are generalized venn diagrams for which the requirement that",
"all intersections be present is relaxed. They are constructed",
"from a specification of set relationships but may sometimes",
"fail to display these appropriately. For instance, try giving",
"the app the specification",
code("A = 5, B = 3, C = 1, A&B = 2, AB&C = 2"),
"to see what I mean."
),
p(
"When this happens, eulerr tries to give an indication of",
"how badly the diagram fits the data through the metrics",
em("stress"),
"and",
em("diag error."),
"The latter of these show the largest difference in percentage",
"points between the specification of any one set combination",
"and its resulting fit. It is the maximum value of",
em("region error,"),
"which is given for each combination. This metric has been",
"adopted from",
a(
href = "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0101717",
"a paper by Micallef and Peter Rodgers."
),
"Stress is more difficult to explain, but I advise the",
"interested reader to read",
a(
"Leland Wilkinson's excellent paper",
href = "https://www.cs.uic.edu/~wilkinson/Publications/venneuler.pdf",
),
"for a proper brief."
),
p(
"Finally, I owe a great deal to the",
"aforementioned Wilkinson as well as",
a(href = "http://www.benfrederickson.com/", "Ben Frederickson"),
"whose work eulerr is inspired by."
),
p(em("Johan Larsson")),
h2("Limitations in the Shiny App"),
p(
"The Shiny app that is hosted here does not completely cover",
"all the functionality that the R package offers.",
"The number of sets is for instance limited to five here",
"but there is no such limitation in the package.",
"If you want to install the R package, then you need to first",
a("install R.", href = "https://www.r-project.org/"),
"After this you can simply install the package by calling ",
tags$code('install.packages("eulerr")', .noWS = "outside"),
"."
),
p(
"To read more about the R package, please visit",
a(
" the package page on CRAN",
href = "https://CRAN.R-project.org/package=eulerr",
.noWS = "outside"
),
"."
),
h2("Contribute"),
p(
"eulerr is an open-source project that welcomes contributions",
"from anyone who's willing to chip in. Please see the",
a(
"development page for the R package",
href = "https://github.com/jolars/eulerr"
),
"if you are interested in taking part or just want to report",
"an issue with the package.",
"If you find any issues with this site, please visit",
a(
"the development page for the Shiny appplication",
href = "https://github.com/jolars/eulerr.co"
),
"and file an issue there."
),
),
)
)
),
tabPanel(
"Citation",
fluidPage(
fluidRow(
column(
6,
offset = 3,
h1("Citation"),
p("To cite eulerr in publications, please use"),
p(
"Larsson, J., & Gustafsson, P. (2018). A case study in fitting",
"area-proportional Euler diagrams with ellipses using eulerr.",
"Proceedings of International Workshop on Set Visualization and",
"Reasoning, 2116, 84–91.",
a(
"http://ceur-ws.org/Vol-2116/paper7.pdf",
href = "http://ceur-ws.org/Vol-2116/paper7.pdf"
)
),
br(),
p("A BibTeX entry for LaTeX users is"),
pre(
"@inproceedings{larssonCaseStudyFitting2018,
title = {A Case Study in Fitting Area-Proportional {{Euler}} Diagrams with Ellipses Using Eulerr},
booktitle = {Proceedings of International Workshop on Set Visualization and Reasoning},
author = {Larsson, Johan and Gustafsson, Peter},
year = {2018},
month = jun,
volume = {2116},
pages = {84--91},
publisher = {CEUR workshop proceedings},
address = {Edinburgh, United Kingdom}
}"
),
)
)
)
)
)
)