Graph-Writer-DSM

 view release on metacpan or  search on metacpan

lib/Graph/Writer/DSM/HTML.pm  view on Meta::CPAN

package Graph::Writer::DSM::HTML;
$Graph::Writer::DSM::HTML::VERSION = '0.008';
use Modern::Perl;
use base qw( Graph::Writer );
use Mojo::Template;

local $/ = undef;
our $TEMPLATE = <DATA>;

=head1 NAME

Graph::Writer::DSM::HTML - draw graph as a DSM matrix in HTML format

=head1 VERSION

version 0.008

=head1 DESCRIPTION

See L<Graph::Writer::DSM>.

=head1 SYNOPSIS

See L<Graph::Writer::DSM>.

=head1 METHODS

=head1 new()

Like L<Graph::Writer::DSM>, this module provide some extra parameters
to new() method.

Supported parameters are:

=over 4

=item title

The title of HTML page. Default: 'Design Structure Matrix'.

=back

=cut

sub _init {
  my ($self, %param) = @_;
  $self->SUPER::_init();
  $self->{title} = $param{title} // 'Design Structure Matrix';
}

=head1 write_graph()

See L<Graph::Writer::DSM>.

=cut

sub _write_graph {
  my ($self, $graph, $FILE) = @_;
  my $template = Mojo::Template->new;
  my $output = $template->render($TEMPLATE, $graph, $self->{title});
  print $FILE $output;
}



( run in 0.652 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )