Title

makediagram -- generates DOT diagram file from data sets

Syntax

makediagram [using filename] ,
export(filename) [ replace graphtype(name)
style(filename) ]

export(filename) export the DOT diagram file.

graphtype(name) specifies the type of the graph which can
be digraph (default) or graph (i.e. undirected).

replace replace the exported DOT file

style(filename) appends an external DOT style sheet to the DOT file.

Description

makediagram generates a DOT file from
a data set that can be rendered to a graphical file using diagram program
within Stata. the data set should be prepared as explained in the next section.

Variable discription

The data set should have 5 variables named cluster (numeric), from
(numeric or string), to (numeric or string), label (string), and
properties (string). The numeric variables can have labels which also changes
the labels in the DOT file.

cluster from to label properties

numeric numeric numeric string string
or or or
string string string

the cluster, label, and properties can be missing. however, the
from and to variables specifies which nodes are connected to one another.
in directed graphs, the direction is "from" towards "to". However, in
undirected graphs, this direction is of no significance and only shows a connection.

the cluster variable defines in which subgraph the connection takes place
(see the examples)

the from and to variables specify the nodes where the connection begines and
ends. the variables can be numeric, e.g. the nodes can be 1 -> 2 or strings
such as A -> B or "Node A" -> "Node B". If the variables are numeric,
their label is automatically used to alter the labels of the DOT graph (see the examples).

the label variable simply "labels the connection". this merely specifies the "label" or
"value" for the arrow. the label of the connection can also be specified within the
properties variable, but due to its common use and importance
(and to make life easier for those who don't wish to learn the DOT language),
it is made available as a separate variable. yet, adding label=" label "
in the properties variable can change the connection label.

Example(s)

the diagram torture test
includes several examples and example data sets for testing the package.

exporting a directed DOT script file from a data set
. makediagram using name.dta, export("name.txt") label("diagram's label")

exporting undirected DOT script file
. makediagram using name.dta, export("name.txt") graphtype(graph)

Author

E. F. Haghish

Center for Medical Biometry and Medical Informatics

University of Freiburg, Germany

and

Department of Mathematics and Computer Science

University of Southern Denmark

haghish@imbi.uni-freiburg.de

http://www.haghish.com/markdoc

Package Updates on Twitter

This help file was dynamically produced by MarkDoc Literate Programming package