From 8bdf10bdd4b6f93515425e1a16fd69e2ce204c3e Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Mon, 4 Apr 2016 09:47:53 -0700 Subject: [PATCH 1/2] Clear sankey vis container on refresh to prevent duplicate charts. --- caravel/assets/visualizations/sankey.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/caravel/assets/visualizations/sankey.js b/caravel/assets/visualizations/sankey.js index a7322920834fd..80e5ad69c92b3 100644 --- a/caravel/assets/visualizations/sankey.js +++ b/caravel/assets/visualizations/sankey.js @@ -128,9 +128,14 @@ function sankeyVis(slice) { slice.done(json); }); }; + + var resize = function() { + div.select("svg").remove(); + render(); + }; return { render: render, - resize: render + resize: resize }; } From df57515157424aa27d54260719a24d2b4eee7a3f Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Mon, 4 Apr 2016 09:56:42 -0700 Subject: [PATCH 2/2] lint. --- caravel/assets/visualizations/sankey.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/caravel/assets/visualizations/sankey.js b/caravel/assets/visualizations/sankey.js index 80e5ad69c92b3..38e31973fd05e 100644 --- a/caravel/assets/visualizations/sankey.js +++ b/caravel/assets/visualizations/sankey.js @@ -129,10 +129,11 @@ function sankeyVis(slice) { }); }; - var resize = function() { + var resize = function () { div.select("svg").remove(); render(); }; + return { render: render, resize: resize