-
Notifications
You must be signed in to change notification settings - Fork 6
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
Tooltip: First attempt to get tooltip in bounds anyway #107
Tooltip: First attempt to get tooltip in bounds anyway #107
Conversation
✅ Deploy Preview for ods-charts ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…can be partially hidden.
f3a44d1
to
5e35081
Compare
if (this.popoverConfig.tooltipConfine) { | ||
const x = pos[0]; | ||
const arrowSize = 10; | ||
const bottom = pos[1] > size.contentSize[1]; // pos[1] > size.viewSize[1] / 2 or pos[1] > size.contentSize[1] or pos[1] > size.viewSize[1] - size.contentSize[1] |
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.
Future reader, please note that there's a possibility to change the rendering by doing:
// pos[1] > size.viewSize[1] / 2 or pos[1] > size.contentSize[1] or pos[1] > size.viewSize[1] - size.contentSize[1]
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.
We spotted some issues when tooltip.confine
and tooltipConfine
are defined and with different values but it should be an issue since we recommend using only tooltipConfine
; it's going to be treated as a separate issue. LGTM!
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.
Looks fine for me
Related issues
Closes #99
Description
This PR introduces a new experimental
ODSChartsPopoverConfig
property namedtooltipConfine
. This property is to be used instead of thetooltip.confine
property in theecharts
options to have a better control over the tooltip position, and make it stay within the chart area.It also changes the arrow position of the tooltip to follow the mouse position.
Types of change