From d00128715d52d2deab1b2a3d95c4bfc76cf731b0 Mon Sep 17 00:00:00 2001 From: Krishna Anandan Ganesan Date: Wed, 28 Aug 2024 19:31:52 -0500 Subject: [PATCH] fix: update current active element's highlight color or fill on color change (#538) --- src/js/constants.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/js/constants.js b/src/js/constants.js index 3711a930..fe1f9113 100644 --- a/src/js/constants.js +++ b/src/js/constants.js @@ -1367,6 +1367,24 @@ class Menu { .setAttribute('aria-live', constants.ariaMode); document.getElementById('init_llm_on_load').checked = constants.autoInitLLM; + const scatter = document.getElementsByClassName('highlight_point'); + const heatmap = document.getElementById('highlight_rect'); + const line = document.getElementById('highlight_point'); + + if (scatter !== null && scatter.length > 0) { + for (let i = 0; i < scatter.length; i++) { + scatter[i].setAttribute('stroke', constants.colorSelected); + scatter[i].setAttribute('fill', constants.colorSelected); + } + } + + if (heatmap !== null) { + heatmap.setAttribute('stroke', constants.colorSelected); + } + + if (line !== null) { + line.setAttribute('stroke', constants.colorSelected); + } } /**