From 5b8d3e28922cf07353d5b928e184227d33f1f998 Mon Sep 17 00:00:00 2001 From: Krishna Anandan Ganesan Date: Fri, 23 Aug 2024 18:20:18 -0500 Subject: [PATCH] fix(scatterplot): destroy highlight and cease autoplay if active on scatterplot (#528) --- src/js/init.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/init.js b/src/js/init.js index df7779fdd..835505a7f 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -473,6 +473,15 @@ function DestroyChartComponents() { chatLLM.Destroy(); } + const scatterSvg = document.querySelector('svg#scatter'); + if (scatterSvg) { + // Incase autoplay was running when the highlighted plot points were being handled, + // kill autoplay first before removing highlight_point elements + constants.KillAutoplay(); + document.querySelectorAll('.highlight_point').forEach((element) => { + element.remove(); + }); + } constants.chart = null; constants.chart_container = null; constants.brailleContainer = null;