GraphViz::Traverse::Filesystem
version 0.0201_1
use GraphViz::Traverse::Filesystem; $g = GraphViz::Traverse::Filesystem->new( ratio => 'compress', bgcolor => 'beige' ); $g->traverse($root); print $g->as_debug;
DEPRECATED
A GraphViz::Traverse::Filesystem object provides methods to traverse a file system and render it with GraphViz.
GraphViz
Inherit this module to define and use custom node_* and edge_* methods. Example:
package Foo; use strict; use warnings; use base qw( GraphViz::Traverse::Filesystem ); sub node_style { return 'filled' } sub node_peripheries { my $self = shift; $_ = shift; return !-d $_ && -x $_ ? 2 : 1; # Executable? Get a ring. } sub node_fillcolor { my $self = shift; $_ = shift; return -d $_ ? 'snow' : /\.pod$/ ? 'cadetblue' : /\.pm$/ ? 'cadetblue4' : /\.cgi$/ ? 'cadetblue3' : /\.pl$/ ? 'cadetblue2' : /(?:readme|changes?)/i ? 'goldenrod' : /\.txt$/ ? 'gold4' : /\.css$/ ? 'plum' : /\.html?$/ ? 'plum3' : /\.jpe?g$/ ? 'orchid4' : /\.gif$/ ? 'orchid3' : /\.png$/ ? 'orchid1' : /\.t(?:ar\.)?gz$/ ? 'red3' : /\.zip$/ ? 'red1' : /\.dump$/ ? 'pink' : 'yellow'; } sub edge_color { return 'gray' } # etc. 1;
$g->traverse($root);
Traverse a file system starting at the given root path and populate the GraphViz object with file nodes-and path-edges.
Foo
GraphViz::Traverse
Gene Boggs <gene@cpan.org>
This software is copyright (c) 2019 by Gene Boggs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install GraphViz::Traverse, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GraphViz::Traverse
CPAN shell
perl -MCPAN -e shell install GraphViz::Traverse
For more information on module installation, please visit the detailed CPAN module installation guide.