Deprecate animationLoop function

This commit is contained in:
Tanner Linsley 2015-06-16 11:57:35 -06:00
parent 48b8a3a2c5
commit e3ffbb155f
4 changed files with 5 additions and 44 deletions

20
Chart.js vendored
View File

@ -836,26 +836,6 @@
return window.clearTimeout(callback, 1000 / 60);
};
})(),
animationLoop = helpers.animationLoop = function(callback, totalSteps, easingString, onProgress, onComplete, chartInstance) {
var currentStep = 0,
easingFunction = easingEffects[easingString] || easingEffects.linear;
var animationFrame = function() {
currentStep++;
var stepDecimal = currentStep / totalSteps;
var easeDecimal = easingFunction(stepDecimal);
callback.call(chartInstance, easeDecimal, stepDecimal, currentStep);
onProgress.call(chartInstance, easeDecimal, stepDecimal);
if (currentStep < totalSteps) {
chartInstance.animationFrame = requestAnimFrame(animationFrame);
} else {
onComplete.apply(chartInstance);
}
};
requestAnimFrame(animationFrame);
},
//-- DOM methods
getRelativePosition = helpers.getRelativePosition = function(evt) {
var mouseX, mouseY;

6
Chart.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -49,9 +49,10 @@
};
$('#randomizeData').click(function() {
var zero = Math.random() < 0.2 ? [0, 0, 0, 0, 0, 0, 0] : false;
$.each(barChartData.datasets, function(i, dataset) {
dataset.backgroundColor = 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
dataset.data = [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()];
dataset.data = zero || [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()];
});
window.myBar.update();

View File

@ -731,26 +731,6 @@
return window.clearTimeout(callback, 1000 / 60);
};
})(),
animationLoop = helpers.animationLoop = function(callback, totalSteps, easingString, onProgress, onComplete, chartInstance) {
var currentStep = 0,
easingFunction = easingEffects[easingString] || easingEffects.linear;
var animationFrame = function() {
currentStep++;
var stepDecimal = currentStep / totalSteps;
var easeDecimal = easingFunction(stepDecimal);
callback.call(chartInstance, easeDecimal, stepDecimal, currentStep);
onProgress.call(chartInstance, easeDecimal, stepDecimal);
if (currentStep < totalSteps) {
chartInstance.animationFrame = requestAnimFrame(animationFrame);
} else {
onComplete.apply(chartInstance);
}
};
requestAnimFrame(animationFrame);
},
//-- DOM methods
getRelativePosition = helpers.getRelativePosition = function(evt) {
var mouseX, mouseY;