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

🐛 (facet) show swatch colour on hovering #4348

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ export class HorizontalCategoricalColorLegend extends HorizontalColorLegend {
<g id={makeIdForHumanConsumption("swatches")}>
{marks.map((mark, index) => {
const isActive = activeColors?.includes(mark.bin.color)
const isHovered = hoverColors.includes(mark.bin.color)
const isNotHovered =
hoverColors.length > 0 &&
!hoverColors.includes(mark.bin.color)
Expand All @@ -863,7 +864,7 @@ export class HorizontalCategoricalColorLegend extends HorizontalColorLegend {
: mark.bin.color

const fill =
isActive || activeColors === undefined
isHovered || isActive || activeColors === undefined
? color
: OWID_NON_FOCUSED_GRAY

Expand Down
Loading