From 9bfb3fc5991dfb0f2229a3c36280cbc0395969c0 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Fri, 5 Feb 2010 10:23:12 +0100 Subject: fix edges --- lib/githubexplorer/Gexf.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib') 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 ); -- cgit 1.4.1