-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix text position in centered tooltips #2154 #1
Conversation
- Bug: when a tooltip displays a sufficiently long text (also depends on overall plot dimensions), the tooltip isn't rendered right or left but centered. In this case the tooltip text was partly rendered outside the tooltip box.
Can you include a screenshot of what a centered label looks like now? Just for reference: the idea is that |
"short label", | ||
"Very long label named San Francisco", | ||
"Very long label named San Francisco", | ||
"Very long label named San Francisco" |
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.
Yep, this is one of the situations that trigger a centered label, when the text to be displayed is extra long. The other common one is a single-bar bar chart filling the whole plot area. I'm not sure we need a mock for this though, as image tests won't show hover labels - I think better would be to just generate these conditions as jasmine tests in https://github.com/plotly/plotly.js/blob/master/test/jasmine/tests/hover_label_test.js, and verify something about the label positioning/shape.
* treat zero as valid fixes plotly#2660 * PR suggestions: toBe instead of toEqual
Fix for number 0 treated as invalid in hover (#1)
Suggested fix for plotly#2154. Added test mock seems to cover plotly#865 as well.
Regarding the fix:
alignHoverText
because it fixes the scenario in question and because I wasn't able to figure out the intent of these four lines of code.Regarding tests:
hover
event.Regarding related issue plotly#865: