-
Notifications
You must be signed in to change notification settings - Fork 11.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
Update line-customTooltips.html (Re issue #4038 ) #4039
Conversation
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.
@el-ee should we also fix pie-customTooltips.html
and dataPoints-customTooltips.html
?
I think that also fixes #3995 and ideally we should remove the use of getBoundingClientRect()
, move the tooltip under the canvas parent container and use offsetTop
and offsetLeft
instead. That can be done while reworking examples for another PR.
@simonbrunel Are these changes what you are saying would be better? (Aside: I did not realize they would show up automatically as part of this existing PR .. but I guess they do. Sorry if that is annoying. I am not an expert at contributing to other people's projects on here.) Anyway, I can put either change -- the first one I suggested or this alternate one -- into all three of the files; I hadn't looked at the pie or dataPoints examples before. Let me know. |
This looks good to me 😄 If it's possible to update the other 2 samples as well, I'd say we should do it to be consistent |
cool yea I can add it to the other 2 samples later today. |
@el-ee if you can, please also rebase this against the sample file rename changes that got submitted tonight. |
ok, i will have to figure out how to do that tomorrow. |
@el-ee the Git docs on rebase are here: https://git-scm.com/docs/git-rebase In general what you will need to do is:
During the rebase process you'll hit a conflict for the |
@el-ee apparently something went wrong, did you force push your changes to GitHub after the rebase: |
@simonbrunel I did not. I can do that now. That codeclimate error looks like it failed to run the fixme engine at all though, rather than that the check actually failed? The details page says: "We had trouble running the fixme engine." ... "docker: Error response from daemon: shim error: context deadline exceeded." And then down below the error message it confusingly has a second box that says passed. IDK. |
I think codeclimate fails because of the error in the commit history. You can try to force push your local master: only your 4 commits should appear in that PR. |
Add window scroll position to tooltip position calculation so they show up in the intended place instead of potentially off-screen!
…ffest into account
ok. it seems possible that I have fixed the weird commit history and rebased properly this time ... fingers crossed. |
I think the two newly fixed examples also need |
Ah, good point. In these files, they show up visually in the same place, regardless of whether they're inside the container in the DOM hierarchy. So, I left them where they were to err on the side of changing fewer lines. But yes, upon reflection, if you added a position:relative to the canvas container div, then it would get weird, and then they would need to be inside it to get the right location. I can move them inside. That is way more resilient for people copying and pasting this code into other files, which is certainly what got me into this mess in the first place! Hah. |
… positioned in terms of its location
Looks good to me. 😄 |
Fix for #4038
Add window scroll position to tooltip position calculation so they show up in the intended place instead of off-screen or otherwise detached from the graph.