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

fix: color collision in dashboard with tabs #24670

Merged
merged 8 commits into from
Jul 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: color collision with tabs
Lily Kuang committed Jul 14, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 5eeb5ebb1b7752165ff4b03594ebd3009efd9c18
Original file line number Diff line number Diff line change
@@ -86,6 +86,12 @@ class CategoricalColorScale extends ExtensibleFunction {
updatedRange.splice(index, 1);
}
});
Object.entries(this.parentForcedColors).forEach(([key, value]) => {
if (key !== cleanedValue) {
const index = updatedRange.indexOf(value);
updatedRange.splice(index, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use a filter method on updatedRange here instead? That may be a little more succinct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks great!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional suggestion: #24670 (comment)

}
}); // remove the color option from forced colors
this.range(updatedRange.length > 0 ? updatedRange : this.originColors);
}