From 1b98483f4496d539e6b3d8da0c30cf6dbcbbbe98 Mon Sep 17 00:00:00 2001 From: Yukiko Noda Date: Fri, 21 Jun 2024 15:41:54 +0900 Subject: [PATCH] fix heatmap event style --- lib/ToolTip.js | 1 + stanzas/heatmap/index.ts | 9 +++++++++ stanzas/heatmap/style.scss | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/ToolTip.js b/lib/ToolTip.js index b10ad08b..c7874eb0 100644 --- a/lib/ToolTip.js +++ b/lib/ToolTip.js @@ -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: ""; diff --git a/stanzas/heatmap/index.ts b/stanzas/heatmap/index.ts index c21ad9c1..9c8ef475 100644 --- a/stanzas/heatmap/index.ts +++ b/stanzas/heatmap/index.ts @@ -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(); diff --git a/stanzas/heatmap/style.scss b/stanzas/heatmap/style.scss index 37cb2a93..50e017d0 100644 --- a/stanzas/heatmap/style.scss +++ b/stanzas/heatmap/style.scss @@ -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; } }