-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from miraisolutions/release/v1.3.0
1.3.0 release
- Loading branch information
Showing
30 changed files
with
1,271 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Exclude hidden files/dirs to cover items related to git checkout, R project | ||
# and R session, which would be present in local builds and affect caching | ||
.* | ||
# .Rbuildignore however is relevant for the package build and must be kept | ||
!.Rbuildignore | ||
|
||
# Exclude the Dockerfile so that it does not affect caching either | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: SmaRP | ||
Title: SmaRP: Smart Retirement Planning | ||
Version: 1.2.0 | ||
Version: 1.3.0 | ||
Authors@R: c(person("Gabriel", "Foix", role = c("aut", "cre"), | ||
email = "[email protected]"), | ||
person("Francesca", "Vitalini", role = c("aut"), | ||
|
@@ -27,16 +27,13 @@ Imports: | |
ggplot2, | ||
googleVis, | ||
htmltools, | ||
kableExtra, | ||
knitr, | ||
lubridate, | ||
magrittr, | ||
pander, | ||
reshape2, | ||
rmarkdown, | ||
shiny, | ||
shinydashboardPlus, | ||
shinyWidgets | ||
shiny | ||
Suggests: testthat, roxygen2 (>= 6.1.1) | ||
VignetteBuilder: knitr | ||
RoxygenNote: 6.1.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,68 @@ | ||
FROM rocker/r-ver:3.5.1 | ||
FROM rocker/r-ver:3.5.3 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
sudo \ | ||
pandoc \ | ||
pandoc-citeproc \ | ||
## Install required dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
## for R package 'curl' | ||
libcurl4-gnutls-dev \ | ||
libcairo2-dev \ | ||
libxt-dev \ | ||
libssl-dev \ | ||
libssh2-1-dev \ | ||
## for R package 'xml2' | ||
libxml2-dev \ | ||
texlive-full \ | ||
## for R package 'openssl' | ||
libssl-dev \ | ||
## for install_tinytex.sh and install_pandoc.sh | ||
wget \ | ||
curl | ||
## for install_tinytex.sh | ||
texinfo \ | ||
## for install_tinytex.sh | ||
ghostscript \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/ | ||
|
||
## Install recent pandoc version, required by rmarkdown | ||
# - see https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md | ||
# - https://pandoc.org/installing.html#linux | ||
# We should use the same version as in rocker/rstudio:<R_VER> | ||
# docker run --rm rocker/rstudio:<R_VER> /usr/lib/rstudio-server/bin/pandoc/pandoc -v | ||
ENV PANDOC_DEB="2.3.1/pandoc-2.3.1-1-amd64.deb" | ||
COPY docker/install_pandoc.sh . | ||
RUN sh install_pandoc.sh $PANDOC_DEB && rm install_pandoc.sh | ||
|
||
## Install TinyTeX as LaTeX installation | ||
COPY docker/install_tinytex.sh . | ||
# - Use a version-stable tlnet archive CTAN repo from texlive.info | ||
# - here we consider the frozen TeXLive 2016 snapshot, corresponding to the TeXLive release | ||
# shipped as texlive-* in Debian stretch (base image for the rocker/verse currently used) | ||
# - note that https was not supported in TeXLive 2016 for the CTAN repository | ||
ENV CTAN_REPO=http://www.texlive.info/tlnet-archive/2017/04/13/tlnet | ||
# - It is important to also install all required LaTeX packages when building the image | ||
RUN sh install_tinytex.sh fancyhdr | ||
## Script for re-installation of TinyTeX in the running container | ||
# - needed if at a certain point the "Remote repository is newer than local", | ||
# for non-version-stable TinyTeX installations | ||
# - this also (re-)executes (and therefore depends on) install_tinytex.sh | ||
COPY docker/reinstall_tinytex.sh . | ||
|
||
# Install needed packages | ||
## Install major fixed R dependencies | ||
# - they will always be needed and we want them in a dedicated layer, | ||
# as opposed to getting them dynamically via `remotes::install_local()` | ||
RUN install2.r --error \ | ||
bsplus \ | ||
dplyr \ | ||
ggplot2 \ | ||
googleVis \ | ||
htmltools \ | ||
kableExtra \ | ||
knitr \ | ||
lubridate \ | ||
magrittr \ | ||
pander \ | ||
reshape2 \ | ||
rmarkdown \ | ||
shiny \ | ||
shinydashboardPlus \ | ||
shinyWidgets | ||
|
||
|
||
# copy the app to the image | ||
RUN mkdir /root/SmaRP | ||
COPY . /root/SmaRP | ||
|
||
# set host and port | ||
RUN echo "options(shiny.port = 80, shiny.host = '0.0.0.0')" >> /usr/local/lib/R/etc/Rprofile.site | ||
shiny \ | ||
dplyr \ | ||
rmarkdown | ||
|
||
## Copy the app to the image | ||
# temporary location of the SmaRP source package in the image | ||
ENV MARP=/tmp/SmaRP | ||
COPY . $MARP | ||
|
||
# install SmaRP | ||
RUN cd /root && \ | ||
install2.r --repos NULL --error -- --no-multiarch --with-keep.source SmaRP | ||
# Install SmaRP | ||
RUN install2.r --error remotes \ | ||
&& R -e "remotes::install_local('$MARP')" \ | ||
&& rm -rf $MARP | ||
|
||
# Set host and port | ||
RUN echo "options(shiny.port = 80, shiny.host = '0.0.0.0')" >> /usr/local/lib/R/etc/Rprofile.site | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["R", "-e", "library(SmaRP); SmaRP::launch_application()"] | ||
CMD ["R", "-e", "SmaRP::launch_application()"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#' @title SmaRPanel | ||
#' | ||
#' @rdname SmaRPanel | ||
#' | ||
#' @description Custom collapsible panel for the SmaRP Shiny app. | ||
#' | ||
#' @param id The unique id of the panel. | ||
#' @param ... UI elements to be displayed in the panel body. | ||
#' @param title The title to be displayed in the panel heading. | ||
#' @param collapsed Whether the panel should be created as collapsed or | ||
#' expanded. If `NA` (the default), a non-collapsible panel is created. | ||
#' | ||
#' @details All elements of the panel are specified with additional classes | ||
#' `"panel-smarp"`, `"panel-heading-smarp"`, `"panel-title-smarp"`, | ||
#' `"panel-body-smarp"`, used for CSS customization. Similarly, the collapse | ||
#' [actionButton()] is defined with no `label` nor `icon` and has a custom | ||
#' class `"btn-collapse-smarp"`, to be used for CSS customization via the | ||
#' `:after` pseudo-element. | ||
#' | ||
#' @return The UI definition of the panel. | ||
#' | ||
#' @example man-roxygen/ex-SmaRPanel.R | ||
#' | ||
#' @export | ||
#' | ||
#' @md | ||
SmaRPanel <- function(id, ..., title = NULL, collapsed = NA) { | ||
# we can add footer if needed | ||
|
||
tags <- htmltools::tags | ||
|
||
# append -smarp to the first class | ||
.class <- function(x) paste(x, sub("^([^ ]+).*$", "\\1-smarp", x), sep = " ") | ||
# specific ids within the panel id | ||
.with_id <- function(x) paste(id, x, sep = "-") | ||
|
||
heading <- if (!is.null(title) || !is.na(collapsed)) { | ||
tags$div( | ||
id = .with_id("heading"), | ||
class = .class("panel-heading"), | ||
tags$div( | ||
class = .class("panel-title"), | ||
title, | ||
if (!is.na(collapsed)) { | ||
shiny::actionButton(.with_id("collapse"), NULL) %>% | ||
bsplus::bs_attach_collapse(.with_id("body")) %>% | ||
# class for styling expand / collapse button | ||
htmltools::tagAppendAttributes(class = paste( | ||
.class("btn-collapse"), | ||
if (isTRUE(collapsed)) "collapsed") | ||
) | ||
} | ||
) | ||
) | ||
} | ||
|
||
body <- tags$div( | ||
# div wrapper similar to bsplus::bs_collapse() | ||
id = .with_id("body"), | ||
class = paste( | ||
if (!is.na(collapsed)) "collapse", | ||
if (isTRUE(!collapsed)) "in" | ||
), | ||
tags$div( | ||
class = .class("panel-body"), | ||
... | ||
) | ||
) | ||
|
||
tags$div( | ||
id = id, | ||
class = .class("panel panel-default"), | ||
heading, | ||
body | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
utils::globalVariables( | ||
c("AHL", "ALV", "AgePath", "BVG", "BVGMindestzinssatz", "BVGcontributionrates", | ||
"BVGcontributionratesPath", "BVGpurchase", "Beruf", "BerufsauslagenMax", | ||
"BerufsauslagenMin", "BerufsauslagenTarif", "BundessteueTabelle", "DO", "DOV", | ||
"DirectP3", "ExpectedSalaryPath", "Gemeindenummer", "Kids", "Kinder", "KinderabzugKG", | ||
"Kirchensteuer", "MaxBVG", "MaxContrTax", "MinBVG", "NBU", "NetSalary", | ||
"P3ContributionPath", "PLZ", "PLZGemeinden", "TaxBenefits", "TaxableIncome", | ||
"TotalContr", "TotalP3", "TotalTax", "VM", "Verheiratet", "Versicherung", | ||
"VersicherungsK", "VersicherungsL", "VersicherungsV", "Calendar", "h4", "icon", "maxALV", | ||
"maxNBU", "modalDialog", "removeModal", "showModal", "taxburden.list") | ||
"BVGcontributionratesPath", "BVGpurchase", "Beruf", "BerufsauslagenMax", | ||
"BerufsauslagenMin", "BerufsauslagenTarif", "BundessteueTabelle", "DO", "DOV", | ||
"DirectP3", "ExpectedSalaryPath", "Gemeindenummer", "Kids", "Kinder", "KinderabzugKG", | ||
"Kirchensteuer", "MaxBVG", "MaxContrTax", "MinBVG", "NBU", "NetSalary", | ||
"P3ContributionPath", "PLZ", "PLZGemeinden", "TaxBenefits", "TaxableIncome", | ||
"TotalContr", "TotalP3", "TotalTax", "VM", "Verheiratet", "Versicherung", | ||
"VersicherungsK", "VersicherungsL", "VersicherungsV", "Calendar", "maxALV", | ||
"maxNBU", "taxburden.list") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.