Skip to content

Commit

Permalink
Merge pull request #18 from jimbrig/main
Browse files Browse the repository at this point in the history
Enhancement: Added Docker Container Support
  • Loading branch information
Nelson-Gon committed May 20, 2023
2 parents 007df67 + 41779e8 commit 236f5e0
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 339 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ testdata/
^R/rsconnect$
^app\.R$
^dev$
^\.dockerignore$
^Dockerfile$
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.RData
.Rhistory
.git
.gitignore
manifest.json
rsconnect/
.Rproj.user
23 changes: 23 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish-Docker
on:
workflow_dispatch:
push:
branches:
- main
- develop
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
default_branch: main
workdir: .
tags: ${{ github.ref_name }}
tag_semver: true
57 changes: 29 additions & 28 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
Package: shinymde
Title: A Shiny Interface to mde, the missing data explorer
Version: 0.1.2.9000
Authors@R:
person(given = "Nelson",
family = "Gonzabato",
role = c("aut", "cre"),
email = "gonzabato@hotmail.com")
Description: Shiny applications provide an easy way for users to perform simple
or complex analyses. The package (app), "shinymde" provides a graphical user
interface to "mde", the missing data explorer R package.
Title: A Shiny Interface to mde, the missing data explorer
Version: 0.1.3
Authors@R: c(
person("Nelson", "Gonzabato", , "gonzabato@hotmail.com", role = c("aut", "cre")),
person("Jimmy", "Briggs", , "jimmy.briggs@jimbrig.com", role = "ctb")
)
Description: Shiny applications provide an easy way for users to perform
simple or complex analyses. The package (app), "shinymde" provides a
graphical user interface to "mde", the missing data explorer R
package.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
URL: https://github.com/Nelson-Gon/shinymde
BugReports: https://github.com/Nelson-Gon/shinymde/issues
Depends:
shiny (>= 1.6.0),
shinydashboard (>= 0.7.1)
Imports:
config (>= 0.3.1),
dplyr (>= 1.0.7),
forcats (>= 0.5.1),
ggplot2 (>= 3.3.4),
golem (>= 0.3.1),
grDevices,
magrittr (>= 2.0.1),
mde,
methods,
readxl (>= 1.3.1),
shinyjs (>= 2.0.0),
vroom (>= 1.5.3),
shinycssloaders (>= 1.0.0),
shinyFeedback (>= 0.3.0),
magrittr (>= 2.0.1),
golem (>= 0.3.1),
config (>= 0.3.1),
mde (>= 0.3.1),
shinyjs (>= 2.0.0),
shinyWidgets (>= 0.6.2),
shinycssloaders (>= 1.0.0)
Depends:
shiny (>= 1.6.0),
shinydashboard (>= 0.7.1)
Remotes:
Nelson-Gon/mde
utils,
vroom (>= 1.5.3)
Suggests:
knitr,
rmarkdown,
markdown
VignetteBuilder: knitr
rmarkdown
VignetteBuilder:
knitr
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM rocker/verse:4.3.0
RUN apt-get update && apt-get install -y libicu-dev make pandoc zlib1g-dev && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("magrittr",upgrade="never", version = "2.0.3")'
RUN Rscript -e 'remotes::install_version("dplyr",upgrade="never", version = "1.1.2")'
RUN Rscript -e 'remotes::install_version("knitr",upgrade="never", version = "1.42")'
RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.7.4")'
RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.1")'
RUN Rscript -e 'remotes::install_version("rmarkdown",upgrade="never", version = "2.21")'
RUN Rscript -e 'remotes::install_version("vroom",upgrade="never", version = "1.6.3")'
RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.7.6")'
RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("shinyFeedback",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("readxl",upgrade="never", version = "1.4.2")'
RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.4.2")'
RUN Rscript -e 'remotes::install_version("forcats",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("shinydashboard",upgrade="never", version = "0.7.2")'
RUN Rscript -e 'remotes::install_cran("mde")'
RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
RUN R -e 'remotes::install_local(upgrade="never")'
RUN rm -rf /build_zone
EXPOSE 80
CMD R -e "options('shiny.port'=80,shiny.host='0.0.0.0');library(shinymde);shinymde::run_app()"
273 changes: 0 additions & 273 deletions NEWS.html

This file was deleted.

37 changes: 24 additions & 13 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
---
date: "1/1/2022"
date: "5/16/2023"
author: "Nelson Gonzabato"
title: "Changes to shinymde"
---

**shinymde 0.1.2**
# shinymde 0.1.3

Contributed by [@jimbrig](https://github.com/jimbrig):

* Added Docker support to package

* Fixed `mde` package dependency in DESCRIPTION

* Added dependencies.R script

* Added dev/docker.sh Shell script


# shinymde 0.1.2

* Plots now fill the entire page.

Expand All @@ -18,7 +31,8 @@ easier to build repetitive UIs. See [#15](https://github.com/Nelson-Gon/shinymde
* There is now an option to customize plot designs for examples themes.
See https://github.com/Nelson-Gon/shinymde/issues/14

**shinymde 0.1.1**

# shinymde 0.1.1

* UI overhaul to ensure a much better user experience. Specifically, inputs were decluttered to make it easier to do analyses with minimal interference.

Expand Down Expand Up @@ -48,9 +62,9 @@ See https://github.com/Nelson-Gon/shinymde/issues/14

* Non-needed directories for build were removed from the shipped package/app.

---
# shinymde 0.1.0

**shinymde 0.1.0**
* Added a `NEWS.md` file to track changes to the package.

* shinymde can now be browsed at https://nelson-gon.shinyapps.io/shinymde.

Expand Down Expand Up @@ -107,7 +121,6 @@ documentation, and author homepage.

* User feedback is now provided via `shinyFeedback` which is a more helpful way for users to view feedback directly within the application.


* A reset button now exists to enable a user to restore default values for plot save preferences.

* Grouped summaries now support exclusion following a fix in [mde](https://nelson-gon.github.io/mde).
Expand All @@ -120,20 +133,18 @@ documentation, and author homepage.

* Visual summaries are now shown in a sidebar layout.


* It is now possible to download a summary of missingness, a data set with values recoded as requested, or one where values have been dropped.

* Initially supported operations

- Data input supports either user data, an inbuilt data set, or a remote data set provided as a web link. For user data, only ".csv", ".xlsx", and ".tsv" are supported.

- A tabular missingness summary is provided that can be downloaded by the user. The file format to write to is guessed from the user's input.
* Data input supports either user data, an inbuilt data set, or a remote data set provided as a web link. For user data, only ".csv", ".xlsx", and ".tsv" are supported.

* A tabular missingness summary is provided that can be downloaded by the user. The file format to write to is guessed from the user's input.

- Recoding values supports `recode_as_na`, `recode_na_as`, `recode_na_if`, `recode_as_na_for` and other recode functions from package `mde`.
* Recoding values supports `recode_as_na`, `recode_na_as`, `recode_na_if`, `recode_as_na_for` and other recode functions from package `mde`.

- Dropping values using `drop_` from `mde`.
* Dropping values using `drop_` from `mde`.

- A visual summary of missingness is also available. This is currently "just" a visual alternative to the tabular summary of missingness.
* A visual summary of missingness is also available. This is currently "just" a visual alternative to the tabular summary of missingness.

* Added a `NEWS.md` file to track changes to the package.
2 changes: 1 addition & 1 deletion R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ get_all_themes <- eventReactive(input$pkg,
})
get_theme <- reactive(
# akrun credit:https://stackoverflow.com/q/70414757/10323798
getFunction(get_all_themes()[grep(req(input$theme), get_all_themes())])()
methods::getFunction(get_all_themes()[grep(req(input$theme), get_all_themes())])()
)
# Update available themes based on the above
observe(
Expand Down
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
shinymde: A shiny interface to mde, the missing data explorer
================
2021-12-18
2023-05-16

[![R-CMD-check](https://github.com/Nelson-Gon/shinymde/actions/workflows/rcheck.yaml/badge.svg)](https://github.com/Nelson-Gon/shinymde/actions/workflows/rcheck.yaml)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -51,39 +51,43 @@ Thank you!

# Currently Implemented features

- [x] Summary of missingness
- [x] Summary of missingness

This uses [mde](https://nelson-gon.github.io/mde)’s `na_summary`
function to generate a simple missingness report. The user can also
download this report for use in other purposes.

- [x] Recoding as NA and recoding NA as
- [x] Recoding as NA and recoding NA as

This allows a user to recode a given value as `NA`, R’s handler of
missing values or convert `NA`s to some other value. It uses `mde`’s
`recode_*` functions.

- [x] Conditional recoding
- [x] Conditional recoding

This allows one to recode values conditionally. This supports
`recode_as_na_for`, `recode_as_na_if`, and other conditional recoding
functions.

- [x] Drop based on missingness
- [x] Drop based on missingness

This uses `mde`’s `drop_na_*` functions.

- [x] Missingness plots
- [x] Missingness plots

- [ ] Gear icon that allows users to customize plot options e.g. plot
themes, axis labels, legends, etc.
- [ ] Gear icon that allows users to customize plot options e.g. plot
themes, axis labels, legends, etc.

# `shinymde` in action

Below is a screenshot showing current functionality.

![shinymde in
action](https://github.com/Nelson-Gon/shinymde/blob/main/images/sample_ui.png?raw=true)
<figure>
<img
src="https://github.com/Nelson-Gon/shinymde/blob/main/images/sample_ui.png?raw=true"
alt="shinymde in action" />
<figcaption aria-hidden="true">shinymde in action</figcaption>
</figure>

View the full app at <https://nelson-gon.shinyapps.io/shinymde/>.

Expand All @@ -92,35 +96,34 @@ View the full app at <https://nelson-gon.shinyapps.io/shinymde/>.
If you would like to work on this project, here is a features list that
could be a good place to start.

- [x] Add user guides in the form of tooltips wherever possible.
- [x] Add user guides in the form of tooltips wherever possible.

- [ ] Add unit tests.
- [ ] Add unit tests.

- [x] Add hovers to user input
- [x] Add hovers to user input

- [ ] Switchable dark mode
- [ ] Switchable dark mode

- [x] Control `pattern_type`/`subset_cols` choice in `na_summary`.
- [x] Control `pattern_type`/`subset_cols` choice in `na_summary`.

- [ ] Use cached filename in input filename if a user quits the
program.
- [ ] Use cached filename in input filename if a user quits the program.

- [ ] Add user help pages that link to `mde` documentation on click or
as an independent tab.
- [ ] Add user help pages that link to `mde` documentation on click or
as an independent tab.

- [x] Allow user to choose plot type.
- [x] Allow user to choose plot type.

- [x] Support dates in [mde](https://nelson-gon.github.io/mde)
- [x] Support dates in [mde](https://nelson-gon.github.io/mde)

- [x] Allow control over visible text on visual summaries.
- [x] Allow control over visible text on visual summaries.

------------------------------------------------------------------------

Thank you and keep building,

Nelson

2021-12-18
2023-05-16

Please note that the ‘shinymde’ project is released with a [Contributor
Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project,
Expand Down
12 changes: 12 additions & 0 deletions dev/config_attachment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
path.n: NAMESPACE
path.d: DESCRIPTION
dir.r: R
dir.v: vignettes
dir.t: tests
extra.suggests: ~
pkg_ignore: ~
document: yes
normalize: yes
inside_rmd: no
must.exist: yes
check_if_suggests_is_installed: yes
29 changes: 29 additions & 0 deletions dev/docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env pwsh
# -*- coding: utf-8 -*-

# Set Variables
$GH_USER="jimbrig"
$GH_REPO="shinymde"
$DOCKER_TAG="latest"
$DOCKER_DESCRIPTION="ShinyMDE Container Image"
$GH_PAT=$Env:GITHUB_API_TOKEN

$IMAGE_SOURCE="https://github.com/" + $GH_USER + "/" + $GH_REPO
$IMAGE_REF="ghcr.io/$GH_USER/$GH_REPO" + ':' + $DOCKER_TAG

# Create Container
RScript -e "golem::add_dockerfile()"

# Login
echo $GH_PAT | docker login ghcr.io -u $GH_USER --password-stdin

# Build
docker build `
--label "org.opencontainers.image.source=https://github.com/$GH_USER/$GH_REPO" `
--label "org.opencontainers.image.description=$DOCKER_DESCRIPTION" `
--label "org.opencontainers.image.licenses=MIT" `
-t $IMAGE_REF `
.

# Push
docker push $IMAGE_REF

0 comments on commit 236f5e0

Please sign in to comment.