From dce01ac19a0298388089ce4297a44ef2aa2c4c46 Mon Sep 17 00:00:00 2001 From: Naeem Model Date: Thu, 9 May 2024 20:22:45 +0000 Subject: Revamp Shiny app --- inst/app/templates/content.html | 14 ++++++++ inst/app/templates/content/about.html | 27 +++++++++++++++ inst/app/templates/content/data.html | 13 ++++++++ inst/app/templates/content/data/enter-data.html | 13 ++++++++ .../content/data/enter-data/bulk-entry.html | 37 ++++++++++++++++++++ .../content/data/enter-data/single-entry.html | 39 ++++++++++++++++++++++ inst/app/templates/content/data/view-data.html | 19 +++++++++++ inst/app/templates/content/estimators.html | 13 ++++++++ .../content/estimators/add-estimators.html | 34 +++++++++++++++++++ .../estimators/add-estimators/components/mu.html | 20 +++++++++++ .../add-estimators/components/panel.html | 21 ++++++++++++ .../estimators/add-estimators/descriptions/id.html | 1 + .../add-estimators/descriptions/idea.html | 1 + .../add-estimators/descriptions/seq_bayes.html | 1 + .../estimators/add-estimators/descriptions/wp.html | 1 + .../estimators/add-estimators/parameters/id.html | 1 + .../estimators/add-estimators/parameters/idea.html | 1 + .../add-estimators/parameters/seq_bayes.html | 22 ++++++++++++ .../estimators/add-estimators/parameters/wp.html | 39 ++++++++++++++++++++++ .../content/estimators/view-estimates.html | 21 ++++++++++++ inst/app/templates/content/help.html | 14 ++++++++ .../app/templates/content/help/example-help-1.html | 1 + .../app/templates/content/help/example-help-2.html | 1 + inst/app/templates/content/help/panel.html | 12 +++++++ inst/app/templates/footer.html | 7 ++++ inst/app/templates/navbar.html | 27 +++++++++++++++ inst/app/templates/tabs.html | 14 ++++++++ 27 files changed, 414 insertions(+) create mode 100644 inst/app/templates/content.html create mode 100644 inst/app/templates/content/about.html create mode 100644 inst/app/templates/content/data.html create mode 100644 inst/app/templates/content/data/enter-data.html create mode 100644 inst/app/templates/content/data/enter-data/bulk-entry.html create mode 100644 inst/app/templates/content/data/enter-data/single-entry.html create mode 100644 inst/app/templates/content/data/view-data.html create mode 100644 inst/app/templates/content/estimators.html create mode 100644 inst/app/templates/content/estimators/add-estimators.html create mode 100644 inst/app/templates/content/estimators/add-estimators/components/mu.html create mode 100644 inst/app/templates/content/estimators/add-estimators/components/panel.html create mode 100644 inst/app/templates/content/estimators/add-estimators/descriptions/id.html create mode 100644 inst/app/templates/content/estimators/add-estimators/descriptions/idea.html create mode 100644 inst/app/templates/content/estimators/add-estimators/descriptions/seq_bayes.html create mode 100644 inst/app/templates/content/estimators/add-estimators/descriptions/wp.html create mode 100644 inst/app/templates/content/estimators/add-estimators/parameters/id.html create mode 100644 inst/app/templates/content/estimators/add-estimators/parameters/idea.html create mode 100644 inst/app/templates/content/estimators/add-estimators/parameters/seq_bayes.html create mode 100644 inst/app/templates/content/estimators/add-estimators/parameters/wp.html create mode 100644 inst/app/templates/content/estimators/view-estimates.html create mode 100644 inst/app/templates/content/help.html create mode 100644 inst/app/templates/content/help/example-help-1.html create mode 100644 inst/app/templates/content/help/example-help-2.html create mode 100644 inst/app/templates/content/help/panel.html create mode 100644 inst/app/templates/footer.html create mode 100644 inst/app/templates/navbar.html create mode 100644 inst/app/templates/tabs.html (limited to 'inst/app/templates') diff --git a/inst/app/templates/content.html b/inst/app/templates/content.html new file mode 100644 index 0000000..8147c07 --- /dev/null +++ b/inst/app/templates/content.html @@ -0,0 +1,14 @@ +
+
+ {{ htmlTemplate("templates/content/about.html") }} +
+
+ {{ htmlTemplate("templates/content/data.html") }} +
+
+ {{ htmlTemplate("templates/content/estimators.html") }} +
+
+ {{ htmlTemplate("templates/content/help.html") }} +
+
diff --git a/inst/app/templates/content/about.html b/inst/app/templates/content/about.html new file mode 100644 index 0000000..aa806d5 --- /dev/null +++ b/inst/app/templates/content/about.html @@ -0,0 +1,27 @@ +

