Skip to content

Commit 59fe934

Browse files
committed
Add accent (link) color and qualitative color palettes
Also, improved approach to adjusting various defaults based on fg/bg/accent
1 parent 348f85e commit 59fe934

File tree

11 files changed

+337
-176
lines changed

11 files changed

+337
-176
lines changed

R/render-cached-plot.R

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ renderCachedPlot <- function(expr,
390390
height <- fitDims$height
391391
})
392392

393-
colors <- getColors(autoTheme, session, outputName)
393+
theme <- getTheme(autoTheme, session, outputName)
394394
pixelratio <- session$clientData$pixelratio %OR% 1
395395

396396
do.call("drawPlot", c(
@@ -402,8 +402,7 @@ renderCachedPlot <- function(expr,
402402
height = height,
403403
pixelratio = pixelratio,
404404
res = res,
405-
bg = colors$bg,
406-
fg = colors$fg
405+
theme = theme
407406
),
408407
args
409408
))
@@ -439,9 +438,9 @@ renderCachedPlot <- function(expr,
439438
width <- fitDims$width
440439
height <- fitDims$height
441440
pixelratio <- session$clientData$pixelratio %OR% 1
442-
colors <- getColors(autoTheme, session, outputName)
441+
theme <- getTheme(autoTheme, session, outputName)
443442

444-
key <- digest::digest(list(outputName, userCacheKeyResult, width, height, res, pixelratio, colors), "xxhash64")
443+
key <- digest::digest(list(outputName, userCacheKeyResult, width, height, res, pixelratio, theme), "xxhash64")
445444

446445
plotObj <- cache$get(key)
447446

@@ -455,7 +454,7 @@ renderCachedPlot <- function(expr,
455454
width = width,
456455
height = height,
457456
pixelratio = pixelratio,
458-
colors = colors
457+
theme = theme
459458
))
460459
}
461460

@@ -478,7 +477,7 @@ renderCachedPlot <- function(expr,
478477
width = width,
479478
height = height,
480479
pixelratio = pixelratio,
481-
colors = colors
480+
theme = theme
482481
)
483482
}
484483
)
@@ -488,7 +487,7 @@ renderCachedPlot <- function(expr,
488487
width <- result$width
489488
height <- result$height
490489
pixelratio <- result$pixelratio
491-
colors <- result$colors
490+
theme <- result$theme
492491

493492
# Three possibilities when we get here:
494493
# 1. There was a cache hit. No need to set a value in the cache.
@@ -510,8 +509,7 @@ renderCachedPlot <- function(expr,
510509
height,
511510
pixelratio,
512511
res,
513-
bg = colors$bg,
514-
fg = colors$fg
512+
theme
515513
),
516514
args
517515
))

0 commit comments

Comments
 (0)