Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Intergraph edges in mermaid rendering #139

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Jul 1, 2024

Defines intergraph edges on the parent region, so mermaid renders them correctly.

This required a lowest-common-ancestor implementation for the hierarchy. See #138.
I replaced the recursive DFS with a stack-based one that reuses the structures when exploring multiple trees.

I also added some benchmarks for both rendering algorithms.

This closes CQCL/hugr#1197

@aborgna-q aborgna-q changed the title Ab/fix mermaid hierarchy fix: Intergraph edges in mermaid rendering Jul 1, 2024
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.55%. Comparing base (a5be34e) to head (1d358c3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   80.17%   80.55%   +0.38%     
==========================================
  Files          22       22              
  Lines        5140     5174      +34     
  Branches     5140     5174      +34     
==========================================
+ Hits         4121     4168      +47     
+ Misses        946      933      -13     
  Partials       73       73              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Defines intergraph edges on the parent region,
so mermaid renders them correctly .
Copy link
Contributor

@lmondada lmondada left a comment

Choose a reason for hiding this comment

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

👍

@aborgna-q aborgna-q added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit bd03a90 Jul 5, 2024
13 checks passed
@aborgna-q aborgna-q deleted the ab/fix-mermaid-hierarchy branch July 5, 2024 08:36
@hugrbot hugrbot mentioned this pull request Jul 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 5, 2024
## 🤖 New release
* `portgraph`: 0.12.1 -> 0.12.2

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.12.2](v0.12.1...v0.12.2)
- 2024-07-05

### Bug Fixes
- Intergraph edges in mermaid rendering
([#139](#139))

### New Features
- Add PortOffset::opposite
([#136](#136))
- Efficient LCA algorithm for the hierarchy
([#138](#138))

### Testing
- Use `insta` for mermaid/dot render tests
([#137](#137))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
github-merge-queue bot pushed a commit to CQCL/hugr that referenced this pull request Jul 5, 2024
aborgna-q added a commit to CQCL/hugr that referenced this pull request Jul 8, 2024
@hugrbot hugrbot mentioned this pull request Jul 25, 2024
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.

mermaid rendering child node in incorrect DataflowBlock
2 participants