Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Only show final node in visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Jul 27, 2019
1 parent b97efd0 commit d5565b5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions metadsl_visualize/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,26 +237,26 @@ def visualize_replacement(replacement: Replacement):

result = replacement.result
result_id = id_(result)
with dot.subgraph(name="clusteri") as sub:
initial_id = visualize(replacement.initial, sub, seen)
sub.attr(style="dashed")
# with dot.subgraph(name="clusteri") as sub:
# initial_id = visualize(replacement.initial, sub, seen)
# sub.attr(style="dashed")

def inner(expr, dot=dot) -> int:
expr_id = id_(expr)
if expr_id in seen:
return expr_id
if expr_id == result_id:
with dot.subgraph(name="clusterr") as sub:
visualize(expr, sub, seen)
sub.attr(style="bold")
dot.edge(
str(initial_id),
str(result_id),
ltail="clusteri",
lhead="clusterr",
minlen="5",
constraint="false",
)
# with dot.subgraph(name="clusterr") as sub:
visualize(expr, dot, seen)
# sub.attr(style="bold")
# dot.edge(
# str(initial_id),
# str(result_id),
# ltail="clusteri",
# lhead="clusterr",
# minlen="5",
# constraint="false",
# )
return result_id
else:
seen.add(expr_id)
Expand Down

0 comments on commit d5565b5

Please sign in to comment.