Parent Directory | Revision Log
skeleton for Frey::Class::Graph which uses GraphViz to draw pretty graphs
1 | package Frey::Class::Graph; |
2 | use Moose; |
3 | |
4 | extends 'Frey'; |
5 | with 'Frey::Web'; |
6 | #with 'Frey::Storage'; |
7 | |
8 | use GraphViz; |
9 | |
10 | has skeleton => ( |
11 | is => 'rw', |
12 | isa => 'Str', |
13 | required => 1, |
14 | default => 'skeleton', |
15 | ); |
16 | |
17 | sub as_markup { |
18 | my ($self) = @_; |
19 | |
20 | my $g = GraphViz->new(); |
21 | |
22 | $g->add_node( 'foo' ); |
23 | $g->add_node( 'bar' ); |
24 | |
25 | $g->add_edge( 'foo' => 'bar' ); |
26 | |
27 | $self->content_type( 'image/png' ); |
28 | return $g->as_png; |
29 | } |
30 | |
31 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |