Closed andy-esch closed 7 years ago
@jiffyclub, pretty much finished with the sequential and diverging palettes here. Any advice on handling qualitative palettes?
Also, looks like the py2.7 and pypy tests are failing because they're grabbing a too-new version of IPython. I've had to limit the IPython version in a setup.py to avoid this issue: https://github.com/CartoDB/cartoframes/blob/master/setup.py#L46-L48 Looks like the version needs to be specified in the .travis.yml
Qualitative maps can be handled in pretty much the same way as the others (e.g. using the same class). For example in the colorbrewer maps I think the only difference between the qualitative palettes and the others is the palette type.
@jiffyclub, could you do a code review of this? I modeled the new palette structure off of cmocean like you said. Only substantial change is adding a new named argument to utils.get_map_factory
that controls how the colors are sampled from the palettes. In my case, the palettes are ordered in the way that the would ideal be sampled (e.g., first three would be a three color palette instead of first, middle, and last like the default).
Let me know if there's anything that you'd like me to change.
@jiffyclub, any thing else you need from me here?
Thanks for this! I haven't had a chance to review in detail, but will try to get to it soon.
Ok, I added the length check (and verified on my end if it errors correctly if a palette is too short for ones requested to build), and changed the slice to same style as rest of code.
Awesome, thank you! Could you also add a test of the new get_map_factory
feature and exception in test_utils.py?
Yep :) here you go: a6452a1
Thanks, this looks good! I'm going to try to get all the tests passing in Travis before I merge this, but I expect to merge this soon.
Porting over the schemes from the CartoColors node module.