Skip to content

Categorical colorscales #1747

Description

@alanocallaghan

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

Activity

  1. etpinard commented on May 30, 2017

    @etpinard
    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

  2. alanocallaghan commented on May 30, 2017

    @alanocallaghan
    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

  3. changed the title [-]Categorical heatmaps[/-] [+]Categorical colorscales[/+] on May 30, 2017
  4. talgalili commented on May 31, 2017

    @talgalili
  5. nicolaskruchten commented on Jun 29, 2018

    @nicolaskruchten
    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.

  6. nicolaskruchten commented on Oct 11, 2018

    @nicolaskruchten
    Contributor

    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.

  7. self-assigned this
    on Oct 11, 2018
  8. removed their assignment
    on Oct 25, 2018
  9. bearmountainsolutions commented on Dec 10, 2018

    @bearmountainsolutions
  10. nicolaskruchten commented on Apr 4, 2019

    @nicolaskruchten
    Contributor

    @etpinard can you propose something here plz?

  11. talgalili commented on Jun 20, 2020

    @talgalili

    +1

  12. amnfar commented on Feb 3, 2023

    @amnfar

    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 ?

  13. self-assigned this
    on Jun 10, 2024
  14. removed their assignment
    on Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions