[turbolizer] Fix graph update bug

D3.v5 needs a merge before applying combined update and
enter actions.

Bug: v8:7327
Change-Id: If5a044c18e4229c5eadb18c18aea191bcbacef32
Reviewed-on: https://chromium-review.googlesource.com/1095188
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53632}
This commit is contained in:
Sigurd Schneider 2018-06-11 13:04:15 +02:00 committed by Commit Bot
parent 9ce6e39ec2
commit 8cc87a7af2

View File

@ -840,11 +840,13 @@ class GraphView extends View implements PhaseView {
}
});
selNodes.select<SVGTextElement>('.type').each(function (d) {
const newAndOldNodes = newGs.merge(selNodes);
newAndOldNodes.select<SVGTextElement>('.type').each(function (d) {
this.setAttribute('visibility', graph.state.showTypes ? 'visible' : 'hidden');
});
selNodes
newAndOldNodes
.classed("selected", function (n) {
if (state.selection.isSelected(n)) return true;
return false;