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()

标签: ,

1 条评论:

Anonymous 匿名 说...

Thx large post PT Lampung
Service HP Bandar Lampung in kridibel visit best from best android from indonesia www.lampungservice.com

2019年1月10日 14:36  

发表评论

订阅 博文评论 [Atom]

<< 主页

、