diff --git a/.Rbuildignore b/.Rbuildignore index 4ffec2b9..94927477 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -14,6 +14,6 @@ ^data-raw$ ^CITATION\.cff$ ^app_hosted$ -^app$ +^app*$ ^page$ ^demo$ diff --git a/.gitignore b/.gitignore index c5e7bc8f..96f86282 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,8 @@ inst/shiny-examples/casting/functions.R functions.R docs inst/doc -app_hosted +app_dev +app_stable app page demo diff --git a/CITATION.cff b/CITATION.cff index ff5aba86..29f48145 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,8 +9,11 @@ type: software license: AGPL-3.0-or-later title: 'FreesearchR: A free and open-source browser based data analysis tool for researchers with publication ready output' -version: 25.5.1 +version: 25.5.2 doi: 10.5281/zenodo.14527429 +identifiers: +- type: url + value: https://app.FreesearchR.org/ abstract: Easily evaluate and analysis clinical health data in your browser on a server or on your own device. Import data from multiple sources, summarise, modify and visualise data and export key metrics and regression analysis results in a publication @@ -974,6 +977,19 @@ references: email: alboukadel.kassambara@gmail.com year: '2025' doi: 10.32614/CRAN.package.ggcorrplot +- type: software + title: shinyjs + abstract: 'shinyjs: Easily Improve the User Experience of Your Shiny Apps in Seconds' + notes: Imports + url: https://deanattali.com/shinyjs/ + repository: https://CRAN.R-project.org/package=shinyjs + authors: + - family-names: Attali + given-names: Dean + email: daattali@gmail.com + orcid: https://orcid.org/0000-0002-5645-3493 + year: '2025' + doi: 10.32614/CRAN.package.shinyjs - type: software title: styler abstract: 'styler: Non-Invasive Pretty Printing of R Code' diff --git a/DESCRIPTION b/DESCRIPTION index 534b0dc4..87cc929d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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.5.1 +Version: 25.5.2 Authors@R: c( person("Andreas Gammelgaard", "Damsbo",email="agdamsbo@clin.au.dk", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7559-1154")), @@ -62,7 +62,8 @@ Imports: eulerr, ggforce, RcppArmadillo, - ggcorrplot + ggcorrplot, + shinyjs Suggests: styler, devtools, @@ -78,7 +79,7 @@ Suggests: shinytest, covr, cffr -URL: https://github.com/agdamsbo/FreesearchR, https://agdamsbo.github.io/FreesearchR/ +URL: https://github.com/agdamsbo/FreesearchR, https://agdamsbo.github.io/FreesearchR/, https://app.FreesearchR.org/ BugReports: https://github.com/agdamsbo/FreesearchR/issues VignetteBuilder: knitr Config/testthat/edition: 3 diff --git a/NEWS.md b/NEWS.md index d8a2c68e..07731215 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# FreesearchR 25.5.2 + +- *FIX*: correct export of plots. The solution in the last version broke more than it solved. + +- *NEW*: added simple loading animation. + +A privately hosted version is now live on app.freesearchr.org. For now, it is hosted on Hetzner with Yunohost. + # FreesearchR 25.5.1 - *FIX*: correct export of single variable plot. diff --git a/R/app_version.R b/R/app_version.R index 724053ed..eca6bb3a 100644 --- a/R/app_version.R +++ b/R/app_version.R @@ -1 +1 @@ -app_version <- function()'25.5.1' +app_version <- function()'25.5.2' diff --git a/R/data_plots.R b/R/data_plots.R index 9ccdd989..8401bf87 100644 --- a/R/data_plots.R +++ b/R/data_plots.R @@ -395,7 +395,9 @@ data_visuals_server <- function(id, content = function(file) { if (inherits(rv$plot,"patchwork")){ plot <- rv$plot - } else { + } else if (inherits(rv$plot,"ggplot")){ + plot <- rv$plot + }else { plot <- rv$plot[[1]] } @@ -421,7 +423,6 @@ data_visuals_server <- function(id, ) } - #' Select all from vector but #' #' @param data vector diff --git a/R/hosted_version.R b/R/hosted_version.R index 10ceeee5..5feb2555 100644 --- a/R/hosted_version.R +++ b/R/hosted_version.R @@ -1 +1 @@ -hosted_version <- function()'v25.5.1-250507' +hosted_version <- function()'v25.5.2-250508' diff --git a/R/sysdata.rda b/R/sysdata.rda index 9d97392c..57d54ffe 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/SESSION.md b/SESSION.md index eb1735f3..da151864 100644 --- a/SESSION.md +++ b/SESSION.md @@ -11,11 +11,11 @@ |collate |en_US.UTF-8 | |ctype |en_US.UTF-8 | |tz |Europe/Copenhagen | -|date |2025-05-05 | +|date |2025-05-08 | |rstudio |2024.12.1+563 Kousa Dogwood (desktop) | |pandoc |3.6.4 @ /opt/homebrew/bin/ (via rmarkdown) | |quarto |1.6.40 @ /usr/local/bin/quarto | -|FreesearchR |25.5.1.250505 | +|FreesearchR |25.5.2.250508 | -------------------------------------------------------------------------------- @@ -24,6 +24,7 @@ |package |loadedversion |date |source | |:-------------|:-------------|:----------|:--------------| |apexcharter |0.4.4 |2024-09-06 |CRAN (R 4.4.1) | +|askpass |1.2.1 |2024-10-04 |CRAN (R 4.4.1) | |assertthat |0.2.1 |2019-03-21 |CRAN (R 4.4.1) | |backports |1.5.0 |2024-05-23 |CRAN (R 4.4.1) | |bayestestR |0.15.3 |2025-04-28 |CRAN (R 4.4.1) | @@ -36,6 +37,7 @@ |bslib |0.9.0 |2025-01-30 |CRAN (R 4.4.1) | |cachem |1.1.0 |2024-05-16 |CRAN (R 4.4.1) | |cellranger |1.1.0 |2016-07-27 |CRAN (R 4.4.0) | +|cffr |1.2.0 |2025-01-25 |CRAN (R 4.4.1) | |class |7.3-23 |2025-01-01 |CRAN (R 4.4.1) | |classInt |0.4-11 |2025-01-08 |CRAN (R 4.4.1) | |cli |3.6.5 |2025-04-23 |CRAN (R 4.4.1) | @@ -43,6 +45,7 @@ |correlation |0.8.7 |2025-03-03 |CRAN (R 4.4.1) | |crayon |1.5.3 |2024-06-20 |CRAN (R 4.4.1) | |crosstalk |1.2.1 |2023-11-23 |CRAN (R 4.4.0) | +|curl |6.2.2 |2025-03-24 |CRAN (R 4.4.1) | |data.table |1.17.0 |2025-02-22 |CRAN (R 4.4.1) | |datamods |1.5.3 |2024-10-02 |CRAN (R 4.4.1) | |datawizard |1.0.2 |2025-03-24 |CRAN (R 4.4.1) | @@ -78,10 +81,10 @@ |insight |1.2.0 |2025-04-22 |CRAN (R 4.4.1) | |jquerylib |0.1.4 |2021-04-26 |CRAN (R 4.4.0) | |jsonlite |2.0.0 |2025-03-27 |CRAN (R 4.4.1) | +|jsonvalidate |1.5.0 |2025-02-07 |CRAN (R 4.4.1) | |KernSmooth |2.23-26 |2025-01-01 |CRAN (R 4.4.1) | |keyring |1.3.2 |2023-12-11 |CRAN (R 4.4.0) | |knitr |1.50 |2025-03-16 |CRAN (R 4.4.1) | -|labeling |0.4.3 |2023-08-29 |CRAN (R 4.4.1) | |later |1.4.2 |2025-04-08 |CRAN (R 4.4.1) | |lattice |0.22-7 |2025-04-02 |CRAN (R 4.4.1) | |lifecycle |1.0.4 |2023-11-07 |CRAN (R 4.4.1) | @@ -96,7 +99,9 @@ |modelbased |0.10.0 |2025-03-10 |CRAN (R 4.4.1) | |nlme |3.1-168 |2025-03-31 |CRAN (R 4.4.1) | |nloptr |2.2.1 |2025-03-17 |CRAN (R 4.4.1) | +|openssl |2.3.2 |2025-02-03 |CRAN (R 4.4.1) | |openxlsx2 |1.15 |2025-04-25 |CRAN (R 4.4.1) | +|pak |0.8.0.2 |2025-04-08 |CRAN (R 4.4.1) | |parameters |0.24.2 |2025-03-04 |CRAN (R 4.4.1) | |patchwork |1.3.0 |2024-09-16 |CRAN (R 4.4.1) | |performance |0.13.0 |2025-01-15 |CRAN (R 4.4.1) | @@ -112,9 +117,11 @@ |ps |1.9.1 |2025-04-12 |CRAN (R 4.4.1) | |purrr |1.0.4 |2025-02-05 |CRAN (R 4.4.1) | |quarto |1.4.4 |2024-07-20 |CRAN (R 4.4.0) | +|R.cache |0.16.0 |2022-07-21 |CRAN (R 4.4.0) | +|R.methodsS3 |1.8.2 |2022-06-13 |CRAN (R 4.4.1) | +|R.oo |1.27.0 |2024-11-01 |CRAN (R 4.4.1) | +|R.utils |2.13.0 |2025-02-24 |CRAN (R 4.4.1) | |R6 |2.6.1 |2025-02-15 |CRAN (R 4.4.1) | -|ragg |1.4.0 |2025-04-10 |CRAN (R 4.4.1) | -|rankinPlot |1.1.0 |2023-01-30 |CRAN (R 4.4.0) | |rbibutils |2.3 |2024-10-04 |CRAN (R 4.4.1) | |RColorBrewer |1.1-3 |2022-04-03 |CRAN (R 4.4.1) | |Rcpp |1.0.14 |2025-01-12 |CRAN (R 4.4.1) | @@ -127,7 +134,6 @@ |REDCapR |1.4.0 |2025-01-11 |CRAN (R 4.4.1) | |reformulas |0.4.0 |2024-11-03 |CRAN (R 4.4.1) | |remotes |2.5.0 |2024-03-17 |CRAN (R 4.4.1) | -|rempsyc |0.1.9 |2025-02-01 |CRAN (R 4.4.1) | |renv |1.1.4 |2025-03-20 |CRAN (R 4.4.1) | |report |0.6.1 |2025-02-07 |CRAN (R 4.4.1) | |rio |1.2.3 |2024-09-25 |CRAN (R 4.4.1) | @@ -142,11 +148,11 @@ |sessioninfo |1.2.3 |2025-02-05 |CRAN (R 4.4.1) | |shiny |1.10.0 |2024-12-14 |CRAN (R 4.4.1) | |shinybusy |0.3.3 |2024-03-09 |CRAN (R 4.4.0) | +|shinyjs |2.1.0 |2021-12-23 |CRAN (R 4.4.0) | |shinyTime |1.0.3 |2022-08-19 |CRAN (R 4.4.0) | |shinyWidgets |0.9.0 |2025-02-21 |CRAN (R 4.4.1) | |stringi |1.8.7 |2025-03-27 |CRAN (R 4.4.1) | -|systemfonts |1.2.2 |2025-04-04 |CRAN (R 4.4.1) | -|textshaping |1.0.0 |2025-01-20 |CRAN (R 4.4.1) | +|styler |1.10.3 |2024-04-07 |CRAN (R 4.4.0) | |tibble |3.2.1 |2023-03-20 |CRAN (R 4.4.0) | |tidyr |1.3.1 |2024-01-24 |CRAN (R 4.4.1) | |tidyselect |1.2.1 |2024-03-11 |CRAN (R 4.4.0) | @@ -154,8 +160,8 @@ |tzdb |0.5.0 |2025-03-15 |CRAN (R 4.4.1) | |urlchecker |1.0.1 |2021-11-30 |CRAN (R 4.4.1) | |usethis |3.1.0 |2024-11-26 |CRAN (R 4.4.1) | +|V8 |6.0.3 |2025-03-26 |CRAN (R 4.4.1) | |vctrs |0.6.5 |2023-12-01 |CRAN (R 4.4.0) | -|viridisLite |0.4.2 |2023-05-02 |CRAN (R 4.4.1) | |vroom |1.6.5 |2023-12-05 |CRAN (R 4.4.0) | |withr |3.0.2 |2024-10-28 |CRAN (R 4.4.1) | |writexl |1.5.4 |2025-04-15 |CRAN (R 4.4.1) | diff --git a/inst/apps/FreesearchR/app.R b/inst/apps/FreesearchR/app.R index 5951a04b..e9886d65 100644 --- a/inst/apps/FreesearchR/app.R +++ b/inst/apps/FreesearchR/app.R @@ -10,7 +10,7 @@ #### Current file: /Users/au301842/FreesearchR/R//app_version.R ######## -app_version <- function()'25.5.1' +app_version <- function()'25.5.2' ######## @@ -1969,7 +1969,9 @@ data_visuals_server <- function(id, content = function(file) { if (inherits(rv$plot,"patchwork")){ plot <- rv$plot - } else { + } else if (inherits(rv$plot,"ggplot")){ + plot <- rv$plot + }else { plot <- rv$plot[[1]] } @@ -1995,7 +1997,6 @@ data_visuals_server <- function(id, ) } - #' Select all from vector but #' #' @param data vector @@ -3954,7 +3955,7 @@ is_identical_to_previous <- function(data, no.name = TRUE) { #### Current file: /Users/au301842/FreesearchR/R//hosted_version.R ######## -hosted_version <- function()'v25.5.1-250507' +hosted_version <- function()'v25.5.2-250508' ######## @@ -9397,7 +9398,12 @@ ui_elements <- list( fluidRow( shiny::column( width = 9, - data_summary_ui(id = "data_summary") + data_summary_ui(id = "data_summary"), + shiny::br(), + shiny::br(), + shiny::br(), + shiny::br(), + shiny::br() ), shiny::column( width = 3, @@ -9735,7 +9741,7 @@ ui_elements <- list( # shiny::img(shiny::icon("book")), shiny::tags$a( href = "https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8", - "Feedback",shiny::icon("arrow-up-right-from-square"), + "Feedback", shiny::icon("arrow-up-right-from-square"), target = "_blank", rel = "noopener noreferrer" ) @@ -9749,7 +9755,7 @@ ui_elements <- list( # shiny::img(shiny::icon("book")), shiny::tags$a( href = "https://agdamsbo.github.io/FreesearchR/", - "Docs",shiny::icon("arrow-up-right-from-square"), + "Docs", shiny::icon("arrow-up-right-from-square"), target = "_blank", rel = "noopener noreferrer" ) @@ -9777,39 +9783,49 @@ ui <- bslib::page_fixed( header_include(), ## This adds the actual favicon ## png and ico versions are kept for compatibility - shiny::tags$head(tags$link(rel="shortcut icon", href="favicon.svg")), + shiny::tags$head(tags$link(rel = "shortcut icon", href = "favicon.svg")), title = "FreesearchR", theme = light, shiny::useBusyIndicators(), - bslib::page_navbar( - id = "main_panel", - ui_elements$home, - ui_elements$import, - ui_elements$overview, - ui_elements$describe, - ui_elements$visuals, - ui_elements$analyze, - ui_elements$download, - bslib::nav_spacer(), - ui_elements$feedback, - ui_elements$docs, - fillable = FALSE, - footer = shiny::tags$footer( - style = "background-color: #14131326; padding: 4px; text-align: center; bottom: 0; width: 100%;", - shiny::p( - style = "margin: 1", - "Data is only stored for analyses and deleted when the app is closed.", shiny::markdown("Consider [running ***FreesearchR*** locally](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine) if working with sensitive data.") - ), - shiny::p( - style = "margin: 1; color: #888;", - shiny::tags$a("Docs", href = "https://agdamsbo.github.io/FreesearchR/", target = "_blank", rel = "noopener noreferrer")," | ", hosted_version(), " | ", shiny::tags$a("License: AGPLv3", href = "https://github.com/agdamsbo/FreesearchR/blob/main/LICENSE.md", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Source", href = "https://github.com/agdamsbo/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Share feedback", href = "https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8", target = "_blank", rel = "noopener noreferrer") - ), + shinyjs::useShinyjs(), + shiny::div( + id = "loading_page", + # shiny::h1("Loading the FreesearchR app..."), + shinybusy::add_busy_spinner(position = "full-page") + ), + shinyjs::hidden( + shiny::div( + id = "main_content", + bslib::page_navbar( + id = "main_panel", + ui_elements$home, + ui_elements$import, + ui_elements$overview, + ui_elements$describe, + ui_elements$visuals, + ui_elements$analyze, + ui_elements$download, + bslib::nav_spacer(), + ui_elements$feedback, + ui_elements$docs, + fillable = FALSE, + footer = shiny::tags$footer( + style = "background-color: #14131326; padding: 4px; text-align: center; bottom: 0; width: 100%;", + shiny::p( + style = "margin: 1", + "Data is only stored for analyses and deleted when the app is closed.", shiny::markdown("Consider [running ***FreesearchR*** locally](https://agdamsbo.github.io/FreesearchR/#run-locally-on-your-own-machine) if working with sensitive data.") + ), + shiny::p( + style = "margin: 1; color: #888;", + shiny::tags$a("Docs", href = "https://agdamsbo.github.io/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", hosted_version(), " | ", shiny::tags$a("License: AGPLv3", href = "https://github.com/agdamsbo/FreesearchR/blob/main/LICENSE.md", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Source", href = "https://github.com/agdamsbo/FreesearchR/", target = "_blank", rel = "noopener noreferrer"), " | ", shiny::tags$a("Share feedback", href = "https://redcap.au.dk/surveys/?s=JPCLPTXYDKFA8DA8", target = "_blank", rel = "noopener noreferrer") + ), + ) + ) ) ) ) - ######## #### Current file: /Users/au301842/FreesearchR/app/server.R ######## @@ -9840,17 +9856,26 @@ library(shinyWidgets) library(DT) library(data.table) library(gtsummary) +library(shinyjs) data(starwars) data(mtcars) data(trial) +load_data <- function() { + Sys.sleep(1) + hide("loading_page") + show("main_content") +} + server <- function(input, output, session) { ## Listing files in www in session start to keep when ending and removing ## everything else. files.to.keep <- list.files("www/") + load_data() + ############################################################################## ######### ######### Night mode (just very popular, not really needed) diff --git a/renv.lock b/renv.lock index 500d62b6..8172a379 100644 --- a/renv.lock +++ b/renv.lock @@ -7930,6 +7930,40 @@ "Maintainer": "Victor Perrier ", "Repository": "CRAN" }, + "shinyjs": { + "Package": "shinyjs", + "Version": "2.1.0", + "Source": "Repository", + "Title": "Easily Improve the User Experience of Your Shiny Apps in Seconds", + "Authors@R": "person(\"Dean\", \"Attali\", email = \"daattali@gmail.com\", role = c(\"aut\", \"cre\"), comment= c(ORCID=\"0000-0002-5645-3493\"))", + "Description": "Perform common useful JavaScript operations in Shiny apps that will greatly improve your apps without having to know any JavaScript. Examples include: hiding an element, disabling an input, resetting an input back to its original value, delaying code execution by a few seconds, and many more useful functions for both the end user and the developer. 'shinyjs' can also be used to easily call your own custom JavaScript functions from R.", + "URL": "https://deanattali.com/shinyjs/", + "BugReports": "https://github.com/daattali/shinyjs/issues", + "Depends": [ + "R (>= 3.1.0)" + ], + "Imports": [ + "digest (>= 0.6.8)", + "jsonlite", + "shiny (>= 1.0.0)" + ], + "Suggests": [ + "htmltools (>= 0.2.9)", + "knitr (>= 1.7)", + "rmarkdown", + "shinyAce", + "shinydisconnect", + "testthat (>= 0.9.1)" + ], + "License": "MIT + file LICENSE", + "VignetteBuilder": "knitr", + "RoxygenNote": "7.1.1", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Dean Attali [aut, cre] ()", + "Maintainer": "Dean Attali ", + "Repository": "CRAN" + }, "sodium": { "Package": "sodium", "Version": "1.4.0",