From 969796fe7c3526aa6f1450f53676fbaae45efe37 Mon Sep 17 00:00:00 2001 From: Federico Marini Date: Thu, 18 Jan 2024 18:17:43 +0100 Subject: [PATCH] exposing the app title as parameter to be possibly chosen by the user upon launching iSEEindex() --- R/iSEEindex.R | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/R/iSEEindex.R b/R/iSEEindex.R index 4dd048d..ed03f96 100644 --- a/R/iSEEindex.R +++ b/R/iSEEindex.R @@ -91,6 +91,9 @@ #' @param default.position Character scalar indicating whether the default #' initial configuration should be added as the `"first"` or `"last"` option #' in the Shiny `selectizeInput()`. +#' @param app.title Character string to specify the desired title to be displayed +#' in the main window of the dashboard. Defaults to `NULL`, which displays some +#' info on the versions of the `iSEEindex` and `iSEE` packages. #' @param body.header UI element to display \emph{above} the main landing page body. #' @param body.footer UI element to display \emph{below} the main landing page body. #' @@ -130,19 +133,26 @@ #' if (interactive()) { #' shiny::runApp(app, port = 1234) #' } -iSEEindex <- function(bfc, FUN.datasets, FUN.initial = NULL, default.add = TRUE, default.position = c("first", "last"), body.header = NULL, body.footer = NULL) { +iSEEindex <- function(bfc, FUN.datasets, FUN.initial = NULL, default.add = TRUE, default.position = c("first", "last"), app.title = NULL, body.header = NULL, body.footer = NULL) { stopifnot(is(bfc, "BiocFileCache")) if (is.null(FUN.initial)) { FUN.initial <- function() NULL } + + if (is.null(app.title)) { + app.title <- sprintf("iSEEindex - v%s|powered by iSEE - v%s", + packageVersion("iSEEindex"), + packageVersion("iSEE")) + } + iSEE( landingPage=.landing_page(bfc, FUN.datasets, FUN.initial, default.add, default.position, body.header, body.footer), - appTitle = sprintf("iSEEindex - v%s", - packageVersion("iSEEindex") - ) + appTitle = app.title ) } + + #' Prepare and Launch the Main App. #' #' Invokes a function that replaces the landing page by the \pkg{iSEE}