diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-07-16 14:03:21 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-07-16 14:03:21 +0200 |
| commit | a279b3fb49d786e7c711fa7156af9bbd0d2a9829 (patch) | |
| tree | b89f68fb8e4159f76cce64d3881a35c776ace58e /lib/Graph/GEXF.pm | |
| parent | basic gexf generation (diff) | |
| download | graph-gexf-a279b3fb49d786e7c711fa7156af9bbd0d2a9829.tar.gz | |
add attributes to edge
Diffstat (limited to 'lib/Graph/GEXF.pm')
| -rw-r--r-- | lib/Graph/GEXF.pm | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Graph/GEXF.pm b/lib/Graph/GEXF.pm index 83716c5..be65219 100644 --- a/lib/Graph/GEXF.pm +++ b/lib/Graph/GEXF.pm @@ -11,7 +11,7 @@ use Graph::GEXF::Node; with 'Graph::GEXF::Role::XML', - 'Graph::GEXF::Role::Attributes' => {for => [qw/node edge/]}; + 'Graph::GEXF::Role::Attributes' => {for => [qw/node edge/], with_method => 1}; has graph_mode => ( is => 'ro', @@ -42,18 +42,6 @@ has nodes => ( }, ); -sub add_node_attribute { - my ($self, $name, $type) = @_; - - my $id = $self->attributes_node_total(); - my $attr = { - id => $id, - title => $name, - type => $type, - }; - $self->set_node_attribute($name => $attr); -} - sub add_node { my ($self, $id) = @_; @@ -73,7 +61,7 @@ sub add_node { $_ => { id => $attribute->{id}, name => $attribute->{name}, - type => $attribute->{type} + type => $attribute->{type}, } ); } $self->attributes_node_list; @@ -135,7 +123,7 @@ could be B<directed>, B<undirected>, B<mutual> or B<notset>. Default is B<direct =over 4 -=item add_node_attribute($name, $type) +=item add_node_attribute($name, $type, [$default_value]) Add attributes to node |
