diff options
author | franck cuny <franck@lumberjaph.net> | 2010-01-30 16:35:44 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-01-30 16:35:44 +0100 |
commit | 1774a184943070ba9c892a30bc563d073209c97d (patch) | |
tree | c4d5582abf0839c242d40f92c63f73285a908088 /lib/githubexplorer/Gexf.pm | |
parent | don't fetch info if profile exists (diff) | |
download | github-explorer-1774a184943070ba9c892a30bc563d073209c97d.tar.gz |
start to gen. gexf
Diffstat (limited to 'lib/githubexplorer/Gexf.pm')
-rw-r--r-- | lib/githubexplorer/Gexf.pm | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/githubexplorer/Gexf.pm b/lib/githubexplorer/Gexf.pm index a82a741..0d814f0 100644 --- a/lib/githubexplorer/Gexf.pm +++ b/lib/githubexplorer/Gexf.pm @@ -3,6 +3,8 @@ package githubexplorer::Gexf; use Moose; use XML::Simple; +has schema => (is => 'ro', isa => 'Object', required => 1); + has graph => ( is => 'rw', isa => 'HashRef', @@ -16,7 +18,23 @@ has graph => ( attributes => { class => 'node', type => 'static', - attribute => [ { id => 0, type => 'string' } ] + attribute => [ + { + id => 0, + type => 'string', + title => 'totalrepo' + }, + { + id => 1, + type => 'string', + title => 'accountlogin' + }, + { + id => 2, + type => 'string', + title => 'forkedrepo' + }, + ] } } } @@ -24,4 +42,24 @@ has graph => ( } ); +sub profiles { + my $self = shift; + my $profiles = $self->schema->resultset('Profiles')->search(); + + while ( my $profile = $profiles->next ) { + my $node = { + id => $profile->name, + label => $profile->name, + attvalues => [ + { id => 0, value => 'total' }, + { id => 1, $profile->name }, + { id => 2, 'forked' } + ] + }; + push @{ $self->graph->{gexf}->{graph}->{nodes}->{node} }, $node; + } + use YAML::Syck; + warn Dump $self->graph; +} + 1; |