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] Improve docs / add more examples #51

Closed
3 tasks done
techniq opened this issue Oct 6, 2023 · 0 comments · Fixed by #72
Closed
3 tasks done

[Tooltip] Improve docs / add more examples #51

techniq opened this issue Oct 6, 2023 · 0 comments · Fixed by #72
Milestone

Comments

@techniq
Copy link
Owner

techniq commented Oct 6, 2023

Extracted from #45 (comment)

With TooltipContext / Tooltip, there are basically 3 ways to position:

  • By default, TooltipContext will use the mouse/pointer position, and Tooltip will apply an offset by default (mostly to not cover up the point you are interested in)
  • In TooltipContext, you can opt into snapping the position to the closest data point's X and/or Y
  • In Tooltip, you can specify explicit top / left positions, overwriting/ignoring what is set in the TooltipContext. This was a recent addition we made for the Sparkline example, but I'd like to add more examples to show what kind of use cases this supports
    • A fixed tooltip in the top left (or any corner) by specifying values for both props (ex. <Tooltip top={8} left={8} />)
    • Only specifying a fixed top such as this visx example or these Observable plot examples which would use 2 instances of <Tooltip>, one with a fixed top and one with a fixed left.

Examples

@techniq techniq added this to the v1 milestone Oct 7, 2023
@techniq techniq changed the title Improve Tooltip docs / add more examples [Tooltip] Improve docs / add more examples Nov 5, 2023
techniq added a commit that referenced this issue Nov 14, 2023
techniq added a commit that referenced this issue Nov 15, 2023
…data" left="data" />`. Add `center` prop to position based on center instead of top/left corner. Add more tooltip examples. Issue #51
techniq added a commit that referenced this issue Nov 16, 2023
…data" left="data" />`. Add `center` prop to position based on center instead of top/left corner. Add more tooltip examples. Issue #51
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

Successfully merging a pull request may close this issue.

1 participant