2008/11/26

Social software graph


via
from random import uniform
graph = ximport('graph')

size(500, 300)

def curly_edge(style, path, edge, alpha=1.0):
path.moveto(edge.node1.x, edge.node1.y)
path.curveto(
edge.node1.x + 40,
edge.node1.y,
edge.node2.x + 40,
edge.node2.y,
edge.node2.x,
edge.node2.y,
)

g = graph.create(distance=0.4)

for service in ('VeryCD', 'Twitter', 'Last.fm', 'Douban', 'theFlashBlog','Latest Macromedia News',
'Delicious', 'Google Reader', 'Flickr', ):
g.add_node(service, radius=5)

# connect services with FriendFeed
for service in ('Twitter', 'Last.fm', 'Delicious', 'Google Reader', 'Flickr','LinkedIn'):
g.add_edge(service, 'FriendFeed', length=uniform(50,100))

g.styles.default.edge = curly_edge
g.solve()
g.draw()

Labels: ,