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
…1223)

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
#254
  • Loading branch information
jenseng authored and zhaoyongjie committed Nov 26, 2021
1 parent fbdde90 commit a4bc5ba
Showing 1 changed file with 4 additions and 1 deletion.
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 a4bc5ba

Please sign in to comment.