Coder Social home page Coder Social logo

asciigraf's People

Contributors

anjoman avatar emilyylma avatar etimberg avatar greatestape avatar yangineer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asciigraf's Issues

Asciigraf should report the length of each branch

Currently, asciigraf returns a networkx graph datastructure where every node has a position relative to the top-left corner of the string in which the network is drawn. It would be great if the graph also came with a length on each edge which indicated the number of characters in the edge. For example:

asciigraf.graph_from_ascii("""
            (13)           (10)
        n0-------------n1----------n2
                       |
                       |  (3)
                       |
                       n4
""").nodes(data=True)
>>> [('n0', {'position': Point(3, 8)}),
        ('n1', {'position': Point(3, 23)}),
        ('n2', {'position': Point(3, 35)}),
        ('n4', {'position': Point(7, 24)})]

If we did this, you could do something like

asciigraf.graph_from_ascii("""
            (13)           (10)
        n0-------------n1----------n2
                       |
                       |  (3)
                       |
                       n4
""").edges(data=True)
>>> [('n0', 'n1', {'length': 13}),
        ('n1', 'n2', {'length': 10}),
        ('n1', 'n4', {'length': 3})]

Support for edge modifiers

It would be valuable to be able to mark an edge with a modifier. E.G. in the below graph, the edge (n2, n3) has an arrow modifier which could be used to make a directed graph, or to modify the significance of the edge in some other way.

     n1---------n2
                ^
                |
                n3

We already support edge labels such as n1---(label_1)---n2 but this change would allow the user to have modifiers and labels on the same edge

``n1<---(edge_3)--->n2`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.