Skip to content
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

Add hoverongaps to heatmap and contour for suppressing hovers on missing data #4291

Merged
merged 4 commits into from
Oct 23, 2019

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Oct 21, 2019

Resolves #4226.

A new attribute titled hovergaps is added to contour and heatmap for disabling hover when the z is missing.

@plotly/plotly_js

@etpinard etpinard added this to the v1.51.0 milestone Oct 21, 2019
@etpinard
Copy link
Contributor

A few questions:

  • What about histogram2d and histogram2dcontour - do they currently show hover labels for out-sample (x,y) coordinates?
  • What about surface - do hover labels ever show NaN values?

@archmoj
Copy link
Contributor Author

archmoj commented Oct 21, 2019

  • What about surface - do hover labels ever show NaN values?

surface plot won't be visible true with missing data.

obj.zLabel = Axes.tickText(dummyAx, zVal, 'hover').text;
}

return [Lib.extendFlat(pointData, obj)];
Copy link
Contributor

Choose a reason for hiding this comment

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

So this mean when hovergaps:false, zLabel and zLabelVal remain undefined, but we still pass pointData back to Fx.hover?

Does this mean that the hover label is suppressed, but the plotly_hover event is still getting triggered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is a codepen displaying the current behaviour with hoverongaps disabled.
Please let me know if you prefer not to have hover effects at all.
cc: @emmanuelle

Copy link
Contributor

@etpinard etpinard Oct 22, 2019

Choose a reason for hiding this comment

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

I think the behaviour in @archmoj above codepen is incorrect. Under hoverongaps: false, there should be no hover labels shown and no plotly_hover event triggered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now fixed in 9269352.
new demo

Copy link
Contributor

Choose a reason for hiding this comment

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

Fantastic!!

@etpinard
Copy link
Contributor

surface plot won't be visible true with missing data.

What wait. What about -> https://codepen.io/etpinard/pen/LYYxRVO ?

…verongaps is false

- adjust new tests to make sure plotly_hover is not triggered on gaps when hoverongaps is false
@archmoj
Copy link
Contributor Author

archmoj commented Oct 22, 2019

  • What about histogram2d and histogram2dcontour - do they currently show hover labels for out-sample (x,y) coordinates?

histogram2d and histogram2dcontour apply null values as zeros.
So the hover on those areas display the zero and not any NaN.
demo.

@archmoj archmoj changed the title Add hovergaps to heatmap and contour for suppressing hovers on missing data Add hoverongaps to heatmap and contour for suppressing hovers on missing data Oct 22, 2019
@archmoj archmoj mentioned this pull request Oct 22, 2019
8 tasks
@etpinard
Copy link
Contributor

Very nicely done @archmoj

💃 for me!

@janosh
Copy link

janosh commented Nov 23, 2021

Great feature! Thanks for implementing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heatmap suppress hovers on missing data
3 participants