Skip to content

Commit 214704e

Browse files
committed
Use better color scale for nottem example
1 parent ee9aa54 commit 214704e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vignettes/cookbook/cookbook.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ reactable(data, columns = list(
6363
dimnames <- list(start(nottem)[1]:end(nottem)[1], month.abb)
6464
temps <- matrix(nottem, ncol = 12, byrow = TRUE, dimnames = dimnames)
6565
66-
# Excel-inspired 3-color scale
67-
GnYlRd <- function(x) rgb(colorRamp(c("#63be7b", "#ffeb84", "#f87274"))(x), maxColorValue = 255)
66+
# ColorBrewer-inspired 3-color scale
67+
BuYlRd <- function(x) rgb(colorRamp(c("#7fb7d7", "#ffffbf", "#fc8d59"))(x), maxColorValue = 255)
6868
6969
reactable(
7070
temps,
7171
defaultColDef = colDef(
7272
style = function(value) {
7373
if (!is.numeric(value)) return()
7474
normalized <- (value - min(nottem)) / (max(nottem) - min(nottem))
75-
color <- GnYlRd(normalized)
75+
color <- BuYlRd(normalized)
7676
list(background = color)
7777
},
7878
format = colFormat(digits = 1),

0 commit comments

Comments
 (0)