ignore isolated nodes by default;
authorwenzelm
Tue, 10 Oct 2017 20:33:29 +0200
changeset 66834 c925393ae6b9
parent 66833 091012ac3dc2
child 66835 ecc99a5a1ab8
ignore isolated nodes by default;
src/Pure/General/graph_display.scala
--- a/src/Pure/General/graph_display.scala	Tue Oct 10 19:51:54 2017 +0200
+++ b/src/Pure/General/graph_display.scala	Tue Oct 10 20:33:29 2017 +0200
@@ -63,10 +63,12 @@
 
   def make_graph[A](
     graph: isabelle.Graph[String, A],
+    isolated: Boolean = false,
     name: (String, A) => String = (x: String, a: A) => x): Graph =
   {
     val entries =
-      (for ((x, (a, (ps, _))) <- graph.iterator) yield ((x, (name(x, a), Nil)), ps.toList)).toList
+      (for { (x, (a, (ps, _))) <- graph.iterator if isolated || !graph.is_isolated(x) }
+       yield ((x, (name(x, a), Nil)), ps.toList)).toList
     build_graph(entries)
   }
 }