Skip to content

Commit

Permalink
Merge pull request #35 from hrbrmstr/dev
Browse files Browse the repository at this point in the history
fix for line colors
  • Loading branch information
hrbrmstr committed Aug 11, 2015
2 parents fc76e44 + 542da9d commit 37585d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: taucharts
Title: Create Interactive Charts with the JavaScript 'TauCharts' Library
Version: 0.3.3
Version: 0.3.3.9001
Authors@R: c(
person("Bob", "Rudis", email = "[email protected]", role = c("aut", "cre")),
person("Kent", "Russell", email = "[email protected]", role = c("aut", "ctb")),
Expand Down
9 changes: 8 additions & 1 deletion R/colors.r
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ tau_color_manual <- function(tau, values=NULL) {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}


#' Use the ColorBrewer palette in the charts
#'
#' @param tau taucharts object
Expand Down Expand Up @@ -57,6 +57,7 @@ tau_color_brewer <- function(tau, n=5, palette="Set2") {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -84,6 +85,7 @@ tau_color_tableau <- function(tau, palette="tableau20") {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -112,6 +114,7 @@ tau_color_economist <- function(tau, n=5) {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -140,6 +143,7 @@ tau_color_few <- function(tau, n=5, palette="medium") {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -168,6 +172,7 @@ tau_color_538 <- function(tau, n=5) {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -196,6 +201,7 @@ tau_color_highcharts <- function(tau, n=5, palette="default") {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
Expand Down Expand Up @@ -226,6 +232,7 @@ tau_color_wsj <- function(tau, n=5, palette="rgby") {
sprintf("{{ID}} .%s { fill: %s; }", eids, values),
sprintf("{{ID}} div .graphical-report__legend__guide.%s { background: %s; border: 1px solid %s; }", eids, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__trendline.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__svg .graphical-report__line.%s { background: %s; border: 1px solid %s; stroke: %s; }", eids, values, values, values),
sprintf("{{ID}} div .graphical-report__legend__item.disabled .graphical-report__legend__guide.%s { background: 0 0; background-color: transparent; }", eids, values, values)
))
}
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following datasets are included:

### News

- Version 0.3.3.9001 released : fix for custom colors and `tau_line`
- Version 0.3.3 released : custom font for chart (`?tau_set_font`)
- Version 0.3.2 released : custom colors working in legend & trendlines
- Version 0.3.1 released : removed R 3.2.0 dependency (removed the dependent code)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The following datasets are included:

### News

- Version 0.3.3.9001 released : fix for custom colors and `tau_line`
- Version 0.3.3 released : custom font for chart (`?tau_set_font`)
- Version 0.3.2 released : custom colors working in legend & trendlines
- Version 0.3.1 released : removed R 3.2.0 dependency (removed the dependent code)
Expand Down Expand Up @@ -86,7 +87,7 @@ library(taucharts)
library(testthat)

date()
#> [1] "Thu Aug 6 18:01:57 2015"
#> [1] "Mon Aug 10 20:17:36 2015"

test_dir("tests/")
#> testthat results ========================================================================================================
Expand Down

0 comments on commit 37585d2

Please sign in to comment.