summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-02-09 13:21:18 +0100
committerfranck cuny <franck@lumberjaph.net>2010-02-09 13:21:18 +0100
commitf8883312a0f7398cf936506cbf2507645b8e4c17 (patch)
tree9fea4ad8f2391968a583766953b8781ea8b27027
parentupdate ignore (diff)
parentfix edges (diff)
downloadgithub-explorer-f8883312a0f7398cf936506cbf2507645b8e4c17.tar.gz
Merge branch 'master' of lj:github-explorer
* 'master' of lj:github-explorer:
  fix edges
-rw-r--r--lib/githubexplorer/Gexf.pm16
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 );