Code Monkey home page Code Monkey logo

Comments (5)

KevinMarquette avatar KevinMarquette commented on July 21, 2024 1

My outputs is actually the output of dot.exe after passing it that simple digraph from your example. That is where the height and position info comes from. It's the default standard out when no image is specified.

I figured it was best to bypass Export-PSGraph while troubleshooting this one. I was unable to find a viable workaround in PowerShell 5.1 in my testing.

from psgraph.

KevinMarquette avatar KevinMarquette commented on July 21, 2024

I did a little more testing on this. When I pipe in your sample graph, I get this output:

digraph g {
    graph [bb="0,0,87.092,108",
            compound=true
    ];
    node [label="\N"];
    "Fran?ois"       [height=0.5,
            pos="43.546,90",
            width=1.1735];
    "S?rensen"       [height=0.5,
            pos="43.546,18",
            width=1.2096];
    "Fran?ois" -> "S?rensen"         [pos="e,43.546,36.104 43.546,71.697 43.546,63.983 43.546,54.712 43.546,46.112"];
}

This confirms what you are seeing. My next test was to save our graph as a file and give that as a parameter to $graphviz

& $graphviz c:\temp\graph.dot

digraph g {
    graph [bb="0,0,88.392,108",
            compound=true
    ];
    node [label="\N"];
    Franτois         [height=0.5,
            pos="44.196,90",
            width=1.1735];
    S°rensen         [height=0.5,
            pos="44.196,18",
            width=1.2277];
    Franτois -> S°rensen     [pos="e,44.196,36.104 44.196,71.697 44.196,63.983 44.196,54.712 44.196,46.112"];
}

I don't get the ? this time, but these characters are still not correct.

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.666
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.666
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

from psgraph.

KevinMarquette avatar KevinMarquette commented on July 21, 2024

I started trying to reproduce these results with PowerShell 6.1. From the console, this output also looks wrong:

$graph | & $graphViz
digraph g {
        graph [bb="0,0,88.392,108",
                compound=true
        ];
        node [label="\N"];
        François        [height=0.5,
                pos="44.196,90",
                width=1.1735];
        S├╕rensen        [height=0.5,
                pos="44.196,18",
                width=1.2277];
        François -> Sørensen   [pos="e,44.196,36.104 44.196,71.697 44.196,63.983 44.196,54.712 44.196,46.112"];
}

But if I actually generate a graph it will show the correct characters. It looks like this is solved in PowerShell 6.1. So this is a bug with Windows Powershell and the way it pipes to executables.

Still trying to chase down why saving to a file first is not working like I would expect. So I am playing with file encodings.

from psgraph.

KevinMarquette avatar KevinMarquette commented on July 21, 2024

I was able to get it to work from a file if I saved it this way:

$graph  | Set-Content c:\temp\graph.dot -Encoding utf8NoBOM

But that encoding option is not available on Windows PowerShell 5.1

I hate to close the issue this way but I don't have an easy way to fix this on my end. It's resolved by updating PowerShell to the current version (PS 6.1).

from psgraph.

Agazoth avatar Agazoth commented on July 21, 2024

The digraph I get when running the initail command is a lot different from yours.

I installed PSGraph in Powershell 6.1 - had to AllowClubber since node has a twin in PSDesiredStateConfiguration. In both Windows Powershell 5.1 and Powershell 6.1 I get this result:

PS C:\>graph g { edge "François" "Sørensen" }
digraph g {
    compound="true";
    "François"->"Sørensen"
}

No hight, position and width at all.

But in Powershell 6.1 there is a huge difference in the output. If I go:

graph g { edge "François" "Sørensen" } | Export-PSGraph -ShowGraph

The names show up with ? in strad of the european characters in Windows Powershell 5.1:
Not Working

But in Powershell 6.1 the image includes the correct european characters.

Working

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.