Skip to content

Commit 1818e65

Browse files
committed
feat: scatterplots are less tall than dendrograms
1 parent fbb2a1c commit 1818e65

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

R/app_server.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,20 @@ app_server = function(input, output, session) {
3737
output$treeview = ggiraph::renderGirafe({
3838
shiny::req(input$widgetChoice)
3939

40-
# set size
41-
w = shinybrowser::get_width() / 72
42-
h = (1800 - 40) / 72
40+
# set the relative height/width of the ggiraph-based graphs
41+
is_dendrogram = grepl("^tree-", x = input$widgetChoice)
42+
width = shinybrowser::get_width() / 72
43+
height = if (is_dendrogram) {
44+
(1800 - 40) / 72
45+
} else {
46+
(600 - 40) / 72
47+
}
4348

4449
create_girafe(
4550
ggobj = imported_ggtree(),
4651
widget_choice = input$widgetChoice,
47-
width_svg = w,
48-
height_svg = h,
52+
width_svg = width,
53+
height_svg = height,
4954
suppress_warnings = TRUE
5055
)
5156
}) %>%

0 commit comments

Comments
 (0)