Solve weird animation issues with the tooltip. The optimization in Chart.Element.transition when the animation finishes to set `_view = _model` caused problems during update because we were using `helpers.extend` all over the place.

I changed to code so that we regenerate the model variable rather than continuously extending the old version. I also removed unnecessary tooltip reinitializations from the controller which should improve overall performance during interaction.
This commit is contained in:
Evert Timberg
2016-10-09 12:26:59 -04:00
committed by GitHub
parent 65a06e4735
commit d21a853f30
2 changed files with 292 additions and 240 deletions

View File

@@ -630,6 +630,7 @@ module.exports = function(Chart) {
_data: me.data,
_options: me.options.tooltips
}, me);
me.tooltip.initialize();
},
bindEvents: function() {
@@ -711,14 +712,10 @@ module.exports = function(Chart) {
// Built in Tooltips
if (tooltipsOptions.enabled || tooltipsOptions.custom) {
tooltip.initialize();
tooltip._active = me.tooltipActive;
tooltip.update(true);
}
// Hover animations
tooltip.pivot();
if (!me.animating) {
// If entering, leaving, or changing elements, animate the change via pivot
if (!helpers.arrayEquals(me.active, me.lastActive) ||
@@ -728,6 +725,7 @@ module.exports = function(Chart) {
if (tooltipsOptions.enabled || tooltipsOptions.custom) {
tooltip.update(true);
tooltip.pivot();
}
// We only need to render at this point. Updating will cause scales to be