Add ggplot2 support und bump to v0.2.0
Change-Id: Iee69051bc64fb9fbde55bbea61c7e892ff95229d
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",