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

Palette feature request #1511

Open
andy-esch opened this issue Jan 21, 2020 · 0 comments
Open

Palette feature request #1511

andy-esch opened this issue Jan 21, 2020 · 0 comments
Milestone

Comments

@andy-esch
Copy link
Contributor

Sometimes its important to associate a palette with specific values. This can be done with color_category_style but it feels laborious:

palette = {
    "Residential": "blue",
    "Commercial": "yellow",
    "BPP,Commercial": "orange",
    "BPP,Residential": "purple",
    "BPP,Commercial,Residential": "white",
    "Commercial,Residential": "green",
    "BPP": "red",
}

Layer(
    polys,
    color_category_style(
        "usedesc", palette=list(palette.values()), cat=list(palette.keys())
    ),
)

It'd be really nice if we could directly pass in palette to the palette argument like so:

Layer(
    polys,
    color_category_style("usedesc", palette=palette),
)

This is more inline with what seaborn and other libraries do:
Screen Shot 2020-01-21 at 4 10 20 PM

Besides this, I've had issues with passing different iterables into the palette and cat kwargs above. I had to cast them to list for it to work. Extracting the keys and values from the dictionary (palette.keys() and palette.values()) gave me the following errors after passed them in:
Screen Shot 2020-01-21 at 4 13 17 PM

IMO most iterables should work as arguments here (excluding str type)

@Jesus89 Jesus89 added this to the [1.1] Next milestone Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants