Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 1 | idsBaseFontFamily <- 'Fira Sans Condensed' |
| 2 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 3 | |
| 4 | #' Title |
| 5 | #' |
| 6 | #' @return |
| 7 | #' @export |
| 8 | #' |
| 9 | #' @examples |
Marc Kupietz | 556dbd5 | 2021-02-04 14:53:21 +0100 | [diff] [blame^] | 10 | idsPaletteIDS <- function() { |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 11 | c( |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 12 | '#F18700', |
| 13 | "#1E2662", |
| 14 | "#6A7702", |
| 15 | "#C10A25", |
| 16 | "#009EE3", |
| 17 | "#FAF3DE", |
| 18 | "#A7C2D2", |
| 19 | "#E2E8A4", |
| 20 | "#CFBCBD", |
| 21 | "#BCE3FA", |
| 22 | "#5C401C", |
| 23 | "#000000", |
| 24 | "#354C32", |
| 25 | "#5C131C", |
| 26 | "#273582", |
| 27 | "#FFE3BF", |
| 28 | "#8994E1", |
| 29 | "#A3B29E", |
| 30 | "#DF9599", |
| 31 | "#79B8DB" |
| 32 | ) |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 33 | } |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 34 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 35 | #' Title |
| 36 | #' |
| 37 | #' @return |
| 38 | #' @export |
| 39 | #' |
| 40 | #' @examples |
| 41 | idsPaletteD3 <- function() { |
| 42 | c( |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 43 | '#EB7C31', |
| 44 | "#1F77B4", |
| 45 | "#2CA02C", |
| 46 | "#D62728", |
| 47 | "#9467BD", |
| 48 | "#8C564B", |
| 49 | "#E377C2", |
| 50 | "#7F7F7F", |
| 51 | "#BCBD22", |
| 52 | "#17BECF", |
| 53 | "#AEC7E8", |
| 54 | "#FFBB78", |
| 55 | "#98DF8A", |
| 56 | "#FF9896", |
| 57 | "#C5B0D5", |
| 58 | "#C49C94", |
| 59 | "#F7B6D2", |
| 60 | "#C7C7C7", |
| 61 | "#DBDB8D", |
| 62 | "#9EDAE5" |
| 63 | ) |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 64 | } |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 65 | |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 66 | #' Title |
| 67 | #' |
| 68 | #' @return |
| 69 | #' @export |
| 70 | #' |
| 71 | #' @examples |
Marc Kupietz | 556dbd5 | 2021-02-04 14:53:21 +0100 | [diff] [blame^] | 72 | idsPalettePoly20 <- function() { |
| 73 | c( |
| 74 | "#EF8700", "#1642FF", "#00D20D", "#FF00CB", "#162E35", "#00C8FC", "#FF004B", "#BBB96A", "#DFA2ED", "#881640", "#22D0AD", "#CF0DF7", |
| 75 | "#2E0D95", "#AFB9BD", "#FC4792", "#EBA392", "#1C7C00", "#939CFF", "#AB00A4", "#AF1C00" |
| 76 | ) |
| 77 | } |
| 78 | |
| 79 | #' Title |
| 80 | #' |
| 81 | #' @return |
| 82 | #' @export |
| 83 | #' |
| 84 | #' @examples |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 85 | idsPaletteGreyscale <- function() { |
| 86 | c( |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 87 | "#000000", "#B2B0AD", "#737373", "#D8D7D6", "#B2B0AD", "#8C8984" |
Marc Kupietz | 161a86a | 2021-02-02 14:40:23 +0100 | [diff] [blame] | 88 | ) |
| 89 | } |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 90 | |
Marc Kupietz | 556dbd5 | 2021-02-04 14:53:21 +0100 | [diff] [blame^] | 91 | #' Title |
| 92 | #' |
| 93 | #' @return |
| 94 | #' @export |
| 95 | #' |
| 96 | #' @examples |
| 97 | idsPalette <- function() { |
| 98 | idsPaletteD3() |
| 99 | } |
| 100 | |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 101 | backgroundColorDark <- "#2a2a2a" |
| 102 | textColorDark <- "#E0E0E3" |
| 103 | lowContrastColorDark <- "#707073" |
| 104 | highContrastColorDark <- "#F0F0F3" |
| 105 | mediumContrastColorDark <- "#808083" |
| 106 | |
| 107 | backgroundColor <- "#ffffff" |
| 108 | textColor <- "#383838" |
| 109 | highContrastColor <- "#101013" |
| 110 | lowContrastColor <- "#E0E0E3" |
| 111 | mediumContrastColor <- "#404043" |
| 112 | tooltipBackgroundColor <- "#ffffffe0" |
| 113 | boxplotFillColor <- "#505053" |
| 114 | candlestickColor <- "black" |
| 115 | errorbarColor <- "black" |
| 116 | |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 117 | #' IDS color palette |
| 118 | #' |
Marc Kupietz | 556dbd5 | 2021-02-04 14:53:21 +0100 | [diff] [blame^] | 119 | #' @param palette \code{c("d3", "grey", "ids", "poly20")} - default: (adapted) d3 palette |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 120 | #' |
| 121 | #' @importFrom scales manual_pal |
| 122 | #' @export |
| 123 | #' |
| 124 | #' @references |
| 125 | #' |
| 126 | #' \url{https://github.com/d3/d3} |
| 127 | #' |
Marc Kupietz | a371c67 | 2020-12-18 15:56:15 +0100 | [diff] [blame] | 128 | ids_pal <- function(palette="default") { |
Marc Kupietz | 556dbd5 | 2021-02-04 14:53:21 +0100 | [diff] [blame^] | 129 | values <- switch(tolower(palette), |
| 130 | ids = idsPalette(), |
| 131 | gray = idsPaletteGreyscale(), |
| 132 | grey = idsPaletteGreyscale(), |
| 133 | poly20 = idsPalettePoly20(), |
| 134 | idsPaletteD3() |
| 135 | ) |
Marc Kupietz | 5214481 | 2020-12-14 23:41:56 +0100 | [diff] [blame] | 136 | f <- scales::manual_pal(values) |
| 137 | attr(f, "max_n") <- length(values) |
| 138 | f |
| 139 | } |