[turbolizer] Remove old links upon phase change

This CL removes the graph between phase changes. This prevents incorrect
path layouting after changing from a phase where a path is displayed that
is not a correct path in the phase we change to.

Change-Id: Iad80f49efc8d8c71600ad51432981c3a206ef9cb
Bug: v8:7327
Reviewed-on: https://chromium-review.googlesource.com/c/1397710
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58592}
This commit is contained in:
Sigurd Schneider 2019-01-07 15:18:11 +01:00 committed by Commit Bot
parent 53b9e1ed26
commit 3ddd7bb1eb

View File

@ -65,7 +65,7 @@ export class GraphView extends View implements PhaseView {
svg.on("click", function (d) {
view.selectionHandler.clear();
});
// Listen for key events. Note that the focus handler seems
// Listen for key events. Note that the focus handler seems
// to be important even if it does nothing.
svg
.attr("focusable", false)
@ -250,9 +250,13 @@ export class GraphView extends View implements PhaseView {
}
deleteContent() {
if (this.visibleNodes) {
this.updateGraphVisibility();
}
for (const n of this.graph.nodes()) {
n.visible = false;
};
this.graph.forEachEdge((e: Edge) => {
e.visible = false;
});
this.updateGraphVisibility();
};
createGraph(data, rememberedSelection) {