Subject: | New Option: random_seed |
According the the NEATO users manual, if the "start" attribute is set to a
number, graphviz will use that number as the random seed, but the layout
will still be deterministic. This is useful if you want to repeat the same
layout after you've found a good one. so i added an option to
new(random_seed => '[NUMBER]')
attached is a patch.
Subject: | Graphviz_random_seed_start.diff |
--- GraphViz.pm~ 2010-03-01 10:40:02.057981100 -0500
+++ GraphViz.pm 2010-03-10 10:08:56.095612500 -0500
@@ -388,6 +388,9 @@
$self->{RANDOM_START} = $config->{random_start}
if ( exists $config->{random_start} );
+
+ $self->{RANDOM_SEED} = $config->{random_seed}
+ if ( exists $config->{random_seed} );
$self->{EPSILON} = $config->{epsilon} if ( exists $config->{epsilon} );
@@ -1114,6 +1117,9 @@
# random start
$dot .= "\tstart=rand;\n" if $self->{RANDOM_START};
+
+ # random seed
+ $dot .= "\tstart=\"" . $self->{RANDOM_SEED} . "\";\n" if $self->{RANDOM_SEED};
# overlap
$dot .= "\toverlap=\"" . $self->{OVERLAP} . "\";\n" if $self->{OVERLAP};