-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
feat: pass some chart options to DateAdapter #10528
feat: pass some chart options to DateAdapter #10528
Conversation
@kurkle it has been a very long time I didn't look at Chart.js, so not sure how my review will be valuable 😄 I'm not sure I like the suggested way to pass down "some" of the chart options to the adapters. I would probably make no assumption of what adapters need from the chart options and pass the entire chart option hierarchy. Adapters can them fallback their options on whatever other chart options they want. This is actually similar to the scale Also, I'm not a fan of storing this _adapters._date.override({
_id: 'luxon',
// Not sure that override works!
constructor(options: LuxonAdapterOptions, { locale }: ChartOptions) {
this.options = { locale, ...options };
}
})
// else
_adapters._date.override({
_id: 'luxon',
// New adapter API
init({ locale }: ChartOptions) {
if (!this.options.locale) {
this.options.locale = locale;
}
}
}) Thoughts? |
@simonbrunel I agree with you and I think the |
@dangreen thank you very much because you anticipated me! I was waiting for version 4.0 (as tagged in the issue) ! 👍 |
@stockiNail Agreed, |
@simonbrunel I just knew you'd have some good points, especially when talking interfaces, thanks!
I'd tend pass just the locale and maybe core version. Edit: to be clear, I'm not against passing the whole chart options. |
Changed it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
@kurkle @LeeLenaleee Can we move it to v3.9? As is does not contain breaking changes. |
That was a suggestion. I'm also fine to pass only Whatever you guys think is better! |
It was already on 3.9.0 milestone :) |
@LeeLenaleee issue was in v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just catching up on the discussion. Looks good to me 👍
I like the idea of passing all the chart options since it hopefully removes the need for future work later
#7859