Skip to content

Commit

Permalink
fix: scatter points not clearing properly (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellvix authored Jan 21, 2025
1 parent 7e3711f commit 2e78cc3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/js/scatterplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,8 @@ class Layer0Point {
* @async
*/
async ClearPoints() {
if (document.getElementById('highlight_point'))
document.getElementById('highlight_point').remove();
let points = document.getElementsByClassName('highlight_point');
for (let i = 0; i < points.length; i++) {
document.getElementsByClassName('highlight_point')[i].remove();
}
// kill all .highlight_point
document.querySelectorAll('.highlight_point').forEach((e) => e.remove());
}

/**
Expand Down Expand Up @@ -821,12 +817,8 @@ class Layer1Point {
* @async
*/
async ClearPoints() {
let points = document.getElementsByClassName('highlight_point');
for (let i = 0; i < points.length; i++) {
document.getElementsByClassName('highlight_point')[i].remove();
}
if (document.getElementById('highlight_point'))
document.getElementById('highlight_point').remove();
// kill all .highlight_point
document.querySelectorAll('.highlight_point').forEach((e) => e.remove());
}

/**
Expand Down

0 comments on commit 2e78cc3

Please sign in to comment.