Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions hugr-core/src/hugr/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,6 @@ pub trait HugrView: HugrInternals {
///
/// The hierarchy is represented using subgraphs. Edges are labelled with
/// their source and target ports.
///
/// For a more detailed representation, use the [`HugrView::dot_string`]
/// format instead.
fn mermaid_string(&self) -> String {
self.mermaid_string_with_formatter(self.mermaid_format())
}
Expand All @@ -436,9 +433,6 @@ pub trait HugrView: HugrInternals {
///
/// The hierarchy is represented using subgraphs. Edges are labelled with
/// their source and target ports.
///
/// For a more detailed representation, use the [`HugrView::dot_string`]
/// format instead.
fn mermaid_string_with_formatter(&self, formatter: MermaidFormatter<Self>) -> String;

/// Construct a mermaid representation of the underlying hierarchical graph.
Expand All @@ -448,16 +442,14 @@ pub trait HugrView: HugrInternals {
///
/// The hierarchy is represented using subgraphs. Edges are labelled with
/// their source and target ports.
///
/// For a more detailed representation, use the [`HugrView::dot_string`]
/// format instead.
fn mermaid_format(&self) -> MermaidFormatter<'_, Self> {
MermaidFormatter::new(self).with_entrypoint(self.entrypoint())
}

/// Return the graphviz representation of the underlying graph and hierarchy side by side.
///
/// For a simpler representation, use the [`HugrView::mermaid_string`] format instead.
/// Deprecated, use the [`HugrView::mermaid_string`] format instead.
#[deprecated(since = "0.29.4", note = "Use `mermaid_string` instead.")]
fn dot_string(&self) -> String
where
Self: Sized;
Expand Down
1 change: 1 addition & 0 deletions hugr-core/src/hugr/views/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ macro_rules! hugr_view_methods {
fn all_neighbours(&self, node: Self::Node) -> impl Iterator<Item = Self::Node> + Clone;
fn mermaid_string(&self) -> String;
fn mermaid_string_with_formatter(&self, #[into] formatter: crate::hugr::views::render::MermaidFormatter<Self>) -> String;
#[expect(deprecated)]
fn dot_string(&self) -> String;
fn static_source(&self, node: Self::Node) -> Option<Self::Node>;
fn static_targets(&self, node: Self::Node) -> Option<impl Iterator<Item = (Self::Node, crate::IncomingPort)>>;
Expand Down
Loading
Loading