From 69bef011b50573ad7f532872804673675187d1b2 Mon Sep 17 00:00:00 2001 From: Nan Xiao Date: Sun, 9 Jun 2024 19:23:09 -0400 Subject: [PATCH] Replace `sysdata.rda` with code --- .Rbuildignore | 1 - DESCRIPTION | 2 +- NEWS.md | 9 +++ data-raw/data-generator.R => R/palettes.R | 64 ++-------------------- R/sysdata.rda | Bin 6136 -> 0 bytes 5 files changed, 14 insertions(+), 62 deletions(-) rename data-raw/data-generator.R => R/palettes.R (89%) delete mode 100644 R/sysdata.rda 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 6864dc914b7ecaeddb58841d8822746bc434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