From 868d0d2240918b360131ba9c0d491c0870f6768c Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 26 Jun 2011 11:53:18 +0200 Subject: move documentation --- lib/Graph/GEXF.pm | 86 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/lib/Graph/GEXF.pm b/lib/Graph/GEXF.pm index 8f7d1ef..f226b06 100644 --- a/lib/Graph/GEXF.pm +++ b/lib/Graph/GEXF.pm @@ -14,12 +14,24 @@ with 'Graph::GEXF::Role::Attributes' => { for => [qw/node edge/], with_method => 1 }; +=attr visualization (B) + +if set to true, the generated graph will includes visualizations informations + +=cut + has visualization => ( is => 'ro', isa => 'Bool', predicate => 'has_visualization', ); +=attr graph_mode (B) + +Is your graph static or dynamic. + +=cut + has graph_mode => ( is => 'ro', isa => enum( [qw/static dynamic/] ), @@ -27,6 +39,12 @@ has graph_mode => ( default => 'static', ); +=attr edge_type (B) + +The type of the edges + +=cut + has edge_type => ( is => 'ro', isa => enum( [qw/directed undirected mutual notset/] ), @@ -34,6 +52,34 @@ has edge_type => ( default => 'directed', ); +=attr nodes + +a HashRef of L objects. + +=cut + +=method total_nodes + +Return the list of nodes attached to the graph + +=cut + +=method get_node + +Return a node + +=cut + +=method add_node_attribute($name, $type, [$default_value]) + +Add attributes to node + +=method all_nodes + +Return all the nodes + +=cut + has nodes => ( traits => ['Hash'], is => 'rw', @@ -49,6 +95,12 @@ has nodes => ( }, ); +=method add_node + +Add a new node to the graph + +=cut + sub add_node { my $self = shift; my ($id, %attributes); @@ -123,37 +175,3 @@ sub add_node { # render the graph in XML my $xml = $graph->to_xml; - -=head1 DESCRIPTION - -=head2 ATTRIBUTES - -=over 4 - -=item visualization - -If set to true, the generated graph will include visualizations informations. - -=item graph_mode - -could be B or B. Default is B - -=item edge_type - -could be B, B, B or B. Default is B. - -=back - -=head2 METHODS - -=over 4 - -=item add_node_attribute($name, $type, [$default_value]) - -Add attributes to node - -=item add_node([$id]) - -Add a new node to the graph - -=back -- cgit v1.2.3