FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improved code minimization by benmccann · Pull Request #6362 · chartjs/Chart.js · GitHub

Improved code minimization - #6362

Merged
etimberg merged 1 commit into
chartjs:masterfrom
benmccann:cleanup
Aug 13, 2019
Merged

Improved code minimization#6362
etimberg merged 1 commit into
chartjs:masterfrom
benmccann:cleanup

Conversation

Copy link
Copy Markdown
Contributor

An assortment of random improvements I came across in the past couple days

etimberg previously approved these changes Jun 29, 2019

kurkle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, but not sure if _getLabels is right function to use.

}

return me.ticks[index - me.minIndex];
return me._getLabels()[index];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is altering of ticks in ticks.callback or afterBuildTicks supported?
me.getTicks()[index].label instead, in that case?

benmccann Jul 1, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I believe it wouldn't be supported because there's no other scale that accesses ticks in getLabelForIndex and this method is only used by the tooltip which a separate concept from ticks. The way we've always suggested customizing the tooltip is via https://www.chartjs.org/docs/latest/configuration/tooltip.html?q=#external-custom-tooltips

Copy link
Copy Markdown
Contributor Author

I've rebased this PR

Copy link
Copy Markdown
Contributor Author

@etimberg @nagix @kurkle any additional thoughts?

etimberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No concerns other than @kurkle's comment. While we don't modify ticks in afterBuildTicks, it's possible that someone has. Not sure if that should block this, but we should be aware of it

benmccann commented Aug 8, 2019
edited
Loading

Copy link
Copy Markdown
Contributor Author

@kurkle did my response address your concern or do you think I should change it back?

kurkle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we should not assume that category scale is fed with only plain array data. So label index might not be same as data index. Anyway, its not what this PR is trying to do, so I think its fine for now.

etimberg merged commit 4093483 into chartjs:master Aug 13, 2019

simonbrunel commented Aug 23, 2019
edited
Loading

Copy link
Copy Markdown
Member

@benmccann @etimberg don't forget to rewrite the commit message when merging ("Minor cleanup" isn't helpful), but also add a label and milestone to every merged PR, it really helps to write release notes :)

benmccann changed the title Minor cleanup Improved code minimization Aug 23, 2019

Copy link
Copy Markdown
Contributor Author

Ok. I've renamed to "Improved code minimization" which hopefully helps describe it a bit better

Copy link
Copy Markdown
Member

Thanks! we should make sure to rewrite the commit message (at least the commit title - first line) before merging so the git history (and blaming) contains more interesting information. infrastructure is everything related to CI/CD, scripts, gulp, npm, etc. but not changes in the code.

exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL