Ruby | Gviz で我が家の恋愛相関図を書いた
概要
我が家の恋愛相関図が入り組んで来たので Gviz で可視化します。
コード
require "gviz"
Graph do
global layout:'dot', overlap:false
nodes width: 3, height: 2, fontname:'MS UI GOTHIC'
edges fontsize: 20, fontname:'MS UI GOTHIC'
node :Husband, {label: '私'}
node :Wife, {label: "妻"}
node :OldestDaughter, {label: "長女"}
node :SecondDaughter, {label: "次女"}
edge :Wife_OldestDaughter, {label: "結婚しないでずっとそばにいて"}
edge :Wife_SecondDaughter, {label: "結婚しないでずっとそばにいて"}
edge :OldestDaughter_Husband, {label: "パパ結婚して"}
edge :SecondDaughter_OldestDaughter, {label: "お姉ちゃん結婚して"}
edge :Husband_OldestDaughter, {label: "いいよ"}
edge :Husband_Wife, {label: "結婚してる"}
edge :Wife_Husband, {label: "結婚してる"}
save :"family", :png
end