Git Product home page Git Product logo

Comments (3)

KevinMarquette avatar KevinMarquette commented on June 12, 2024

Other node names that cause this:

  • node
  • edge
  • subgraph
  • digraph

The first error message is coming from graphviz when it parses the graph output.

Error: <stdin>: syntax error in line 7 near '}'

I suspect all DOT keywords would cause this failure.

from psgraph.

dchristian3188 avatar dchristian3188 commented on June 12, 2024

What do you think about changing this section in Format-Value?

 # Normal value, no quotes
                '^[\w]+$'
                {
                    '"{0}"' -f $value
                }

I ran through some quick tests and it seems to resolve the issue.

from psgraph.

KevinMarquette avatar KevinMarquette commented on June 12, 2024

There are two scenarios that I would need to look at that I may as well document here and get some tests added.

The first one is setting note (or edge) attribute defaults.

 Graph testGraph {
    node @{shape='rect'}
    node 'cat'
    node 'dog'    
 } | Export-PSGraph -ShowGraph

If that first node gets quotes around it, it becomes a real node instead of defining the attributes for the other nodes. In one case you would get two squares and in the other, you would get one square and two circles.

I did notice that custom format scripts are causing issues like this too, so I opened #32 to track it. I'm going to look to see how easy it would be to pull that special case out of the normal format logic.

The second is edges to record nodes.

graph g {
    node @{shape='record'}
    node struct1 @{shape='record';label=" left|<f1> middle|<f2> right"}
    node struct2 @{shape='record';label="<f0> one| two"}
    node struct3 @{shape='record';label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"}
    edge struct1:f1 -to struct2:f0
    edge struct1:f2 -to struct3:here
} | Export-PSGraph -ShowGraph

The edge in this example may need some more analysis. I don't have any documentation on record nodes and edges, but I want to maintain that underlying engine compatibility.

I am tempted to add a way to turn that off though and that may be a better discussion in another thread. As it stands, it gets in the way of edges to uri and server:port named nodes.

from psgraph.

Related Issues (20)

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.