opusonesolutions / asciigraf

A python library for making ascii-art into network graphs.
MIT License
36 stars 6 forks source link

Vertical line labels #33

Closed etimberg closed 6 years ago

etimberg commented 6 years ago

Adds support for labeling vertical lines. This was easier said than done. I think it might help overall if it was easier to look for a character at a given grid square (perhaps an accessor around the string?). That way this could all be done in one pass rather than 2 but I think that might be better in it's own PR.

From the test:

def test_vertical_line_labels():
    graph = graph_from_ascii("""
        A
        |
      (Vertical)
        |
        B
    """)
coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.6%) to 97.368% when pulling 6fe199be36805387930a9b1fa2bc05bc7a829c8a on vertical-line-labels into 83a1301bb6ef89d0074af1d00dcbea2a9c5054e3 on master.

greatestape commented 6 years ago

What should this do? Error?

        A     C
        |     |
      (Vertical)
        |     |
        B     D
greatestape commented 6 years ago

Similar case

        A     
        |     
      (Vertical)--C
        |     
        B     
etimberg commented 6 years ago

I think both those cases are errors because a wire can only connect two nodes and both cases violate that

@AnjoMan thoughts?

AnjoMan commented 6 years ago

I agree those are both error cases. (label) is not a node