tesselle/khroma

Reduce dependencies

nfrerebeau opened this issue · 0 comments

ggplot2, scales and spacesXYZ should be suggested packages, so that khroma only imports grDevices and grid.

We need to check if a suggested package is available before using it:

if (!requireNamespace("pkg", quietly = TRUE)) {
  stop("Package \"pkg\" needed for this function to work. Please install it.", call. = FALSE)
}

An alternative would be to create a new package without dependencies (such as viridis and viridisLite) containing only the colour() function.