From: Ian Jackson Date: Thu, 6 Feb 2014 00:56:52 +0000 (+0000) Subject: graphviz: label the winning node(s) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=appendix-a6.git;a=commitdiff_plain;h=19150655609ade77a0687da8afe2b14f871e49ff graphviz: label the winning node(s) --- diff --git a/compute b/compute index 7c70079..58b3587 100755 --- a/compute +++ b/compute @@ -408,10 +408,13 @@ for (;;) { print "no defeats within the Schwartz set\n"; print "final schwartz set:\n\n"; +my $winxlabel; if ($schwartz->vertices() == 1) { print "WINNER IS:\n"; + $winxlabel = "winner"; } else { print "WINNER IS ONE OF (CASTING VOTE DECIDES):\n"; + $winxlabel = "potential winner"; } printf " %-5s %s\n", $_, $choices{$_}{Desc} @@ -424,6 +427,9 @@ if (defined $gfile) { if ($cho->{Dropped}) { $label .= "\nDropped: $cho->{Dropped}"; } + if ($schwartz->has_vertex($chn)) { + $label .= "\n$winxlabel"; + } $showg->set_vertex_attribute($chn, 'label', $label); }