Giter Club home page Giter Club logo

Comments (15)

aitap avatar aitap commented on August 15, 2024

from cmocean.

japhir avatar japhir commented on August 15, 2024

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.

aitap avatar aitap commented on August 15, 2024

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.

japhir avatar japhir commented on August 15, 2024

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.

japhir avatar japhir commented on August 15, 2024

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.

japhir avatar japhir commented on August 15, 2024

looks like you already check the others, so I added a name check :).

Wasn't sure about the indentation you use.

from cmocean.

aitap avatar aitap commented on August 15, 2024

from cmocean.

richardsc avatar richardsc commented on August 15, 2024

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.

japhir avatar japhir commented on August 15, 2024

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.

aitap avatar aitap commented on August 15, 2024

from cmocean.

aitap avatar aitap commented on August 15, 2024

from cmocean.

japhir avatar japhir commented on August 15, 2024

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.

aitap avatar aitap commented on August 15, 2024

Thanks, submitted v0.3 to CRAN.

from cmocean.

richardsc avatar richardsc commented on August 15, 2024

Sorry, was a bit behind checking up on this, but it looks great to me. Thanks!

from cmocean.

aitap avatar aitap commented on August 15, 2024

from cmocean.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.