Welcome to the Rnaught web application!

+

+ Rnaught is an R package and web application for estimating the + basic reproduction number + of infectious diseases. For information about using this application, view the + Help tab. + To learn more about the package, visit the online + documentation or + GitHub repository. + Technical details about the estimators featured in this project can be found in the reference + article. +

+ +

What is the basic reproduction number?

+

+ The basic reproduction number, denoted R0, describes the expected number of infections caused by a + single infectious individual. It assumes that all individuals in a given population are susceptible to the disease, + and that no preventive measures (such as lockdowns or vaccinations) have been enforced. As such, it is a useful + indicator of the transmissibility of a disease during the early stages of its detection. +

+

+ If R0 < 1, then the disease will eventually die out. On the other hand, if + R0 > 1, the rate at which the disease spreads is exponential. Typically, it is difficult to + determine R0 precisely, due to uncertainty in information relating to the spread of the disease. + Therefore, many estimation methods exist, each based on their own models and yielding different estimates. It is the + responsibility of public health officials to employ the most appropriate estimator given the situation at hand. +

diff --git a/inst/app/templates/content/data.html b/inst/app/templates/content/data.html new file mode 100644 index 0000000..eaae571 --- /dev/null +++ b/inst/app/templates/content/data.html @@ -0,0 +1,13 @@ + + +
+
+ {{ htmlTemplate("templates/content/data/enter-data.html") }} +
+
+ {{ htmlTemplate("templates/content/data/view-data.html") }} +
+
diff --git a/inst/app/templates/content/data/enter-data.html b/inst/app/templates/content/data/enter-data.html new file mode 100644 index 0000000..621c785 --- /dev/null +++ b/inst/app/templates/content/data/enter-data.html @@ -0,0 +1,13 @@ +
+
+ {{ htmlTemplate("templates/content/data/enter-data/single-entry.html") }} +
+
+
Data plot
+ {{ plotOutput(outputId = "data_plot") }} +
+
+
+
+ {{ htmlTemplate("templates/content/data/enter-data/bulk-entry.html") }} +
diff --git a/inst/app/templates/content/data/enter-data/bulk-entry.html b/inst/app/templates/content/data/enter-data/bulk-entry.html new file mode 100644 index 0000000..82a3ccf --- /dev/null +++ b/inst/app/templates/content/data/enter-data/bulk-entry.html @@ -0,0 +1,37 @@ +

Bulk entry

+ + + +
+
+

Enter one or more rows in the following format:

+

+ Dataset name,Time units,Case counts +

+

+ Time units must be one of + Days or + Weeks, and + Case counts + must be a comma-separated list of one or more non-negative integers. +

+

Example:

+

+ Montreal,Days,1,2,3,4,5,6,7,8,9,19
+ Ottawa,Weeks,1,2,3,4,5,6,7,8,9,19
+ Toronto,Days,1,2,3,4,5,6,7,8,9,19 +

+
+
+ +
+ + +
+ + diff --git a/inst/app/templates/content/data/enter-data/single-entry.html b/inst/app/templates/content/data/enter-data/single-entry.html new file mode 100644 index 0000000..9f249d9 --- /dev/null +++ b/inst/app/templates/content/data/enter-data/single-entry.html @@ -0,0 +1,39 @@ +

Single entry

+ +
+ + + +
+ +
+ + + +
+ +
+ +
+
+ +
+
+ +
+
+
+ + diff --git a/inst/app/templates/content/data/view-data.html b/inst/app/templates/content/data/view-data.html new file mode 100644 index 0000000..52f1e85 --- /dev/null +++ b/inst/app/templates/content/data/view-data.html @@ -0,0 +1,19 @@ +

Data table

