-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
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
var clipPath; | ||
var ltx; | ||
|
||
if(lx < (tbb.width + 2 * HOVERTEXTPAD + HOVERARROWSIZE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
Very nice. |
... so that each start-of-line is always visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard thanks very much for covering that!
Please find my question below.
Nicely done. |
Thanks again for the review @archmoj - merging! |
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