plotly / plotly/dash

Send categorical color data on click/hover/select

Open
#2,738 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P2
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Hi there,
I just discovered Dash recently and while making my first app I noticed that the mouse actions' data used in callbacks doesn't contain the color data of the active point. I tried this for bar plots and scatter plots, when I use clickData for example in a callback, I get its color data when it's numerical but not when it's categorical.
The solution here would be to add a field in the JSON data sent to the callback, ideally with the same color.marker name for numerical data to ensure consistency.
I thought about making a mapping from my categorical data to a numeric one. The problem with this approach is that it infers a comparison between the categorical values which is not always desirable.
Have a great day.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with bar and scatter plots using categorical colors, then inspect the clickData, hoverData, and selectData callback payloads. Done means categorical color data is included for the active point under a consistent field matching numerical color data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.