Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless check for hover option in the indexable definition for doughnut #11140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/controller.doughnut.js
Expand Up @@ -76,7 +76,7 @@ export default class DoughnutController extends DatasetController {

static descriptors = {
_scriptable: (name) => name !== 'spacing',
_indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),
_indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash'),
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/elements/element.arc.ts
Expand Up @@ -284,7 +284,7 @@ export default class ArcElement extends Element<ArcProps, ArcOptions> {

static descriptors = {
_scriptable: true,
_indexable: (name) => name !== 'borderDash'
_indexable: (name) => !name.startsWith('borderDash')
};

circumference: number;
Expand Down
43 changes: 43 additions & 0 deletions test/fixtures/controller.doughnut/borderDash/hover.js
@@ -0,0 +1,43 @@
module.exports = {
config: {
type: 'polarArea',
data: {
labels: [0, 1, 2, 3, 4, 5],
datasets: [
{
// option in dataset
data: [5, 2, 4, 7, 6, 8],
borderAlign: 'inner',
borderColor: 'black'
},
]
},
options: {
events: [],
elements: {
arc: {
backgroundColor: 'transparent',
borderWidth: 1,
hoverBorderDash: [3, 3]
}
},
scales: {
r: {
display: false
}
}
}
},
options: {
canvas: {
height: 256,
width: 512
},
run(chart) {
chart.setActiveElements([
{datasetIndex: 0, index: 0}, {datasetIndex: 0, index: 3}
]);
chart.update();
}
}
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions test/fixtures/controller.polarArea/borderDash/hover.js
@@ -0,0 +1,43 @@
module.exports = {
config: {
type: 'polarArea',
data: {
labels: [0, 1, 2, 3, 4, 5],
datasets: [
{
// option in dataset
data: [5, 2, 4, 7, 6, 8],
borderAlign: 'inner',
borderColor: 'black'
},
]
},
options: {
events: [],
elements: {
arc: {
backgroundColor: 'transparent',
borderWidth: 1,
hoverBorderDash: [3, 3]
}
},
scales: {
r: {
display: false
}
}
}
},
options: {
canvas: {
height: 256,
width: 512
},
run(chart) {
chart.setActiveElements([
{datasetIndex: 0, index: 0}, {datasetIndex: 0, index: 3}
]);
chart.update();
}
}
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.