Skip to content
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 can go offscreen for rightmost and leftmost nodes #109

Open
wonder-mice opened this issue Sep 20, 2018 · 4 comments
Open

tooltip can go offscreen for rightmost and leftmost nodes #109

wonder-mice opened this issue Sep 20, 2018 · 4 comments
Labels

Comments

@wonder-mice
Copy link

In certain cases part of tooltip will be obscured by browser window.
tooltip

@spiermar spiermar added the enhancement New feature or request label Sep 20, 2018
@spiermar spiermar added this to the 2.2 milestone Sep 20, 2018
@wonder-mice
Copy link
Author

Just want to add, that this one is almost a blocker for me. I have large data sets with long names and tooltips always go over left edge or under the bottom edge.

@trask
Copy link

trask commented Sep 26, 2018

Hi, I just ran into this also (via glowroot/glowroot#457) and wanted to share my solution (not sure if it's optimal or not).

Here's my patch for d3-tip: trask/d3-tip@66ad693

And here's the (minor) patch for d3-flame-graph: trask@234e52b trask@e4b6ee9

I started out with another option for keeping tooltips on screen (based on caged/d3-tip#198), but I thought that keeping the tooltips always south of the frame (instead of jumping to the east or west of the frame) was nicer for flame graphs.

It could probably be nicer still if the "caret" were a dom element instead of using css :after, because then the caret's horizontal position could be dynamic relative to the tooltip itself, which would allow the tooltip itself to extend further right/left as needed/available, while the caret could still point at the correct frame.

You can see the patched version in action at https://demo.glowroot.org/transaction/thread-flame-graph?transaction-type=Web

@spiermar I'd like your thoughts before opening a PR to d3-tip in case you have other ideas/plans. Thanks.

@spiermar
Copy link
Owner

@trask I like the solution. Changing the direction when close to the border. Having said that, the only d3-flame-graph changes are in the CSS. All the JavaScript changes are in the d3-color and d3-tip dependencies apparently, so it would be a matter of having the changes accepted there. I would open a PR to d3-tip anyway, because it's a common issue and the maintainers probably had to deal with it before and might have a better input that I do. I also have to check the change a bit more carefully, but it might be possible to just override the functions in the d3-tip and avoid the d3-color (and possible other dependency) changes.

@trask
Copy link

trask commented Sep 27, 2018

@spiermar Thanks, I've submitted the PR to d3-tip caged/d3-tip#238. Let's see how that goes. The d3-color related changes were unintentional, I was building with old npm version so it didn't use the package-lock.json. I've fixed my local build and updated the d3-flame-graph patch link above.

@spiermar spiermar removed this from the 3.1 milestone Oct 12, 2021
@spiermar spiermar added bug and removed enhancement New feature or request labels Oct 12, 2021
@spiermar spiermar assigned spiermar and unassigned spiermar Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants