Skip to content

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