diff --git a/R/help.R b/R/help.R index 1d569af..870201b 100644 --- a/R/help.R +++ b/R/help.R @@ -6,15 +6,7 @@ help_warranty <- function(...) { ) } -help_cite <- function(...) { - pkg <- switch ( - get_app_name(), - seriate = "kairos", - source = "nexus", - ternary = "isopleuros", - NULL - ) - +help_cite <- function(package) { list( tags$p( "If you use this application in your research, you must report", @@ -24,7 +16,7 @@ help_cite <- function(...) { "by the research community." ), tags$p("To cite in your publications, please use:"), - cite_package(pkg) + cite_package(package) ) } @@ -65,38 +57,10 @@ help_tesselle <- function(...) { ) } -help_overview <- function(...) { - switch ( - get_app_name(), - source = .help_overview_source(), - tags$p() - ) -} - -.help_overview_source <- function(...) { - list( - tags$p( - "Provenance studies rely on the identification of probable sources,", - "such that the variability between two sources is greater than", - "the internal variability of a single source", - "(the so-called", tags$em("provenance postulate", .noWS = "after"), ").", - "This assumes that a unique signature can be identified for each source", - "on the basis of several criteria." - ), - tags$p( - "This application is designed for chemical fingerprinting", - "and source tracking of ancient materials. It provides provides tools", - "for the exploration, visualization and analysis of compositional data", - "in the framework of", - cite_article(author = "Aitchison", year = "1986", after = ".") - ) - ) -} - help_workflow <- function(...) { def <- .help_workflow_panel() tab <- switch ( - get_app_name(), + get_option("name"), source = c("Data", "Composition", "Transform", "Statistics", "Plot", "Analysis"), ternary = c("Data", "Plot"), "Data" diff --git a/R/home.R b/R/home.R index 39a2c2c..b5e8573 100644 --- a/R/home.R +++ b/R/home.R @@ -2,11 +2,12 @@ #' About UI #' #' @param id A [`character`] vector to be used for the namespace. +#' @param package A [`character`] vector of package names to be cited. #' @seealso [home_server()] #' @family page modules #' @keywords internal #' @export -home_ui <- function(id) { +home_ui <- function(id, package) { # Create a namespace function using the provided id ns <- NS(id) @@ -22,7 +23,8 @@ home_ui <- function(id) { placement = "above", nav_panel( title = "Overview", - help_overview(), + h3(get_option("title")), + HTML(get_option("description")), help_warranty(), tags$p( class = "logo", @@ -34,7 +36,7 @@ home_ui <- function(id) { ), nav_panel( title = "How to cite", - help_cite() + help_cite(package) ), nav_panel( title = "About", diff --git a/R/run.R b/R/run.R index 2287df3..b4687de 100644 --- a/R/run.R +++ b/R/run.R @@ -35,7 +35,6 @@ run_app <- function(app = c("seriate", "source", "ternary"), ## Bundling the options inside the shinyApp object kinesis_options <- get_config(app) obj$appOptions$kinesis_options <- kinesis_options - obj$appOptions$app_name <- app obj } @@ -75,7 +74,3 @@ get_option <- function(name = NULL, default = NULL) { shiny::getShinyOption("kinesis_options")[[name]] %||% default } } - -get_app_name <- function(...) { - shiny::getShinyOption("app_name") -} diff --git a/inst/seriate/config.yml b/inst/seriate/config.yml index 7689ca5..b120553 100644 --- a/inst/seriate/config.yml +++ b/inst/seriate/config.yml @@ -1,6 +1,8 @@ default: production: TRUE verbose: FALSE + name: "seriate" + title: "Matrix Seriation" test: production: FALSE diff --git a/inst/seriate/ui.R b/inst/seriate/ui.R index 58e4e49..5f41216 100644 --- a/inst/seriate/ui.R +++ b/inst/seriate/ui.R @@ -9,7 +9,7 @@ shiny_ui <- function(request) { lang = "en", bslib::page_navbar( title = "seriate", - kinesis::home_ui("home"), + kinesis::home_ui("home", package = "kairos"), bslib::nav_panel( title = "Data", kinesis::import_ui("import") diff --git a/inst/source/config.yml b/inst/source/config.yml index 7689ca5..2b9b001 100644 --- a/inst/source/config.yml +++ b/inst/source/config.yml @@ -1,6 +1,18 @@ default: production: TRUE verbose: FALSE + name: "source" + title: "Compositional Data Analysis" + description: | +

Provenance studies rely on the identification of probable sources, + such that the variability between two sources is greater than the internal + variability of a single source (the so-called, provenance postulate). + This assumes that a unique signature can be identified for each source on + the basis of several criteria.

+

This application is designed for chemical fingerprinting and source + tracking of ancient materials. It provides provides tools for the + exploration, visualization and analysis of compositional data in the + framework of Aitchison (1986).

test: production: FALSE diff --git a/inst/source/ui.R b/inst/source/ui.R index ef7064a..2eaeec3 100644 --- a/inst/source/ui.R +++ b/inst/source/ui.R @@ -9,7 +9,7 @@ shiny_ui <- function(request) { lang = "en", bslib::page_navbar( title = "source", - kinesis::home_ui("home"), + kinesis::home_ui("home", package = "nexus"), bslib::nav_panel( title = "Data", kinesis::import_ui("import") diff --git a/inst/ternary/config.yml b/inst/ternary/config.yml index cde6c1c..8d47878 100644 --- a/inst/ternary/config.yml +++ b/inst/ternary/config.yml @@ -1,12 +1,13 @@ default: production: TRUE verbose: FALSE + name: "ternary" title: "Ternary Plot" description: | - This app allows to create ternary plots. It provides functions to display +

This app allows to create ternary plots. It provides functions to display the data in the ternary space, to add or tune graphical elements and to display statistical summaries. It also includes common ternary diagrams - useful for the archaeologist. + useful for the archaeologist.

test: production: FALSE diff --git a/inst/ternary/ui.R b/inst/ternary/ui.R index e18db83..6c34f22 100644 --- a/inst/ternary/ui.R +++ b/inst/ternary/ui.R @@ -9,7 +9,7 @@ shiny_ui <- function(request) { lang = "en", bslib::page_navbar( title = "ternary", - kinesis::home_ui("home"), + kinesis::home_ui("home", package = "isopleuros"), bslib::nav_panel( title = "Data", kinesis::import_ui("import") diff --git a/man/home_ui.Rd b/man/home_ui.Rd index f98268f..93a386e 100644 --- a/man/home_ui.Rd +++ b/man/home_ui.Rd @@ -4,10 +4,12 @@ \alias{home_ui} \title{About UI} \usage{ -home_ui(id) +home_ui(id, package) } \arguments{ \item{id}{A \code{\link{character}} vector to be used for the namespace.} + +\item{package}{A \code{\link{character}} vector of package names to be cited.} } \description{ About UI