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

test(xychart): add refined Tooltip, TooltipProvider tests #852

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Oct 7, 2020

🏠 Internal

Builds on #846, adding tests for the new Tooltip + TooltipProvider functionality (new tests highlighted). Separated for review-ability.

@kristw @hshoff

}}
>
<Tooltip
resizeObserverPolyfill={ResizeObserver}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the polyfill is not passed?

Copy link
Collaborator Author

@williaster williaster Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's not passed and it's not available globally on window, it will throw (this logic lives in react-use-measure). Throwing may seem extreme but I think it's the cleanest way to polyfill, we import it globally in @visx/responsive's ParentSize and have gotten negative feedback about it.

I think we just need to be clear about it in the docs like in @visx/tooltip + react-use-measure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ic. a bit more gear towards power users i guess.
If doc emphasizes it enough probably ok.
Perhaps can make it a bit more convenient later to do this once instead of passing to every Tooltip instance.

@williaster williaster force-pushed the chris--xychart-refined-tooltip-tests branch from c7901b2 to 8d01a95 Compare October 7, 2020 22:56
@coveralls
Copy link

Pull Request Test Coverage Report for Build 128

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.7%) to 57.292%

Totals Coverage Status
Change from base Build 125: 1.7%
Covered Lines: 1273
Relevant Lines: 2155

💛 - Coveralls

@williaster williaster merged commit 12f4819 into chris--xychart-refined-tooltip Oct 7, 2020
@williaster williaster deleted the chris--xychart-refined-tooltip-tests branch October 7, 2020 23:21
williaster added a commit that referenced this pull request Oct 8, 2020
* new(tooltip/useTooltipInPortal): allow detectBounds overrid in component

* new(xychart/Tooltip): add working crosshairs + point

* internal(demo/xychart/ChartBackground): use innerWidth/Height

* new(xychart): working multi-datum toolips

* new(xychart/Tooltip): add snapTooltipToDatumX/Y

* new(xychart): add showMultipleCircles support, debounce hideTooltip

* new(demo/xychart): add tooltip controls

* internal(xychart): cleanup

* internal(xychart): cleanup

* internal(xychart): memoize coordinate getter

* type(xychart/TooltipContext): remove svgPoint

* fix(xychart/TooltipContext): infer Datum type

* new(xychart): circle => glyph

* test(xychart): add refined Tooltip, TooltipProvider tests (#852)

* test(xychart): add more Tooltip tests

* test(xychart): add more TooltipProvider tests
@williaster williaster added this to the 1.1.0 milestone Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants