Skip to content

Commit

Permalink
🐛 (facet) show swatch colour on hovering
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 20, 2024
1 parent cfce1bb commit 0434444
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 0434444

Please sign in to comment.