Skip to content

Commit

Permalink
Fix a bug that parallel edges are drawn with the same color (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-fedotov authored Jun 8, 2024
1 parent 02dc0a5 commit 7bbb675
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ticket_to_ride/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def visualize(self: tp.Self, node_size: int = 1400) -> None:
edgelist=edges_between_pair,
width=4,
alpha=0.7,
edge_color=tuple(edge[2]["color"].value for edge in edges_between_pair), # type: ignore[arg-type]
# edge_color, if a sequence, should be a list rather than a tuple due to a bug in nx or plt package
edge_color=[edge[2]["color"].value for edge in edges_between_pair], # type: ignore[arg-type]
# For the style parameter below, note that the sequence of strings should be specifically a list
# because matplotlib style resolvers treat tuples as numeric parameters for styles.
style=[edge[2]["transportation_type"].value for edge in edges_between_pair], # type: ignore[arg-type]
Expand Down

0 comments on commit 7bbb675

Please sign in to comment.