Skip to content

Commit

Permalink
fix(legacy-plugin-chart-sankey-loop): clear element before redrawing
Browse files Browse the repository at this point in the history
otherwise every (re)render adds a new svg to the element. this is essentially
the same as the fix that was applied to legacy-plugin-chart-sankey back in
apache/superset#254
  • Loading branch information
jenseng committed Jul 14, 2021
1 parent 15ab0c6 commit 6d2bbee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ function SankeyLoop(element, props) {
)
.linkColor(d => color(d.source.name));

const svg = select(element)
const div = select(element);
div.selectAll('*').remove();

const svg = div
.append('svg')
.classed('superset-legacy-chart-sankey-loop', true)
.style('width', width)
Expand Down

0 comments on commit 6d2bbee

Please sign in to comment.