Workarounds for "common" (aka axis) hover label clipping#4298
Merged
Workarounds for "common" (aka axis) hover label clipping#4298
Conversation
... and place hover label arrow to left or right of text box.
... so that their text start is visible in the graph's viewport
etpinard
commented
Oct 23, 2019
| var clipPath; | ||
| var ltx; | ||
|
|
||
| if(lx < (tbb.width + 2 * HOVERTEXTPAD + HOVERARROWSIZE)) { |
Contributor
Author
There was a problem hiding this comment.
@nicolaskruchten this used to be:
if(lx < (tbb.width + HOVERTEXTPAD + HOVERARROWSIZE)) { // ...which may have caused the problem described in #4221 (comment)
New attempt: https://codepen.io/etpinard/pen/qBBrLwx
Contributor
|
Very nice. |
... so that each start-of-line is always visible.
Contributor
|
Nicely done. |
Contributor
Author
|
Thanks again for the review @archmoj - merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

resolves #4221
68521df - Under
hovermode: 'x', the common hover label (i.e. the one on top of the x axis) is constrained into the viewport while the hover label arrow appear on the left or right edge.xaxis.automargin: true)2c94e5f - Under
hovermode: 'y', the common hover label forside:'left'y axes has its text shifted to the right so that its beginning is visible and then clipped so that it doesn't overlap the hover label arrow.yaxis.automargin: true)cc @plotly/plotly_js