Skip to content

Commit

Permalink
add node colors
Browse files Browse the repository at this point in the history
  • Loading branch information
swo committed Dec 13, 2024
1 parent a96ad9a commit 663c286
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ringvax/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ def make_graph(sim: Simulation):
for infectee in sim.query_people():
infector = sim.get_person_property(infectee, "infector")

if infector is None:
# this is the index infection
graph.node(str(infectee))
else:
color = (
"black"
if sim.get_person_property(infectee, "actually_infected")
else "gray"
)

graph.node(str(infectee), color=color)

if infector is not None:
graph.edge(str(infector), str(infectee))

return graph
Expand Down

0 comments on commit 663c286

Please sign in to comment.