Skip to content

Commit

Permalink
feat: scatterplots are less tall than dendrograms
Browse files Browse the repository at this point in the history
  • Loading branch information
russHyde committed Oct 15, 2024
1 parent 9a66a6f commit 3bd7e61
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}) %>%
Expand Down

0 comments on commit 3bd7e61

Please sign in to comment.