1

私はgraphvizとcircoそれが提供するツールでグラフを生成しています。

生成されたグラフはきれいな形ですが、ノード間のエッジの長さが必要以上に長いため、ノードのテキストが (出力イメージに比べて) 小さくなり、非常に読みにくくなっています。

ノード内のテキストが読みやすくなるように、出力イメージでノードを (比較的) 大きくするにはどうすればよいですか?

出力画像:

ここに画像の説明を入力

ソース グラフ ファイル:

digraph G {
    FoundUrlToFollow [shape=box];
    "Fetch the URL" [shape=circle];
    FoundUrlToFollow -> "Fetch the URL";
    ResponseReceived [shape=box];
    "Fetch the URL" [shape=circle, label=<Fetch the URL>];
    "Fetch the URL" -> ResponseReceived;
    ResponseError [shape=box];
    "Fetch the URL" [shape=circle, label=<Fetch the URL>];
    "Fetch the URL" -> ResponseError;
    ResponseReceived [shape=box];
    "Log response" [shape=circle];
    ResponseReceived -> "Log response";
    ResponseReceived [shape=box];
    "Is the response OK?" [shape=circle];
    ResponseReceived -> "Is the response OK?";
    ResponseOk [shape=box];
    "Is the response OK?" [shape=circle, label=<Is the response<br/>OK?>];
    "Is the response OK?" -> ResponseOk;
    ResponseOk [shape=box];
    "Is the response HTML?" [shape=circle];
    ResponseOk -> "Is the response HTML?";
    HtmlToParse [shape=box];
    "Is the response HTML?" [shape=circle, label=<Is the response<br/>HTML?>];
    "Is the response HTML?" -> HtmlToParse;
    HtmlToParse [shape=box];
    "Parse the HTML to find links" [shape=circle];
    HtmlToParse -> "Parse the HTML to find links";
    FoundUrl [shape=box];
    "Parse the HTML to find links" [shape=circle, label=<Parse the HTML<br/>to find links>];
    "Parse the HTML to find links" -> FoundUrl;
    FoundUrl [shape=box];
    "Should we follow this URL?" [shape=circle];
    FoundUrl -> "Should we follow this URL?";
    FoundUrlToSkip [shape=box];
    "Should we follow this URL?" [shape=circle, label=<Should we<br/>follow this<br/>URL?>];
    "Should we follow this URL?" -> FoundUrlToSkip;
    FoundUrlToFollow [shape=box];
    "Should we follow this URL?" [shape=circle, label=<Should we<br/>follow this<br/>URL?>];
    "Should we follow this URL?" -> FoundUrlToFollow;
    FoundUrlToSkip [shape=box];
    "Log skipped links" [shape=circle];
    FoundUrlToSkip -> "Log skipped links";
    graph [label="Switches are circles. Events are boxes.", fontsize="12", overlap=scale];
    edge [splines=curved];
}

指示:

circo -Tpng -ograph_so.png graph.dot
4

2 に答える 2

1

-Gsize(インチ単位) と を変更してみてください-Gdpi。両方を一緒に変更すると、同じピクセル サイズの異なる出力が得られますが、ノード自体のサイズに対してノード間の間隔が異なります。また、微調整にも役立つ場合があります-Gnodesep-Nfontsizeまた、Graphviz の PNG レンダラーを使用する代わりに、EPS、PDF、または SVG にレンダリングしてから、それを PNG に変換する方がうまくいく場合もあります。Graphviz から満足のいく出力を得ることは、私の経験では、非常に不正確な科学です。

于 2017-01-06T08:11:28.697 に答える