Index: tools/turbolizer/graph-view.js |
diff --git a/tools/turbolizer/graph-view.js b/tools/turbolizer/graph-view.js |
index 5c802e1b56fd1ef355b13dec939e3eef895a1857..1863e1a7014cb8adfdf15e822e36ff369ff8a8c7 100644 |
--- a/tools/turbolizer/graph-view.js |
+++ b/tools/turbolizer/graph-view.js |
@@ -125,6 +125,7 @@ class GraphView extends View { |
d3.select("#upload").on("click", partial(this.uploadAction, graph)); |
d3.select("#layout").on("click", partial(this.layoutAction, graph)); |
d3.select("#show-all").on("click", partial(this.showAllAction, graph)); |
+ d3.select("#hide-dead").on("click", partial(this.hideDeadAction, graph)); |
d3.select("#hide-unselected").on("click", partial(this.hideUnselectedAction, graph)); |
d3.select("#hide-selected").on("click", partial(this.hideSelectedAction, graph)); |
d3.select("#zoom-selection").on("click", partial(this.zoomSelectionAction, graph)); |
@@ -463,6 +464,11 @@ class GraphView extends View { |
graph.viewWholeGraph(); |
} |
+ hideDeadAction(graph) { |
+ graph.nodes.filter(function(n) { if (!n.live) n.visible = false; }) |
+ graph.updateGraphVisibility(); |
+ } |
+ |
hideUnselectedAction(graph) { |
var unselected = graph.visibleNodes.filter(function(n) { |
return !this.classList.contains("selected"); |
@@ -725,6 +731,8 @@ class GraphView extends View { |
.append("g"); |
newGs.classed("control", function(n) { return n.isControl(); }) |
+ .classed("live", function(n) { return n.isLive(); }) |
+ .classed("dead", function(n) { return !n.isLive(); }) |
.classed("javascript", function(n) { return n.isJavaScript(); }) |
.classed("input", function(n) { return n.isInput(); }) |
.classed("simplified", function(n) { return n.isSimplified(); }) |