Giter Site home page Giter Site logo

Comments (10)

davidmanzanares avatar davidmanzanares commented on July 17, 2024

Is ramp($price, inverse(burg)) fine?

from carto-vl.

makella avatar makella commented on July 17, 2024

yep!

from carto-vl.

davidmanzanares avatar davidmanzanares commented on July 17, 2024

inverse() is already there!

from carto-vl.

makella avatar makella commented on July 17, 2024

nice!!

so what category of operator would this be?

I know we had a category of Color Constructors -- being able to manipulate things like h,s,v channels... do you think this is part of that?

from carto-vl.

makella avatar makella commented on July 17, 2024

@davidmanzanares

So looking at this closer... do you mean that by default we read in the inverse() of a sequential scheme?

I ask because that is the default behavior I'm seeing.

For example, using the Airbnb data's price attribute the higher value listings, by default, are colored with the lightest color in the scheme Emrld:
screen shot 2018-02-23 at 11 41 39 am

color: ramp(quantiles($price,7),Emrld): result

with inverse():
color: ramp(quantiles($price,7),inverse(Emrld)): result

Let's discuss this because from a "traditional" standpoint, people will expect the inverse() result as the default vs. the way we have it now.

from carto-vl.

davidmanzanares avatar davidmanzanares commented on July 17, 2024

Sorry for the delay, I forgot about this.

No, I don't think this could be considered part of Color Constructors. I would say this is part of palettes, I think it would be good to explain this after explaining how cartocolors can be used with ramps, also near custom palettes (something that hasn't been implemented yet).

About reading in the inverse order, we get the order from cartocolors, but it is certainly possible that that order was meant to be read in the other way.
Does this inversion happen in all cases (all cartocolos, numeric properties, categorical properties...)?
Inverting this is easy, but, if it doesn't need to be inverted in all cases, we would need more details.

from carto-vl.

makella avatar makella commented on July 17, 2024

@davidmanzanares no prob!

Let's talk about this next week... they were flipped in cartocolor.js for Builder (long story that I need to refresh myself on)

from carto-vl.

makella avatar makella commented on July 17, 2024

After looking deeper david thinks this might have to do specifically with quantiles as linear is giving the expected result:

Linear example

from carto-vl.

davidmanzanares avatar davidmanzanares commented on July 17, 2024

I found the bug, quantiles assigned incorrectly the last bucket. Should be already fixed on ghpages now. 🚀

from carto-vl.

makella avatar makella commented on July 17, 2024

Nice, checked, and looks good to me!

thanks, david!

from carto-vl.

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.