GraphvizWriter Class
Writes flowcharts in the DOT language of Graphviz, which GraphvizDocument.Parse reads back.
public static class GraphvizWriterRemarks
The graph is a digraph; the subgraphs of the flowchart are clusters. The shapes of the flowcharts that Graphviz does not have are written as the closest shape of Graphviz, the styles of the classes are written on each element, and the theme (except its background), the curves of the edges other than straight and orthogonal ones, the markdown of the labels and the accessibility texts are not written.
Example
var flowchart = new FlowchartDiagram { Direction = DiagramDirection.LeftToRight };
var start = flowchart.AddNode("start", "Start", FlowchartNodeShape.Stadium);
var end = flowchart.AddNode("end_node", "End", FlowchartNodeShape.DoubleCircle);
flowchart.AddEdge(start, end, "done").LineStyle = FlowchartLineStyle.Dotted;
var dot = GraphvizWriter.Write(flowchart);Methods
| Name | Description |
|---|---|
| Write(FlowchartDiagram) | Writes a flowchart in the DOT language. |
| Write(FlowchartDiagram, TextWriter) | Writes a flowchart in the DOT language. |
Write overloads
Write(FlowchartDiagram)
GraphvizWriter.csWrites a flowchart in the DOT language.
public static string Write(FlowchartDiagram diagram)Parameters
diagramFlowchartDiagram- The flowchart.
Returns
string The DOT text, with line feeds.
Exceptions
ArgumentException- An identifier cannot be written in DOT: it ends with an odd number of backslashes and has unbalanced angle brackets.
Write(FlowchartDiagram, TextWriter)
GraphvizWriter.csWrites a flowchart in the DOT language.
public static void Write(FlowchartDiagram diagram, TextWriter writer)Parameters
diagramFlowchartDiagram- The flowchart.
writerTextWriter- The writer the text is written to, with line feeds.
Exceptions
ArgumentException- An identifier cannot be written in DOT: it ends with an odd number of backslashes and has unbalanced angle brackets.