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

Categorical colorscales #1747

Open
alanocallaghan opened this issue May 30, 2017 · 9 comments
Open

Categorical colorscales #1747

alanocallaghan opened this issue May 30, 2017 · 9 comments
Labels
feature something new P3 backlog

Comments

@alanocallaghan
Copy link

Would it be possible to add the ability to use categorical (ie, String) values in a heatmap, mapped to a color scale?

This is currently possible only by mapping to numeric values and spoofing a colorscale and colorbar.

EG: https://i.stack.imgur.com/1MS66.png

Again apologies, in this case I realise this could require a radical overhaul of that trace

@etpinard
Copy link
Contributor

Thanks for writing in. More generally, we should start thinking about adding categorical colorscales that could be applied not only to heatmap traces but to scatter bubble charts and choropleths to name a few.

In the meantime, here's a (somewhat hacky) workaround: https://codepen.io/etpinard/pen/GmbVZq?editors=0010

@etpinard etpinard added the feature something new label May 30, 2017
@alanocallaghan
Copy link
Author

Cheers. If you have pointers on where to look I'd be glad to have a try, though my JS is not exactly the greatest

@alanocallaghan alanocallaghan changed the title Categorical heatmaps Categorical colorscales May 30, 2017
@talgalili

This comment has been minimized.

@nicolaskruchten
Copy link
Contributor

Let's resurrect this guy :)

As a starting point, I propose a new flag somewhere that says "treat the values in the color array as discrete and generate a categorical colorscale" that way we could pass in either numbers or non-css strings and have a categorical colorscale/colorbar be generated.

@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Oct 11, 2018

Additional thoughts on this from a conversation with @alexcjohnson when he was in Montreal: for categorical colorscales we should could not use the colorbar: we should could instead insert legend items like we do for pie traces.

@bearmountainsolutions

This comment has been minimized.

@nicolaskruchten
Copy link
Contributor

@etpinard can you propose something here plz?

@talgalili
Copy link

+1

@amnfar
Copy link

amnfar commented Feb 3, 2023

Do we have a solution now? I have also exhausted all my resources to plot cetagorical values in heatmap. Do we have categorical color scales for heatmaps ?

@gvwilson gvwilson self-assigned this Jun 10, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P3 backlog label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

8 participants