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

Hovering on point with no data first renders glyph and tooltip outside chart #1054

Closed
mira-t opened this issue Feb 9, 2021 · 3 comments · Fixed by #1068
Closed

Hovering on point with no data first renders glyph and tooltip outside chart #1054

mira-t opened this issue Feb 9, 2021 · 3 comments · Fixed by #1068

Comments

@mira-t
Copy link

mira-t commented Feb 9, 2021

When I have a point with a y value that is undefined (representing a data gap) and I hover over it without first hovering over other points (e.g. moving mouse in from under x axis to this point), the glyph and tooltip do this:

Screenshot (29)

@mira-t
Copy link
Author

mira-t commented Feb 9, 2021

This is an AnimatedLineSeries in an XYChart and I am using @visx/[email protected]

@williaster
Copy link
Collaborator

Hey @mira-t 👋 thanks for checking out visx. Can you explain more what you would expect to happen in this case? From a UX perspective it seems like the following would probably be most ideal:

  • if x or y is defined, use that position
  • if x or y is undefined, fallback to wherever the cursor or pointer event occurred

I think as a workaround for now you probably could set snapTooltipToDataY={false} on the Tooltip. That seems to work fine in the demo:

@mira-t
Copy link
Author

mira-t commented Feb 11, 2021

Yes, when the x or y is undefined, I would expect the tooltip to fallback to wherever the cursor/pointer event occurred, but no glyph as there is no data.

I also noticed that the glyph only goes to the bottom of the svg if my mouse approaches the chart from below it. If the mouse was previously close to the points to the left or right of the gap it just uses that y-value instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment