- 
                Notifications
    You must be signed in to change notification settings 
- Fork 206
Visualization Using Graphviz
        Andrey Vernigora edited this page Feb 2, 2019 
        ·
        3 revisions
      
    QuickGraph supports generating dot files, the file format of Graphviz. All Graphviz related code are located in the QuickGraph.Graphviz.dll assembly.
The GraphvizAlgorithm class contains the logic to render a IVertexAndEdgeListGraph.
- 
GraphFormat,CommonVertexFormatandCommonEdgeFormatcontrol the default 'looks' of the generated graph,
- 
FormatVertexandFormatEdgeevents let you customize the display of individual vertices and edges.
IVertexAndEdgeListGraph<TVertex,TEdge> g= ...;
var graphviz = new GraphvizAlgorithm<TVertex,TEdge>(g);
// render
string output = graphviz.Generate(new FileDotEngine(), "graph");QuickGraph sends the generated dot code to a 'dot engine' interface which is supposed to do the rest of the work. This is where you can plugin and add any additional steps. QuickGraph provides a simple rendering engine that writes the dot file to disk :)
public interface IDotEngine
{
    // renders the dot code and returns the name of the generated file
    string Run(
        GraphvizImageType imageType,
        string dot,
        string outputFileName);
}