public class DotGenerator
extends java.lang.Object
Graph
instances.Modifier and Type | Method and Description |
---|---|
static <V> java.lang.String |
generateDot(Graph<V> graph)
Generates the dot representation for the given graph.
|
static <V> java.lang.String |
generateDot(Graph<V> graph,
boolean colorSCCs,
java.util.function.Function<V,java.lang.String> nameFunction,
java.util.function.Function<V,java.lang.String> colorFunction,
java.util.function.Function<V,java.util.function.Function<V,java.lang.String>> edgeFunction)
Generates the dot representation for the given graph.
|
static <V> java.util.function.Function<V,java.lang.String> |
getNameShortener(int maxLength)
Returns a simple name shortener function that can be used in the graphviz visualization to help with readability.
|
public static <V> java.lang.String generateDot(Graph<V> graph, boolean colorSCCs, java.util.function.Function<V,java.lang.String> nameFunction, java.util.function.Function<V,java.lang.String> colorFunction, java.util.function.Function<V,java.util.function.Function<V,java.lang.String>> edgeFunction)
graph
- the graphcolorSCCs
- specifies if the strongly connected components with size greater than shall be colorednameFunction
- use this function to provide custom names to nodes, null if the default toString shall be usedcolorFunction
- use this function to provide custom color to nodes, null if the default white color shall be usededgeFunction
- use this function to provide custom edge labels, null if no edge label shall be printedpublic static <V> java.lang.String generateDot(Graph<V> graph)
graph
- the graphpublic static <V> java.util.function.Function<V,java.lang.String> getNameShortener(int maxLength)
Node
s too much, the visualization may become incorrect because
grahpviz will treat different nodes as the same if their shortened names are the same.maxLength
- the maximum length of the text that is kept from the toString of the objects in the graph