Skip to content

Commit

Permalink
Deprecate Chart.LinearScaleBase
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrunel committed Jan 5, 2019
1 parent f3e3dcc commit 8243721
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/chart.js
Expand Up @@ -17,7 +17,6 @@ Chart.Element = require('./core/core.element');
Chart.elements = require('./elements/index');
Chart.Interaction = require('./core/core.interaction');
Chart.layouts = require('./core/core.layouts');
Chart.LinearScaleBase = require('./scales/scale.linearbase');
Chart.platform = require('./platforms/platform');
Chart.plugins = require('./core/core.plugins');
Chart.Scale = require('./core/core.scale');
Expand Down Expand Up @@ -105,6 +104,15 @@ Chart.canvasHelpers = Chart.helpers.canvas;
*/
Chart.layoutService = Chart.layouts;

/**
* Provided for backward compatibility, not available anymore.
* @namespace Chart.LinearScaleBase
* @deprecated since version 2.8
* @todo remove at version 3
* @private
*/
Chart.LinearScaleBase = require('./scales/scale.linearbase');

/**
* Provided for backward compatibility, instead we should create a new Chart
* by setting the type in the config (`new Chart(id, {type: '{chart-type}'}`).
Expand Down
8 changes: 8 additions & 0 deletions test/specs/global.deprecations.tests.js
Expand Up @@ -31,6 +31,14 @@ describe('Deprecations', function() {
expect(typeof Chart.helpers.aliasPixel).toBe('function');
});
});

describe('Chart.LinearScaleBase', function() {
it('should be defined and inherit from Chart.Scale', function() {
expect(Chart.LinearScaleBase).toBeDefined();
expect(typeof Chart.LinearScaleBase).toBe('function');
expect(Chart.LinearScaleBase.prototype instanceof Chart.Scale).toBeTruthy();
});
});
});

describe('Version 2.7.3', function() {
Expand Down

0 comments on commit 8243721

Please sign in to comment.