Skip to content

Misalignment of horizontal box/violin hover labels #3050

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

Closed
etpinard opened this issue Sep 25, 2018 · 2 comments · Fixed by #3401
Closed

Misalignment of horizontal box/violin hover labels #3050

etpinard opened this issue Sep 25, 2018 · 2 comments · Fixed by #3401
Labels
bug something broken

Comments

@etpinard
Copy link
Contributor

Split out of @alexcjohnson 's #2970 (comment)


The misalignment in the original multi-plot codepen https://codepen.io/kotwgarnku/pen/gdxaPN when you set the first plot to closest is still there (and yes, the codepen is now using 1.41.3). To be clear, I'm talking about how eg the "min" label is not pointing to the "min" value, but to where that value would be according to the bottom plot. There also seems to be a problem with the overlap avoidance algorithm when one of the labels is too long and gets flipped to the top - it's putting them out of order and then stretching them across each other.
screen shot 2018-09-25 at 4 52 23 pm

@alexcjohnson
Copy link
Collaborator

alexcjohnson commented Sep 25, 2018

In fact, flipped labels shouldn't try to avoid each other at all, since they can't overlap. Top and bottom labels should go through the avoidance algorithm separately, or even better (in case of hover invoked externally, that needn't produce labels with any particular alignment, and for centered labels, which we use when neither side has enough room) we could make a new algorithm that's aware of the full 2D extent of each label. That applies to regular unrotated labels too, left- and right-side labels need not avoid each other.

Also especially labels that get pushed to the left look ugly (self-crossing label outline) and it's hard to tell what's pointing where:
screen shot 2018-09-25 at 5 26 18 pm
Perhaps we can shift some of the labels vertically - in this image, we could push min and q1 down so the rotated edge of their boxes align with the rotated edge of the median box perhaps?

@etpinard
Copy link
Contributor Author

etpinard commented Jan 4, 2019

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
2 participants