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: Country colour coding according to filter #6731

Open
droberts-ctrlo opened this issue Sep 21, 2023 · 2 comments
Open

Feature: Country colour coding according to filter #6731

droberts-ctrlo opened this issue Sep 21, 2023 · 2 comments

Comments

@droberts-ctrlo
Copy link

We have a specific use-case we are using plotly.js for within the company I work for; we sometimes need to colour-code countries according to specific criterion within a geo map - for example, we may need all predominantly English speaking countries to be Blue, all predominantly French to be green, predominantly Spanish to be yellow, etc.

We have implemented this for our use-case, and wonder if it would be useful for the community; should it be as such, we can open a pull request of our code, and work from there.

@28raining
Copy link
Contributor

Have you tried Choropleth maps?
https://plotly.com/javascript/choropleth-maps/

@alexcjohnson
Copy link
Collaborator

Thanks @droberts-ctrlo - I'm curious to hear about what you implemented. From the sound of it I'm guessing you already have a choropleth, and I think what you're adding is a flavor of categorical colorscales #1747. The alternative for this kind of data is to break it into different traces, one per category, and give each trace a fixed color. This is what plotly.express does from the Python side, but we don't have a clean way to construct traces like this purely in JS.

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

4 participants