-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat!: mermaid rendering #125
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
+ Coverage 78.77% 79.38% +0.60%
==========================================
Files 19 21 +2
Lines 4773 5016 +243
Branches 4773 5016 +243
==========================================
+ Hits 3760 3982 +222
- Misses 946 962 +16
- Partials 67 72 +5 ☔ View full report in Codecov by Sentry. |
ss2165
approved these changes
Mar 1, 2024
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 1, 2024
## 🤖 New release * `portgraph`: 0.11.0 -> 0.12.0 (⚠️ API breaking changes) ###⚠️ `portgraph` breaking changes ``` --- failure enum_missing: pub enum removed or renamed --- Description: A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.1/src/lints/enum_missing.ron Failed in: enum portgraph::dot::PortStyle, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:33 enum portgraph::dot::EdgeStyle, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:74 enum portgraph::dot::NodeStyle, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:10 --- failure module_missing: pub module removed or renamed --- Description: A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.1/src/lints/module_missing.ron Failed in: mod portgraph::dot, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:1 --- failure struct_missing: pub struct removed or renamed --- Description: A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.1/src/lints/struct_missing.ron Failed in: struct portgraph::dot::DotFormatter, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:99 --- failure trait_missing: pub trait removed or renamed --- Description: A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.1/src/lints/trait_missing.ron Failed in: trait portgraph::dot::DotFormat, previously in file /tmp/.tmpRl5Civ/portgraph/src/dot.rs:359 ``` <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## 0.12.0 (2024-03-01) ### Features - Proptest for Multiportgraph - (Multi)Portgraph implement Arbitrary - [**breaking**] Mermaid rendering ([#125](#125)) ### Miscellaneous Tasks - [**breaking**] Hike MSRV to 1.75 </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-merge-queue bot
pushed a commit
to CQCL/hugr
that referenced
this pull request
Mar 5, 2024
Adds a `HugrView::mermaid_string` which produces things like ```mermaid graph LR subgraph 0 ["(0) DFG"] direction LR 1["(1) Input"] 1--0:0-->3 1--1:1-->3 2["(2) Output"] 3["(3) test.quantum.CX"] 3--0:1-->4 3--1:0-->4 3-.2:2.-4 4["(4) test.quantum.CX"] 4--0:0-->2 4--1:1-->2 end ``` Note that edges in mermaid are unordered, so I had to add the port indices explicitly. The new code in `src/hugr/views/render.rs` is just moved from `src/hugr/views.rs`. Closes #696 Requires CQCL/portgraph#125
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Renames the
dot
module torender
, and adds a mermaid formatter using the same style configuration structs.BREAKING CHANGE: Moved
portgraph::dot
toportgraph::render