Skip to content

Fix horizontal box/violin hover label misalignment under hovermode:'closest' #3401

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
Jan 7, 2019

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Jan 4, 2019

fixes #3050 (although it might worth moving #3050 (comment) into a new issue).

The idea behind this patch came from @nicolaskruchten 's #3396 - which revealed that something was wrong with how box/violin horizontal hover labels were sorted before the avoid-overlap algo. This PR is essentially a continuation of #3043

I have to add some tolerance in the kde hover label text assertion, but other than that this PR is ready to review cc @plotly/plotly_js

- that 'posref' val is used to sort the labels before the
  during the 'avoid-overlap' algo.
... and still tests what we want to test
@etpinard
Copy link
Contributor Author

etpinard commented Jan 4, 2019

Note that this PR doesn't make #2970 "worse" - unlike #3396 (comment)

@@ -489,6 +489,40 @@ describe('Test violin hover:', function() {
nums: '(96, Old Faithful)',
name: '',
isRotated: false
}, {
desc: 'orientation:h | hovermode;y',
Copy link
Contributor

Choose a reason for hiding this comment

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

Colon or semicolon here?

@@ -312,6 +312,29 @@ describe('Test box hover:', function() {
},
nums: 'look:0.7',
name: ''
}, {
desc: 'orientation:h | hovermode;y',
Copy link
Contributor

Choose a reason for hiding this comment

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

Colon or semicolon?

@nicolaskruchten
Copy link
Contributor

💃 if the colon/semicolon is a display-only thing, which it appears to be.

@etpinard etpinard merged commit 07b695a into master Jan 7, 2019
@etpinard etpinard deleted the horiz-box-violin-label-align-fix branch January 7, 2019 14:43
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.

Misalignment of horizontal box/violin hover labels
2 participants