+ +
+ {{ DT::dataTableOutput(outputId = "data_table") }} +
+ + + + + + + Export table + diff --git a/inst/app/templates/content/estimators.html b/inst/app/templates/content/estimators.html new file mode 100644 index 0000000..e664ad2 --- /dev/null +++ b/inst/app/templates/content/estimators.html @@ -0,0 +1,13 @@ + + +
+
+ {{ htmlTemplate("templates/content/estimators/add-estimators.html") }} +
+
+ {{ htmlTemplate("templates/content/estimators/view-estimates.html") }} +
+
diff --git a/inst/app/templates/content/estimators/add-estimators.html b/inst/app/templates/content/estimators/add-estimators.html new file mode 100644 index 0000000..dce2dae --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators.html @@ -0,0 +1,34 @@ +
+ {{ + htmlTemplate("templates/content/estimators/add-estimators/components/panel.html", + id = "id", + header = "Incidence Decay (ID)", + reference_label = "Fisman et al. (PloS One, 2013)", + reference_url = "https://doi.org/10.1371/journal.pone.0083622" + ) + }} + {{ + htmlTemplate("templates/content/estimators/add-estimators/components/panel.html", + id = "idea", + header = "Incidence Decay and Exponential Adjustment (IDEA)", + reference_label = "Fisman et al. (PloS One, 2013)", + reference_url = "https://doi.org/10.1371/journal.pone.0083622" + ) + }} + {{ + htmlTemplate("templates/content/estimators/add-estimators/components/panel.html", + id = "seq_bayes", + header = "Sequential Bayes (seqB)", + reference_label = "Bettencourt and Riberio (PloS One, 2008)", + reference_url = "https://doi.org/10.1371/journal.pone.0002185" + ) + }} + {{ + htmlTemplate("templates/content/estimators/add-estimators/components/panel.html", + id = "wp", + header = "White and Pagano (WP)", + reference_label = "White and Pagano (Statistics in Medicine, 2008)", + reference_url = "https://doi.org/10.1002/sim.3136" + ) + }} +
diff --git a/inst/app/templates/content/estimators/add-estimators/components/mu.html b/inst/app/templates/content/estimators/add-estimators/components/mu.html new file mode 100644 index 0000000..f25a1c8 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/components/mu.html @@ -0,0 +1,20 @@ + + +
+ + + + +
+ + diff --git a/inst/app/templates/content/estimators/add-estimators/components/panel.html b/inst/app/templates/content/estimators/add-estimators/components/panel.html new file mode 100644 index 0000000..b1e0378 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/components/panel.html @@ -0,0 +1,21 @@ +
+

+ +

+
+
+

Reference: {{ reference_label }}

+

{{ htmlTemplate(paste0("templates/content/estimators/add-estimators/descriptions/", id, ".html")) }}

