Преглед на файлове

Dynamically generate rank plot grids

Bryan Roessler преди 6 месеца
родител
ревизия
1e816e1a71
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 6 1
      qhtcp-workflow/apps/r/calculate_interaction_zscores.R

+ 6 - 1
qhtcp-workflow/apps/r/calculate_interaction_zscores.R

@@ -870,7 +870,12 @@ generate_rank_plot_configs <- function(df, variables, is_lm = FALSE, adjust = FA
     }
   }
 
-  return(list(grid_layout = list(ncol = 3, nrow = 2), plots = configs))
+  # Calculate dynamic grid layout based on the number of plots
+  num_plots <- length(configs)
+  grid_ncol <- 3
+  grid_nrow <- ceiling(num_plots / grid_ncol)  # Automatically calculate the number of rows
+
+  return(list(grid_layout = list(ncol = grid_ncol, nrow = grid_nrow), plots = configs))
 }
 
 generate_correlation_plot_configs <- function(df, highlight_cyan = FALSE) {