/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 982 by dpavlin, Sat Jan 10 01:27:28 2009 UTC revision 1099 by dpavlin, Sun Jun 28 22:19:17 2009 UTC
# Line 69  has show_disconnected => ( Line 69  has show_disconnected => (
69  );  );
70    
71    
72    has layout => (
73            documentation => 'layout algorithm',
74            is => 'rw',
75            isa => 'Str',
76            required => 1,
77    );
78    
79    sub layout_available { q/
80    dot             directed graph
81    neato   spring model
82    twopi   radial
83    circo   circular
84    fdp             force directed spring model
85    / }
86    
87  has portrait => (  has portrait => (
88          documentation => 'vertical layout',          documentation => 'vertical layout',
89          is => 'rw',          is => 'rw',
90          isa => 'Bool',          isa => 'Bool',
91  );  );
92    
93    has no_overlap => (
94            documentation => 'avoid overlaping nodes',
95            is => 'rw',
96            isa => 'Bool',
97    );
98    
99  has produce_dot => (  has produce_dot => (
100          documentation => 'dump .dot text format',          documentation => 'dump .dot text format',
101          is => 'rw',          is => 'rw',
# Line 90  sub as_markup { Line 111  sub as_markup {
111    
112          my $g = GraphViz->new(          my $g = GraphViz->new(
113                  rankdir => $rankdir,                  rankdir => $rankdir,
114                    layout => $self->layout,
115  #               layout => 'neato', # grabs too much memory  #               layout => 'neato', # grabs too much memory
116  #               layout => 'twopi', # grabs too much memory  #               layout => 'twopi', # grabs too much memory
117  #               overlap => 'compress',  #               overlap => 'compress',
118  #               no_overlap => 1,                  no_overlap => $self->no_overlap,
119    
120                  node => {                  node => {
121                          shape => 'box',                          shape => 'box',
# Line 142  sub as_markup { Line 164  sub as_markup {
164                          foreach my $role ( keys %{ $data->{roles} } ) {                          foreach my $role ( keys %{ $data->{roles} } ) {
165                                  next if $filter && $self->filter_roles && $role !~ m{$filter};                                  next if $filter && $self->filter_roles && $role !~ m{$filter};
166                                  warn "# $class\trole\t$role\n";                                  warn "# $class\trole\t$role\n";
167                                  $g->add_edge( $role => $class, label => 'role', color => 'yellow' );                                  $g->add_edge( $role => $class, label => 'with', color => 'yellow' );
168  #                               $g->add_node( $role, rank => 'role' );                                  $g->add_node( $role, shape => 'diamond' );
169                                  $count->{$class}++;                                  $count->{$class}++;
170                                  $count->{$role}++;                                  $count->{$role}++;
171                          }                          }

Legend:
Removed from v.982  
changed lines
  Added in v.1099

  ViewVC Help
Powered by ViewVC 1.1.26