Skip to content

Inconsistent location of edge attributes #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PlanetEarthSoftware opened this issue Dec 8, 2024 · 1 comment
Open

Inconsistent location of edge attributes #2

PlanetEarthSoftware opened this issue Dec 8, 2024 · 1 comment

Comments

@PlanetEarthSoftware
Copy link

PlanetEarthSoftware commented Dec 8, 2024

Thanks for this library, beats auduchinok/DotParser which has many missing feature bugs; the only other .net GraphVis dot file parser that does not rely on compiled GraphVis C binaries in a .dll.

In some cases the Attributes are located in NodeStatements inside EdgeStatementSyntax rather than in the EdgeStatementSyntax itself.

 A -> B [label=mobile]
    EdgeStatementSynax
      Right=NodeStatementSyntax A
      Left=NodeStatementSyntax B [label=mobile]

 A -> {B, C} [label=mobile]
    EdgeStatementSynax [label=mobile]
      Right=NodeStatementSyntax A
      Left=SubgraphStatementSyntax
        [0] NodeStatementSyntax B
        [1] NodeStatementSyntax ,
        [2] NodeStatementSyntax C

A -> B -> C [label=mobile]
    EdgeStatementSynax
      Right=NodeStatementSyntax A
      Left=EdgeStatementSyntax
        Left=NodeStatementSyntax B
        Right=NodeStatementSyntax C [label=mobile]

 A -> {B, C} -> D [label=mobile]
    EdgeStatementSynax
      Right=NodeStatementSyntax A
      Left=EdgeStatementSyntax
        Left=SubgraphStatementSyntax
          [0] NodeStatementSyntax B
          [1] NodeStatementSyntax ,
          [2] NodeStatementSyntax C
        Right=NodeStatementSyntax D [label=mobile]

graphs.zip

FYI the attributes apply to all edges in the list of edges in the statement.
digraph { A -> B -> C [label=mobile] } is
edge A - B - C with label dot

It would ideal if the Attributes were set in the top level EdgeStatementSyntax or even copied to each EdgeStatementSyntax.

I am very busy so can not fork and fix this myself. If I have time I shall augment the README.md with a basic introduction, I had to look in the tests to get started with SyntaxTree tree = new Parser(str).Parse();.

You could add a mention to this project on https://graphviz.org/resources It may be a page under https://gitlab.com/graphviz/graphviz .

@PlanetEarthSoftware
Copy link
Author

You may find this useful also, a repository of test GraphVis graphs: https://github.com/ellson/MOTHBALLED-graphviz/tree/master/rtest/graphs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant