Skip to content

Commit

Permalink
Merge pull request #145 from togostanza/fix/heatmap
Browse files Browse the repository at this point in the history
fix heatmap event style
  • Loading branch information
penqe authored Jun 21, 2024
2 parents 0b4a17e + 1b98483 commit 803e9b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/ToolTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class ToolTip extends LitElement {
height: 0;
visibility: hidden;
transition: height 0ms 250ms linear, opacity 200ms 0ms linear;
pointer-events: none;
}
.tooltip::before {
content: "";
Expand Down
9 changes: 9 additions & 0 deletions stanzas/heatmap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ export default class Heatmap extends MetaStanza {
return setColor(numericValue);
});

rectGroup.on("mouseenter", function () {
const node = select(this);
rectGroup.classed("-fadeout", true);
node.classed("-fadeout", false);
});
rectGroup.on("mouseleave", function () {
rectGroup.classed("-fadeout", false);
});

// Add event listener
rectGroup.on("click", (e, d) => {
select(e.target).raise();
Expand Down
8 changes: 6 additions & 2 deletions stanzas/heatmap/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ rect {
cursor: pointer;
}

&.-fadeout {
opacity: var(--togostanza-fadeout-opacity);
transition: var(--togostanza-fadeout-transition);
}

&.-selected {
stroke-width: 2px;
stroke: var(--togostanza-theme-selected_border_color);
opacity: 1;
}
}

Expand Down

0 comments on commit 803e9b6

Please sign in to comment.