Rename the 'gender' coloring to be more freeform, and make it an optional field.
This commit is contained in:
parent
b8114a0016
commit
228e899b66
3 changed files with 6 additions and 6 deletions
10
polygraph.py
10
polygraph.py
|
@ -8,7 +8,7 @@ def parse_args():
|
|||
parser = argparse.ArgumentParser(description='Generate graphs of polyamorous family networks from data files')
|
||||
parser.add_argument('--input', '-i', default='network.json', help='Input file in json format')
|
||||
parser.add_argument('--output', '-o', default='network.png', help='Output image file. Format auto-detected from file extension')
|
||||
parser.add_argument('--gender', '-g', action='store_true', help='Include gender colors in output graph')
|
||||
parser.add_argument('--color', '-c', action='store_true', help='Include node colors in output graph')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
|
@ -28,11 +28,11 @@ def main():
|
|||
|
||||
# Add nodes to graph
|
||||
for user in data['members']:
|
||||
gender_color = 'white'
|
||||
if settings.gender:
|
||||
gender_color = user['color']
|
||||
node_color = 'white'
|
||||
if settings.color and user.has_key('color'):
|
||||
node_color = user['color']
|
||||
|
||||
graph.add_node(user['name'], fillcolor=gender_color)
|
||||
graph.add_node(user['name'], fillcolor=node_color)
|
||||
|
||||
# Add edges to graph
|
||||
edge_style = 'solid'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue