]> nmode's Git Repositories - Rnaught/commitdiff
Update web app entry point
authorNaeem Model <me@nmode.ca>
Mon, 6 Jan 2025 23:55:43 +0000 (23:55 +0000)
committerNaeem Model <me@nmode.ca>
Mon, 6 Jan 2025 23:55:43 +0000 (23:55 +0000)
- Rename 'app' -> 'web'
- Return shiny app object in entry point function

43 files changed:
NAMESPACE
R/web.R [moved from R/app.R with 56% similarity]
inst/web/app.R [moved from inst/app/app.R with 100% similarity]
inst/web/index.html [moved from inst/app/index.html with 100% similarity]
inst/web/scripts/data.R [moved from inst/app/scripts/data.R with 100% similarity]
inst/web/scripts/estimators.R [moved from inst/app/scripts/estimators.R with 100% similarity]
inst/web/templates/content.html [moved from inst/app/templates/content.html with 100% similarity]
inst/web/templates/content/about.html [moved from inst/app/templates/content/about.html with 100% similarity]
inst/web/templates/content/data.html [moved from inst/app/templates/content/data.html with 100% similarity]
inst/web/templates/content/data/enter-data.html [moved from inst/app/templates/content/data/enter-data.html with 100% similarity]
inst/web/templates/content/data/enter-data/load-samples.html [moved from inst/app/templates/content/data/enter-data/load-samples.html with 100% similarity]
inst/web/templates/content/data/enter-data/manual-entry.html [moved from inst/app/templates/content/data/enter-data/manual-entry.html with 100% similarity]
inst/web/templates/content/data/enter-data/required-format.html [moved from inst/app/templates/content/data/enter-data/required-format.html with 100% similarity]
inst/web/templates/content/data/enter-data/upload-data.html [moved from inst/app/templates/content/data/enter-data/upload-data.html with 100% similarity]
inst/web/templates/content/data/view-data.html [moved from inst/app/templates/content/data/view-data.html with 100% similarity]
inst/web/templates/content/data/view-data/data-plots.html [moved from inst/app/templates/content/data/view-data/data-plots.html with 100% similarity]
inst/web/templates/content/data/view-data/data-table.html [moved from inst/app/templates/content/data/view-data/data-table.html with 100% similarity]
inst/web/templates/content/estimation.html [moved from inst/app/templates/content/estimation.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators.html [moved from inst/app/templates/content/estimation/about-estimators.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators/id.html [moved from inst/app/templates/content/estimation/about-estimators/id.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators/idea.html [moved from inst/app/templates/content/estimation/about-estimators/idea.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators/panel.html [moved from inst/app/templates/content/estimation/about-estimators/panel.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators/seq_bayes.html [moved from inst/app/templates/content/estimation/about-estimators/seq_bayes.html with 100% similarity]
inst/web/templates/content/estimation/about-estimators/wp.html [moved from inst/app/templates/content/estimation/about-estimators/wp.html with 100% similarity]
inst/web/templates/content/estimation/estimates.html [moved from inst/app/templates/content/estimation/estimates.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators.html [moved from inst/app/templates/content/estimation/estimates/add-estimators.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/id.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/id.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/idea.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/idea.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/mu.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/mu.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/parameters.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/parameters.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/seq_bayes.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/seq_bayes.html with 100% similarity]
inst/web/templates/content/estimation/estimates/add-estimators/wp.html [moved from inst/app/templates/content/estimation/estimates/add-estimators/wp.html with 100% similarity]
inst/web/templates/content/estimation/estimates/estimates-table.html [moved from inst/app/templates/content/estimation/estimates/estimates-table.html with 100% similarity]
inst/web/templates/content/help.html [moved from inst/app/templates/content/help.html with 100% similarity]
inst/web/templates/content/help/panel.html [moved from inst/app/templates/content/help/panel.html with 100% similarity]
inst/web/templates/content/help/serial-interval.html [moved from inst/app/templates/content/help/serial-interval.html with 100% similarity]
inst/web/templates/footer.html [moved from inst/app/templates/footer.html with 100% similarity]
inst/web/templates/navbar.html [moved from inst/app/templates/navbar.html with 100% similarity]
inst/web/templates/tabs.html [moved from inst/app/templates/tabs.html with 100% similarity]
inst/web/www/script.js [moved from inst/app/www/script.js with 100% similarity]
inst/web/www/styles.css [moved from inst/app/www/styles.css with 100% similarity]
man/app.Rd [deleted file]
man/web.Rd [new file with mode: 0644]

index 1557cc12b14606247842880a39bd08354bfc8da0..140ea5f89df2ac53902b7878024bc71d837ab389 100644 (file)
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,9 +1,9 @@
 # Generated by roxygen2: do not edit by hand
 
-export(app)
 export(id)
 export(idea)
 export(seq_bayes)
+export(web)
 export(wp)
 importFrom(stats,pgamma)
 importFrom(stats,qgamma)
diff --git a/R/app.R b/R/web.R
similarity index 56%
rename from R/app.R
rename to R/web.R
index 23e32ab8674be017cf43500d9e8ed941172c6714..ecfd501d48bc2d73f945a0e06ab4179dd7f8e6f6 100644 (file)
--- a/R/app.R
+++ b/R/web.R
@@ -1,17 +1,35 @@
 #' Launch the Rnaught Web Application
 #'
+#' This is the entry point of the Rnaught web application, which creates and
+#' returns a Shiny app object. When invoked directly, the web application is
+#' launched.
+#'
+#' The following dependencies are required to run the application:
+#'   * [shiny](https://shiny.posit.co)
+#'   * [bslib](https://rstudio.github.io/bslib)
+#'   * [DT](https://rstudio.github.io/DT)
+#'   * [plotly](https://plotly-r.com)
+#'
+#' If any of the above packages are missing during launch, a prompt will appear
+#' to install them.
+#'
+#' To configure settings such as the port, host or default browser, set Shiny's
+#' global options (see [shiny::runApp()]).
+#'
+#' @return A Shiny app object for the Rnaught web application.
+#'
 #' @importFrom utils install.packages
 #'
 #' @export
-app <- function() {
+web <- function() {
   missing_pkgs <- c()
   # Check for any missing, required packages.
-  if (!requireNamespace("bslib", quietly = TRUE)) {
-    missing_pkgs <- c(missing_pkgs, "bslib")
-  }
   if (!requireNamespace("shiny", quietly = TRUE)) {
     missing_pkgs <- c(missing_pkgs, "shiny")
   }
+  if (!requireNamespace("bslib", quietly = TRUE)) {
+    missing_pkgs <- c(missing_pkgs, "bslib")
+  }
   if (!requireNamespace("DT", quietly = TRUE)) {
     missing_pkgs <- c(missing_pkgs, "DT")
   }
@@ -35,5 +53,5 @@ app <- function() {
     }
   }
 
-  shiny::runApp(appDir = system.file("app", package = "Rnaught"))
+  shiny::shinyAppDir(appDir = system.file("web", package = "Rnaught"))
 }
similarity index 100%
rename from inst/app/app.R
rename to inst/web/app.R
similarity index 100%
rename from inst/app/index.html
rename to inst/web/index.html
diff --git a/man/app.Rd b/man/app.Rd
deleted file mode 100644 (file)
index f558dc9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/app.R
-\name{app}
-\alias{app}
-\title{Launch the Rnaught Web Application}
-\usage{
-app()
-}
-\description{
-Launch the Rnaught Web Application
-}
diff --git a/man/web.Rd b/man/web.Rd
new file mode 100644 (file)
index 0000000..36bce07
--- /dev/null
@@ -0,0 +1,31 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/web.R
+\name{web}
+\alias{web}
+\title{Launch the Rnaught Web Application}
+\usage{
+web()
+}
+\value{
+A Shiny app object for the Rnaught web application.
+}
+\description{
+This is the entry point of the Rnaught web application, which creates and
+returns a Shiny app object. When invoked directly, the web application is
+launched.
+}
+\details{
+The following dependencies are required to run the application:
+\itemize{
+\item \href{https://shiny.posit.co}{shiny}
+\item \href{https://rstudio.github.io/bslib}{bslib}
+\item \href{https://rstudio.github.io/DT}{DT}
+\item \href{https://plotly-r.com}{plotly}
+}
+
+If any of the above packages are missing during launch, a prompt will appear
+to install them.
+
+To configure settings such as the port, host or default browser, set Shiny's
+global options (see \code{\link[shiny:runApp]{shiny::runApp()}}).
+}