Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category color assignment #110

Closed
makella opened this issue Feb 23, 2018 · 8 comments
Closed

Category color assignment #110

makella opened this issue Feb 23, 2018 · 8 comments

Comments

@makella
Copy link
Contributor

makella commented Feb 23, 2018

@davidmanzanares

While testing the category ramp fix (#66), I noticed something else that I don't think is expected behavior.

Using some Airbnb data, there are 3 categories of the attribute room_type:
Entire home/apt,
Private room,
Shared room

Using this syntax:

color: ramp($room_type,vivid)

I'd expect to see the first three colors in the scheme vivid for each of the types:
screen shot 2018-02-23 at 10 24 14 am

Instead, what I'm seeing is this where the first color in the scheme is skipped and the third category Shared room being skipped altogether.

screen shot 2018-02-23 at 10 02 04 am

On the other hand, if I define the style with buckets:

color: ramp(buckets($room_type,"Entire home/apt", "Private room", "Shared room"),vivid)

I see the expected result for that syntax which is also what I would expect to see in the first rendering.

screen shot 2018-02-23 at 10 01 14 am

@davidmanzanares
Copy link

I think I fixed this, and #75 , but it would be very good if you could check the new ramp() behavior (not just these two cases). Thank you!

@makella
Copy link
Contributor Author

makella commented Mar 1, 2018

@davidmanzanares what are the new ramp behaviors?

@davidmanzanares
Copy link

I hope that the ones that you expected in the first place. I'm saying this because the fix included relatively important changes that affect all maps that are styled by category, not just ramps, actually, and I'm not very confident in the solution 😂

@makella
Copy link
Contributor Author

makella commented Mar 1, 2018

ohhhh ok. I'll go through all my category map types and check them!

@makella
Copy link
Contributor Author

makella commented Mar 2, 2018

heyy @davidmanzanares

Ok, so I went through the cateogry maps.

color: ramp($room_type,vivid): Fixed!

color: ramp(top($neighbourhood,4),prism) : Looks good

Two that I want to take a closer look at in the morning to understand better what is happening. To be honest, I kind of like these results but want to take a deeper look over multiple datasets to figure out the pattern better.

color: ramp(MODE($neighbourhood_cleansed),Prism)

I think there are over 200 neighborhoods defined... will test over different datasets

color: ramp($neighbourhood,prism)

Ok! I'll dig deeper tomorrow.

@makella
Copy link
Contributor Author

makella commented Mar 5, 2018

@davidmanzanares the initial issue of colors being skipped in category schemes seems to be fixed.

I still don't understand exactly what is happening with colors being interpolated with category schemes (when there are many categories) and seeing different behaviors depending on the schemes. Will post in another issue.

@davidmanzanares
Copy link

@makella

Nice! Closing this one!

Feel free to open another issue about related things. When there are more categories than cartocolors the renderer choose the palette with most colors available and it linearly interpolates between those. I think this is a good behavior in general, but it can be broken (bad implementation) and there can be many corner cases that aren't being looked upon.

@makella
Copy link
Contributor Author

makella commented Mar 5, 2018

@davidmanzanares opened another issue with some questions (#129). Can you give me a deeper dive into the linear interpolation between colors? Maybe you have explained it to me before but I am seeing really weird results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants