Code Monkey home page Code Monkey logo

Comments (3)

tbreloff avatar tbreloff commented on May 18, 2024

Part 1 is done... still need to address "Could also take this opportunity to do away with the pluralized form (or at least map AbstractVector inputs to the pluralized form automatically)"

from plots.jl.

tbreloff avatar tbreloff commented on May 18, 2024

On this same note, I think it would be nice to have a preliminary layer which converts alternative names into the "one true name" for keyword keys and values. So for example:

(:c, :r) --> (:colors, [:red])
(:c, [:r,:b])  --> (:colors, [:red,:blue])
(:t, :l) --> (:linetypes, [:line])
(:type, :s) --> (:linetypes, [:scatter])
  etc...

Then syntax could be super short:

plot(y, c=:r)

The one gotcha to look out for... if I want to pass an array of colors for one series (say, for a colorscheme), then I need a way to pass in an array and have it be treated as a single value by the "renaming layer". This is the single most important reason that I still have explicit pluralized arguments. With a good solution I will merge plural and singular versions so they both do the same thing.

from plots.jl.

tbreloff avatar tbreloff commented on May 18, 2024

A clunky solution would be to require the user to wrap "array values" explicitly if the whole array should be applied to one series. So then:

(:c, :r) --> (:colors, [colorant"red"])
(:c, [:r, :b]) --> (:colors, [colorant"red", colorant"blue"])
(:c, [[:r, :b]]) --> (:colors, [[colorant"red", colorant"blue"]])

In the 1st and 2nd cases, the odd series would get the one color red while the even series would get the one color blue. In the 3rd case, all series would get the full vector of [red,blue]

from plots.jl.

Related Issues (20)

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.