GraphViz - How to have a subgraph be left-to-right when main graph is top-to-bottom?

前端 未结 5 1933
梦毁少年i
梦毁少年i 2021-02-01 16:31

I have a graph file like this:

digraph {
    \"Step1\" -> \"Step2\" -> \"Step3\";

    subgraph step2detail {
        \"Step2\" -> \"note1\";
        \"         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 17:06

    Here's as simple as it gets - just use the group attribute to have graphviz prefer straight edges:

    digraph {
        node[group=a, fontname="Arial", fontsize=14];
        "Step1" -> "Step2" -> "Step3";
    
        node[group=""];
        "Step2" -> "note1";
        "Step2" -> "note2";
        "Step2" -> "note3";
        "Step2" -> "note4";
    }
    

    graphviz output

提交回复
热议问题