-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make Chart.Animation/animations/Tooltip
importable
#5382
Conversation
@@ -1,5 +1,6 @@ | |||
{ | |||
"indent-style": "tabs", | |||
"line-end-style": false, |
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.
@loicbourgois I had to disable this rule, else we can't run gulp lint
on Windows with Git configured to AutoCrlf.
/** | ||
* @namespace Chart.Tooltip.positioners | ||
*/ | ||
exports.positioners = positioners; |
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.
@etimberg I'm not sure why we need to expose positioners (Chart.Tooltip.positioners
)
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.
It must be a backwards compatibility thing. Not sure when it first got introduced
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.
Actually, I think it was public to allow users to implement their own logic:
Chart.Tooltip.positioners.foobar = function(elements) {
// ...
};
options: {
tooltips: {
position: 'foobar'
}
}
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.
} | ||
// If the user provided a sorting function, use it to modify the tooltip items | ||
if (opts.itemSort) { | ||
tooltipItems = tooltipItems.sort(function(a, b) { |
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.
tooltipItems.sort(function(a, b) {
return opts.itemSort(a, b, data);
});
remove self-assignment
Relates to #4478