diff --git a/polygraph.py b/polygraph.py index 758cd50..9a4dac7 100755 --- a/polygraph.py +++ b/polygraph.py @@ -22,8 +22,8 @@ gender_colors = { # Relationship types... feel free to edit to suit your poly family's needs relationship_colors = { - 's': 'blue', - 'd': 'red' + 'stable': 'blue', + 'developing': 'red' } @@ -40,16 +40,15 @@ def main(): graph.edge_attr['arrowsize'] = 0.5 # Add nodes to graph - for user in data: + for user in data['members']: graph.add_node(user['name'], fillcolor=gender_colors[user['gender']]) # Add edges to graph - for user1 in data: - for (user2, rel, fluid) in user1['connections']: - graph.add_edge(user1['name'], user2, style=fluid_colors[fluid], color=relationship_colors[rel]) + for (member1,member2,rel,fluid) in data['relationships']: + graph.add_edge(member1, member2, style=fluid_colors[fluid], color=relationship_colors[rel]) graph.layout() - graph.draw('/tmp/graph.png') + graph.draw('poly_network.png') if __name__ == '__main__': main()