@@ -2061,15 +2061,7 @@ ui <- dashboardPage(
2061
2061
column(
2062
2062
width = 6,
2063
2063
align = "center",
2064
- numericInput(
2065
- "tiplab_size",
2066
- label = h5("Label size", style = "color:white; margin-bottom: 0px"),
2067
- min = 1,
2068
- max = 10,
2069
- step = 0.5,
2070
- value = 4,
2071
- width = "80px"
2072
- ),
2064
+ uiOutput("nj_tiplab_size"),
2073
2065
br(),
2074
2066
selectInput(
2075
2067
"nj_tiplab_fontface",
@@ -2410,15 +2402,7 @@ ui <- dashboardPage(
2410
2402
ticks = FALSE
2411
2403
),
2412
2404
br(),
2413
- sliderInput(
2414
- inputId = "nj_tippoint_size",
2415
- label = h5("Size", style = "color:white; margin-bottom: 0px"),
2416
- min = 1,
2417
- max = 20,
2418
- value = 5,
2419
- width = "150px",
2420
- ticks = FALSE
2421
- )
2405
+ uiOutput("nj_tippoint_size")
2422
2406
)
2423
2407
)
2424
2408
)
@@ -4432,15 +4416,7 @@ ui <- dashboardPage(
4432
4416
ticks = FALSE
4433
4417
),
4434
4418
br(),
4435
- sliderInput(
4436
- inputId = "upgma_tippoint_size",
4437
- label = h5("Size", style = "color:white; margin-bottom: 0px"),
4438
- min = 1,
4439
- max = 20,
4440
- value = 5,
4441
- width = "150px",
4442
- ticks = FALSE
4443
- )
4419
+ uiOutput("upgma_tippoint_size")
4444
4420
)
4445
4421
)
4446
4422
)
@@ -9030,8 +9006,7 @@ server <- function(input, output, session) {
9030
9006
# Change scheme
9031
9007
observeEvent(input$reload_db, {
9032
9008
9033
- testt <<- upgma_tiplab_size()
9034
- test <<- input$upgma_tiplab_size
9009
+ test <<- input$nj_layout
9035
9010
9036
9011
if(tail(readLines(paste0(getwd(), "/execute/script_log.txt")), 1)!= "0") {
9037
9012
show_toast(
@@ -10164,6 +10139,33 @@ server <- function(input, output, session) {
10164
10139
10165
10140
#### NJ and UPGMA controls ----
10166
10141
10142
+ ##### Tippoint size ----
10143
+ output$nj_tippoint_size <- renderUI(
10144
+ sliderInput(
10145
+ inputId = "nj_tippoint_size",
10146
+ label = h5("Size", style = "color:white; margin-bottom: 0px"),
10147
+ min = 1,
10148
+ max = 20,
10149
+ step = 0.5,
10150
+ value = Vis$tippointsize_nj,
10151
+ width = "150px",
10152
+ ticks = FALSE
10153
+ )
10154
+ )
10155
+
10156
+ output$upgma_tippoint_size <- renderUI(
10157
+ sliderInput(
10158
+ inputId = "upgma_tippoint_size",
10159
+ label = h5("Size", style = "color:white; margin-bottom: 0px"),
10160
+ min = 1,
10161
+ max = 20,
10162
+ step = 0.5,
10163
+ value = Vis$tippointsize_upgma,
10164
+ width = "150px",
10165
+ ticks = FALSE
10166
+ )
10167
+ )
10168
+
10167
10169
##### Tiplabel size ----
10168
10170
output$upgma_tiplab_size <- renderUI(
10169
10171
numericInput(
@@ -11406,7 +11408,6 @@ server <- function(input, output, session) {
11406
11408
})
11407
11409
11408
11410
# No label clip off for linear NJ tree
11409
-
11410
11411
clip_label <- reactive({
11411
11412
if(!(input$nj_layout == "circular" | input$nj_layout == "inward")) {
11412
11413
coord_cartesian(clip = "off")
@@ -11611,37 +11612,37 @@ server <- function(input, output, session) {
11611
11612
aes(shape = !!sym(input$nj_tipcolor_mapping)),
11612
11613
alpha = input$nj_tippoint_alpha,
11613
11614
color = input$nj_tippoint_color,
11614
- size = input$ nj_tippoint_size
11615
+ size = nj_tippoint_size()
11615
11616
)
11616
11617
} else {
11617
11618
geom_tippoint(
11618
11619
aes(color = !!sym(input$nj_tipcolor_mapping)),
11619
11620
alpha = input$nj_tippoint_alpha,
11620
11621
shape = input$nj_tippoint_shape,
11621
- size = input$ nj_tippoint_size
11622
+ size = nj_tippoint_size()
11622
11623
)
11623
11624
}
11624
11625
} else if (input$nj_tipcolor_mapping_show == FALSE & input$nj_tipshape_mapping_show == TRUE) {
11625
11626
geom_tippoint(
11626
11627
aes(shape = !!sym(input$nj_tipshape_mapping)),
11627
11628
alpha = input$nj_tippoint_alpha,
11628
11629
color = input$nj_tippoint_color,
11629
- size = input$ nj_tippoint_size
11630
+ size = nj_tippoint_size()
11630
11631
)
11631
11632
} else if (input$nj_tipcolor_mapping_show == TRUE & input$nj_tipshape_mapping_show == TRUE) {
11632
11633
if(input$nj_mapping_show == TRUE) {
11633
11634
geom_tippoint(
11634
11635
aes(shape = !!sym(input$nj_tipshape_mapping)),
11635
11636
color = input$nj_tippoint_color,
11636
11637
alpha = input$nj_tippoint_alpha,
11637
- size = input$ nj_tippoint_size
11638
+ size = nj_tippoint_size()
11638
11639
)
11639
11640
} else {
11640
11641
geom_tippoint(
11641
11642
aes(shape = !!sym(input$nj_tipshape_mapping),
11642
11643
color = !!sym(input$nj_tipcolor_mapping)),
11643
11644
alpha = input$nj_tippoint_alpha,
11644
- size = input$ nj_tippoint_size
11645
+ size = nj_tippoint_size()
11645
11646
)
11646
11647
}
11647
11648
} else {
@@ -11650,7 +11651,7 @@ server <- function(input, output, session) {
11650
11651
colour = input$nj_tippoint_color,
11651
11652
fill = input$nj_tippoint_color,
11652
11653
shape = input$nj_tippoint_shape,
11653
- size = input$ nj_tippoint_size
11654
+ size = nj_tippoint_size()
11654
11655
)
11655
11656
}
11656
11657
} else {NULL
@@ -11783,6 +11784,15 @@ server <- function(input, output, session) {
11783
11784
}
11784
11785
})
11785
11786
11787
+ # Tippoint size
11788
+ nj_tippoint_size <- reactive({
11789
+ if(!is.null(input$nj_tippoint_size)) {
11790
+ input$nj_tippoint_size
11791
+ } else {
11792
+ Vis$tippointsize_nj
11793
+ }
11794
+ })
11795
+
11786
11796
# Show Label Panels?
11787
11797
nj_geom <- reactive({
11788
11798
if(input$nj_geom == TRUE) {
@@ -12256,37 +12266,37 @@ server <- function(input, output, session) {
12256
12266
aes(shape = !!sym(input$upgma_tipcolor_mapping)),
12257
12267
alpha = input$upgma_tippoint_alpha,
12258
12268
color = input$upgma_tippoint_color,
12259
- size = input$ upgma_tippoint_size
12269
+ size = upgma_tippoint_size()
12260
12270
)
12261
12271
} else {
12262
12272
geom_tippoint(
12263
12273
aes(color = !!sym(input$upgma_tipcolor_mapping)),
12264
12274
alpha = input$upgma_tippoint_alpha,
12265
12275
shape = input$upgma_tippoint_shape,
12266
- size = input$ upgma_tippoint_size
12276
+ size = upgma_tippoint_size()
12267
12277
)
12268
12278
}
12269
12279
} else if (input$upgma_tipcolor_mapping_show == FALSE & input$upgma_tipshape_mapping_show == TRUE) {
12270
12280
geom_tippoint(
12271
12281
aes(shape = !!sym(input$upgma_tipshape_mapping)),
12272
12282
alpha = input$upgma_tippoint_alpha,
12273
12283
color = input$upgma_tippoint_color,
12274
- size = input$ upgma_tippoint_size
12284
+ size = upgma_tippoint_size()
12275
12285
)
12276
12286
} else if (input$upgma_tipcolor_mapping_show == TRUE & input$upgma_tipshape_mapping_show == TRUE) {
12277
12287
if(input$upgma_mapping_show == TRUE) {
12278
12288
geom_tippoint(
12279
12289
aes(shape = !!sym(input$upgma_tipshape_mapping)),
12280
12290
color = input$upgma_tippoint_color,
12281
12291
alpha = input$upgma_tippoint_alpha,
12282
- size = input$ upgma_tippoint_size
12292
+ size = upgma_tippoint_size()
12283
12293
)
12284
12294
} else {
12285
12295
geom_tippoint(
12286
12296
aes(shape = !!sym(input$upgma_tipshape_mapping),
12287
12297
color = !!sym(input$upgma_tipcolor_mapping)),
12288
12298
alpha = input$upgma_tippoint_alpha,
12289
- size = input$ upgma_tippoint_size
12299
+ size = upgma_tippoint_size()
12290
12300
)
12291
12301
}
12292
12302
} else {
@@ -12295,7 +12305,7 @@ server <- function(input, output, session) {
12295
12305
colour = input$upgma_tippoint_color,
12296
12306
fill = input$upgma_tippoint_color,
12297
12307
shape = input$upgma_tippoint_shape,
12298
- size = input$ upgma_tippoint_size
12308
+ size = upgma_tippoint_size()
12299
12309
)
12300
12310
}
12301
12311
} else {NULL
@@ -12419,6 +12429,15 @@ server <- function(input, output, session) {
12419
12429
12420
12430
})
12421
12431
12432
+ # TIppoint size
12433
+ upgma_tippoint_size <- reactive({
12434
+ if(!is.null(input$upgma_tippoint_size)) {
12435
+ input$upgma_tippoint_size
12436
+ } else {
12437
+ Vis$tippointsize_upgma
12438
+ }
12439
+ })
12440
+
12422
12441
# Tiplab size
12423
12442
upgma_tiplab_size <- reactive({
12424
12443
if(!is.null(input$upgma_tiplab_size)) {
@@ -13049,40 +13068,56 @@ server <- function(input, output, session) {
13049
13068
if(input$nj_layout == "circular" | input$nj_layout == "inward") {
13050
13069
if(sum(DB$data$Include) < 21) {
13051
13070
Vis$labelsize_nj <- 5.5
13071
+ Vis$tippointsize_nj <- 5.5
13052
13072
} else if (between(sum(DB$data$Include), 21, 40)) {
13053
13073
Vis$labelsize_nj <- 5
13074
+ Vis$tippointsize_nj <- 5
13054
13075
} else if (between(sum(DB$data$Include), 41, 60)) {
13055
13076
Vis$labelsize_nj <- 4.5
13077
+ Vis$tippointsize_nj <- 4.5
13056
13078
} else if (between(sum(DB$data$Include), 61, 80)) {
13057
13079
Vis$labelsize_nj <- 4
13058
- } else if (between(sum(DB$data$Include), 81, 120)) {
13080
+ Vis$tippointsize_nj <- 4
13081
+ } else if (between(sum(DB$data$Include), 81, 100)) {
13059
13082
Vis$labelsize_nj <- 3.5
13083
+ Vis$tippointsize_nj <- 3.5
13060
13084
} else {
13061
13085
Vis$labelsize_nj <- 3
13086
+ Vis$tippointsize_nj <- 3
13062
13087
}
13063
13088
} else {
13064
13089
if(sum(DB$data$Include) < 21) {
13065
13090
Vis$labelsize_nj <- 5
13091
+ Vis$tippointsize_nj <- 5
13066
13092
} else if (between(sum(DB$data$Include), 21, 40)) {
13067
13093
Vis$labelsize_nj <- 4.5
13094
+ Vis$tippointsize_nj <- 4.5
13068
13095
} else if (between(sum(DB$data$Include), 41, 60)) {
13069
13096
Vis$labelsize_nj <- 4
13097
+ Vis$tippointsize_nj <- 4
13070
13098
} else if (between(sum(DB$data$Include), 61, 80)) {
13071
13099
Vis$labelsize_nj <- 3.5
13100
+ Vis$tippointsize_nj <- 3.5
13072
13101
} else if (between(sum(DB$data$Include), 81, 100)) {
13073
13102
Vis$labelsize_nj <- 3
13103
+ Vis$tippointsize_nj <- 3
13074
13104
} else {
13075
13105
Vis$labelsize_nj <- 2.5
13106
+ Vis$tippointsize_nj <- 2.5
13076
13107
}
13077
13108
}
13078
13109
} else {
13079
13110
Vis$labelsize_nj <- 4
13111
+ Vis$tippointsize_nj <- 4
13080
13112
}
13081
13113
13082
13114
# Update visualization control inputs
13083
13115
if(!is.null(input$nj_tiplab_size)) {
13084
13116
updateNumericInput(session, "nj_tiplab_size", value = Vis$labelsize_nj)
13085
13117
}
13118
+ if(!is.null(input$nj_tippoint_size)) {
13119
+ updateSliderInput(session, "nj_tippoint_size", value = Vis$tippointsize_nj)
13120
+ }
13086
13121
13087
13122
# Create phylogenetic tree
13088
13123
Vis$nj <- ape::nj(hamming_nj())
@@ -13113,40 +13148,56 @@ server <- function(input, output, session) {
13113
13148
if(input$upgma_layout == "circular" | input$upgma_layout == "inward") {
13114
13149
if(sum(DB$data$Include) < 21) {
13115
13150
Vis$labelsize_upgma <- 5.5
13151
+ Vis$tippointsize_upgma <- 5.5
13116
13152
} else if (between(sum(DB$data$Include), 21, 40)) {
13117
13153
Vis$labelsize_upgma <- 5
13154
+ Vis$tippointsize_upgma <- 5
13118
13155
} else if (between(sum(DB$data$Include), 41, 60)) {
13119
13156
Vis$labelsize_upgma <- 4.5
13157
+ Vis$tippointsize_upgma <- 4.5
13120
13158
} else if (between(sum(DB$data$Include), 61, 80)) {
13121
13159
Vis$labelsize_upgma <- 4
13122
- } else if (between(sum(DB$data$Include), 81, 120)) {
13160
+ Vis$tippointsize_upgma <- 4
13161
+ } else if (between(sum(DB$data$Include), 81, 100)) {
13123
13162
Vis$labelsize_upgma <- 3.5
13163
+ Vis$tippointsize_upgma <- 3.5
13124
13164
} else {
13125
13165
Vis$labelsize_upgma <- 3
13166
+ Vis$tippointsize_upgma <- 3
13126
13167
}
13127
13168
} else {
13128
13169
if(sum(DB$data$Include) < 21) {
13129
13170
Vis$labelsize_upgma <- 5
13171
+ Vis$tippointsize_upgma <- 5
13130
13172
} else if (between(sum(DB$data$Include), 21, 40)) {
13131
13173
Vis$labelsize_upgma <- 4.5
13174
+ Vis$tippointsize_upgma <- 4.5
13132
13175
} else if (between(sum(DB$data$Include), 41, 60)) {
13133
13176
Vis$labelsize_upgma <- 4
13177
+ Vis$tippointsize_upgma <- 4
13134
13178
} else if (between(sum(DB$data$Include), 61, 80)) {
13135
13179
Vis$labelsize_upgma <- 3.5
13180
+ Vis$tippointsize_upgma <- 3.5
13136
13181
} else if (between(sum(DB$data$Include), 81, 100)) {
13137
13182
Vis$labelsize_upgma <- 3
13183
+ Vis$tippointsize_upgma <- 3
13138
13184
} else {
13139
13185
Vis$labelsize_upgma <- 2.5
13186
+ Vis$tippointsize_upgma <- 2.5
13140
13187
}
13141
13188
}
13142
13189
} else {
13143
13190
Vis$labelsize_upgma <- 4
13191
+ Vis$tippointsize_upgma <- 4
13144
13192
}
13145
13193
13146
13194
# Update visualization control inputs
13147
13195
if(!is.null(input$upgma_tiplab_size)) {
13148
13196
updateNumericInput(session, "upgma_tiplab_size", value = Vis$labelsize_upgma)
13149
13197
}
13198
+ if(!is.null(input$upgma_tippoint_size)) {
13199
+ updateSliderInput(session, "upgma_tippoint_size", value = Vis$tippointsize_upgma)
13200
+ }
13150
13201
13151
13202
# Create phylogenetic tree
13152
13203
Vis$upgma <- phangorn::upgma(hamming_nj())
0 commit comments