diff options
author | franck cuny <franck@lumberjaph.net> | 2010-02-05 10:23:12 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-02-05 10:23:12 +0100 |
commit | 9bfb3fc5991dfb0f2229a3c36280cbc0395969c0 (patch) | |
tree | 0c8c4a2ccc04075ad0d4f7dda9e907ef17b21ebe /lib | |
parent | first try to generate a gexf (diff) | |
download | github-explorer-9bfb3fc5991dfb0f2229a3c36280cbc0395969c0.tar.gz |
fix edges
Diffstat (limited to 'lib')
-rw-r--r-- | lib/githubexplorer/Gexf.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/githubexplorer/Gexf.pm b/lib/githubexplorer/Gexf.pm index 652800e..503eebe 100644 --- a/lib/githubexplorer/Gexf.pm +++ b/lib/githubexplorer/Gexf.pm @@ -50,9 +50,13 @@ sub profiles { my $node = { id => $profile->id, label => $profile->login, - name => $profile->name, - followers_count => $profile->followers_count, - following_count => $profile->following_count, + attvalues => { + attvalue => [ + {name => $profile->name}, + {followers_count => $profile->followers_count}, + {following_count => $profile->following_count}, + ] + }, }; push @{ $self->graph->{gexf}->{graph}->{nodes}->{node} }, $node; } @@ -62,12 +66,12 @@ sub profiles { while ( my $edge = $edges->next ) { my $e = { cardinal => 1, - source => $edge->origin, - target => $edge->source, + source => $edge->origin->id, + target => $edge->dest->id, type => 'dir', id => $id++, }; - push @{ $self->graph->{gexf}->{graph}->{eges}->{edge} }, $e; + push @{ $self->graph->{gexf}->{graph}->{edges}->{edge} }, $e; } my $xml_out = XMLout( $self->graph, AttrIndent => 1, keepRoot => 1 ); |