Repository navigation
Categorical colorscales #1747
Description
Activity
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
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
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.
Reacted by Alex Ryckman Mellnik, Tim Nonner, harisbal and Ramin Haeri AzadAdditional 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.Reacted by amalekian, Daniel Buades Marcos and Rachel Resnickbearmountainsolutions commented
on Dec 10, 2018 on Dec 10, 2018 · Hidden as off-topicshow commentMore actions@etpinard can you propose something here plz?
+1
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 ?
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