Skip to content
/ dot4j Public

A Java library for GraphViz DOT which enables both read and write of DOT files

License

Notifications You must be signed in to change notification settings

teverett/dot4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

DOT4J

A Java library for reading and writing GraphViz DOT files.

The DOT grammar is from here

A formal description of DOT is available at graphviz.org

License

kGraphML is licensed under the 3-Clause BSD license.

Maven Coordinates

<groupId>com.khubla.dot4j</groupId>
<artifactId>dot4j</artifactId>
<version>1.2.0</version>
<packaging>jar</packaging>

Usage

Reading and writing of DOT files is done via DOTMarshaller

Reading DOT

Graph g = DOTMarshaller.importGraph(inputStream);

Writing DOT

Graph g = new Graph(false, GraphType.digraph, "mygraph");
Node n1 = new Node("n1");
g.addNode(n1);
Node n2 = new Node("node2");
g.addNode(n2);
Edge theEdge = new Edge("n1", "node2");
g.addEdge(theEdge);
DOTMarshaller.exportGraph(g, baos);

Creates:

digraph mygraph {
   node2;
   n1;
   n1 -> node2;
}

About

A Java library for GraphViz DOT which enables both read and write of DOT files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published