From 32861c2dc6135b0022b56ccde88a5a68ee2f0537 Mon Sep 17 00:00:00 2001 From: Russ Hyde Date: Thu, 14 Mar 2024 11:31:06 +0000 Subject: [PATCH] feat: scatterplots are less tall than dendrograms --- R/app_server.R | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index 8b6db4d..64f7a78 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -37,15 +37,20 @@ app_server = function(input, output, session) { output$treeview = ggiraph::renderGirafe({ shiny::req(input$widgetChoice) - # set size - w = shinybrowser::get_width() / 72 - h = (1800 - 40) / 72 + # set the relative height/width of the ggiraph-based graphs + is_dendrogram = grepl("^tree-", x = input$widgetChoice) + width = shinybrowser::get_width() / 72 + height = if (is_dendrogram) { + (1800 - 40) / 72 + } else { + (600 - 40) / 72 + } create_girafe( ggobj = imported_ggtree(), widget_choice = input$widgetChoice, - width_svg = w, - height_svg = h, + width_svg = width, + height_svg = height, suppress_warnings = TRUE ) }) %>%