]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Remove deprecated code from animations and core (#6624)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Sun, 27 Oct 2019 22:28:47 +0000 (00:28 +0200)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 27 Oct 2019 22:28:47 +0000 (18:28 -0400)
src/core/core.animation.js
src/core/core.controller.js
test/specs/core.tooltip.tests.js
test/specs/scale.time.tests.js

index 892eb1cd77b6f124487b83d17c836e3337929115..236e923a1f3205b8f623770eeb4911300303c869 100644 (file)
@@ -14,32 +14,3 @@ var exports = Element.extend({
 });
 
 module.exports = exports;
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart.Animation instead
- * @prop Chart.Animation#animationObject
- * @deprecated since version 2.6.0
- * @todo remove at version 3
- */
-Object.defineProperty(exports.prototype, 'animationObject', {
-       get: function() {
-               return this;
-       }
-});
-
-/**
- * Provided for backward compatibility, use Chart.Animation#chart instead
- * @prop Chart.Animation#chartInstance
- * @deprecated since version 2.6.0
- * @todo remove at version 3
- */
-Object.defineProperty(exports.prototype, 'chartInstance', {
-       get: function() {
-               return this.chart;
-       },
-       set: function(value) {
-               this.chart = value;
-       }
-});
index 27884bcf04fd749f85da6b0b168f7427204cb5ce..8827c78df403e8f78ec232a9596f36c4f174010b 100644 (file)
@@ -192,17 +192,6 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
                me._bufferedRender = false;
                me._layers = [];
 
-               /**
-                * Provided for backward compatibility, Chart and Chart.Controller have been merged,
-                * the "instance" still need to be defined since it might be called from plugins.
-                * @prop Chart#chart
-                * @deprecated since version 2.6.0
-                * @todo remove at version 3
-                * @private
-                */
-               me.chart = me;
-               me.controller = me; // chart.chart.controller #inception
-
                // Add the chart instance to the global namespace
                Chart.instances[me.id] = me;
 
@@ -563,14 +552,6 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
                        item._idx = index;
                });
 
-               /**
-                * Provided for backward compatibility, use `afterLayout` instead.
-                * @method IPlugin#afterScaleUpdate
-                * @deprecated since version 2.5.0
-                * @todo remove at version 3
-                * @private
-                */
-               plugins.notify(me, 'afterScaleUpdate');
                plugins.notify(me, 'afterLayout');
        },
 
@@ -1110,41 +1091,3 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
 Chart.instances = {};
 
 module.exports = Chart;
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart instead.
- * @class Chart.Controller
- * @deprecated since version 2.6
- * @todo remove at version 3
- * @private
- */
-Chart.Controller = Chart;
-
-/**
- * Provided for backward compatibility, not available anymore.
- * @namespace Chart
- * @deprecated since version 2.8
- * @todo remove at version 3
- * @private
- */
-Chart.types = {};
-
-/**
- * Provided for backward compatibility, not available anymore.
- * @namespace Chart.helpers.configMerge
- * @deprecated since version 2.8.0
- * @todo remove at version 3
- * @private
- */
-helpers.configMerge = mergeConfig;
-
-/**
- * Provided for backward compatibility, not available anymore.
- * @namespace Chart.helpers.scaleMerge
- * @deprecated since version 2.8.0
- * @todo remove at version 3
- * @private
- */
-helpers.scaleMerge = mergeScaleConfig;
index 737b50c782fed60e1c7dd5a1a4a2a48eb92d81f4..bda878f85bb2b8545fcfa325cc66a63b15c147da 100755 (executable)
@@ -949,7 +949,7 @@ describe('Core.Tooltip', function() {
                var meta = chart.getDatasetMeta(0);
                var firstPoint = meta.data[1];
 
-               var node = chart.chart.canvas;
+               var node = chart.canvas;
                var rect = node.getBoundingClientRect();
 
                var firstEvent = new MouseEvent('mousemove', {
index 421aab928b18a8782e8a9cf4a07ef7be50b77bf0..0702221174b0d2e6636b9a9ec50c43aa31df5f3f 100755 (executable)
@@ -1521,7 +1521,7 @@ describe('Time scale tests', function() {
                        });
 
                        it ('should reverse the values for pixels', function() {
-                               var scale = this.chart.chart.scales.x;
+                               var scale = this.chart.scales.x;
                                expect(scale.getValueForPixel(scale.left)).toBeCloseToTime({
                                        value: moment('2042-01-01T00:00:00'),
                                        unit: 'hour',