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

Lazily compute label sizes #6351

Merged
merged 2 commits into from
Jun 27, 2019
Merged

Lazily compute label sizes #6351

merged 2 commits into from
Jun 27, 2019

Conversation

benmccann
Copy link
Contributor

@benmccann benmccann commented Jun 22, 2019

Lazily computing has the following benefits:

  • longestLabelWidth was previously set in a somewhat arbitrary place. This now sets it at the same time as _labelSizes
  • This makes it easier to reorder methods in further refactorings because we don't need to worry about whether _labelSizes has been set
  • Removes two levels of indentation in calculateTickRotation
  • Fixes CodeClimate warning: Function calculateTickRotation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring

@etimberg etimberg merged commit fb3d6ab into chartjs:master Jun 27, 2019
@nagix nagix added this to the Version 2.9 milestone Jun 27, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
* Lazily compute label sizes

* Reduce file size
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.

4 participants