I’m using Dash, and I made a heatmap (go.Heatmap). It works, it’s visible, it’s gorgeous.
Now I’m trying to add customdata to it (to be used on a click event later, aka I’m accessing clickdata later). I have two bar graphs were I put in customdata and when I click on them, I get the customdata field in my clickdata. I have tried and failed to do the same with the heatmap. Here is a dummy example of what I’m writing:
Everything works, except the customdata. In this example, I’ve set it equal to the same thing as what I’m using for the text field, as both are lists and the text one worked, so I thought it’d be a good thing to test with. But, as said above, when I click a point and access the clickdata, there is no customdata at all. Any guidance would be appreciated!
Hi @chriddyp I am also experiencing this issue in Scatter traces using mode=‘lines’. The bug does indeed seem to be in the Graph component, although my JS knowledge is very limited, I am identifying the conditional below as the likely culprit:
This still appears to be a problem today (dash==1.13.4, plotly==4.8.1). customdata from go.Heatmap can appear in the figure’s hovertemplate but not in clickdata.
My current solution is to include the necessary data in the figure’s text attribute and parse it out from clickdata['points'][0]['text'] but this is less than ideal.
Just wanted to revive this topic because this is a real headache to workaround, especially if you want to use both text and customdata for different purposes.
Bump because i have the same issue. I have long labels that have to be shortened before using as the y data, so I add the full text to the customdata for the hovertemplate. In a callback I would like to get the full text.