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

fix(annotation/Label): fix doc types and padding #989

Merged
merged 2 commits into from
Jan 11, 2021

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Jan 5, 2021

📝 Documentation

🐛 Bug Fix

This fixes a couple of small issues with Label from @visx/annotation:

  • the prop types for Label were not correctly generated in docs/annotation because the exported component name did not match the file name (this is a limitation of the TS doc type generation, should turn on the lint rule for this)
  • Label's props.backgroundPadding can be of shape number | { top?: number, right: ..., bottom: ..., left: ... }. the logic for the object shape was currently broken / this fixes it.
  • there was no default for anchorLineStroke, so if you set showAnchorLine={true} it wasn't visible by default. should have a default so users aren't confused!
  • Previously the /annotation demo didn't update the annotation position on screen size changes. This results in a broken example in codesandbox when it initially renders with 0 width/height or if the dimensions changed. Added a fix.

Here's the verified doc fix:

Before/after in code sandbox:

@hshoff

@coveralls
Copy link

coveralls commented Jan 5, 2021

Pull Request Test Coverage Report for Build 467004564

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 61.203%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/visx-annotation/src/components/Label.tsx 0 1 0.0%
Totals Coverage Status
Change from base Build 462020185: 0.03%
Covered Lines: 1728
Relevant Lines: 2690

💛 - Coveralls

@williaster williaster merged commit d6db693 into master Jan 11, 2021
@williaster williaster deleted the chris--annotation-fixes branch January 11, 2021 19:25
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