Comments (15)
from cmocean.
I would be happy if you could do this! I'm in the last year of my PhD and shouldn't be doing these kinds of fun programming exercises ;-).
Adding the dependency check sounds great.
from cmocean.
What do you think about the API we have as of e55f9bb? (there's a package file ready for install.packages
at https://github.com/aitap/cmocean/releases/download/v0.3pre/cmocean_0.2.tar.gz). If you think it's good, I will prepare some minor changes I've been planning, increment the version and submit it to CRAN in the following days.
from cmocean.
That looks great to me!
In viridis they do implement the two col[o]ur functions separately, probably so that roxygen notices them both and creates docs for both? I haven't checked by trying to install the package to see if it does it correctly.
#' @rdname scale_viridis
#'
#' @importFrom ggplot2 scale_fill_gradientn scale_color_gradientn discrete_scale
#'
#' @export
scale_color_viridis <- function(..., alpha = 1, begin = 0, end = 1, direction = 1,
discrete = FALSE, option = "D") {
if (discrete) {
discrete_scale("colour", "viridis", viridis_pal(alpha, begin, end, direction, option), ...)
} else {
scale_color_gradientn(colours = viridisLite::viridis(256, alpha, begin, end, direction, option), ...)
}
}
#' @rdname scale_viridis
#' @aliases scale_color_viridis
#' @export
scale_colour_viridis <- scale_color_viridis
Also, and this is probably not related to this issue but might be easy to implement, it may be good to do some input checking in the base cmocean fuction, like in viridisLite::viridis: https://github.com/sjmgarnier/viridisLite/blob/b44c8792478c5406256760f734b47ba70bcce904/R/viridis.R#L145
from cmocean.
Ah never mind, I just saw that you're not using roxygen but writing the docs in a separate Rd file by hand. :)
from cmocean.
looks like you already check the others, so I added a name check :).
Wasn't sure about the indentation you use.
from cmocean.
from cmocean.
I second being consistent about allowing version specification. There's not a super high chance that the colours might change, but small tweaks are possible (maybe I'll check in with the cmocean creator to get a sense of what future plans might be coming down the pipeline).
from cmocean.
Hmm I guess that it would be important for future updates and reproducible figures... I agree that including it with the proper defaults is the right approach.
from cmocean.
from cmocean.
from cmocean.
looks good to me. It might be useful to write some tests at some point to make sure that future updates don't break any of the intended functionality, but for now it's relatively simple so I would postpone that until the next release. 👍
from cmocean.
Thanks, submitted v0.3
to CRAN.
from cmocean.
Sorry, was a bit behind checking up on this, but it looks great to me. Thanks!
from cmocean.
from cmocean.
Related Issues (5)
- Versioning HOT 10
- names and namespace collisions HOT 4
- add vignette? HOT 4
- Vignette loads external JavaScript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmocean.