Remove unreachable code paths from plugins (#8513)

This commit is contained in:
Jukka Kurkela 2021-02-24 21:33:07 +02:00 committed by GitHub
parent 65a601476c
commit 692d8a4128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 36 deletions

View File

@ -114,24 +114,18 @@ class simpleArc {
pathSegment(ctx, bounds, opts) {
const {x, y, radius} = this;
bounds = bounds || {start: 0, end: TAU};
if (opts.reverse) {
ctx.arc(x, y, radius, bounds.end, bounds.start, true);
} else {
ctx.arc(x, y, radius, bounds.start, bounds.end);
}
ctx.arc(x, y, radius, bounds.end, bounds.start, true);
return !opts.bounds;
}
interpolate(point, property) {
interpolate(point) {
const {x, y, radius} = this;
const angle = point.angle;
if (property === 'angle') {
return {
x: x + Math.cos(angle) * radius,
y: y + Math.sin(angle) * radius,
angle
};
}
return {
x: x + Math.cos(angle) * radius,
y: y + Math.sin(angle) * radius,
angle
};
}
}

View File

@ -119,24 +119,6 @@ function createTitle(chart, titleOpts) {
chart.titleBlock = title;
}
function removeTitle(chart) {
const title = chart.titleBlock;
if (title) {
layouts.removeBox(chart, title);
delete chart.titleBlock;
}
}
function createOrUpdateTitle(chart, options) {
const title = chart.titleBlock;
if (title) {
layouts.configure(chart, title, options);
title.options = options;
} else {
createTitle(chart, options);
}
}
export default {
id: 'title',
@ -157,11 +139,9 @@ export default {
},
beforeUpdate(chart, _args, options) {
if (options === false) {
removeTitle(chart);
} else {
createOrUpdateTitle(chart, options);
}
const title = chart.titleBlock;
layouts.configure(chart, title, options);
title.options = options;
},
defaults: {