Open alanocallaghan opened 7 years ago
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
+1 to this feature.
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.
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.
has there been any progress on this?
@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