Skip to content

Reduce complexity for resolving the label callout position #743

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

Merged
merged 3 commits into from
May 23, 2022
Merged

Reduce complexity for resolving the label callout position #743

merged 3 commits into from
May 23, 2022

Conversation

stockiNail
Copy link
Collaborator

This reduces complexity using the enumerated callout position values to check if manageable instead of an if statement with for conditions in OR.

@stockiNail stockiNail added this to the 2.0.0 milestone May 20, 2022
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

could use positions.includes?

@stockiNail
Copy link
Collaborator Author

positions.includes

yes... as usual, forgive my poor knowledge on JS api...

@stockiNail
Copy link
Collaborator Author

positions.includes

yes... as usual, forgive my poor knowledge on JS api...

done

Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

The compressed size change is a little disappointing, but a saved byte is a saved byte :)

Filename Size Change
dist/chartjs-plugin-annotation.esm.js 15.2 kB -2 B (0%)
dist/chartjs-plugin-annotation.min.js 9.74 kB -1 B (0%)

@stockiNail stockiNail merged commit 5487062 into chartjs:master May 23, 2022
@stockiNail stockiNail deleted the improvePositionResolving branch May 23, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants