Table of Contents

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

graph IReadOnlyGraph<TVertex, TEdge>

The graph to render.

Returns

string

The GraphML document text.

Type Parameters

TVertex

The vertex type.

TEdge

The 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

graph IReadOnlyGraph<TVertex, TEdge>

The graph to render.

options GraphMlExportOptions<TVertex, TEdge>

Rendering options.

Returns

string

The GraphML document text; edgedefault follows IsDirected.

Type Parameters

TVertex

The vertex type.

TEdge

The edge type.

Exceptions

ArgumentNullException

Either argument is null.