-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
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
talgalili, kernc, mrjrdnthms, mschilli87, aviolante and 10 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
etpinard commentedon May 30, 2017
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
alanocallaghan commentedon May 30, 2017
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
[-]Categorical heatmaps[/-][+]Categorical colorscales[/+]talgalili commentedon May 31, 2017
nicolaskruchten commentedon Jun 29, 2018
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.
marker.color
accept an array of categories #2795nicolaskruchten commentedon Oct 11, 2018
Additional thoughts on this from a conversation with @alexcjohnson when he was in Montreal: for categorical colorscales we
shouldcould not use the colorbar: weshouldcould instead insert legend items like we do for pie traces.bearmountainsolutions commentedon Dec 10, 2018
nicolaskruchten commentedon Apr 4, 2019
@etpinard can you propose something here plz?
talgalili commentedon Jun 20, 2020
+1
amnfar commentedon 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 ?