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

Use tick.major rather than recomputing #6265

Merged
merged 3 commits into from May 14, 2019

Conversation

benmccann
Copy link
Contributor

getLabelForIndex is ignoring the value of tick.major and recomputing it, which means you can't use your own computation of tick.major in afterBuildTicks

kurkle
kurkle previously requested changes May 11, 2019
src/scales/scale.time.js Outdated Show resolved Hide resolved
@benmccann benmccann requested a review from kurkle May 11, 2019 18:31
@benmccann benmccann dismissed kurkle’s stale review May 11, 2019 18:31

Updated PR per request

kurkle
kurkle previously approved these changes May 11, 2019
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.

Lgtm

@@ -408,8 +408,9 @@ function computeOffsets(table, ticks, min, max, options) {
return {start: start, end: end};
}

function ticksFromTimestamps(scale, values, majorUnit) {
function ticksFromTimestamps(scale, values) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not fan of this change because it makes the code harder to maintain by obfuscating the method inputs. Except for _adapter, I wouldn't assume any of the other scale computed values to be available at the time of calling this method.

Copy link
Contributor Author

@benmccann benmccann May 11, 2019

Choose a reason for hiding this comment

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

Not sure if we care about the size, but the way I wrote it is 6 bytes smaller

src/scales/scale.time.js Outdated Show resolved Hide resolved
src/scales/scale.time.js Outdated Show resolved Hide resolved
@benmccann
Copy link
Contributor Author

Thanks for the review @simonbrunel. I've updated the PR

etimberg
etimberg previously approved these changes May 12, 2019
kurkle
kurkle previously approved these changes May 12, 2019
simonbrunel
simonbrunel previously approved these changes May 13, 2019
@nagix
Copy link
Contributor

nagix commented May 13, 2019

@benmccann Can you rebase this PR?

@benmccann
Copy link
Contributor Author

Thanks. I've rebased this PR

@simonbrunel simonbrunel added this to the Version 2.9 milestone May 13, 2019
Copy link
Member

@simonbrunel simonbrunel left a comment

Choose a reason for hiding this comment

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

Thanks @benmccann for the changes!

exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
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.

None yet

5 participants