write.dot {vistla} | R Documentation |
Export tree to a Graphviz DOT format
Description
Exports the vistla tree in a DOT format, which can be later layouted and rendered by Graphviz programs like dot or neato.
Usage
write.dot(
x,
con,
vstyle = list(shape = function(x) ifelse(x$depth < 0, "egg", ifelse(x$leaf, "box",
"ellipse")), label = function(x) sprintf("\"%s\"", x$name)),
estyle = list(penwidth = function(x) sprintf("%0.3f", 0.5 + x$score/max(x$score) *
2.5)),
gstyle = list(overlap = "\"prism\"", splines = "true"),
direction = c("none", "fromY", "intoY")
)
Arguments
x |
vistla object. |
con |
connection; passed to |
vstyle |
vertex attribute list — should be a named list of Graphviz attributes like |
estyle |
edge attribute list, behaves exactly like |
gstyle |
graph attribute list. Functions are not supported here. |
direction |
when set to |
Value
For a missing con
argument, a character vector with the graph in the DOT format, invisible NULL
otherwise.
Note
Graphviz attribute values can be either strings, like "some vertex"
in label
, or atoms, like box
for shape
.
When returning a string value, you must supply quotes, otherwise it will be included as an atom.
The default value of gstyle
may invoke long layout calculations in Graphviz.
Change to list()
for a fast but less aesthetic layout.
The function does no validation whether provided attributes or values are correct.
References
"An open graph visualization system and its applications to software engineering" E.R. Gansner, S.C. North. Software: Practice and Experience 30:1203-1233 (2000).