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

Tooltips sometimes appear invisible when using browser zoom #103

Open
DavidC-75 opened this issue Dec 14, 2022 · 2 comments
Open

Tooltips sometimes appear invisible when using browser zoom #103

DavidC-75 opened this issue Dec 14, 2022 · 2 comments

Comments

@DavidC-75
Copy link

DavidC-75 commented Dec 14, 2022

Describe the bug
When using the browser zoom (tried Edge and Chrome), tooltips sometimes appear invisible because they are offset relative to the mouse pointer and are out of the visible region.

To Reproduce
Navigate to https://vasturiano.github.io/sunburst-chart/example/flare/ and set your bowser zoom to max (500%)
Then hover over some of the small terminal leaves (don't click on the parent to 'zoom' on that part of the chart !)

Expected behavior
It would be nice to be able to see the tooltips regardless of the browser zoom settings (and currently the tooltips also appear magnified - they could possibly remain at the original size)

Additional context
This might not be a bug at all, just the way browsers render the SVG.... But I have no detailed understanding of that.
To work around the issue, I was hoping to use d3-zoomable so the browser zoom is not used but a native d3 zoom is used instead. Alas I'm a total beginner and couldn't figure out how to integrate d3-zoomable in https://github.com/vasturiano/sunburst-chart/blob/master/example/flare/index.html. Any suggestions ?

@vasturiano
Copy link
Owner

@DavidC-75 this library doesn't play very well with browser level zoom changes, specially wrt interaction events and tooltips.

Mildly hacky as it's reaching into the inner DOM structure of the component, but it can be done with d3-zoomable. Something like:

d3Zoomable()
  (document.querySelector('.sunburst-viz svg'))
  .svgEl(document.querySelector('.sunburst-viz svg g'))

@DavidC-75
Copy link
Author

For the record, I guess you meant
zoomable()
instead of
d3Zoomable()

But other than that.... works like a charm !! 👍
Thanks a lot for that !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants