Skip to content

Commit

Permalink
fix(scatterplot): destroy highlight and cease autoplay if active on s…
Browse files Browse the repository at this point in the history
…catterplot (#528)
  • Loading branch information
krishnanand5 authored Aug 23, 2024
1 parent b869158 commit 5b8d3e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b8d3e2

Please sign in to comment.