From: Tara L Andrews Date: Fri, 13 Jan 2012 11:56:43 +0000 (+0100) Subject: make GraphViz account for reading ranks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81a4c6a0dfcf1ad1c3fb2272bcd8e561cedd9788;p=scpubgit%2Fstemmatology.git make GraphViz account for reading ranks --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index c39e12a..c92e858 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -437,6 +437,10 @@ sub as_dot { 'label' => join( ', ', $self->path_display_label( $edge ) ), ); my $varopts = join( ', ', map { $_.'="'.$variables{$_}.'"' } sort keys %variables ); + # Account for the rank gap if necessary + my $rankgap = $self->reading( $edge->[1] )->rank + - $self->reading( $edge->[0] )->rank; + $varopts .= ", minlen=$rankgap" if $rankgap > 1; $dot .= sprintf( "\t\"%s\" -> \"%s\" [ %s ];\n", $edge->[0], $edge->[1], $varopts ); }