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

(re)allow modifying ticks in afterBuildTicks #5913

Merged
merged 3 commits into from
Jan 11, 2019
Merged

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Dec 14, 2018

A workaround proposal to regain lost functionality.
The 'internal' tick objects are exposed, but I only see it as a bonus for custom axis types.

Closes #4749

https://codepen.io/kurkle/pen/EGKWgM?editors=0010

@simonbrunel
Copy link
Member

I'm not sure why I didn't think about that solution when refactoring this part of the scales, maybe because I was planning to deprecate all those callbacks. Anyway, looks like a good solution for now :)

To get the same results as #4749 (before 2.6.0), the user also needs to set scale.ticks.source: 'data' because the previous createFilterTicks functor directly uses the data as input (and not the generated ticks) (codepen) (in fact, we don't even need to filter the 'day' ticks in that case).

The 'internal' tick objects are exposed, but I only see it as a bonus for custom axis types.

It's already public via scale.getTicks().

@kurkle can you add a unit test?

@benmccann
Copy link
Contributor

@kurkle this PR will need to be rebased as well

etimberg
etimberg previously approved these changes Jan 3, 2019
src/core/core.scale.js Show resolved Hide resolved
src/core/core.scale.js Outdated Show resolved Hide resolved
docs/axes/README.md Outdated Show resolved Hide resolved
src/core/core.scale.js Outdated Show resolved Hide resolved
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