Class GraphMlExtensions
- Namespace
- Graph1x.Serialization
- Assembly
- Graph1x.dll
Exports graphs to GraphML (http://graphml.graphdrawing.org). Vertices are declared first (isolated ones included) and edges follow in the graph's enumeration order (grouped by source vertex); XML escaping is handled by the writer, so arbitrary vertex strings are safe. Weights are written with the invariant culture.
public static class GraphMlExtensions
- Inheritance
-
GraphMlExtensions
- Inherited Members
Methods
ToGraphMl<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>)
Renders the graph in GraphML with default options.
public static string ToGraphMl<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 GraphML document text.
Type Parameters
TVertexThe vertex type.
TEdgeThe edge type.
ToGraphMl<TVertex, TEdge>(IReadOnlyGraph<TVertex, TEdge>, GraphMlExportOptions<TVertex, TEdge>)
Renders the graph in GraphML.
public static string ToGraphMl<TVertex, TEdge>(this IReadOnlyGraph<TVertex, TEdge> graph, GraphMlExportOptions<TVertex, TEdge> options) where TVertex : notnull where TEdge : IEdge<TVertex>
Parameters
graphIReadOnlyGraph<TVertex, TEdge>The graph to render.
optionsGraphMlExportOptions<TVertex, TEdge>Rendering options.
Returns
- string
The GraphML document text;
edgedefaultfollows IsDirected.
Type Parameters
TVertexThe vertex type.
TEdgeThe edge type.
Exceptions
- ArgumentNullException
Either argument is null.