mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
Deprecate animationLoop function
This commit is contained in:
parent
48b8a3a2c5
commit
e3ffbb155f
20
Chart.js
vendored
20
Chart.js
vendored
@ -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
6
Chart.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user