plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Unable to access customdata using clickData

Open kulasbart opened this issue 1 year ago • 1 comments

Want to revive this issue (or bug?), I have seen some old threads about it (https://community.plotly.com/t/plotly-dash-heatmap-customdata/5871), doesn't seem to be specific to the plot type either... where customdata attribute does not exist when using an interactive clickData graph component

Heres my example. I have created some mesh traces and want to use customdata to access some data on each trace:

fig.add_trace(go.Mesh3d(
                      x=elec_mesh_coords[:, 0],
                      y=elec_mesh_coords[:, 1],
                      z=elec_mesh_coords[:, 2],
                      i=faces[:, 0],
                      j=faces[:, 1],
                      k=faces[:, 2],
                      flatshading=False,
                      opacity=1,
                      facecolor=color[i],
                      hoverinfo='text',
                      text=labels[i],
                      customdata=coord_table['elec_num'][i],
                      showlegend=False
              ))

When accessing clickData for some callback logic, I cannot see the customdata attribute at all. I have tried using the name and ids parameters as well, they have the same issue. An example of the attributes that do get returned:

{'points': [{'x': 0.5805200245207541, 'y': 0.5194049306332301, 'z': 0.4701940166055228, 'curveNumber': 61, 'pointNumber': 84, 'i': 40, 'j': 21, 'k': 19, 'bbox': {'x0': 577.6691955628038, 'x1': 577.6691955628038, 'y0': 430.66051146242046, 'y1': 430.66051146242046}}]}

kulasbart avatar Nov 17 '23 00:11 kulasbart

thanks for creating this issue, @kulasbart . Can you please share a minimal reproducible example so we can try to replicate the bug locally?

Coding-with-Adam avatar Nov 20 '23 21:11 Coding-with-Adam

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

gvwilson avatar Jul 11 '24 17:07 gvwilson