「Sandbox/plugin/graphviz」の版間の差分

提供:防弾掲示板wiki
ナビゲーションに移動 検索に移動
36行目: 36行目:
}
}


</graphviz>
</syntaxhighlight>
===色を付ける====
<graphviz>
digraph G {
  1 -> 2;
  1 -> 3 [color="blue"];
  3  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
  2 -> 4;
  2 -> 5 [color="blue"];
  5  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
}
</graphviz>
<syntaxhighlight lang="dot">
<graphviz>
digraph G {
  1 -> 2;
  1 -> 3 [color="blue"];
  3  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
  2 -> 4;
  2 -> 5 [color="blue"];
  5  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
}
</graphviz>
</graphviz>
</syntaxhighlight>
</syntaxhighlight>

2023年9月25日 (月) 07:16時点における版

単純な例

有向グラフの例(矢印があるグラフの例)

<graphviz>
digraph graph_name {
  alpha;
  beta;
  alpha -> beta;
}

</graphviz>

無向グラフの例(矢印がないグラフの例)

<graphviz>
graph graph_name {
  alpha;
  beta;
  alpha -- beta;
}

</graphviz>

色を付ける=

<graphviz>
digraph G {
  1 -> 2; 
  1 -> 3 [color="blue"];
  3  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
  2 -> 4;
  2 -> 5 [color="blue"];
  5  [style=filled, fontcolor="green" color = "red", fillcolor="yellow"];
}
</graphviz>

サンプル