Skip to content

Commit

Permalink
changed parameter oder for deprecated sg_colors
Browse files Browse the repository at this point in the history
  • Loading branch information
hrbrmstr committed Feb 17, 2015
1 parent a095321 commit 632c0a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/streamgraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ sg_axis_y <- function(sg, tick_count=5, tick_format=",g") {
#' Change the ColorBrewer palette being used
#'
#' @param sg streamgraph object
#' @param palette UNUSED; being removed in next release; use \code{sg_fill_*} instead
#' @param axis_color color of the axis text (defaults to "\code{black}")
#' @param tooltip_color color of the tooltip text (defaults to "\code{black}")
#' @param label_color color of the label text for the legend select menu (defaults to "\code{black}")
#' @param palette UNUSED; being removed in next release; use \code{sg_fill_*} instead
#' @return streamgraph object
#' @export
#' @examples \dontrun{
Expand All @@ -231,7 +231,7 @@ sg_axis_y <- function(sg, tick_count=5, tick_format=",g") {
#' streamgraph(dat, "genre", "n", "year") %>%
#' sg_colors("PuOr")
#' }
sg_colors <- function(sg, axis_color="black", tooltip_color="black", label_color="black", palette=NULL) {
sg_colors <- function(sg, palette=NULL, axis_color="black", tooltip_color="black", label_color="black") {

if (!is.null(palette)) {
message("Use 'sg_fill_*' for setting stream colors. This parameter will be removed in an upcoming release.")
Expand Down
8 changes: 4 additions & 4 deletions man/sg_colors.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
\alias{sg_colors}
\title{Modify streamgraph colors}
\usage{
sg_colors(sg, axis_color = "black", tooltip_color = "black",
label_color = "black", palette = NULL)
sg_colors(sg, palette = NULL, axis_color = "black",
tooltip_color = "black", label_color = "black")
}
\arguments{
\item{sg}{streamgraph object}

\item{palette}{UNUSED; being removed in next release; use \code{sg_fill_*} instead}

\item{axis_color}{color of the axis text (defaults to "\code{black}")}

\item{tooltip_color}{color of the tooltip text (defaults to "\code{black}")}

\item{label_color}{color of the label text for the legend select menu (defaults to "\code{black}")}

\item{palette}{UNUSED; being removed in next release; use \code{sg_fill_*} instead}
}
\value{
streamgraph object
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/sg.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ggplot2::movies %>%

streamgraph(dat, "genre", "n", "year", interactive=TRUE) %>%
sg_axis_x(20, "year", "%Y") %>%
sg_colors("red", "blue", "green") %>%
sg_fill_tableau("tableau10medium") %>%
sg_colors("#1F77B4", "#1F77B4", "black") %>%
sg_fill_tableau("tableau20") %>%
# sg_fill_manual(c("red", "#00ff00", rgb(0,0,1))) %>%
# sg_fill_brewer("Spectral") %>%
sg_legend(TRUE, "Genre")
Expand Down

0 comments on commit 632c0a9

Please sign in to comment.