From fe582589822b188a4f237cb714d43206c9324275 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Fri, 11 Sep 2015 12:48:32 -0400 Subject: [PATCH] lib/graphs: introduce `show_dot` for debugging digraphs. Signed-off-by: Alexandre Terrasa --- lib/graphs/digraph.nit | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/graphs/digraph.nit b/lib/graphs/digraph.nit index 0b74c4c..bc9a8af 100644 --- a/lib/graphs/digraph.nit +++ b/lib/graphs/digraph.nit @@ -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 ## ## ------------ ## -- 1.7.9.5