Class DotGenerator
java.lang.Object
tools.refinery.interpreter.rete.itc.graphimpl.DotGenerator
This class contains utility methods to generate dot representations for
Graph
instances.- Since:
- 2.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> String
generateDot
(Graph<V> graph) Generates the dot representation for the given graph.static <V> String
generateDot
(Graph<V> graph, boolean colorSCCs, Function<V, String> nameFunction, Function<V, String> colorFunction, Function<V, Function<V, String>> edgeFunction) Generates the dot representation for the given graph.getNameShortener
(int maxLength) Returns a simple name shortener function that can be used in the graphviz visualization to help with readability.
-
Method Details
-
generateDot
public static <V> String generateDot(Graph<V> graph, boolean colorSCCs, Function<V, String> nameFunction, Function<V, String> colorFunction, Function<V, Function<V, String>> edgeFunction) Generates the dot representation for the given graph.- Parameters:
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 printed- Returns:
- the dot representation as a string
-
generateDot
Generates the dot representation for the given graph. No special pretty printing customization will be applied.- Parameters:
graph
- the graph- Returns:
- the dot representation as a string
-
getNameShortener
Returns a simple name shortener function that can be used in the graphviz visualization to help with readability. WARNING: if you shorten the name of theinvalid reference
Node
- Parameters:
maxLength
- the maximum length of the text that is kept from the toString of the objects in the graph- Returns:
- the shrunk toString value
-