pub struct GraphRowShape<N> {Show 13 fields
pub node: N,
pub merge: bool,
pub separator_line: bool,
pub style: GraphRowShapeStyle,
pub is_head: bool,
pub is_root: bool,
pub node_column: usize,
pub parent_columns: Vec<usize>,
pub node_line: Vec<NodeLine>,
pub link_line: Option<Vec<LinkLine>>,
pub link_line_from_node: Option<Vec<LinkLine>>,
pub term_line: Option<Vec<bool>>,
pub ancestry_line: Vec<PadLine>,
}Expand description
An abstract graph row shape for one rendered node.
This is the output of the graph-to-rows stage. It captures the node’s current column, the edge shape around it, and any row-level facts needed by later stages. It intentionally does not contain glyphs or message text.
Example of different type of lines, depending on the rendering style, certain lines can be skipped or repeated:
│ // pre_node_line() (optional, repeatable)
│ // pre_node_line()
o F // node_line (mandory, once)
│ very long message 0 // post_node_line() (optional, repeatable)
│ very long message 0 // post_node_line()
├─┬─╮ very long message 1 // link_line (mandory, once)
│ │ ~ very long message 2 // term_line (mandory, once)
: │ very long message 3 // ancestry_line (mandory, once or repeatable)
│ │ very long message 4 // post_ancestry_line() (optional, repeatable)
│ │ very long message 5 // post_ancestry_line()Fields§
§node: NThe node represented by this row.
merge: boolTrue if this row connects to multiple parents.
Some prefix renderers use this to choose clearer junction glyphs.
separator_line: boolTrue if this row needs a blank separator before its graph lines.
style: GraphRowShapeStyleStyle used to produce this row shape.
is_head: boolTrue if this node is a head (no children, uses a new column).
is_root: boolTrue if this node has no parents.
node_column: usizeThe column containing the node glyph.
parent_columns: Vec<usize>The columns occupied by this node’s parents.
node_line: Vec<NodeLine>Abstract columns for the line containing the node.
link_line: Option<Vec<LinkLine>>Abstract columns for the line connecting the node to its parents.
This is absent when the node and its parents can be represented without an explicit link line.
link_line_from_node: Option<Vec<LinkLine>>The part of link_line that is directly emitted from this row’s node.
For example:
│ o // node line
├─╯ // link lineThe link_line_from_node LinkLine looks like:
╭─╯Note “├” is changed to “╭”.
Consumers can use this to follow or highlight edges that originate from the current node without guessing from the full link line.
term_line: Option<Vec<bool>>Terminator columns for anonymous parents.
A true entry marks a column where the edge should terminate. Other
columns should be rendered using the row’s padding columns.
ancestry_line: Vec<PadLine>Abstract columns for ancestry continuation below this row.
Implementations§
Source§impl<N> GraphRowShape<N>
impl<N> GraphRowShape<N>
Sourcepub fn has_indirect_ancestor(&self) -> bool
pub fn has_indirect_ancestor(&self) -> bool
True if the ancestry line contains an indirect ancestor edge.
Sourcepub fn pre_node_line(&self) -> Vec<PadLine>
pub fn pre_node_line(&self) -> Vec<PadLine>
Derive the repeatable padding line before the node line.
Sourcepub fn post_node_line(&self) -> Vec<PadLine>
pub fn post_node_line(&self) -> Vec<PadLine>
Derive the repeatable padding line after the node line.
Sourcepub fn post_ancestry_line(&self) -> Vec<PadLine>
pub fn post_ancestry_line(&self) -> Vec<PadLine>
Derive the repeatable padding line after the ancestry line.