X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Fbin%2Fseq2dot;fp=home%2Fbin%2Fseq2dot;h=ac423236b8ebda3aebc18b4e837b78c792b348ad;hb=4f4a0353e16ea2e75965e807f9464d99099143f0;hp=d91e45b24b2bc358a7c941f20e36150268f58f0c;hpb=3cfc001c51c9750a0764b15aeabea008b8b9b57a;p=khome.git diff --git a/home/bin/seq2dot b/home/bin/seq2dot index d91e45b..ac42323 100755 --- a/home/bin/seq2dot +++ b/home/bin/seq2dot @@ -4,17 +4,39 @@ # highlighting frequencies of pairings. # -BEGIN {print "digraph {"} - { - prev = prev ? prev : "--" curr = $0 +} + +NR == 1 { + init = curr +} + +NR > 1 { ++nlinks[prev] ++nlinks_to[prev, curr] +} + +{ prev = curr } END { + final = curr + print "digraph {" + if (init == final) { + printf \ + "\"%s\" [penwidth=10, style=filled, fillcolor=tomato , fontcolor=white, color=yellowgreen];\n", \ + init + } else { + printf \ + "\"%s\" [penwidth=0, style=filled, fillcolor=yellowgreen, fontcolor=white];\n", \ + init + printf \ + "\"%s\" [penwidth=0, style=filled, fillcolor=tomato , fontcolor=white];\n", \ + final + } + for (src_dst in nlinks_to) { split(src_dst, sd, SUBSEP); src = sd[1]