Skip to content

Commit 8243721

Browse files
committed
Deprecate Chart.LinearScaleBase
1 parent f3e3dcc commit 8243721

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/chart.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Chart.Element = require('./core/core.element');
1717
Chart.elements = require('./elements/index');
1818
Chart.Interaction = require('./core/core.interaction');
1919
Chart.layouts = require('./core/core.layouts');
20-
Chart.LinearScaleBase = require('./scales/scale.linearbase');
2120
Chart.platform = require('./platforms/platform');
2221
Chart.plugins = require('./core/core.plugins');
2322
Chart.Scale = require('./core/core.scale');
@@ -105,6 +104,15 @@ Chart.canvasHelpers = Chart.helpers.canvas;
105104
*/
106105
Chart.layoutService = Chart.layouts;
107106

107+
/**
108+
* Provided for backward compatibility, not available anymore.
109+
* @namespace Chart.LinearScaleBase
110+
* @deprecated since version 2.8
111+
* @todo remove at version 3
112+
* @private
113+
*/
114+
Chart.LinearScaleBase = require('./scales/scale.linearbase');
115+
108116
/**
109117
* Provided for backward compatibility, instead we should create a new Chart
110118
* by setting the type in the config (`new Chart(id, {type: '{chart-type}'}`).

test/specs/global.deprecations.tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ describe('Deprecations', function() {
3131
expect(typeof Chart.helpers.aliasPixel).toBe('function');
3232
});
3333
});
34+
35+
describe('Chart.LinearScaleBase', function() {
36+
it('should be defined and inherit from Chart.Scale', function() {
37+
expect(Chart.LinearScaleBase).toBeDefined();
38+
expect(typeof Chart.LinearScaleBase).toBe('function');
39+
expect(Chart.LinearScaleBase.prototype instanceof Chart.Scale).toBeTruthy();
40+
});
41+
});
3442
});
3543

3644
describe('Version 2.7.3', function() {

0 commit comments

Comments
 (0)