Graphviz練習

Qwerty(英語配列)でAに該当する位置を押すとDvorakではBになるという関係をA→BとしたときのグラフをGraphvizを使って出力してみた。

ソース

// q2d.dot

digraph q2d {
  graph [rankdir = LR];
  "a" -> "a";
  "b" -> "x";
  "c" -> "j";
  "d" -> "e";
  "e" -> ".";
  "f" -> "u";
  "g" -> "i";
  "h" -> "d";
  "i" -> "c";
  "j" -> "h";
  "k" -> "t";
  "l" -> "n";
  "m" -> "m";
  "n" -> "b";
  "o" -> "r";
  "p" -> "l";
  "q" -> "'";
  "r" -> "p";
  "s" -> "o";
  "t" -> "y";
  "u" -> "g";
  "v" -> "k";
  "w" -> ",";
  "x" -> "q";
  "y" -> "f";
  "z" -> ";";
  ";" -> "s";
  "'" -> "-";
  "/" -> "z";
  "-" -> "[";
  "=" -> "]";
  "," -> "w";
  "." -> "v";
  "[" -> "/";
  "]" -> "=";
}

変換

dot -Tgif q2d.dot -o q2d.gif

出力

もっと正方形に収めるにはどうすればいいんでしょう。

cjhde.vktyfugibxq'-[/z;sorpln という文字列は繰り返し打ち続けるとQwertyでもDvorakでも同じ手の動きになるというのが面白いです。