From 9fd931aeeba4ab7bdede1a625f64e7024c2b55aa Mon Sep 17 00:00:00 2001 From: Naeem Model Date: Sun, 9 Jun 2024 16:01:51 +0000 Subject: Update Shiny app - Remove template/logic for single data entry - Change 'Add estimators' to 'About estimators'; adding estimators and viewing estimates are now done in the same tab - Swap rows and columns in estimates table (estimators as row names, datasets as column names) - Add a separate column for the serial interval to the estimates table - Add plots for daily and weekly data using the Plotly library - Remove italics from the subscript in all occurences of 'R_0' - Fix code/text formatting --- inst/app/templates/content/data/enter-data.html | 17 ++++---- .../content/data/enter-data/bulk-entry.html | 48 ---------------------- .../templates/content/data/enter-data/entry.html | 48 ---------------------- .../content/data/enter-data/load-samples.html | 2 + .../content/data/enter-data/manual-entry.html | 11 +++++ .../content/data/enter-data/required-format.html | 25 +++++++++++ .../content/data/enter-data/single-entry.html | 39 ------------------ .../content/data/enter-data/upload-data.html | 12 ++++++ inst/app/templates/content/data/view-data.html | 22 ++-------- .../content/data/view-data/data-plots.html | 7 ++++ .../content/data/view-data/data-table.html | 18 ++++++++ 11 files changed, 87 insertions(+), 162 deletions(-) delete mode 100644 inst/app/templates/content/data/enter-data/bulk-entry.html delete mode 100644 inst/app/templates/content/data/enter-data/entry.html create mode 100644 inst/app/templates/content/data/enter-data/manual-entry.html create mode 100644 inst/app/templates/content/data/enter-data/required-format.html delete mode 100644 inst/app/templates/content/data/enter-data/single-entry.html create mode 100644 inst/app/templates/content/data/enter-data/upload-data.html create mode 100644 inst/app/templates/content/data/view-data/data-plots.html create mode 100644 inst/app/templates/content/data/view-data/data-table.html (limited to 'inst/app/templates/content/data') diff --git a/inst/app/templates/content/data/enter-data.html b/inst/app/templates/content/data/enter-data.html index 77846fa..254f1d7 100644 --- a/inst/app/templates/content/data/enter-data.html +++ b/inst/app/templates/content/data/enter-data.html @@ -1,8 +1,9 @@ - -
- {{ htmlTemplate("templates/content/data/enter-data/entry.html") }} -
-
-
- {{ htmlTemplate("templates/content/data/enter-data/load-samples.html") }} -
+
+ {{ htmlTemplate("templates/content/data/enter-data/required-format.html") }} + {{ htmlTemplate("templates/content/data/enter-data/manual-entry.html") }} + {{ htmlTemplate("templates/content/data/enter-data/upload-data.html") }} +
+
+
+ {{ htmlTemplate("templates/content/data/enter-data/load-samples.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 deleted file mode 100644 index 30fab06..0000000 --- a/inst/app/templates/content/data/enter-data/bulk-entry.html +++ /dev/null @@ -1,48 +0,0 @@ -

Bulk entry

- - - -
-
-

Manually enter rows or upload a CSV file 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/entry.html b/inst/app/templates/content/data/enter-data/entry.html deleted file mode 100644 index be43625..0000000 --- a/inst/app/templates/content/data/enter-data/entry.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
-
-

Manually enter rows or upload a CSV file 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/load-samples.html b/inst/app/templates/content/data/enter-data/load-samples.html index a42a8c8..2a4f013 100644 --- a/inst/app/templates/content/data/enter-data/load-samples.html +++ b/inst/app/templates/content/data/enter-data/load-samples.html @@ -1,4 +1,5 @@

Load samples

+ {{ checkboxInput(inputId = "covid_canada", label = "COVID-19 Canada, 2020/03/03 - 2020/03/31 (Weekly)", value = FALSE, width = "100%" @@ -9,6 +10,7 @@ value = FALSE, width = "100%" ) }} +
diff --git a/inst/app/templates/content/data/enter-data/manual-entry.html b/inst/app/templates/content/data/enter-data/manual-entry.html new file mode 100644 index 0000000..a6319d9 --- /dev/null +++ b/inst/app/templates/content/data/enter-data/manual-entry.html @@ -0,0 +1,11 @@ + +
+ + +
+ +
+ +
diff --git a/inst/app/templates/content/data/enter-data/required-format.html b/inst/app/templates/content/data/enter-data/required-format.html new file mode 100644 index 0000000..724dd83 --- /dev/null +++ b/inst/app/templates/content/data/enter-data/required-format.html @@ -0,0 +1,25 @@ + + + +
+
+

Manually enter rows or upload a CSV file 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:

+

+ Disease A,Days,1,2,3,4,5,6,7,8,9
+ Disease B,Weeks,3,1,4,1,5,2,9
+ Disease C,Days,2,3,5,7,11,13,17,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 deleted file mode 100644 index 9f249d9..0000000 --- a/inst/app/templates/content/data/enter-data/single-entry.html +++ /dev/null @@ -1,39 +0,0 @@ -

Single entry

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

Data table

- -
- {{ DT::dataTableOutput(outputId = "data_table") }} -
- - - - - - - Export table - +{{ htmlTemplate("templates/content/data/view-data/data-table.html") }} +
+{{ htmlTemplate("templates/content/data/view-data/data-plots.html") }} diff --git a/inst/app/templates/content/data/view-data/data-plots.html b/inst/app/templates/content/data/view-data/data-plots.html new file mode 100644 index 0000000..5019088 --- /dev/null +++ b/inst/app/templates/content/data/view-data/data-plots.html @@ -0,0 +1,7 @@ +

Data plots

+
+ {{ plotly::plotlyOutput(outputId = "data_plot_days") }} +
+
+ {{ plotly::plotlyOutput(outputId = "data_plot_weeks") }} +
diff --git a/inst/app/templates/content/data/view-data/data-table.html b/inst/app/templates/content/data/view-data/data-table.html new file mode 100644 index 0000000..590a5b9 --- /dev/null +++ b/inst/app/templates/content/data/view-data/data-table.html @@ -0,0 +1,18 @@ +

Data table

+
+ {{ DT::dataTableOutput(outputId = "data_table") }} +
+ + + + + + + Export table + -- cgit v1.2.3