+
Parameters
+
+ {{ htmlTemplate(paste0("templates/content/estimators/add-estimators/parameters/", id, ".html")) }} +
+ +
+
+
diff --git a/inst/app/templates/content/estimators/add-estimators/descriptions/id.html b/inst/app/templates/content/estimators/add-estimators/descriptions/id.html new file mode 100644 index 0000000..b182ae5 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/descriptions/id.html @@ -0,0 +1 @@ +This is a short description of the ID method. diff --git a/inst/app/templates/content/estimators/add-estimators/descriptions/idea.html b/inst/app/templates/content/estimators/add-estimators/descriptions/idea.html new file mode 100644 index 0000000..edfbb79 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/descriptions/idea.html @@ -0,0 +1 @@ +This is a short description of the IDEA method. diff --git a/inst/app/templates/content/estimators/add-estimators/descriptions/seq_bayes.html b/inst/app/templates/content/estimators/add-estimators/descriptions/seq_bayes.html new file mode 100644 index 0000000..f6df3ee --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/descriptions/seq_bayes.html @@ -0,0 +1 @@ +This is a short description of the seqB method. diff --git a/inst/app/templates/content/estimators/add-estimators/descriptions/wp.html b/inst/app/templates/content/estimators/add-estimators/descriptions/wp.html new file mode 100644 index 0000000..640b44d --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/descriptions/wp.html @@ -0,0 +1 @@ +This is a short description of the WP method. diff --git a/inst/app/templates/content/estimators/add-estimators/parameters/id.html b/inst/app/templates/content/estimators/add-estimators/parameters/id.html new file mode 100644 index 0000000..a3159ca --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/parameters/id.html @@ -0,0 +1 @@ +{{ htmlTemplate("templates/content/estimators/add-estimators/components/mu.html", id = "id") }} diff --git a/inst/app/templates/content/estimators/add-estimators/parameters/idea.html b/inst/app/templates/content/estimators/add-estimators/parameters/idea.html new file mode 100644 index 0000000..379be84 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/parameters/idea.html @@ -0,0 +1 @@ +{{ htmlTemplate("templates/content/estimators/add-estimators/components/mu.html", id = "idea") }} diff --git a/inst/app/templates/content/estimators/add-estimators/parameters/seq_bayes.html b/inst/app/templates/content/estimators/add-estimators/parameters/seq_bayes.html new file mode 100644 index 0000000..bcc82b7 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/parameters/seq_bayes.html @@ -0,0 +1,22 @@ +
+ +
+ {{ htmlTemplate("templates/content/estimators/add-estimators/components/mu.html", id = "seq_bayes") }} +
+ +
+ + + + + + +
+
diff --git a/inst/app/templates/content/estimators/add-estimators/parameters/wp.html b/inst/app/templates/content/estimators/add-estimators/parameters/wp.html new file mode 100644 index 0000000..b789a23 --- /dev/null +++ b/inst/app/templates/content/estimators/add-estimators/parameters/wp.html @@ -0,0 +1,39 @@ + + +
+
+ +
+
+ +
+
+ +
+ {{ htmlTemplate("templates/content/estimators/add-estimators/components/mu.html", id = "wp") }} +
+ +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
diff --git a/inst/app/templates/content/estimators/view-estimates.html b/inst/app/templates/content/estimators/view-estimates.html new file mode 100644 index 0000000..e81fff6 --- /dev/null +++ b/inst/app/templates/content/estimators/view-estimates.html @@ -0,0 +1,21 @@ +

Estimates table

+ +
+ {{ DT::dataTableOutput(outputId = "estimates_table") }} +
+ + + + + + + Export table + diff --git a/inst/app/templates/content/help.html b/inst/app/templates/content/help.html new file mode 100644 index 0000000..388afb1 --- /dev/null +++ b/inst/app/templates/content/help.html @@ -0,0 +1,14 @@ +
+ {{ + htmlTemplate("templates/content/help/panel.html", + id = "example-help-1", + header = "Example help 1" + ) + }} + {{ + htmlTemplate("templates/content/help/panel.html", + id = "example-help-2", + header = "Example help 2" + ) + }} +
diff --git a/inst/app/templates/content/help/example-help-1.html b/inst/app/templates/content/help/example-help-1.html new file mode 100644 index 0000000..245b9b6 --- /dev/null +++ b/inst/app/templates/content/help/example-help-1.html @@ -0,0 +1 @@ +Example help 1 diff --git a/inst/app/templates/content/help/example-help-2.html b/inst/app/templates/content/help/example-help-2.html new file mode 100644 index 0000000..a4817b5 --- /dev/null +++ b/inst/app/templates/content/help/example-help-2.html @@ -0,0 +1 @@ +Example help 2 diff --git a/inst/app/templates/content/help/panel.html b/inst/app/templates/content/help/panel.html new file mode 100644 index 0000000..9eb6e2e --- /dev/null +++ b/inst/app/templates/content/help/panel.html @@ -0,0 +1,12 @@ +
+

+ +

+
+
+ {{ htmlTemplate(paste0("templates/content/help/", id, ".html")) }} +
+
+
diff --git a/inst/app/templates/footer.html b/inst/app/templates/footer.html new file mode 100644 index 0000000..19d4b0c --- /dev/null +++ b/inst/app/templates/footer.html @@ -0,0 +1,7 @@ + diff --git a/inst/app/templates/navbar.html b/inst/app/templates/navbar.html new file mode 100644 index 0000000..1f86953 --- /dev/null +++ b/inst/app/templates/navbar.html @@ -0,0 +1,27 @@ + diff --git a/inst/app/templates/tabs.html b/inst/app/templates/tabs.html new file mode 100644 index 0000000..bd07df9 --- /dev/null +++ b/inst/app/templates/tabs.html @@ -0,0 +1,14 @@ + -- cgit v1.2.3