Skip to content

Commit

Permalink
Bugfix/legend renders twice when you render the plot twice (#33)
Browse files Browse the repository at this point in the history
* Remove Existing Legend Before Creating A New One

* Bump up lib version
  • Loading branch information
OssamaRafique authored Jan 16, 2024
1 parent 08fb3cb commit 63e549a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "epiviz.heatmap.gl",
"version": "0.0.22",
"version": "0.0.23",
"repository": "https://github.com/jkanche/epiviz.heatmap.gl",
"homepage": "https://github.com/jkanche/epiviz.heatmap.gl",
"author": {
Expand Down
3 changes: 3 additions & 0 deletions src/BaseGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ class BaseGL {
// Only render the legend if we have the legend data and the legend dom element
if (!this.legendDomElement || !this.intensityLegendData) return;

//Clear the legend dom element
select(this.legendDomElement).select("svg").remove();

const parsedMargins = parseMargins(this._spec.margins);
const containerWidth =
this.legendWidth ||
Expand Down

0 comments on commit 63e549a

Please sign in to comment.