Skip to content

Commit

Permalink
Bugfix: correctly remove label texts on toggle/re-render
Browse files Browse the repository at this point in the history
  • Loading branch information
abought committed Sep 8, 2020
1 parent f7d4865 commit fc53e54
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions esm/components/data_layer/scatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ class Scatter extends BaseDataLayer {
.append('g')
.attr('class', style_class);

// Render label texts
if (this.label_texts) {
this.label_texts.remove();
}
Expand Down Expand Up @@ -318,12 +317,15 @@ class Scatter extends BaseDataLayer {
.remove();
} else {
// If the layout definition has changed (& no longer specifies labels), strip any previously rendered
if (this.label_groups) {
this.label_groups.remove();
if (this.label_texts) {
this.label_texts.remove();
}
if (this.label_lines) {
this.label_lines.remove();
}
if (this.label_groups) {
this.label_groups.remove();
}
}

// Generate main scatter data elements
Expand Down

0 comments on commit fc53e54

Please sign in to comment.