graphmd: LR orientation

This commit is contained in:
Juan Batiz-Benet 2015-01-07 15:03:17 -08:00
parent d1bff333a5
commit 8c6dc4f5d3

View File

@ -3,10 +3,18 @@
if [ "$#" -ne 1 ]; then
echo "usage: $0 <ipfs-path>..."
echo "output merkledag links in graphviz dot"
echo ""
echo "use it with dot:"
echo " $0 QmZPAMWUfLD95GsdorXt9hH7aVrarb2SuLDMVVe6gABYmx | dot -Tsvg"
echo " $0 QmZPAMWUfLD95GsdorXt9hH7aVrarb2SuLDMVVe6gABYmx | dot -Tpng"
echo " $0 QmZPAMWUfLD95GsdorXt9hH7aVrarb2SuLDMVVe6gABYmx | dot -Tpdf"
echo ""
exit 1
fi
fmt='<src> -> <dst> [label="<linkname>"];'
echo "digraph {"
echo " graph [rankdir=LR];"
ipfs refs -r --format="$fmt" "$@" | awk '{ print "\t" $0 }'
# ipfs refs -r --format="$fmt" "$@" | awk '{ print "\t" $0 }' | unflatten -l3
echo "}"