Dot Diagram

A simple Java wrapper on top of Graphviz dot

License

License

GroupId

GroupId

io.github.livingdocumentation
ArtifactId

ArtifactId

dot-diagram
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

Dot Diagram
A simple Java wrapper on top of Graphviz dot
Project URL

Project URL

https://github.com/LivingDocumentation/dot-diagram
Source Code Management

Source Code Management

http://github.com/LivingDocumentation/dot-diagram/tree/master

Download dot-diagram

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.livingdocumentation/dot-diagram/ -->
<dependency>
    <groupId>io.github.livingdocumentation</groupId>
    <artifactId>dot-diagram</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.livingdocumentation/dot-diagram/
implementation 'io.github.livingdocumentation:dot-diagram:1.1'
// https://jarcasting.com/artifacts/io.github.livingdocumentation/dot-diagram/
implementation ("io.github.livingdocumentation:dot-diagram:1.1")
'io.github.livingdocumentation:dot-diagram:jar:1.1'
<dependency org="io.github.livingdocumentation" name="dot-diagram" rev="1.1">
  <artifact name="dot-diagram" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.livingdocumentation', module='dot-diagram', version='1.1')
)
libraryDependencies += "io.github.livingdocumentation" % "dot-diagram" % "1.1"
[io.github.livingdocumentation/dot-diagram "1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
com.github.kevinsawicki : http-request jar 5.5

test (1)

Group / Artifact Type Version
junit : junit jar 4.12-beta-3

Project Modules

There are no modules declared in this project.

dot-diagram

A simple Java wrapper on top of Graphviz dot tool. It offers two basic layers of functionalities.

API on top of the Dot Syntax

This project provides a convenient API (DotGraph) to create graphs, including sub-graphs (clusters), that are then rendered into .dot syntax text.

For example:

final DotGraph graph = new DotGraph("simple test");
final Digraph digraph = graph.getDigraph();
digraph.addNode("Car").setLabel("My Car").setComment("This is BMW").setOptions(STUB_NODE_OPTIONS);
digraph.addNode("Wheel").setLabel("Its wheels").setComment("The wheels of my car");
digraph.addAssociation("Car", "Wheel").setLabel("4*").setComment("There are 4 wheels").setOptions(ASSOCIATION_EDGE_STYLE);

Would generate the dot syntax:

# Class diagram simple test
digraph G {
	graph [labelloc=top,label="simple test",fontname="Verdana",fontsize=12];
	edge [fontname="Verdana",fontsize=9,labelfontname="Verdana",labelfontsize=9];
	node [fontname="Verdana",fontsize=9,shape=record];
//This is BMW
	c0 [label="My Car", color=grey,fontcolor=grey,fontname="Verdana",fontsize=9]
//The wheels of my car
	c1 [label="Its wheels"]
	// There are 4 wheels
	c0 -> c1 [label="4*"  , arrowhead=open];
}

Convenience on top of the Graphviz tool

This project also offers for convenience a DotWriter that launches Graphviz to render the dot file into an image file. This requires Graphviz to be installed on the machine, along with read/write access to the disk for temporary .dot files.

For example, calling dot on the simple graph above would generate this image:

Rendered to .png

And the clustering example would generate this image:

Rendered to .png

Please look at the tests for more examples.

Get it!

From the Maven Central Repository

<!-- https://mvnrepository.com/artifact/io.github.livingdocumentation/dot-diagram -->
<dependency>
    <groupId>io.github.livingdocumentation</groupId>
    <artifactId>dot-diagram</artifactId>
    <version>1.1</version>
</dependency>

See

http://www.graphviz.org

io.github.livingdocumentation

Living Documentation

An organization to gather all contributions about Living Documentation

Versions

Version
1.1