diff --git a/.Rbuildignore b/.Rbuildignore index 8ed264c..292a130 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,7 +6,6 @@ ^pkgdown$ ^docs$ -^data-raw$ ^CONTRIBUTING\.md$ ^CODE_OF_CONDUCT\.md$ ^LICENSE\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index 0129fe0..b2a1b93 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ggsci Type: Package Title: Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2' -Version: 3.1.0 +Version: 3.1.0.9000 Authors@R: c( person("Nan", "Xiao", email = "me@nanx.me", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0250-5673")), diff --git a/NEWS.md b/NEWS.md index 9da0644..e2168dd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +# ggsci 3.1.0.9000 + +## Improvements + +- Move internal color palette data from `R/sysdata.rda` to `R/palettes.R`. + This change enhances package development transparency, reduces unnecessary + indirection, and simplifies contributions by avoiding the construction + of the palette data using the R script in `data-raw/` (#42). + # ggsci 3.1.0 ## New features diff --git a/data-raw/data-generator.R b/R/palettes.R similarity index 89% rename from data-raw/data-generator.R rename to R/palettes.R index 3c164b5..f6dafdc 100644 --- a/data-raw/data-generator.R +++ b/R/palettes.R @@ -1,6 +1,7 @@ -# Generate internal color palettes data `R/sysdata.rda`: -# - R Packages - Internal data. -# - Name that Color. +# Construct color palettes data +# +# If not available, the color names are generated by "Name that Color" at +# . ggsci_db <- vector("list") @@ -487,60 +488,3 @@ ggsci_db$"material"$"blue-grey" <- c( "BlueGrey600" = "#546E7A", "BlueGrey700" = "#455A64", "BlueGrey800" = "#37474F", "BlueGrey900" = "#263238" ) - -save(ggsci_db, file = "R/sysdata.rda") - -test_barplot <- function(palette, type) { - pal <- ggsci_db[[palette]][[type]] - barplot(rep(1, length(pal)), col = pal) -} - -test_barplot("npg", "nrc") -test_barplot("aaas", "default") -test_barplot("nejm", "default") -test_barplot("lancet", "lanonc") -test_barplot("jama", "default") -test_barplot("bmj", "default") -test_barplot("jco", "default") -test_barplot("ucscgb", "default") -test_barplot("d3", "category10") -test_barplot("d3", "category20") -test_barplot("d3", "category20b") -test_barplot("d3", "category20c") -test_barplot("locuszoom", "default") -test_barplot("igv", "default") -test_barplot("igv", "alternating") -test_barplot("uchicago", "default") -test_barplot("uchicago", "light") -test_barplot("uchicago", "dark") -test_barplot("cosmic", "hallmarks_dark") -test_barplot("cosmic", "hallmarks_light") -test_barplot("cosmic", "signature_substitutions") -test_barplot("startrek", "uniform") -test_barplot("tron", "legacy") -test_barplot("futurama", "planetexpress") -test_barplot("rickandmorty", "schwifty") -test_barplot("simpsons", "springfield") -test_barplot("gsea", "default") -test_barplot("flatui", "default") -test_barplot("flatui", "flattastic") -test_barplot("flatui", "aussie") -test_barplot("material", "red") -test_barplot("material", "pink") -test_barplot("material", "purple") -test_barplot("material", "deep-purple") -test_barplot("material", "indigo") -test_barplot("material", "blue") -test_barplot("material", "light-blue") -test_barplot("material", "cyan") -test_barplot("material", "teal") -test_barplot("material", "green") -test_barplot("material", "light-green") -test_barplot("material", "lime") -test_barplot("material", "yellow") -test_barplot("material", "amber") -test_barplot("material", "orange") -test_barplot("material", "deep-orange") -test_barplot("material", "brown") -test_barplot("material", "grey") -test_barplot("material", "blue-grey") diff --git a/R/sysdata.rda b/R/sysdata.rda deleted file mode 100644 index 6864dc9..0000000 Binary files a/R/sysdata.rda and /dev/null differ