Skip to content

renderdag: same-column connected nodes indistinguishable from disconnected ones with min_row_height=1 #1292

@geraschenko

Description

@geraschenko

When rendering a DAG with with_min_row_height(1), renderdag does not draw a between adjacent same-column nodes connected by a parent/child edge. Since nodes that merely share a column (after one's column is freed) also get no separator, a reader cannot tell whether two adjacent nodes are connected.

Reproduction

Render the DAG A B-C with min_row_height=1:

let mut renderer = GraphRowRenderer::new()
    .output()
    .with_min_row_height(1)
    .build_box_drawing();

print!("{}", renderer.next_row("C", vec![Ancestor::Parent("B")], "o".to_string(), "C".to_string()));
print!("{}", renderer.next_row("B", vec![], "o".to_string(), "B".to_string()));
print!("{}", renderer.next_row("A", vec![], "o".to_string(), "A".to_string()));

Expected output: connected nodes get a separator; disconnected nodes do not:

o  C 
│
o  B
o  A

Actual output: both cases render identically:

o  C
o  B
o  A

I have a proposed fix in #1293.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions