/[Frey]/trunk/lib/Frey/Class/Graph.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/Class/Graph.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 970 - (show annotations)
Fri Jan 9 16:21:26 2009 UTC (15 years, 4 months ago) by dpavlin
File size: 411 byte(s)
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