Created
January 17, 2010 21:05
-
-
Save mjbommar/279584 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Jan 17, 2010 | |
@author: mjbommar | |
''' | |
from GraphMovie import GraphMovie | |
import igraph | |
if __name__ == "__main__": | |
''' | |
Create the GraphMovie object. | |
''' | |
m = GraphMovie() | |
''' | |
Create the first graph. | |
''' | |
edges = [(0,1),(1,2),(1,3)] | |
g = igraph.Graph(edges) | |
for i,v in enumerate(g.vs): | |
v['label'] = str(i) | |
m.addGraph(g) | |
''' | |
Now add an edge. | |
''' | |
edges.append((4,1)) | |
g = igraph.Graph(edges) | |
for i,v in enumerate(g.vs): | |
v['label'] = str(i) | |
m.addGraph(g) | |
''' | |
Now add a few edges! | |
''' | |
edges.extend([(5,2),(6,5),(7,5),(8,5),(8,7),(9,8)]) | |
g = igraph.Graph(edges) | |
for i,v in enumerate(g.vs): | |
v['label'] = str(i) | |
m.addGraph(g) | |
''' | |
Now process the layouts, render the frames, and generate the movie. | |
''' | |
m.doMovieLayout() | |
m.renderMovie() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this, however it looks like I have an error running your example:
is there anything I did wrong? thanks!