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

feature request: helper methods palette expressions as python lists #825

Closed
andy-esch opened this issue Jul 1, 2019 · 1 comment · Fixed by #870
Closed

feature request: helper methods palette expressions as python lists #825

andy-esch opened this issue Jul 1, 2019 · 1 comment · Fixed by #870
Assignees

Comments

@andy-esch
Copy link
Contributor

andy-esch commented Jul 1, 2019

Right now the palette keyword takes a string expression, but it would be handy to have it take lists as well:

Map(
    color_category_layer(
        'county_measures',
        'male_or_female', 
        'Predominant Gender', 
        palette=['#6486FD', '#FD8F64', 'yellow']   # in addition to '[#6486FD,#FD8F64,yellow]'
    )
)
@Jesus89
Copy link
Member

Jesus89 commented Jul 2, 2019

OK. This is because we pass directly the param to VL, and ['#6486FD', '#FD8F64', 'yellow'] cannot be parsed as a palette because they are strings.

We can add a utility method in the color helpers to serialize the palette to [#6486FD, #FD8F64, yellow].

@Jesus89 Jesus89 self-assigned this Jul 18, 2019
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

Successfully merging a pull request may close this issue.

2 participants