my ($self, $cluster_name, $depth) = @_;
my $colour_scheme = $self->colour_scheme();
my $colour_offset = $self->colour_offset();
my $prefix = "\t" x $depth;
my $text = '';
$text .= $prefix . "subgraph cluster_${cluster_name} {\n";
# uncomment the following line to see the cluster names:
# $text .= $prefix . "\tlabel=\"$cluster_name\";\n";
$text .= $prefix . "\tcolorscheme=$colour_scheme;\n";
$text .= $prefix . "\tstyle=filled;\n";
$text .= $prefix . "\tcolor=".($depth+$colour_offset).";\n";
foreach my $node_name ( @{ $self->cluster_2_nodes->{ $cluster_name } || [] } ) {
$text .= $prefix . "\t${node_name};\n";
if( @{ $self->cluster_2_nodes->{ $node_name } || [] } ) {
$text .= $self->display_subgraph( $node_name, $depth+1 );
}
}
$text .= $prefix . "}\n";
return $text;
}