Skip to content

Commit

Permalink
Add app description in config files
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Oct 21, 2024
1 parent 74749f3 commit 24de937
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 53 deletions.
42 changes: 3 additions & 39 deletions R/help.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
)
}

Expand Down Expand Up @@ -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"
Expand Down
8 changes: 5 additions & 3 deletions R/home.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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",
Expand All @@ -34,7 +36,7 @@ home_ui <- function(id) {
),
nav_panel(
title = "How to cite",
help_cite()
help_cite(package)
),
nav_panel(
title = "About",
Expand Down
5 changes: 0 additions & 5 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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")
}
2 changes: 2 additions & 0 deletions inst/seriate/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
default:
production: TRUE
verbose: FALSE
name: "seriate"
title: "Matrix Seriation"

test:
production: FALSE
Expand Down
2 changes: 1 addition & 1 deletion inst/seriate/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 12 additions & 0 deletions inst/source/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
default:
production: TRUE
verbose: FALSE
name: "source"
title: "Compositional Data Analysis"
description: |
<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, <em>provenance postulate</em>).
This assumes that a unique signature can be identified for each source on
the basis of several criteria.</p>
<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 Aitchison (1986).</p>
test:
production: FALSE
Expand Down
2 changes: 1 addition & 1 deletion inst/source/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 3 additions & 2 deletions inst/ternary/config.yml
Original file line number Diff line number Diff line change
@@ -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
<p>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.<p>
test:
production: FALSE
Expand Down
2 changes: 1 addition & 1 deletion inst/ternary/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion man/home_ui.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24de937

Please sign in to comment.