mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 01:49:39 +02:00
This commit is contained in:
parent
62b5d7a668
commit
7fceb96a83
3 changed files with 35 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
Package: FreesearchR
|
||||
Title: A free and open-source browser based data analysis tool for researchers with publication ready output
|
||||
Version: 25.7.3
|
||||
Version: 25.8.1
|
||||
Authors@R: c(
|
||||
person("Andreas Gammelgaard", "Damsbo",email="agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
||||
comment = c(ORCID = "0000-0002-7559-1154")),
|
||||
|
|
7
NEWS.md
7
NEWS.md
|
@ -1,7 +1,12 @@
|
|||
# FreesearchR 25.7.3 - DEV
|
||||
# FreesearchR 25.8.2 - DEV
|
||||
|
||||
- *NEW* preparing to automatically only show relevant tabs to simplify interface. NOT IMPLEMENTED YET
|
||||
|
||||
# FreesearchR 25.8.1
|
||||
|
||||
- *NEW* improved the use of `wrap_plot_list()` to pass on additional arguments to `patchwork::wrap_plots()` and allowed to specify axes to align in `align_axes()`.
|
||||
- *FIX* fixed axis text printed in Euler diagrams
|
||||
|
||||
# FreesearchR 25.7.2
|
||||
|
||||
- *FIX* refining hiding drop downs. All JavaScript is now in separate file. Coded with GAI help from claude.ai.
|
||||
|
|
|
@ -2364,7 +2364,8 @@ wrap_plot_list <- function(data,
|
|||
patchwork::wrap_plots(
|
||||
guides = "collect",
|
||||
axes = "collect",
|
||||
axis_titles = "collect"
|
||||
axis_titles = "collect",
|
||||
...
|
||||
)
|
||||
if (!is.null(tag_levels)) {
|
||||
out <- out + patchwork::plot_annotation(tag_levels = tag_levels)
|
||||
|
@ -2400,7 +2401,7 @@ wrap_plot_list <- function(data,
|
|||
#' @returns list of ggplot2 objects
|
||||
#' @export
|
||||
#'
|
||||
align_axes <- function(...) {
|
||||
align_axes <- function(...,x.axis=TRUE,y.axis=TRUE) {
|
||||
# https://stackoverflow.com/questions/62818776/get-axis-limits-from-ggplot-object
|
||||
# https://github.com/thomasp85/patchwork/blob/main/R/plot_multipage.R#L150
|
||||
if (ggplot2::is_ggplot(..1)) {
|
||||
|
@ -2418,7 +2419,16 @@ align_axes <- function(...) {
|
|||
xr <- clean_common_axis(p, "x")
|
||||
|
||||
suppressWarnings({
|
||||
p |> purrr::map(~ .x + ggplot2::xlim(xr) + ggplot2::ylim(yr))
|
||||
purrr::map(p, \(.x){
|
||||
out <- .x
|
||||
if (isTRUE(x.axis)){
|
||||
out <- out + ggplot2::xlim(xr)
|
||||
}
|
||||
if (isTRUE(y.axis)){
|
||||
out <- out + ggplot2::ylim(yr)
|
||||
}
|
||||
out
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -5029,7 +5039,7 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103) {
|
|||
na.omit() |>
|
||||
plot_euler_single()
|
||||
})
|
||||
|
||||
# browser()
|
||||
# names(out)
|
||||
wrap_plot_list(out,title=glue::glue("Grouped by {get_label(data,ter)}"))
|
||||
# patchwork::wrap_plots(out, guides = "collect")
|
||||
|
@ -5087,6 +5097,7 @@ plot_euler_single <- function(data) {
|
|||
#'
|
||||
#' @examples
|
||||
#' mtcars |> plot_hbars(pri = "carb", sec = "cyl")
|
||||
#' mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am")
|
||||
#' mtcars |> plot_hbars(pri = "carb", sec = NULL)
|
||||
plot_hbars <- function(data, pri, sec, ter = NULL) {
|
||||
out <- vertical_stacked_bars(data = data, score = pri, group = sec, strata = ter)
|
||||
|
@ -5496,6 +5507,8 @@ plot_violin <- function(data, pri, sec, ter = NULL) {
|
|||
ds <- list(data)
|
||||
}
|
||||
|
||||
# browser()
|
||||
suppressWarnings({
|
||||
out <- lapply(ds, \(.ds){
|
||||
rempsyc::nice_violin(
|
||||
data = .ds,
|
||||
|
@ -5507,6 +5520,7 @@ plot_violin <- function(data, pri, sec, ter = NULL) {
|
|||
})
|
||||
|
||||
wrap_plot_list(out, title = glue::glue("Grouped by {get_label(data,ter)}"))
|
||||
})
|
||||
# patchwork::wrap_plots(out,guides = "collect")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue