Commit 29d88134 authored by Sigurdur Asgeirsson's avatar Sigurdur Asgeirsson Committed by Commit Bot

Don't leak group elements on node deletion in chrome://discards.

Change-Id: I9d984924273755bf0b13a03642af117b99dbbd3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142037
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: dpapad <dpapad@chromium.org>
Auto-Submit: Sigurður Ásgeirsson <siggi@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757499}
parent 6534af2b
...@@ -557,15 +557,17 @@ class Graph { ...@@ -557,15 +557,17 @@ class Graph {
// Give dead nodes a distinguishing class to exclude them from the selection // Give dead nodes a distinguishing class to exclude them from the selection
// above. Interrupt any ongoing transitions, then transition them out. // above. Interrupt any ongoing transitions, then transition them out.
const deletedNodes = node.exit().classed('dead', true).interrupt(); const deletedNodes = node.exit().classed('dead', true);
deletedNodes.interrupt();
deletedNodes.select('circle') const deletedTransition = deletedNodes.transition();
deletedTransition.select('circle')
.attr('r', 9) .attr('r', 9)
.attr('fill', 'red') .attr('fill', 'red')
.transition() .transition()
.duration(2000) .duration(2000)
.attr('r', 0) .attr('r', 0);
.remove(); // Remove the nodes at the end of transition.
deletedTransition.remove();
// Update the title for all nodes. // Update the title for all nodes.
node.selectAll('title').text(d => d.title); node.selectAll('title').text(d => d.title);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment