Class GraphDotExtensions
- Namespace
- Graph1x.Serialization
- Assembly
- Graph1x.dll
Exports graphs to the Graphviz DOT language. Output is deterministic
(vertices in insertion order, edges in the graph's enumeration order —
grouped by source vertex — and \n line endings) so it can be
asserted, diffed, and cached; every identifier is quoted and escaped,
so arbitrary vertex strings are safe.
public static class GraphDotExtensions
- Inheritance
-
GraphDotExtensions
- Inherited Members
Methods
ToDot<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>)
Renders the graph in DOT with default options.
public static string ToDot<TVertex, TEdge>(this IReadOnlyGraph<TVertex, TEdge> graph) where TVertex : notnull where TEdge : IEdge<TVertex>
Parameters
graphIReadOnlyGraph<TVertex, TEdge>The graph to render.
Returns
- string
The DOT document.
Type Parameters
TVertexThe vertex type.
TEdgeThe edge type.
ToDot<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, DotExportOptions<TVertex, TEdge>)
Renders the graph in DOT.
public static string ToDot<TVertex, TEdge>(this IReadOnlyGraph<TVertex, TEdge> graph, DotExportOptions<TVertex, TEdge> options) where TVertex : notnull where TEdge : IEdge<TVertex>
Parameters
graphIReadOnlyGraph<TVertex, TEdge>The graph to render.
optionsDotExportOptions<TVertex, TEdge>Rendering options.
Returns
- string
The DOT document:
digraph/->for directed graphs,graph/--for undirected ones.
Type Parameters
TVertexThe vertex type.
TEdgeThe edge type.
Exceptions
- ArgumentNullException
Either argument is null.