-
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
Generic registry for controllers, scales, elements and plugins #7435
Conversation
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.
this looks pretty good to me if it works, which always seems to be the tricky thing :-) did you test if things get shaken out in rollup and webpack?
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.
I like the direction this is going. Looks like it includes #7412.
In terms of the changes of elements.Arc
to elements.arc
I kinda preferred the old version since they're classes. If we do make this change, we'll need to document it as a breaking change since these are publicly available.
Yes, I included #7412 to make things a bit easier (I'm assuming it gets merged)
I restored those to be capitalized. |
Looks like this needs a rebase @kurkle |
This looks pretty good to me. I can do a final pass after rebase |
Rebased. Had added a |
|
||
const controllerDefaults = defaults[type]; | ||
const ControllerClass = registry.getController(type); | ||
Object.assign(ControllerClass.prototype, { |
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.
why can't we still set these in the controllers?
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.
So we don't pull the element types with the controller. So when you derive from a controller, you can change the element types and the original ones can be shaked.
This also enabled changing the element type only, for example:
Chart.register(MyBar);
Chart.defaults.bar.dataElementType = 'MyBar'`;
Needs another rebase @kurkle. |
Noticed that scale service was mentioned in couple of places still, while it does not exist any more. So updated those. |
* Generic registry for controllers, scales, elements and plugins * Remove references to scale service
Agrees with #7407 in many ways, only goes a lot further.
TODO:
defaults.scales.scale
, and that would be another breaking change.Resolves: #7496