-
Notifications
You must be signed in to change notification settings - Fork 26
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
CARTOColor category schemes and interpolation #129
Comments
Ok, so, I just added a few tests to check the current behavior, and it works as expected. Although I think that we may want to release a new cartocolor version with some new features and tweaks. Ramp casesI'll try to list every
SummaryColor interpolation will be activated if Answer to the original questionRegarding your questions:
Yes, interpolation is being used in both examples, but in the first one is less noticeable because the colors are ordered. Follow-up questionsWe may want to release at some point a new cartocolor version with some adjustments and new features. I think it would be better if we had ordered colors (like Additionally, we could export colorbrewer in a prettier form, see #31 Also, we could add palettes with different alpha values, since it is possible now, see: https://cartodb.github.io/renderer-prototype/example/mapbox.html#eyJhIjoibW5tYXBwbHV0byIsImIiOiIiLCJjIjoiZG1hbnphbmFyZXMiLCJkIjoiaHR0cHM6Ly97dXNlcn0uY2FydG8uY29tIiwiZSI6ImNvbG9yOiByYW1wKGxpbmVhcihsb2coJG51bWZsb29ycyksIDEsIDQpLCAgICBbIGhzdmEoMCwxLDEsMCksIGhzdmEoMCwwLDEsMSkgXSkiLCJmIjp7ImxuZyI6LTczLjk2NjYxNjI0ODY0MjQyLCJsYXQiOjQwLjc2OTA2NzAxOTAxNjk0NH0sImciOjExLjM2MTQ3MjE1NjIwNjIwNH0= |
Note: I closed this since I think that the original issue is resolved, but the follow-ups are certainly something to be discussed. |
@davidmanzanares I'm gonna reopen this specifically to talk about this part:
I've been doing a lot of testing today and I'm curious to get more information about:
Interpolation Current orderI totally see where the issues are coming from with the current ordering for example, in the images below, where the original This is related to a few different things that I can see:
Interpolation Reordered exampleThis is I have been running a side research project with Steph to test some adjustments schemes for better differentiation between categories, but specifically for Builder. She has come up with some adjustments to the ordering and slight saturation/brightness modifications. Once you and I have had a chance to talk more in depth about the interpolation piece, I will start testing some of her proposed adjustments in the VL context. We will find the happy medium for both Builder and VL!! |
I also did some testing to try and understand the idea of "sub-palettes" better. The behaviour is different with pre-defined CARTOColor schemes (as you described above), but this is the pattern I am seeing when custom color values are defined which I think demonstrates what you mean by sub-palettes. Would be good to talk through this too. |
Wow, so much detail, I'll try to answer the best I can.
Exactly, it is a human perception problem. I think interpolation is better than nothing though. For example, in a dataset with 50 categories (and 50 colors), it will be almost impossible to differentiate them. However, if the user zooms into a region of just 4 categories, the colors probably can be differentiated. Another option could be to use Regarding the color schemes, I guess that some schemes, the ones that use the entire hue space will be better, but, other than that, I don't have a better idea.
Yes, it takes the "subpalette" with most colors. Regarding forbidding the use of things like Regarding what I mean by "subpalette". For me, a "subpalette" is just a cartocolor of a specific number of colors, because, in cartocolors, each color scheme has multiple "subpalettes": https://github.com/CartoDB/CartoColor/blob/master/cartocolor.js#L10 |
Agree... that's a good way to do it. If people expect what they get with Builder, they'll wonder why they see so many different colors but there are so many Builder users that want a color for all of their categories! So this will accomplish both.
So in Builder what we do is not show the color schemes tagged
Now that I know how we interpolate when trying to go to more colors, I think the solution is to reorder the color schemes so they are distinguishable from one another in the 11 colors (need for Builder + VL) and do color adjustments so we don't get the muddy colors when interpolated with the ones next to them.
|
Hey, @makella. This is in the done column for the project. Can we close this issue? |
@rochoa I want to leave it open because it is a larger CARTOColor, category scheme piece of research that needs to happen. Basically, with VL's built-in interpolation, we have some issues of colors that are adjacent to one another not mixing well. So for example, if VL interpolates the category scheme The main thing that I need to spend more time looking at is if the ordering of the category color schemes.... are there combinations that will both be distinguishable between each other for Builder and VL. The other question is if category schemes that we provide should be interpolated... I added a label research (hope that's ok) so we can tag instances like this that need more work. Also, I believe all of this will become a really useful guide/blog post once we have it all figure out. |
@davidmanzanares OH! I just thought of something. Tell me what you think. what if we had a more ordered set of CARTOColor qualitative schemes that we triggered if someone activates interpolation on a category attribute? So for example, If interpolation is activated, we could switch to something like This way, we can still provide the distinction between colors when people use |
@davidmanzanares
I do want to say, that I think the interpolation piece is good for when there are a large number of categories, but I need to understand better how the interpolation is happening with category colors.
Before we go there, I think we need to step back and understand better what is happening at the smaller, and fewer categories, level. I am not seeing the same behavior with all category schemes so I am wondering if you can help me understand better.
Below are a series of maps symbolized off a text field 13 categories (values A-M) using different qualitative CARTOColor schemes.
I can't pin down exactly what is happening, and maybe
prism
isn't the best scheme to use because my initial sense is that we find a color close to another color (or something).Anyway, I'm confused!
Prism
At first, this looks right... but Argentina and Brazil are not part of the color scheme. Maybe others aren't either (based off the results illustrated for other color schemes below)
color: ramp($mapcolor13_text,prism)
MAP
Unique values 12 categories
When I assign unique values to 12 categories, the 13th, Argentina gets colored as other:
color: ramp(buckets($mapcolor13_text,"A","B","C","D","E","F","G","H","I","J","K","L"),prism)
MAP
BUT I have no idea where Suriname, Bolivia, or Chile are getting their fill colors from:
Unique values 13 categories
Totally different result where I think Bolivia and Uruguay are interpolated and potentially others.
color: ramp(buckets($mapcolor13_text,"A","B","C","D","E","F","G","H","I","J","K","L","M"),prism)
MAP
Bold
I'm not exactly sure how to describe what is happening here. From what I can see, we are going straight to interpolation (?). Maybe that is happening in the
prism
map but less noticeable (?) Below is the color scheme, followed by the output mapcolor: ramp($mapcolor13_text,bold)
MAP
The text was updated successfully, but these errors were encountered: