From 75571bc71c41e611c29fbc6ab6b62fea7f16a1d5 Mon Sep 17 00:00:00 2001 From: dmpe Date: Sun, 20 Mar 2016 15:51:38 +0100 Subject: [PATCH 1/3] update only 3 files and roxygen them --- R/dashboardPage.R | 8 ++++++-- R/utils.R | 8 +++++--- man/dashboardPage.Rd | 8 +++++--- man/validStatuses.Rd | 1 + tests-manual/bigDash.R | 4 +++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/R/dashboardPage.R b/R/dashboardPage.R index 0fdf0815..b5bbe727 100644 --- a/R/dashboardPage.R +++ b/R/dashboardPage.R @@ -8,10 +8,12 @@ #' @param title A title to display in the browser's title bar. If no value is #' provided, it will try to extract the title from the \code{dashboardHeader}. #' @param skin A color theme. One of \code{"blue"}, \code{"black"}, -#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}. +#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}. Or light +#' skin of each color, e.g. \code{"red-light"} #' #' @seealso \code{\link{dashboardHeader}}, \code{\link{dashboardSidebar}}, #' \code{\link{dashboardBody}}. +#' #' @examples #' ## Only run this example in interactive R sessions #' if (interactive()) { @@ -29,7 +31,9 @@ #' } #' @export dashboardPage <- function(header, sidebar, body, title = NULL, - skin = c("blue", "black", "purple", "green", "red", "yellow")) { + skin = c("blue", "blue-light", "black", "black-light", "purple", + "purple-light", "green", "green-light", "red", "red-light", "yellow", + "yellow-light")) { tagAssert(header, type = "header", class = "main-header") tagAssert(sidebar, type = "aside", class = "main-sidebar") diff --git a/R/utils.R b/R/utils.R index a7ea6d3b..33d7b169 100644 --- a/R/utils.R +++ b/R/utils.R @@ -83,9 +83,10 @@ validateColor <- function(color) { #' @format NULL #' #' @keywords internal -validColors <- c("red", "yellow", "aqua", "blue", "light-blue", "green", +validColors <- c("red", "yellow", "aqua", "blue", "light-blue","blue-light", + "green","black-light", "purple-light","green-light", "navy", "teal", "olive", "lime", "orange", "fuchsia", - "purple", "maroon", "black") + "purple", "maroon", "black", "red-light", "yellow-light") # Returns TRUE if a status is valid; throws error otherwise. @@ -112,13 +113,14 @@ validateStatus <- function(status) { #' \item \code{info} Blue #' \item \code{warning} Orange #' \item \code{danger} Red +#' \item \code{default} Grey #' } #' #' @usage NULL #' @format NULL #' #' @keywords internal -validStatuses <- c("primary", "success", "info", "warning", "danger") +validStatuses <- c("primary", "success", "info", "warning", "danger", "default") "%OR%" <- function(a, b) if (!is.null(a)) a else b diff --git a/man/dashboardPage.Rd b/man/dashboardPage.Rd index d8b8969a..b490bf09 100644 --- a/man/dashboardPage.Rd +++ b/man/dashboardPage.Rd @@ -4,8 +4,9 @@ \alias{dashboardPage} \title{Dashboard page} \usage{ -dashboardPage(header, sidebar, body, title = NULL, skin = c("blue", "black", - "purple", "green", "red", "yellow")) +dashboardPage(header, sidebar, body, title = NULL, skin = c("blue", + "blue-light", "black", "black-light", "purple", "purple-light", "green", + "green-light", "red", "red-light", "yellow", "yellow-light")) } \arguments{ \item{header}{A header created by \code{dashboardHeader}.} @@ -18,7 +19,8 @@ dashboardPage(header, sidebar, body, title = NULL, skin = c("blue", "black", provided, it will try to extract the title from the \code{dashboardHeader}.} \item{skin}{A color theme. One of \code{"blue"}, \code{"black"}, -\code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}.} +\code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}. Or light +skin of each color, e.g. \code{"red-light"}} } \description{ This creates a dashboard page for use in a Shiny app. diff --git a/man/validStatuses.Rd b/man/validStatuses.Rd index 60760c80..d5102783 100644 --- a/man/validStatuses.Rd +++ b/man/validStatuses.Rd @@ -16,6 +16,7 @@ generally appear as follows: \item \code{info} Blue \item \code{warning} Orange \item \code{danger} Red + \item \code{default} Grey } } \keyword{internal} diff --git a/tests-manual/bigDash.R b/tests-manual/bigDash.R index 1fd4a3ee..53369718 100644 --- a/tests-manual/bigDash.R +++ b/tests-manual/bigDash.R @@ -211,6 +211,7 @@ body <- dashboardBody(tabItems( box( width = 4, + status = "default", background = "light-blue", p("This is content. The background color is set to light-blue") ) @@ -306,6 +307,7 @@ server <- function(input, output) { ui <- dashboardPage(header, sidebar, - body) + body, + skin = "blue-light") shinyApp(ui, server) From 01225e3b5e8ac907a1a735a62d513e0fe5e744ee Mon Sep 17 00:00:00 2001 From: dmpe Date: Sun, 20 Mar 2016 16:09:12 +0100 Subject: [PATCH 2/3] prepare news file to be merged also --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS b/NEWS index d26178f8..957c7133 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,12 @@ shinydashboard 0.5.1.9000 -------------------------------------------------------------------------------- * Updated to AdminLTE 2.3.2 (1ee281b). + + +* Add more colors addressing #118 and #125 (dashboardPage light-skin colors and + "default" (grey) color boxes) + + shinydashboard 0.5.1 -------------------------------------------------------------------------------- From ffd24a680fb73bb4cec661e139dc7af06df94fcd Mon Sep 17 00:00:00 2001 From: dmpe Date: Sat, 26 Mar 2016 15:05:28 +0100 Subject: [PATCH 3/3] bring even more colors --- R/utils.R | 22 +++++++++++++++------- man/validColors.Rd | 12 ++++++++++++ man/validStatuses.Rd | 3 +++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/R/utils.R b/R/utils.R index 33d7b169..3e096b6e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -63,31 +63,38 @@ validateColor <- function(color) { #' #' \itemize{ #' \item \code{red} +#' \item \code{red-light} #' \item \code{yellow} +#' \item \code{yellow-light} #' \item \code{aqua} #' \item \code{blue} #' \item \code{light-blue} +#' \item \code{blue-light} #' \item \code{green} +#' \item \code{green-light} #' \item \code{navy} #' \item \code{teal} +#' \item \code{gray} #' \item \code{olive} #' \item \code{lime} #' \item \code{orange} #' \item \code{fuchsia} #' \item \code{purple} +#' \item \code{purple-light} #' \item \code{maroon} #' \item \code{black} +#' \item \code{black-light} #' } -#' +#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#layout} +#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/pages/UI/general.html} #' @usage NULL #' @format NULL #' #' @keywords internal -validColors <- c("red", "yellow", "aqua", "blue", "light-blue","blue-light", - "green","black-light", "purple-light","green-light", - "navy", "teal", "olive", "lime", "orange", "fuchsia", - "purple", "maroon", "black", "red-light", "yellow-light") - +validColors <- c("red", "red-light", "yellow", "yellow-light","green", "green-light", + "blue", "light-blue","blue-light", "black", "black-light", + "purple", "purple-light", "navy", "teal", "olive", "lime", + "orange", "fuchsia", "maroon", "gray", "aqua") # Returns TRUE if a status is valid; throws error otherwise. validateStatus <- function(status) { @@ -113,11 +120,12 @@ validateStatus <- function(status) { #' \item \code{info} Blue #' \item \code{warning} Orange #' \item \code{danger} Red -#' \item \code{default} Grey +#' \item \code{default} Gray #' } #' #' @usage NULL #' @format NULL +#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-box} #' #' @keywords internal validStatuses <- c("primary", "success", "info", "warning", "danger", "default") diff --git a/man/validColors.Rd b/man/validColors.Rd index f4e69ba3..ea7862a4 100644 --- a/man/validColors.Rd +++ b/man/validColors.Rd @@ -4,6 +4,11 @@ \name{validColors} \alias{validColors} \title{Valid colors} +\source{ +\url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#layout} + +\url{https://almsaeedstudio.com/themes/AdminLTE/pages/UI/general.html} +} \description{ These are valid colors for various dashboard components. Valid colors are listed below. @@ -11,20 +16,27 @@ listed below. \details{ \itemize{ \item \code{red} + \item \code{red-light} \item \code{yellow} + \item \code{yellow-light} \item \code{aqua} \item \code{blue} \item \code{light-blue} + \item \code{blue-light} \item \code{green} + \item \code{green-light} \item \code{navy} \item \code{teal} + \item \code{gray} \item \code{olive} \item \code{lime} \item \code{orange} \item \code{fuchsia} \item \code{purple} + \item \code{purple-light} \item \code{maroon} \item \code{black} + \item \code{black-light} } } \keyword{internal} diff --git a/man/validStatuses.Rd b/man/validStatuses.Rd index d5102783..10190006 100644 --- a/man/validStatuses.Rd +++ b/man/validStatuses.Rd @@ -4,6 +4,9 @@ \name{validStatuses} \alias{validStatuses} \title{Valid statuses} +\source{ +\url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-box} +} \description{ These status strings correspond to colors as defined in Bootstrap's CSS. Although the colors can vary depending on the particular CSS selector, they