Skip to content

Fix for xyz column heatmap trace 'text' on hover #1417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2017

Conversation

etpinard
Copy link
Contributor

fixes #1391

- and use that to determine the text label on hover
- in the case of XYZ column traces calc'3d has a
  different structure then fullData text, so it becomes
  important to use calc'ed text to hover text to work after
  non-do-calc interaction (e.g. zoom).
@etpinard etpinard added status: reviewable bug something broken labels Feb 24, 2017
@etpinard etpinard added this to the 1.24.0 milestone Feb 24, 2017
if(Array.isArray(trace.text) && Array.isArray(trace.text[ny])) {
text = trace.text[ny][nx];
if(Array.isArray(cd0.text) && Array.isArray(cd0.text[ny])) {
text = cd0.text[ny][nx];
Copy link
Contributor Author

@etpinard etpinard Feb 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for xyz heatmaps, fullData[i].trace.text is 1D, whereas gd.calcdata[i][0].text is 2D.

Previously, fullData[i].trace.text was converted to be 2D during the calc step, but since the calc step isn't called on relayout(gd, 'xaxis.range', [/* */]), text on this line here was undefined after zoom interactions as discovered in #1391.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, nice detective work!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine as a bugfix, though I would think the more robust solution would not alter fullData at all, and only keep the re-dimensioned text array in calcdata.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and only keep the re-dimensioned text array in calcdata.

I agree 100%. But, I wanted to keep this patch to a minimum as @rreusser's carpet PR already alters heatmap/convert_column_xyz.js.

I'll make a comment there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good thinking. 💃

@etpinard etpinard mentioned this pull request Feb 27, 2017
44 tasks
@etpinard etpinard merged commit c227d15 into master Feb 27, 2017
@etpinard etpinard deleted the heatmap-xyz-text-in-hover-fix branch February 27, 2017 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover label disappear after dragging axes on this graph
2 participants