mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Remove deprecated code from index.js (#6623)
Remove deprecated code from index.js
This commit is contained in:
parent
26dc04d25f
commit
d932f9c56e
100
src/index.js
100
src/index.js
@ -48,103 +48,3 @@ module.exports = Chart;
|
||||
if (typeof window !== 'undefined') {
|
||||
window.Chart = Chart;
|
||||
}
|
||||
|
||||
// DEPRECATIONS
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, not available anymore
|
||||
* @namespace Chart.Chart
|
||||
* @deprecated since version 2.8.0
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.Chart = Chart;
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, not available anymore
|
||||
* @namespace Chart.Legend
|
||||
* @deprecated since version 2.1.5
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.Legend = plugins.legend._element;
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, not available anymore
|
||||
* @namespace Chart.Title
|
||||
* @deprecated since version 2.1.5
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.Title = plugins.title._element;
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, use Chart.plugins instead
|
||||
* @namespace Chart.pluginService
|
||||
* @deprecated since version 2.1.5
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.pluginService = Chart.plugins;
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, inheriting from Chart.PlugingBase has no
|
||||
* effect, instead simply create/register plugins via plain JavaScript objects.
|
||||
* @interface Chart.PluginBase
|
||||
* @deprecated since version 2.5.0
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.PluginBase = Chart.Element.extend({});
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, use Chart.helpers.canvas instead.
|
||||
* @namespace Chart.canvasHelpers
|
||||
* @deprecated since version 2.6.0
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
Chart.canvasHelpers = Chart.helpers.canvas;
|
||||
|
||||
/**
|
||||
* Provided for backward compatibility, use Chart.layouts instead.
|
||||
* @namespace Chart.layoutService
|
||||
* @deprecated since version 2.7.3
|
||||
* @todo remove at version 3
|
||||
* @private
|
||||
*/
|
||||
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}'}`).
|
||||
* @deprecated since version 2.8.0
|
||||
* @todo remove at version 3
|
||||
*/
|
||||
Chart.helpers.each(
|
||||
[
|
||||
'Bar',
|
||||
'Bubble',
|
||||
'Doughnut',
|
||||
'Line',
|
||||
'PolarArea',
|
||||
'Radar',
|
||||
'Scatter'
|
||||
],
|
||||
function(klass) {
|
||||
Chart[klass] = function(ctx, cfg) {
|
||||
return new Chart(ctx, Chart.helpers.merge(cfg || {}, {
|
||||
type: klass.charAt(0).toLowerCase() + klass.slice(1)
|
||||
}));
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -1,5 +1,5 @@
|
||||
parserOptions:
|
||||
ecmaVersion: 5 # don't rely on default, since its changed by env: es6
|
||||
ecmaVersion: 6
|
||||
|
||||
env:
|
||||
es6: true # also changes default ecmaVersion to 6
|
||||
|
@ -1,5 +1,7 @@
|
||||
// Test the rectangle element
|
||||
|
||||
var Title = Chart.plugins.getAll().find(p => p.id === 'title')._element;
|
||||
|
||||
describe('Title block tests', function() {
|
||||
it('Should have the correct default config', function() {
|
||||
expect(Chart.defaults.global.title).toEqual({
|
||||
@ -19,7 +21,7 @@ describe('Title block tests', function() {
|
||||
var options = Chart.helpers.clone(Chart.defaults.global.title);
|
||||
options.text = 'My title';
|
||||
|
||||
var title = new Chart.Title({
|
||||
var title = new Title({
|
||||
chart: chart,
|
||||
options: options
|
||||
});
|
||||
@ -49,7 +51,7 @@ describe('Title block tests', function() {
|
||||
options.text = 'My title';
|
||||
options.position = 'left';
|
||||
|
||||
var title = new Chart.Title({
|
||||
var title = new Title({
|
||||
chart: chart,
|
||||
options: options
|
||||
});
|
||||
@ -81,7 +83,7 @@ describe('Title block tests', function() {
|
||||
options.display = true;
|
||||
options.lineHeight = 1.5;
|
||||
|
||||
var title = new Chart.Title({
|
||||
var title = new Title({
|
||||
chart: chart,
|
||||
options: options
|
||||
});
|
||||
@ -101,7 +103,7 @@ describe('Title block tests', function() {
|
||||
var options = Chart.helpers.clone(Chart.defaults.global.title);
|
||||
options.text = 'My title';
|
||||
|
||||
var title = new Chart.Title({
|
||||
var title = new Title({
|
||||
chart: chart,
|
||||
options: options,
|
||||
ctx: context
|
||||
@ -154,7 +156,7 @@ describe('Title block tests', function() {
|
||||
options.text = 'My title';
|
||||
options.position = 'left';
|
||||
|
||||
var title = new Chart.Title({
|
||||
var title = new Title({
|
||||
chart: chart,
|
||||
options: options,
|
||||
ctx: context
|
||||
|
Loading…
Reference in New Issue
Block a user