コンテンツにスキップ

Graphviz

参考

  • https://qiita.com/rubytomato@github/items/51779135bc4b77c8c20d
  • .gv 系のファイル.

サンプル

1
2
3
digraph {
  A->B;
}

サンプル

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
digraph {
  graph [fontname="MS Gothic"];
  node [fontname="MS Gothic"];
  edge [fontname="MS Gothic"];
  label = "有向グラフの例";
  "谷保" -> "立川" [label=南武線];
  "立川" -> "新宿" [label=中央線];
  "谷保" -> "分倍河原" [label=南武線];
  "分倍河原" -> "新宿" [label=京王線];
}

サンプル

1
2
3
4
5
6
7
8
9
graph {
  graph [fontname="MS Gothic"];
  node [fontname="MS Gothic"];
  edge [fontname="MS Gothic"];
  label = "無向グラフの例";
  "谷保" -- "立川" -- "秋葉原";
  "谷保" -- "分倍河原" -- "新宿" -- "秋葉原";
  "谷保" [label="yaho"];
}

サンプル

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
digraph {
  graph [fontname="MS Gothic"];
  label = "clusterで始まっているものは外枠で囲われる";
  A->B;
  A->C;

  subgraph cluster1 {
    label = "sub1";
    1->2;
    1->3;
  }

  subgraph sub2 {
    label = "sub2";
    H--I;
    H--J;
  }
}

サンプル

1
2
3
4
5
digraph {
  node [fontname="MS Gothic"];
  "努力"->"成功";
  "金"->"成功";
};