Skip to content

Better Dot rendering of closures#117

Merged
acl-cqc merged 7 commits intomainfrom
acl/dot_closures
May 4, 2026
Merged

Better Dot rendering of closures#117
acl-cqc merged 7 commits intomainfrom
acl/dot_closures

Conversation

@acl-cqc
Copy link
Copy Markdown
Collaborator

@acl-cqc acl-cqc commented May 1, 2026

closes #101 - the BRAT graph is fine, it was just the rendering that was terrible.

  • Exclude nodes captured by a box from being in the box. This was how multiple Sources were ending up in the same box as a Target. Instead each Source should now end up in the same box as its Target.
  • Add edge from Box node to Target. This is probably redundant now I have properly fixed the previous.
  • Shorten rendering of labels: "Box sourcenodename targetnodename" is now just "Box", similarly Eval. The names are redundant as they are shown by the dotted edges. (So maybe the Box-Target edge does have a purpose, allowing label to be shortened?)
  • Properly nest clusters, i.e. when a Box node B1 is in a cluster C1, the associated cluster C2 with B1's Source+Target should now be a subcluster of C2

This piccy demonstrates effect on function f in closures.brat, admittedly for the pic I also shortened PatternMatch but really we need to handle those properly - a TODO for a followup

image

Previously the middle (between left and right) Source had been put in the LHS cluster, causing the confusion, and of course the clusters were not nested.

Comment thread brat/Brat/Dot.hs Outdated
toDotString :: Graph -> CaptureSets -> String
toDotString (ns,ws) cs = unpack . GV.printDotGraph $ GV.graphElemsToDot params verts edges
where
_ = cs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 now defunct but it was temporarily to silence some error messages. Thanks for spotting :) now removed!

@acl-cqc acl-cqc merged commit 88e8617 into main May 4, 2026
1 check passed
@acl-cqc acl-cqc deleted the acl/dot_closures branch May 4, 2026 07:50
acl-cqc added a commit that referenced this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed Brat Graph in closures.brat

2 participants