Skip to content

Commit

Permalink
double penwidth and reduce arrow size of edge
Browse files Browse the repository at this point in the history
  • Loading branch information
salistha-shakya committed Oct 22, 2024
1 parent b939b1e commit a480c9c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions causing/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def annotated_graphs(

NODE_PALETTE = "#ff7973 #FFC7AD #EEEEEE #BDE7BD #75cf73".split(" ")
EDGE_PALETTE = "#ff7973 #FFC7AD #BBBBBB #aad3aa #75cf73".split(" ")
PEN_WIDTH_PALETTE = [6, 4, 2, 4, 6]
PEN_WIDTH_PALETTE = [12, 8, 4, 8, 12]


def color(val, max_val, palette):
Expand Down Expand Up @@ -175,7 +175,10 @@ def graph_to_dot(
)
col_str = color(data["effect"], max_val, palette=edge_palette)
penwidth = color(data["effect"], max_val, palette=pen_width_palette)
dot_str += f' "{from_node}" -> "{to_node}" [label="{eff_str}" color="{col_str}" penwidth="{penwidth}"]\n'
dot_str += (
f' "{from_node}" -> "{to_node}" [label="{eff_str}" color="{col_str}" penwidth="{penwidth}", '
f"arrowsize=0.5]\n"
)

for from_node, to_node in invisible_edges:
dot_str += f' "{from_node}" -> "{to_node}" [style = "invisible", arrowhead="none"]\n'
Expand Down

0 comments on commit a480c9c

Please sign in to comment.