From a4bc5bae61ffe99fe3e6302db519510374941074 Mon Sep 17 00:00:00 2001 From: Jon Jensen Date: Tue, 10 Aug 2021 04:52:36 -0600 Subject: [PATCH] fix(legacy-plugin-chart-sankey-loop): clear element before redrawing (#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 apache/superset#254 --- .../legacy-plugin-chart-sankey-loop/src/SankeyLoop.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js b/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js index a7b8a1bada13..3bb54d2f293e 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-sankey-loop/src/SankeyLoop.js @@ -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)