lib/graphs: introduce `show_dot` for debugging digraphs.
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 11 Sep 2015 16:48:32 +0000 (12:48 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 15 Oct 2015 18:07:59 +0000 (14:07 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/graphs/digraph.nit

index 0b74c4c..bc9a8af 100644 (file)
@@ -383,6 +383,15 @@ interface Digraph[V: Object]
                return s
        end
 
+       # Open Graphviz with `self.to_dot`.
+       #
+       # Mainly used for debugging.
+       fun show_dot do
+               var f = new ProcessWriter("dot", "-Txlib")
+               f.write to_dot
+               f.close
+       end
+
        ## ------------ ##
        ## Neighborhood ##
        ## ------------ ##