Add ggplot2 support und bump to v0.2.0
Change-Id: Iee69051bc64fb9fbde55bbea61c7e892ff95229d
diff --git a/.Rbuildignore b/.Rbuildignore
index 0c1c641..21ae968 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -2,3 +2,4 @@
^\.Rproj\.user$
LICENSE.md
Readme.md
+Changelog.md
diff --git a/Changelog.md b/Changelog.md
new file mode 100644
index 0000000..8e74e6f
--- /dev/null
+++ b/Changelog.md
@@ -0,0 +1,8 @@
+# Changelog
+
+## 0.2.0
+* themes and palettes for ggplot2 added: `theme_ids()`, `theme_ids(style="dark")`, `scale_colour_ids()`, `scale_fill_ids()`
+* centralised initialisation for colours and palettes
+
+## 0.1.0
+* themes for highcharter: `hc_theme_ids_light()`, `hc_theme_ids_dark()`, `hc_theme_ids_mono()`
diff --git a/DESCRIPTION b/DESCRIPTION
index 278759b..679e432 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: idsThemeR
Type: Package
Title: Plot themes for the Leibniz Institute for the German Language (IDS)
-Version: 0.1.0
+Version: 0.2.0
Authors@R:
c(person(given = "Marc",
family = "Kupietz",
@@ -16,7 +16,12 @@
tidyverse,
highcharter,
magrittr,
+ ggthemes,
+ ggplot2,
+ scales,
RKorAPClient
Collate:
+ 'idsThemeR.R'
'highcharter-themes.R'
+ 'ggplot-theme.R'
RoxygenNote: 7.1.1
diff --git a/NAMESPACE b/NAMESPACE
index b10031b..f3d776b 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -3,6 +3,19 @@
export(hc_theme_ids_dark)
export(hc_theme_ids_light)
export(hc_theme_ids_mono)
+export(ids_pal)
+export(scale_color_ids)
+export(scale_colour_ids)
+export(scale_fill_ids)
+export(theme_ids)
import(highcharter)
import(tidyverse)
+importFrom(ggplot2,discrete_scale)
+importFrom(ggplot2,element_blank)
+importFrom(ggplot2,element_line)
+importFrom(ggplot2,element_rect)
+importFrom(ggplot2,element_text)
+importFrom(ggplot2,theme)
+importFrom(ggthemes,gdocs_pal)
importFrom(magrittr,"%>%")
+importFrom(scales,manual_pal)
diff --git a/R/ggplot-theme.R b/R/ggplot-theme.R
new file mode 100644
index 0000000..fb3176b
--- /dev/null
+++ b/R/ggplot-theme.R
@@ -0,0 +1,108 @@
+#' IDS Theme for ggplot2
+#'
+#' Based on Highcharts ggtheme \link[ggthemes]{theme_hc}
+#' which again is based on the plots in \url{Highcharts JS}.
+#'
+#' @note
+#'
+#' Note that here, unlike with the highcharter theme, you have to set the scale
+#' explicitly.
+#'
+#'
+#' @references
+#'
+#' \link[ggthemes]{theme_hc}
+#'
+#' \url{http://www.highcharts.com/demo/line-basic}
+#'
+#' \url{https://github.com/highslide-software/highcharts.com/tree/master/js/themes}
+#'
+#' @inheritParams ggplot2::theme_bw
+#' @param style \code{'light'}, \code{'dark'}.
+#' @param bgcolor Deprecated
+#' @example inst/examples/ex-ggplot.R
+#' @family themes ids
+#' @importFrom ggplot2 theme element_rect element_text element_line element_blank
+#' @export
+theme_ids <- function(base_size = 14,
+ base_family = idsBaseFontFamily,
+ style = c("default", "light", "dark"),
+ bgcolor = NULL) {
+
+ if (!is.null(bgcolor)) {
+ warning("`bgcolor` is deprecated. Use `style` instead.")
+ style <- bgcolor
+ }
+ style <- match.arg(style)
+ bgcolor <- switch(style,
+ default = backgroundColor,
+ "light" = backgroundColor,
+ "mono" = backgroundColor,
+ "dark" = backgroundColorDark)
+
+ ret <- theme(rect = element_rect(fill = bgcolor, linetype = 0, colour = NA),
+ text = element_text(size = base_size, family = base_family),
+ plot.title = element_text(hjust = 0.5),
+ plot.subtitle = element_text(hjust = 0.5, size = 13, colour = mediumContrastColor),
+ title = element_text(hjust = 0.5),
+ axis.title.x = element_text(hjust = 0.5, size=11),
+ axis.title.y = element_text(hjust = 0.5, size=11),
+ legend.title = element_text(size=11),
+ panel.grid.major.y = element_line(colour = lowContrastColor),
+ panel.grid.minor.y = element_blank(),
+ panel.grid.major.x = element_blank(),
+ panel.grid.minor.x = element_blank(),
+ panel.border = element_blank(),
+ panel.background = element_blank(),
+ legend.position = "right",
+ legend.key = element_rect(fill = paste0(bgcolor,"00")))
+
+ if (style == "dark") {
+ ret <- (ret + theme(rect = element_rect(fill = bgcolor),
+ text = element_text(colour = textColorDark),
+ plot.title = element_text(colour = highContrastColorDark),
+ plot.subtitle = element_text(colour = mediumContrastColorDark),
+ axis.title.x = element_text(colour = textColorDark),
+ axis.title.y = element_text(colour = textColorDark),
+ axis.text.x = element_text(color=textColorDark),
+ axis.text.y = element_text(color=textColorDark),
+ panel.grid.major.y = element_line(colour = lowContrastColorDark),
+ legend.title = element_text(colour = textColorDark)))
+ }
+ ret
+}
+
+
+#' IDS color and fill scales
+#'
+#' Colour and fill scales which use the palettes in
+#' \code{\link{ids_pal}()} and are meant for use with
+#' \code{\link{theme_ids}()}.
+#'
+#' @param palette A palette function that when called with a single integer
+#' argument (the number of levels in the scale) returns the values that they should take.
+#'
+#' @importFrom ggthemes gdocs_pal
+#' @importFrom ggplot2 discrete_scale
+#'
+#' @inheritDotParams ggthemes::scale_colour_gdocs
+#' @family colour ids
+#' @rdname scale_ids
+#' @export
+scale_colour_ids <- function(palette = "default", ...) {
+ discrete_scale("colour", "ids", ids_pal(), ...)
+}
+
+#' @rdname scale_ids
+#' @inheritDotParams ggthemes::scale_colour_gdocs
+#' @importFrom ggplot2 discrete_scale
+#' @export
+scale_color_ids <- scale_colour_ids
+
+#' @rdname scale_ids
+#' @inheritParams ggthemes::scale_fill_gdocs
+#' @importFrom ggplot2 discrete_scale
+#' @export
+scale_fill_ids <- function(palette = "default", ...) {
+ discrete_scale("fill", "ids", ids_pal(), ...)
+}
diff --git a/R/highcharter-themes.R b/R/highcharter-themes.R
index 7cafeb2..d9bca09 100644
--- a/R/highcharter-themes.R
+++ b/R/highcharter-themes.R
@@ -1,11 +1,11 @@
#' Dark IDS theme for \link[highcharter]{highcharter}
#'
-#' @param fontFamily font family
+#' @param fontFamily font family
#' @param fontSize default font size
#' @param textColor default text color
-#' @param lowContrastColor color with low contrast to background
-#' @param highContrastColor color with high contrast to background
-#' @param palette array of colors to be used for different series
+#' @param lowContrastColor color with low contrast to background
+#' @param highContrastColor color with high contrast to background
+#' @param palette array of colors to be used for different series
#' @param backgroundColor background color
#' @param titleColor color of the title text
#' @param subtitleColor color of the subtitle text
@@ -41,31 +41,10 @@
hc_theme_ids_dark <-
function(fontFamily = "Fira Sans Condensed",
fontSize = "medium",
- textColor = "#E0E0E3",
- lowContrastColor = "#707073",
- highContrastColor = "#F0F0F3",
- palette = c(
- '#EB7C31',
- "#1F77B4",
- "#2CA02C",
- "#D62728",
- "#9467BD",
- "#8C564B",
- "#E377C2",
- "#7F7F7F",
- "#BCBD22",
- "#17BECF",
- "#AEC7E8",
- "#FFBB78",
- "#98DF8A",
- "#FF9896",
- "#C5B0D5",
- "#C49C94",
- "#F7B6D2",
- "#C7C7C7",
- "#DBDB8D",
- "#9EDAE5"
- ),
+ textColor = textColorDark,
+ lowContrastColor = lowContrastColorDark,
+ highContrastColor = highContrastColorDark,
+ palette = idsPalette,
backgroundColor = list(linearGradient = list(
x1 = 0,
y1 = 1,
@@ -152,17 +131,17 @@
),
credits = list(style = list(color = creditsColor)),
labels = list(style = list(color = "#707073")),
-
+
drilldown = list(
activeAxisLabelStyle = list(color = "#F0F0F3"),
activeDataLabelStyle = list(color = "#F0F0F3")
),
-
+
navigation = list(buttonOptions = list(
symbolStroke = "#DDDDDD",
theme = list(fill = burgerMenuBackground)
)),
-
+
rangeSelector = list(
buttonTheme = list(
fill = "#505053",
@@ -186,7 +165,7 @@
color = "silver"),
labelStyle = list(color = "silver")
),
-
+
navigator = list(
handles = list(backgroundColor = "#666",
borderColor = "#AAA"),
@@ -195,7 +174,7 @@
lineColor = "#A6C7ED"),
xAxis = list(gridLineColor = "#505053")
),
-
+
scrollbar = list(
barBackgroundColor = "#808083",
barBorderColor = "#808083",
@@ -206,7 +185,7 @@
trackBackgroundColor = "#404043",
trackBorderColor = "#404043"
),
-
+
legendBackgroundColor = "rgba(0, 0, 0, 0)",
background2 = "#233238",
dataLabelsColor = "#233238",
@@ -214,14 +193,14 @@
maskColor = "rgba(255,255,255,0.3)",
contrastTextColor = highContrastColor
)
-
+
theme <- structure(theme, class = "hc_theme")
-
+
if (length(list(...)) > 0) {
theme <- hc_theme_merge(theme,
hc_theme(...))
}
-
+
theme
}
@@ -229,8 +208,9 @@
#'
#' See \code{\link{hc_theme_ids_dark}} for further documentation.
#'
-#' @param ... named arguments to modify the theme
-#'
+#' @inheritParams hc_theme_ids_dark
+#' @inheritDotParams hc_theme_ids_dark
+#'
#' @importFrom magrittr %>%
#' @import tidyverse
#' @import highcharter
@@ -244,7 +224,7 @@
hc_theme_ids_light <- function(...) {
hc_theme_ids_dark(
backgroundColor = "#ffffff",
- textColor = "#383838",
+ textColor = textColor ,
highContrastColor = "#101013",
lowContrastColor = "#E0E0E3",
tooltipBackgroundColor = "#ffffffe0",
@@ -258,8 +238,9 @@
#'
#' See \code{\link{hc_theme_ids_dark}} for further documentation.
#'
-#' @param ... named arguments to modify the theme
-#'
+#' @inheritParams hc_theme_ids_dark
+#' @inheritDotParams hc_theme_ids_dark
+#'
#' @importFrom magrittr %>%
#' @import tidyverse
#' @import highcharter
@@ -272,9 +253,7 @@
#' @export
hc_theme_ids_mono <- function(...) {
hc_theme_ids_dark(
- palette = c(
- "#000000", "#B2B0AD", "#737373", "#D8D7D6", "#B2B0AD", "#8C8984"
- ),
+ palette = idsPaletteGreyscale,
backgroundColor = "white",
textColor = "black",
highContrastColor = "black",
diff --git a/R/idsThemeR.R b/R/idsThemeR.R
new file mode 100644
index 0000000..d62f03c
--- /dev/null
+++ b/R/idsThemeR.R
@@ -0,0 +1,60 @@
+idsBaseFontFamily <- 'Fira Sans Condensed'
+
+idsPalette <- c(
+ '#EB7C31',
+ "#1F77B4",
+ "#2CA02C",
+ "#D62728",
+ "#9467BD",
+ "#8C564B",
+ "#E377C2",
+ "#7F7F7F",
+ "#BCBD22",
+ "#17BECF",
+ "#AEC7E8",
+ "#FFBB78",
+ "#98DF8A",
+ "#FF9896",
+ "#C5B0D5",
+ "#C49C94",
+ "#F7B6D2",
+ "#C7C7C7",
+ "#DBDB8D",
+ "#9EDAE5"
+)
+
+idsPaletteGreyscale <- c(
+ "#000000", "#B2B0AD", "#737373", "#D8D7D6", "#B2B0AD", "#8C8984"
+)
+
+backgroundColorDark <- "#2a2a2a"
+textColorDark <- "#E0E0E3"
+lowContrastColorDark <- "#707073"
+highContrastColorDark <- "#F0F0F3"
+mediumContrastColorDark <- "#808083"
+
+backgroundColor <- "#ffffff"
+textColor <- "#383838"
+highContrastColor <- "#101013"
+lowContrastColor <- "#E0E0E3"
+mediumContrastColor <- "#404043"
+tooltipBackgroundColor <- "#ffffffe0"
+boxplotFillColor <- "#505053"
+candlestickColor <- "black"
+errorbarColor <- "black"
+
+#' IDS color palette based on the d3 color palette
+#'
+#' @importFrom scales manual_pal
+#' @export
+#'
+#' @references
+#'
+#' \url{https://github.com/d3/d3}
+#'
+ids_pal <- function() {
+ values <- idsPalette
+ f <- scales::manual_pal(values)
+ attr(f, "max_n") <- length(values)
+ f
+}
diff --git a/Readme.md b/Readme.md
index 12d64a6..650b133 100644
--- a/Readme.md
+++ b/Readme.md
@@ -2,7 +2,7 @@
---
## Description
-The package provides a collection themes for different plotting libraries (currently limited to [highcharter](https://cran.r-project.org/package=highcharter)), following the corporate design of the Leibniz Institute for the German Language (IDS) in Mannheim (Germany).
+The package provides a collection themes for different plotting libraries, following the corporate design of the Leibniz Institute for the German Language (IDS) in Mannheim (Germany).
## Installation
```R
@@ -11,6 +11,7 @@
```
## Examples
+### [highcharter](https://cran.r-project.org/package=highcharter) – light
```R
library(tidyverse)
@@ -21,10 +22,66 @@
```
![](./man/figures/Readme-Example-1.png)<!-- -->
+### ggplot2 – dark
+
+```R
+library(ggplot2)
+library(idsThemeR)
+
+dtemp <- data.frame(months = factor(rep(substr(month.name, 1, 3), 4),
+ levels = substr(month.name, 1, 3)),
+ city = rep(c("Tokyo", "New York", "Berlin", "London"),
+ each = 12),
+ temp = c(7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
+ 25.2, 26.5, 23.3, 18.3, 13.9, 9.6,
+ -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
+ 24.8, 24.1, 20.1, 14.1, 8.6, 2.5,
+ -0.9, 0.6, 3.5, 8.4, 13.5, 17.0,
+ 18.6, 17.9, 14.3, 9.0, 3.9, 1.0,
+ 3.9, 4.2, 5.7, 8.5, 11.9, 15.2,
+ 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+
+ggplot(dtemp, aes(x = months, y = temp, group = city, color = city)) +
+ geom_line() +
+ geom_point(size = 1.1) +
+ ggtitle("Monthly Average Temperature") +
+ theme_ids(style="dark") +
+ scale_colour_ids()
+```
+![](./man/figures/Readme-Example-2.png)<!-- -->
+
+### ggplot2 – light
+
+```R
+dtemp <- data.frame(Months = factor(rep(substr(month.name, 1, 3), 4),
+ levels = substr(month.name, 1, 3)),
+ City = rep(c("Tokyo", "New York", "Berlin", "London"),
+ each = 12),
+ Temperature = c(7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
+ 25.2, 26.5, 23.3, 18.3, 13.9, 9.6,
+ -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
+ 24.8, 24.1, 20.1, 14.1, 8.6, 2.5,
+ -0.9, 0.6, 3.5, 8.4, 13.5, 17.0,
+ 18.6, 17.9, 14.3, 9.0, 3.9, 1.0,
+ 3.9, 4.2, 5.7, 8.5, 11.9, 15.2,
+ 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+
+ggplot(dtemp, aes(x = Months, y = Temperature, group = City, color = City)) +
+ geom_line() +
+ geom_point(size = 1.1) +
+ ggtitle("Monthly Average Temperature", subtitle="Source: WorldClimate.com") +
+ theme_ids() +
+ scale_colour_ids()
+```
+![](./man/figures/Readme-Example-3.png)<!-- -->
+
## Demos
More elaborate R scripts demonstrating the use of the package can be found in the [demo](demo) folder.
+## Changes
+See [Changelog](./Changelog.md)
+
## Development and License
**Authors**: [Marc Kupietz](http://www1.ids-mannheim.de/zfo/personal/kupietz/)
@@ -41,7 +98,7 @@
### Further Affected Licenses and Terms of Services
#### Highcharts
-idsThemeR imports the [highcharter package](https://cran.r-project.org/package=highcharter) which has a dependency on Highcharts, a commercial JavaScript charting library. Highcharts offers both a commercial license as well as a free non-commercial license. Please review the licensing options and terms before using the highcharter plot options, as the `idsThemeR` license neither provides nor implies a license for Highcharts.
+idsThemeR imports the [highcharter package](https://cran.r-project.org/package=highcharter) which has a dependency on Highcharts, a commercial JavaScript charting library. Highcharts offers both a commercial license as well as a free non-commercial license. Please review the licensing options and terms before using the highcharter plot options, as the `idsThemeR` license neither provides nor implies a license for Highcharts.
[Highcharts](http://highcharts.com) is a Highsoft product which is not free for commercial and governmental use.
@@ -50,7 +107,7 @@
Contributions are very welcome!
Your contributions should be committed via our [Gerrit server](https://korap.ids-mannheim.de/gerrit/)
-to facilitate reviewing (see [Gerrit Code Review - A Quick Introduction](https://korap.ids-mannheim.de/gerrit/Documentation/intro-quick.html).
+to facilitate reviewing (see [Gerrit Code Review - A Quick Introduction](https://korap.ids-mannheim.de/gerrit/Documentation/intro-quick.html)).
Please note that unless you explicitly state otherwise any
contribution intentionally submitted for inclusion into this software shall –
diff --git a/inst/examples/ex-ggplot.R b/inst/examples/ex-ggplot.R
new file mode 100644
index 0000000..6c349d2
--- /dev/null
+++ b/inst/examples/ex-ggplot.R
@@ -0,0 +1,32 @@
+library(ggplot2)
+library(idsThemeR)
+
+if (interactive()) {
+p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
+ colour = factor(gear))) + facet_wrap(~am)
+p + theme_ids() + scale_colour_ids()
+p + theme_ids(style = "dark") +
+ scale_colour_ids("dark")
+
+dtemp <- data.frame(Months = factor(rep(substr(month.name, 1, 3), 4),
+ levels = substr(month.name, 1, 3)),
+ City = rep(c("Tokyo", "New York", "Berlin", "London"),
+ each = 12),
+ Temperature = c(7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
+ 25.2, 26.5, 23.3, 18.3, 13.9, 9.6,
+ -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
+ 24.8, 24.1, 20.1, 14.1, 8.6, 2.5,
+ -0.9, 0.6, 3.5, 8.4, 13.5, 17.0,
+ 18.6, 17.9, 14.3, 9.0, 3.9, 1.0,
+ 3.9, 4.2, 5.7, 8.5, 11.9, 15.2,
+ 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+
+ggplot(dtemp, aes(x = Months, y = Temperature, group = City, color = City)) +
+ geom_line() +
+ geom_point(size = 1.1) +
+ ggtitle("Monthly Average Temperature", subtitle="Source: WorldClimate.com") +
+ theme_ids() +
+ scale_colour_ids()
+
+}
+
diff --git a/man/figures/Readme-Example-2.png b/man/figures/Readme-Example-2.png
new file mode 100644
index 0000000..c3a2359
--- /dev/null
+++ b/man/figures/Readme-Example-2.png
Binary files differ
diff --git a/man/figures/Readme-Example-3.png b/man/figures/Readme-Example-3.png
new file mode 100644
index 0000000..e97b0d8
--- /dev/null
+++ b/man/figures/Readme-Example-3.png
Binary files differ
diff --git a/man/hc_theme_ids_dark.Rd b/man/hc_theme_ids_dark.Rd
index 2620594..162a64c 100644
--- a/man/hc_theme_ids_dark.Rd
+++ b/man/hc_theme_ids_dark.Rd
@@ -7,12 +7,10 @@
hc_theme_ids_dark(
fontFamily = "Fira Sans Condensed",
fontSize = "medium",
- textColor = "#E0E0E3",
- lowContrastColor = "#707073",
- highContrastColor = "#F0F0F3",
- palette = c("#EB7C31", "#1F77B4", "#2CA02C", "#D62728", "#9467BD", "#8C564B",
- "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF", "#AEC7E8", "#FFBB78", "#98DF8A",
- "#FF9896", "#C5B0D5", "#C49C94", "#F7B6D2", "#C7C7C7", "#DBDB8D", "#9EDAE5"),
+ textColor = textColorDark,
+ lowContrastColor = lowContrastColorDark,
+ highContrastColor = highContrastColorDark,
+ palette = idsPalette,
backgroundColor = list(linearGradient = list(x1 = 0, y1 = 1, x2 = 1, y2 = 0), stops =
list(list(0, "#2a2a2b"), list(1, "#3e3e3e"))),
titleColor = textColor,
diff --git a/man/hc_theme_ids_light.Rd b/man/hc_theme_ids_light.Rd
index fec68e2..80b8107 100644
--- a/man/hc_theme_ids_light.Rd
+++ b/man/hc_theme_ids_light.Rd
@@ -7,7 +7,36 @@
hc_theme_ids_light(...)
}
\arguments{
-\item{...}{named arguments to modify the theme}
+\item{...}{
+ Arguments passed on to \code{\link[=hc_theme_ids_dark]{hc_theme_ids_dark}}
+ \describe{
+ \item{\code{fontFamily}}{font family}
+ \item{\code{fontSize}}{default font size}
+ \item{\code{textColor}}{default text color}
+ \item{\code{lowContrastColor}}{color with low contrast to background}
+ \item{\code{highContrastColor}}{color with high contrast to background}
+ \item{\code{palette}}{array of colors to be used for different series}
+ \item{\code{backgroundColor}}{background color}
+ \item{\code{titleColor}}{color of the title text}
+ \item{\code{subtitleColor}}{color of the subtitle text}
+ \item{\code{gridLineColor}}{color of grid lines}
+ \item{\code{axisLabelColor}}{color of the axis labels}
+ \item{\code{axisLineColor}}{color of the axis lines}
+ \item{\code{minorGridLineColor}}{color of minor grid lines}
+ \item{\code{tickColor}}{color of axis ticks}
+ \item{\code{axisTitleColor}}{color of axis titles}
+ \item{\code{tooltipBackgroundColor}}{background color for tool tips}
+ \item{\code{tooltipColor}}{foreground color for tool tips}
+ \item{\code{dataLabelColor}}{color of data point labels}
+ \item{\code{boxplotFillColor}}{color for box plot fills}
+ \item{\code{candlestickColor}}{color the candle stick part of error bars}
+ \item{\code{errorbarColor}}{error bar color}
+ \item{\code{legendColor}}{series legend label color}
+ \item{\code{legendHoverColor}}{mouse over series legend label color}
+ \item{\code{legendHiddenColor}}{hidden series legend label color}
+ \item{\code{creditsColor}}{color of the credits}
+ \item{\code{burgerMenuBackground}}{burger menu background color}
+ }}
}
\description{
See \code{\link{hc_theme_ids_dark}} for further documentation.
diff --git a/man/hc_theme_ids_mono.Rd b/man/hc_theme_ids_mono.Rd
index 5ce70cb..fb4a4dc 100644
--- a/man/hc_theme_ids_mono.Rd
+++ b/man/hc_theme_ids_mono.Rd
@@ -7,7 +7,36 @@
hc_theme_ids_mono(...)
}
\arguments{
-\item{...}{named arguments to modify the theme}
+\item{...}{
+ Arguments passed on to \code{\link[=hc_theme_ids_dark]{hc_theme_ids_dark}}
+ \describe{
+ \item{\code{fontFamily}}{font family}
+ \item{\code{fontSize}}{default font size}
+ \item{\code{textColor}}{default text color}
+ \item{\code{lowContrastColor}}{color with low contrast to background}
+ \item{\code{highContrastColor}}{color with high contrast to background}
+ \item{\code{palette}}{array of colors to be used for different series}
+ \item{\code{backgroundColor}}{background color}
+ \item{\code{titleColor}}{color of the title text}
+ \item{\code{subtitleColor}}{color of the subtitle text}
+ \item{\code{gridLineColor}}{color of grid lines}
+ \item{\code{axisLabelColor}}{color of the axis labels}
+ \item{\code{axisLineColor}}{color of the axis lines}
+ \item{\code{minorGridLineColor}}{color of minor grid lines}
+ \item{\code{tickColor}}{color of axis ticks}
+ \item{\code{axisTitleColor}}{color of axis titles}
+ \item{\code{tooltipBackgroundColor}}{background color for tool tips}
+ \item{\code{tooltipColor}}{foreground color for tool tips}
+ \item{\code{dataLabelColor}}{color of data point labels}
+ \item{\code{boxplotFillColor}}{color for box plot fills}
+ \item{\code{candlestickColor}}{color the candle stick part of error bars}
+ \item{\code{errorbarColor}}{error bar color}
+ \item{\code{legendColor}}{series legend label color}
+ \item{\code{legendHoverColor}}{mouse over series legend label color}
+ \item{\code{legendHiddenColor}}{hidden series legend label color}
+ \item{\code{creditsColor}}{color of the credits}
+ \item{\code{burgerMenuBackground}}{burger menu background color}
+ }}
}
\description{
See \code{\link{hc_theme_ids_dark}} for further documentation.
diff --git a/man/ids_pal.Rd b/man/ids_pal.Rd
new file mode 100644
index 0000000..15e0c3e
--- /dev/null
+++ b/man/ids_pal.Rd
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/idsThemeR.R
+\name{ids_pal}
+\alias{ids_pal}
+\title{IDS color palette based on the d3 color palette}
+\usage{
+ids_pal()
+}
+\description{
+IDS color palette based on the d3 color palette
+}
+\references{
+\url{https://github.com/d3/d3}
+}
diff --git a/man/scale_ids.Rd b/man/scale_ids.Rd
new file mode 100644
index 0000000..f45be02
--- /dev/null
+++ b/man/scale_ids.Rd
@@ -0,0 +1,30 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ggplot-theme.R
+\name{scale_colour_ids}
+\alias{scale_colour_ids}
+\alias{scale_color_ids}
+\alias{scale_fill_ids}
+\title{IDS color and fill scales}
+\usage{
+scale_colour_ids(palette = "default", ...)
+
+scale_color_ids(palette = "default", ...)
+
+scale_fill_ids(palette = "default", ...)
+}
+\arguments{
+\item{palette}{A palette function that when called with a single integer
+argument (the number of levels in the scale) returns the values that they should take.}
+
+\item{...}{
+ Arguments passed on to \code{\link[ggthemes:scale_gdocs]{ggthemes::scale_colour_gdocs}}, \code{\link[ggthemes:scale_gdocs]{ggthemes::scale_colour_gdocs}}
+ \describe{
+ \item{\code{}}{}
+ }}
+}
+\description{
+Colour and fill scales which use the palettes in
+\code{\link{ids_pal}()} and are meant for use with
+\code{\link{theme_ids}()}.
+}
+\concept{colour ids}
diff --git a/man/theme_ids.Rd b/man/theme_ids.Rd
new file mode 100644
index 0000000..7f64164
--- /dev/null
+++ b/man/theme_ids.Rd
@@ -0,0 +1,72 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ggplot-theme.R
+\name{theme_ids}
+\alias{theme_ids}
+\title{IDS Theme for ggplot2}
+\usage{
+theme_ids(
+ base_size = 14,
+ base_family = idsBaseFontFamily,
+ style = c("default", "light", "dark"),
+ bgcolor = NULL
+)
+}
+\arguments{
+\item{base_size}{base font size, given in pts.}
+
+\item{base_family}{base font family}
+
+\item{style}{\code{'light'}, \code{'dark'}.}
+
+\item{bgcolor}{Deprecated}
+}
+\description{
+Based on Highcharts ggtheme \link[ggthemes]{theme_hc}
+which again is based on the plots in \url{Highcharts JS}.
+}
+\note{
+Note that here, unlike with the highcharter theme, you have to set the scale
+explicitly.
+}
+\examples{
+library(ggplot2)
+library(idsThemeR)
+
+if (interactive()) {
+p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
+ colour = factor(gear))) + facet_wrap(~am)
+p + theme_ids() + scale_colour_ids()
+p + theme_ids(style = "dark") +
+ scale_colour_ids("dark")
+
+dtemp <- data.frame(Months = factor(rep(substr(month.name, 1, 3), 4),
+ levels = substr(month.name, 1, 3)),
+ City = rep(c("Tokyo", "New York", "Berlin", "London"),
+ each = 12),
+ Temperature = c(7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
+ 25.2, 26.5, 23.3, 18.3, 13.9, 9.6,
+ -0.2, 0.8, 5.7, 11.3, 17.0, 22.0,
+ 24.8, 24.1, 20.1, 14.1, 8.6, 2.5,
+ -0.9, 0.6, 3.5, 8.4, 13.5, 17.0,
+ 18.6, 17.9, 14.3, 9.0, 3.9, 1.0,
+ 3.9, 4.2, 5.7, 8.5, 11.9, 15.2,
+ 17.0, 16.6, 14.2, 10.3, 6.6, 4.8))
+
+ggplot(dtemp, aes(x = Months, y = Temperature, group = City, color = City)) +
+ geom_line() +
+ geom_point(size = 1.1) +
+ ggtitle("Monthly Average Temperature", subtitle="Source: WorldClimate.com") +
+ theme_ids() +
+ scale_colour_ids()
+
+}
+
+}
+\references{
+\link[ggthemes]{theme_hc}
+
+\url{http://www.highcharts.com/demo/line-basic}
+
+\url{https://github.com/highslide-software/highcharts.com/tree/master/js/themes}
+}
+\concept{themes ids}