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

add textPath prop to Text component #926

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

grsoares21
Copy link

This was implemented as a solution for #759
It is my first PR to a big open-source project. I'd appreciate your feeback.

💥 Breaking Changes

  • none

🚀 Enhancements

  • Adds an optional textPath props that can be used as a path for the text to follow along

@coveralls
Copy link

coveralls commented Nov 11, 2020

Pull Request Test Coverage Report for Build 383662667

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • 27 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.2%) to 60.982%

Files with Coverage Reduction New Missed Lines %
packages/visx-annotation/src/components/EditableAnnotation.tsx 6 38.46%
packages/visx-brush/src/Brush.tsx 21 2.42%
Totals Coverage Status
Change from base Build 348549012: 0.2%
Covered Lines: 1634
Relevant Lines: 2537

💛 - Coveralls

Copy link
Member

@hshoff hshoff left a comment

Choose a reason for hiding this comment

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

Hi @grsoares21, thanks for the PR! This looks good to me except for a minor change.

Comment on lines 121 to 123
if(props.textPath) {
this.setState({ textPathId: uniqueId('text-path-') })
}
Copy link
Member

@hshoff hshoff Nov 11, 2020

Choose a reason for hiding this comment

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

I see this is called from componentDidMount(). Ideally we could move this initial state to the constructor() because it doesn't rely on the DOM.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, it took me so long to fix this. I've moved the whole state initialization into the constructor with the id generation in there as well.

@susiwen8
Copy link
Contributor

susiwen8 commented Dec 5, 2020

@grsoares21 I'm very sorry, Text has been refactored by hook(#946 ) that means you should rewrite this feature...... I‘m sincerely sorry about it........

@grsoares21
Copy link
Author

@grsoares21 I'm very sorry, Text has been refactored by hook(#946 ) that means you should rewrite this feature...... I‘m sincerely sorry about it........

Hello @susiwen8 . No problems :D. I'm glad to hear it's on hooks now. I'll try to reimplement this next weekend then.

@williaster
Copy link
Collaborator

Sorry for the delayed review, will try and review asap once I see any new commits to avoid any future conflicts 👍

@derrickbeining
Copy link

Came here for this very thing. Sad to see it has stalled. Are you planning to pick it up again @grsoares21 ?

@williaster
Copy link
Collaborator

If someone else wants to pick this up I'm happy to review! it shouldn't be too complicated, tho as noted @visx/text was refactored to use hooks so the approach will need to be tweaked slightly for that.

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.

6 participants