Визуализация данных с помощью Graphviz
April 21st, 2009
No comments
Graph Visualization Software from AT&T Laboratories and
Bell Laboratories (Lucent Technologies)These programs licensed under the terms described in the web page at:
http://www.graphviz.org/License.php
The package contains:
dotty – customizable X windows graph viewer written in the Lefty editor
tcldot – customizable TCL/tk graph viewer written by John Ellson
dot – batch program for drawing directed graphs as hierarchies
neato – batch program for drawing undirected graphs using Kamada-Kawai
spring modelsWWW: http://www.graphviz.org/
Установка:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | $ cd /usr/ports/graphics/graphviz $ make showconfig ===> The following configuration options are available for graphviz-2.22.2: ICONV=on "Build with ICONV support" XPM=on "Build with XPM support" DIGCOLA=on "DIGCOLA features in neato layout engine" IPSEPCOLA=on "IPSEPCOLA features in neato layout engine" SMYRNA=off "SMYRNA large graph viewer" NLS=on "Build with gettext support" TK=off "Build with TK support" PANGOCAIRO=off "build with pangocairo support" RSVG=off "build with rsvg library" GTK=off "build with gtk plugin" GDK_PIXBUF=off "build with gdk pixbuf support" GNOMEUI=off "build with libgnomeui support" MING=off "Build with ming plugin" DEVIL=off "Build with devil plugin" GHOSTSCRIPT=off "Build with ghostscript plugin" PERL=off "Perl bindings (swig)" PHP=off "PHP bindings (swig)" PYTHON=off "Python bindings (swig)" RUBY=off "Ruby bindings (swig)" LUA=off "Lua bindings (swig)" TCL=off "TCL bindings (swig)" GUILE=off "Guile bindings (swig)" ===> Use 'make config' to modify these settings $ make install clean |
Создаем файл данных dots.txt. В файл добавлена строка с указанием шрифта, наче dot ругается что не может его найти.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | digraph "microdc2 build Dependencies" { enode [fontname="/usr/local/www/data/temp/dot/Times.dfont"] "gettext-0.17_1" -> "libiconv-1.11_1" "gettext-0.17_1" -> "libtool-1.5.26" "gmake-3.81_3" -> "gettext-0.17_1" "gmake-3.81_3" -> "libiconv-1.11_1" "libiconv-1.11_1" -> "libtool-1.5.26" "libxml2-2.7.3" -> "gettext-0.17_1" "libxml2-2.7.3" -> "gmake-3.81_3" "libxml2-2.7.3" -> "libiconv-1.11_1" "libxml2-2.7.3" -> "pkg-config-0.23_1" "microdc2" -> "gettext-0.17_1" "microdc2" -> "libiconv-1.11_1" "microdc2" -> "libxml2-2.7.3" "microdc2" -> "pkg-config-0.23_1" "pkg-config-0.23_1" -> "gettext-0.17_1" "pkg-config-0.23_1" -> "gmake-3.81_3" "pkg-config-0.23_1" -> "libiconv-1.11_1" } |
Запускаем сборку:
1 | $ dot -Tpng -o dots.png dots |
Получилось:

