10 my $indent_level = length $1;
14 if($indent_level > $prev_indent_level)
16 $parent_of_level{$indent_level} = $prev_node;
19 $related_node = $parent_of_level{$indent_level};
21 if(defined $related_node)
23 $relation{$node}->{$related_node} = 1;
26 $prev_indent_level = $indent_level;
31 $rankdir = $ENV{'INDENT2DOT_RANKDIR'} || 'LR';
34 print "rankdir=$rankdir;";
35 print "node [shape=box];";
37 for my $node (sort keys %relation)
39 for my $related_node (sort keys %{$relation{$node}})
41 if($ENV{'INDENT2DOT_ASCENDENT_CHART'})
43 print "\"$node\" -> \"$related_node\";";
47 print "\"$related_node\" -> \"$node\";";