AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
dotGraph (String graph) yoix.graph
 
Returns an Graph by parsing the supplied graph argument, which should be in the DOT graph description format, which is described at http://www.research.att.com/sw/tool/graphviz/.
 
 Example:   The following script loads a graph in DOT format from a string and writes in to standard output in DOT format, effectively performing a pretty-print operation.
import yoix.graph.*;

graph_str = "digraph g { node [shape=ellipse]\n\
n1 [label=\"DOT Input\"]\n\
n2 [label=\"Yoix Script\", shape=box]\n\
n3 [label=\"DOT Output\"]\n\
n1->n2->n3 }";

g = dotGraph(graph_str);

stdout.nextbuf = g.text(DOT);
The results on standard output are:
digraph g {
    node [
        shape=ellipse
    ];
    n1 [
        label="DOT Input"
    ];
    n2 [
        shape=box,
        label="Yoix Script"
    ];
    n3 [
        shape=box,
        label="DOT Output"
    ];
    n1 -> n2;
    n2 -> n3;
}
 
 Return:   Graph
 
 See Also:   countElements, Edge, Graph, listElements, Node

 

Yoix is a registered trademark of AT&T Inc.