Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
Visualization Using Graphviz
Mark Junker edited this page Jun 7, 2018
·
3 revisions
QuickGraph supports generating dot files, the file format of [Graphviz]. All Graphviz related code are located in the QuickGraph.Graphviz 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= ...;vargraphviz=newGraphvizAlgorithm<TVertex,TEdge>(g);// renderstringoutput=graphviz.Generate(newFileDotEngine(),"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 :)
publicinterfaceIDotEngine{// renders the dot code and returns the name of the generated filestringRun(GraphvizImageTypeimageType,stringdot,stringoutputFileName);}