This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
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 #23 from nik01010/rel/v1_1_0
Version 1.1.0
- Loading branch information
Showing
55 changed files
with
3,284 additions
and
2,242 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^Makefile$ | ||
^Jenkinsfile$ | ||
^\.lintr$ | ||
^\.travis\.yml$ | ||
^codecov\.yml$ | ||
^LICENSE\.md$ | ||
^cran-comments\.md$ |
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,3 +1,7 @@ | ||
inst/doc | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata | ||
inst/doc | ||
doc | ||
Meta |
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,33 @@ | ||
linters: with_defaults( | ||
object_name_linter(styles = c("CamelCase", "camelCase", "snake_case")), | ||
object_length_linter(30), | ||
line_length_linter(110), | ||
assignment_linter, | ||
object_usage_linter, | ||
open_curly_linter = NULL, | ||
closed_curly_linter(allow_single_line = FALSE), | ||
paren_brace_linter, | ||
commas_linter, | ||
spaces_inside_linter, | ||
spaces_left_parentheses_linter, | ||
commented_code_linter = NULL, | ||
cyclocomp_linter, | ||
equals_na_linter, | ||
function_left_parentheses_linter, | ||
single_quotes_linter = NULL, | ||
pipe_continuation_linter, | ||
seq_linter, | ||
T_and_F_symbol_linter, | ||
trailing_whitespace_linter = NULL, | ||
undesirable_function_linter = NULL, | ||
undesirable_operator_linter = NULL, | ||
todo_comment_linter = NULL | ||
# WIP: add custom lint rules for: | ||
# - parameter names should be specified in functions | ||
# - white space rules for equals signs | ||
# - unit tests should use arrange/act/assert pattern | ||
# - etc | ||
) | ||
exclude: "# Exclude Linting" | ||
exclude_start: "# Begin Exclude Linting" | ||
exclude_end: "# End Exclude Linting" |
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,30 @@ | ||
language: r | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
r: | ||
- release | ||
- oldrel | ||
- devel | ||
|
||
jobs: | ||
exclude: | ||
- r: devel | ||
os: osx | ||
|
||
repos: | ||
CRAN: https://cloud.r-project.org | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- libv8-dev | ||
|
||
cache: packages | ||
latex: false | ||
warnings_are_errors: true | ||
|
||
after_success: | ||
- Rscript -e 'covr::codecov()' |
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,20 +1,29 @@ | ||
Package: dashboardthemes | ||
Type: Package | ||
Title: Customise the appearance of Shiny dashboard applications using themes | ||
Version: 1.0.6 | ||
Version: 1.1.0 | ||
Authors@R: person("Nik", "Lilovski", email = "nik.lilovski@outlook.com", | ||
role = c("aut", "cre")) | ||
Maintainer: Nik Lilovski <nik.lilovski@outlook.com> | ||
Description: Allows manual creation of themes and logos to be used in | ||
applications created using the shinydashboard package. Removes the need to | ||
change the underlying css code by wrapping it into a set of convenient R | ||
functions. | ||
Depends: R (>= 3.2.3) | ||
Imports: htmltools (>= 0.3.5) | ||
License: GPL-3 | ||
URL: https://github.com/nik01010/dashboardthemes | ||
BugReports: https://github.com/nik01010/dashboardthemes/issues | ||
Depends: | ||
R (>= 3.2.3) | ||
Imports: | ||
htmltools (>= 0.3.5) | ||
Suggests: | ||
testthat, | ||
lintr, | ||
knitr, | ||
rmarkdown, | ||
glue, | ||
covr | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.1.1 | ||
Suggests: knitr, | ||
rmarkdown | ||
RoxygenNote: 7.1.0 | ||
VignetteBuilder: knitr |
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,15 @@ | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('Build') { | ||
steps { | ||
bat 'make build' | ||
} | ||
} | ||
stage('Check') { | ||
steps { | ||
bat 'make check' | ||
} | ||
} | ||
} | ||
} |
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,2 @@ | ||
YEAR: 2020 | ||
COPYRIGHT HOLDER: Nik Lilovski |
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,26 @@ | ||
# h/t to @jimhester and @yihui for this parse block: | ||
# https://github.com/yihui/knitr/blob/dc5ead7bcfc0ebd2789fe99c527c7d91afb3de4a/Makefile#L1-L4 | ||
# Note the portability change as suggested in the manual: | ||
# https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Writing-portable-packages | ||
PKGNAME = `sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION` | ||
PKGVERS = `sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION` | ||
|
||
|
||
all: build check | ||
|
||
build: | ||
R CMD build --no-build-vignettes . | ||
|
||
check: | ||
R CMD check --as-cran --no-manual $(PKGNAME)_$(PKGVERS).tar.gz | ||
|
||
install_deps: | ||
Rscript \ | ||
-e 'if (!requireNamespace("remotes")) install.packages("remotes")' \ | ||
-e 'remotes::install_deps(dependencies = TRUE)' | ||
|
||
install: install_deps build | ||
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz | ||
|
||
clean: | ||
@rm -rf $(PKGNAME)_$(PKGVERS).tar.gz $(PKGNAME).Rcheck |
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,78 @@ | ||
# Function: cssGradientThreeColors ---------------------------------------------------------------------- | ||
#' @title cssGradientThreeColors | ||
#' @description Generates CSS code for a gradient with three colors | ||
#' | ||
#' @param direction String. Direction of the gradient (down/right). Defaults to down. | ||
#' @param colorStart String. Start (top/left) colour of the gradient. | ||
#' @param colorMiddle String. Middle colour of the gradient. | ||
#' @param colorEnd String. End (bottom/right) colour of the gradient. | ||
#' @param colorStartPos Numeric. Position of the start colour. Defaults to 0. | ||
#' @param colorMiddlePos Numeric. Position of the middle colour. Defaults to 50. | ||
#' @param colorEndPos Numeric. Position of the end colour; defaults to 100. | ||
#' | ||
#' @return CSS code. Gradient with three colors. | ||
#' @examples | ||
#' \dontrun{ | ||
#' cssGradientThreeColors( | ||
#' direction = "right" | ||
#' ,colorStart = "rgba(44,222,235,1)" | ||
#' ,colorMiddle = "rgba(44,222,235,1)" | ||
#' ,colorEnd = "rgba(0,255,213,1)" | ||
#' ,colorStartPos = 0 | ||
#' ,colorMiddlePos = 30 | ||
#' ,colorEndPos = 100 | ||
#' ) | ||
#' } | ||
#' @seealso \code{\link{shinyDashboardThemeDIY}, \link{shinyDashboardLogoDIY}}, | ||
#' @export | ||
cssGradientThreeColors <- function( | ||
direction = "down", colorStart, colorMiddle, colorEnd, colorStartPos = 0, | ||
colorMiddlePos = 50, colorEndPos = 100 | ||
) { | ||
|
||
# handling direction types | ||
if (direction == "down") { | ||
colorStartSide <- "top" | ||
colorStartSideCorner <- "left top" | ||
colorEndSideCorner <- "left bottom" | ||
colorDirection <- "to bottom" | ||
} else if (direction == "right") { | ||
colorStartSide <- "left" | ||
colorStartSideCorner <- "left top" | ||
colorEndSideCorner <- "right top" | ||
colorDirection <- "to right" | ||
} else { | ||
stop("The chosen direction isn't supported.") | ||
} | ||
|
||
# building up css code | ||
cssCode <- paste0( | ||
colorStart, '; | ||
background: -moz-linear-gradient(', | ||
colorStartSide, ', ', colorStart, " ", colorStartPos, '%, ', colorMiddle, | ||
" ", colorMiddlePos, '%, ', colorEnd, " ", colorEndPos, '%); | ||
background: -webkit-gradient(', | ||
colorStartSideCorner, ',', colorEndSideCorner, ', | ||
color-stop(', colorStartPos, '%, ', colorStart, '), | ||
color-stop(', colorMiddlePos, '%, ', colorMiddle, '), | ||
color-stop(', colorEndPos, '%, ', colorEnd, ')); | ||
background: -webkit-linear-gradient(', | ||
colorStartSide, ', ', colorStart, " ", colorStartPos, '%, ', colorMiddle, " ", | ||
colorMiddlePos, '%, ', colorEnd, " ", colorEndPos, '%); | ||
background: -o-linear-gradient(', | ||
colorStartSide, ', ', colorStart, " ", colorStartPos, '%, ', colorMiddle, " ", | ||
colorMiddlePos, '%, ', colorEnd, " ", colorEndPos, '%); | ||
background: -ms-linear-gradient(', | ||
colorStartSide, ', ', colorStart, " ", colorStartPos, '%, ', colorMiddle, " ", | ||
colorMiddlePos, '%, ', colorEnd, " ", colorEndPos, '%); | ||
background: linear-gradient(', | ||
colorDirection, ', ', colorStart, " ", colorStartPos, '%, ', colorMiddle, " ", | ||
colorMiddlePos, '%, ', colorEnd, " ", colorEndPos, '%)' | ||
) | ||
|
||
# removing new line symbols and formatting spacing | ||
cssCode <- gsub(pattern = "\n", replacement = "", x = cssCode) | ||
cssCode <- gsub(pattern = "[[:space:]]{2,3}", replacement = "", x = cssCode) | ||
|
||
return(cssCode) | ||
} |
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,79 @@ | ||
# Function: shinyDashboardLogo -------------------------------------------------------------------------- | ||
#' @title shinyDashboardLogo | ||
#' @description Calls a custom logo object created using shinyDashboardLogoDIY | ||
#' | ||
#' @param theme String. Name of theme to be used | ||
#' @param boldText String. Bold text for the logo. | ||
#' @param mainText String. Main text for the logo. | ||
#' @param badgeText String. Text for the logo badge. | ||
#' | ||
#' @return HTML code. Logo for shinydashboard's sidebar. | ||
#' @examples | ||
#' \dontrun{ | ||
#' ... | ||
#' ### ui | ||
#' ui <- dashboardPage( | ||
#' | ||
#' ### ui header | ||
#' dashboardHeader( | ||
#' | ||
#' ### changing logo | ||
#' title = shinyDashboardLogo( | ||
#' theme = "blue_gradient", | ||
#' boldText = "Shiny", | ||
#' mainText = "App", | ||
#' badgeText = "v1.1" | ||
#' ) | ||
#' ... | ||
#' } | ||
#' @seealso \code{\link{shinyDashboardLogoDIY}, \link{shinyDashboardThemes}} | ||
#' @note This logo design was inspired from \url{http://www.dataseries.org/}. | ||
#' @export | ||
shinyDashboardLogo <- function(theme, boldText = "Shiny", mainText = "App", badgeText = "v1.1") { | ||
|
||
if (theme == "blue_gradient") { | ||
return( | ||
dashboardthemes::logo_blue_gradient(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "flat_red") { | ||
return( | ||
dashboardthemes::logo_flat_red(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "grey_light") { | ||
return( | ||
dashboardthemes::logo_grey_light(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "grey_dark") { | ||
return( | ||
dashboardthemes::logo_grey_dark(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "onenote") { | ||
return( | ||
dashboardthemes::logo_onenote(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "poor_mans_flatly") { | ||
return( | ||
dashboardthemes::logo_poor_mans_flatly(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "purple_gradient") { | ||
return( | ||
dashboardthemes::logo_purple_gradient(boldText = boldText, mainText = mainText, badgeText = badgeText) | ||
) | ||
|
||
} else if (theme == "boe_website") { | ||
|
||
stop("The boe_website theme has been discontinued after v1.1.0, please use flat_red instead.") | ||
|
||
} else { | ||
|
||
stop("The chosen theme isn't supported.") | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.